@versini/sassysaint-common 4.8.1 → 4.10.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 +5 -4
- package/dist/index.js +44 -43
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -25,25 +25,26 @@ declare const MODEL_GPT5 = "gpt-5";
|
|
|
25
25
|
declare const MODEL_GPT4_MINI = "gpt-4.1-nano";
|
|
26
26
|
declare const MODEL_O4_MINI = "o4-mini";
|
|
27
27
|
declare const MODEL_CLAUDE_HAIKU = "claude-3-5-haiku-20241022";
|
|
28
|
-
declare const MODEL_CLAUDE_SONNET = "claude-sonnet-4-
|
|
28
|
+
declare const MODEL_CLAUDE_SONNET = "claude-sonnet-4-5-20250929";
|
|
29
29
|
declare const MODEL_GEMINI_FLASH = "gemini-2.5-flash";
|
|
30
30
|
declare const MODEL_GEMINI_PRO = "gemini-2.5-pro";
|
|
31
31
|
declare const MODEL_SONAR = "sonar";
|
|
32
32
|
declare const MODEL_SONAR_PRO = "sonar-pro";
|
|
33
33
|
declare const MODEL_DEV = "mistralai/mistral-small-3.2-24b-instruct:free";
|
|
34
34
|
declare const MODEL_MEMORY_INFERENCE = "gpt-4o-mini";
|
|
35
|
+
declare const MODEL_EMBEDDING_TEXT = "text-embedding-3-small";
|
|
35
36
|
/**
|
|
36
37
|
* List of all models available TODAY.
|
|
37
38
|
* This is used by the client to display the list of models.
|
|
38
39
|
*/
|
|
39
|
-
declare const ALL_MODELS: readonly ["gpt-5", "gpt-4.1-nano", "o4-mini", "claude-3-5-haiku-20241022", "claude-sonnet-4-
|
|
40
|
+
declare const ALL_MODELS: readonly ["gpt-5", "gpt-4.1-nano", "o4-mini", "claude-3-5-haiku-20241022", "claude-sonnet-4-5-20250929", "gemini-2.5-flash", "gemini-2.5-pro"];
|
|
40
41
|
declare const ALL_REASONING_MODELS: string[];
|
|
41
42
|
/**
|
|
42
43
|
* List of models available according to the providers.
|
|
43
44
|
*/
|
|
44
45
|
declare const MODELS_PER_PROVIDER: {
|
|
45
46
|
readonly OpenAI: readonly ["gpt-4.1-nano", "gpt-5"];
|
|
46
|
-
readonly Anthropic: readonly ["claude-3-5-haiku-20241022", "claude-sonnet-4-
|
|
47
|
+
readonly Anthropic: readonly ["claude-3-5-haiku-20241022", "claude-sonnet-4-5-20250929"];
|
|
47
48
|
readonly Google: readonly ["gemini-2.5-flash", "gemini-2.5-pro"];
|
|
48
49
|
readonly Perplexity: readonly ["sonar", "sonar-pro"];
|
|
49
50
|
};
|
|
@@ -384,4 +385,4 @@ declare function isEntitlementLoaded(state: EntitlementStateLike | null | undefi
|
|
|
384
385
|
declare function toCapabilitySet(capabilities: string[] | undefined | null): Set<string> | null;
|
|
385
386
|
declare function isEntitled(capabilitiesOrSet: string[] | Set<string> | null | undefined, required: CapabilityInput, options?: IsEntitledOptions): boolean;
|
|
386
387
|
|
|
387
|
-
export { ALL_MODELS, ALL_PROVIDERS, ALL_REASONING_MODELS, APPLICATION_NAME, CAPABILITIES, type CapabilityInput, DEFAULT_PROVIDER, DIGGIDY_CHAT_ID_HEADER, type EntitlementStateLike, type IsEntitledOptions, MODELS_PER_PROVIDER, MODEL_CLAUDE_HAIKU, MODEL_CLAUDE_SONNET, MODEL_DEV, MODEL_GEMINI_FLASH, MODEL_GEMINI_PRO, MODEL_GPT4_MINI, MODEL_GPT5, MODEL_MEMORY_INFERENCE, MODEL_O4_MINI, MODEL_SONAR, MODEL_SONAR_PRO, PLAN_FREE, PLAN_PLUS, PLAN_PREMIUM, POLICY_GRANTS, PROVIDER_ANTHROPIC, PROVIDER_GOOGLE, PROVIDER_MEMORY, PROVIDER_MISTRAL, PROVIDER_OPENAI, PROVIDER_PERPLEXITY, PROVIDER_ROLE_MAP, PROVIDER_SUMMARY, ROLE_ASSISTANT, ROLE_HIDDEN, ROLE_INTERNAL, ROLE_SYSTEM, ROLE_USER, SORT_BY_TIMESTAMP, SORT_BY_TOKEN_USAGE, index as crypto, findProvider, isEntitled, isEntitlementLoaded, toCapabilitySet };
|
|
388
|
+
export { ALL_MODELS, ALL_PROVIDERS, ALL_REASONING_MODELS, APPLICATION_NAME, CAPABILITIES, type CapabilityInput, DEFAULT_PROVIDER, DIGGIDY_CHAT_ID_HEADER, type EntitlementStateLike, type IsEntitledOptions, MODELS_PER_PROVIDER, MODEL_CLAUDE_HAIKU, MODEL_CLAUDE_SONNET, MODEL_DEV, MODEL_EMBEDDING_TEXT, MODEL_GEMINI_FLASH, MODEL_GEMINI_PRO, MODEL_GPT4_MINI, MODEL_GPT5, MODEL_MEMORY_INFERENCE, MODEL_O4_MINI, MODEL_SONAR, MODEL_SONAR_PRO, PLAN_FREE, PLAN_PLUS, PLAN_PREMIUM, POLICY_GRANTS, PROVIDER_ANTHROPIC, PROVIDER_GOOGLE, PROVIDER_MEMORY, PROVIDER_MISTRAL, PROVIDER_OPENAI, PROVIDER_PERPLEXITY, PROVIDER_ROLE_MAP, PROVIDER_SUMMARY, ROLE_ASSISTANT, ROLE_HIDDEN, ROLE_INTERNAL, ROLE_SYSTEM, ROLE_USER, SORT_BY_TIMESTAMP, SORT_BY_TOKEN_USAGE, index as crypto, findProvider, isEntitled, isEntitlementLoaded, toCapabilitySet };
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
const
|
|
1
|
+
const S = "system", a = "user", c = "assistant", te = "hidden", ne = "data", i = "OpenAI", E = "Anthropic", y = "Google", g = "Summary", L = "Memory", d = "Perplexity", re = "Mistral", oe = i, se = [
|
|
2
2
|
i,
|
|
3
3
|
E,
|
|
4
4
|
y
|
|
5
|
-
],
|
|
6
|
-
|
|
5
|
+
], u = "gpt-5", p = "gpt-4.1-nano", M = "o4-mini", _ = "claude-3-5-haiku-20241022", O = "claude-sonnet-4-5-20250929", R = "gemini-2.5-flash", l = "gemini-2.5-pro", T = "sonar", m = "sonar-pro", ae = "mistralai/mistral-small-3.2-24b-instruct:free", ce = "gpt-4o-mini", ie = "text-embedding-3-small", Ee = [
|
|
6
|
+
u,
|
|
7
7
|
p,
|
|
8
8
|
M,
|
|
9
|
-
R,
|
|
10
|
-
O,
|
|
11
9
|
_,
|
|
10
|
+
O,
|
|
11
|
+
R,
|
|
12
12
|
l
|
|
13
|
-
],
|
|
14
|
-
|
|
13
|
+
], ye = [
|
|
14
|
+
u,
|
|
15
15
|
O,
|
|
16
16
|
l
|
|
17
17
|
], w = "claude-sonnet-4", h = "claude-3", b = "gpt-", N = "o3", C = "o4", U = "gemini", v = "sonar", K = {
|
|
@@ -25,27 +25,27 @@ const D = "system", a = "user", c = "assistant", te = "hidden", ne = "data", i =
|
|
|
25
25
|
C
|
|
26
26
|
],
|
|
27
27
|
[y]: [U],
|
|
28
|
-
[
|
|
29
|
-
}, ye = {
|
|
30
|
-
[i]: [p, d],
|
|
31
|
-
[E]: [R, O],
|
|
32
|
-
[y]: [_, l],
|
|
33
|
-
[u]: [T, m]
|
|
28
|
+
[d]: [v]
|
|
34
29
|
}, Ae = {
|
|
35
|
-
[i]: [
|
|
30
|
+
[i]: [p, u],
|
|
31
|
+
[E]: [_, O],
|
|
32
|
+
[y]: [R, l],
|
|
33
|
+
[d]: [T, m]
|
|
34
|
+
}, de = {
|
|
35
|
+
[i]: [S, a, c],
|
|
36
36
|
[E]: [a, c],
|
|
37
37
|
[g]: [a, c],
|
|
38
38
|
[L]: [a, c],
|
|
39
39
|
[y]: [a, c],
|
|
40
|
-
[
|
|
41
|
-
}, ue = "x-diggidy-chat-id",
|
|
40
|
+
[d]: [a, c]
|
|
41
|
+
}, ue = "x-diggidy-chat-id", Oe = (n) => {
|
|
42
42
|
for (const [e, r] of Object.entries(
|
|
43
43
|
K
|
|
44
44
|
))
|
|
45
45
|
if (r.some((t) => n.startsWith(t)))
|
|
46
46
|
return e;
|
|
47
47
|
return null;
|
|
48
|
-
},
|
|
48
|
+
}, le = "timestamp", pe = "tokenUsage", _e = "Diggidy";
|
|
49
49
|
class s extends Error {
|
|
50
50
|
constructor(e, r, t) {
|
|
51
51
|
super(e), this.code = r, this.originalError = t, this.name = "CryptoError";
|
|
@@ -210,26 +210,26 @@ function x() {
|
|
|
210
210
|
function I() {
|
|
211
211
|
return typeof window < "u" && typeof window.crypto < "u" && typeof window.crypto.subtle < "u";
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function D() {
|
|
214
214
|
return typeof window < "u" && (window.isSecureContext || window.location.protocol === "https:");
|
|
215
215
|
}
|
|
216
216
|
function X() {
|
|
217
|
-
return I() &&
|
|
217
|
+
return I() && D();
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function B(n) {
|
|
220
220
|
const e = new Uint8Array(n);
|
|
221
221
|
let r = "";
|
|
222
222
|
for (let t = 0; t < e.byteLength; t++)
|
|
223
223
|
r += String.fromCharCode(e[t]);
|
|
224
224
|
return btoa(r);
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function $(n) {
|
|
227
227
|
const e = atob(n), r = new Uint8Array(e.length);
|
|
228
228
|
for (let t = 0; t < e.length; t++)
|
|
229
229
|
r[t] = e.charCodeAt(t);
|
|
230
230
|
return r.buffer;
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function j(n) {
|
|
233
233
|
try {
|
|
234
234
|
return JSON.stringify(n);
|
|
235
235
|
} catch {
|
|
@@ -246,11 +246,11 @@ function z(n) {
|
|
|
246
246
|
function W(n, ...e) {
|
|
247
247
|
typeof process < "u" && process.env && process.env.NODE_ENV === "development" && console.info(`🔐 [Crypto] ${n}`, ...e);
|
|
248
248
|
}
|
|
249
|
-
const Re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, CryptoError: s, DEFAULT_CRYPTO_CONFIG: f, arrayBufferToBase64:
|
|
249
|
+
const Re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, CryptoError: s, DEFAULT_CRYPTO_CONFIG: f, arrayBufferToBase64: B, base64ToArrayBuffer: $, canUseEncryption: X, debugLog: W, decryptFromServer: V, encryptForServer: F, establishCryptoSession: Y, exportPublicKey: G, generateClientKeyPair: k, generateDeviceId: x, importServerPublicKey: P, isCryptoSessionValid: H, isSecureContext: D, isWebCryptoSupported: I, safeParse: z, safeStringify: j }, Symbol.toStringTag, { value: "Module" })), J = "sassy:free", Z = "sassy:plus", Q = "sassy:advanced", fe = {
|
|
250
250
|
PLAN_FREE: J,
|
|
251
251
|
PLAN_PLUS: Z,
|
|
252
252
|
PLAN_PREMIUM: Q
|
|
253
|
-
},
|
|
253
|
+
}, Pe = {
|
|
254
254
|
TOOL: {
|
|
255
255
|
DATETIME: "getDateTime",
|
|
256
256
|
IMAGES: "getImages",
|
|
@@ -269,34 +269,35 @@ const Re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
269
269
|
CODEINTERPRETER: "addon:codeinterpreter"
|
|
270
270
|
}
|
|
271
271
|
};
|
|
272
|
-
function
|
|
272
|
+
function Ie(n) {
|
|
273
273
|
return !!n && Array.isArray(n.capabilities) && n.capabilities.length >= 0;
|
|
274
274
|
}
|
|
275
275
|
function q(n) {
|
|
276
276
|
return n ? new Set(n) : null;
|
|
277
277
|
}
|
|
278
|
-
function
|
|
278
|
+
function De(n, e, r) {
|
|
279
279
|
if (!e || Array.isArray(e) && e.length === 0)
|
|
280
280
|
return !0;
|
|
281
281
|
const t = n instanceof Set ? n : q(n);
|
|
282
282
|
return !t || t.size === 0 ? !1 : typeof e == "string" ? t.has(e) : r?.any === !0 ? e.some((o) => t.has(o)) : e.every((o) => t.has(o));
|
|
283
283
|
}
|
|
284
284
|
export {
|
|
285
|
-
|
|
285
|
+
Ee as ALL_MODELS,
|
|
286
286
|
se as ALL_PROVIDERS,
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
287
|
+
ye as ALL_REASONING_MODELS,
|
|
288
|
+
_e as APPLICATION_NAME,
|
|
289
|
+
Pe as CAPABILITIES,
|
|
290
290
|
oe as DEFAULT_PROVIDER,
|
|
291
291
|
ue as DIGGIDY_CHAT_ID_HEADER,
|
|
292
|
-
|
|
293
|
-
|
|
292
|
+
Ae as MODELS_PER_PROVIDER,
|
|
293
|
+
_ as MODEL_CLAUDE_HAIKU,
|
|
294
294
|
O as MODEL_CLAUDE_SONNET,
|
|
295
295
|
ae as MODEL_DEV,
|
|
296
|
-
|
|
296
|
+
ie as MODEL_EMBEDDING_TEXT,
|
|
297
|
+
R as MODEL_GEMINI_FLASH,
|
|
297
298
|
l as MODEL_GEMINI_PRO,
|
|
298
299
|
p as MODEL_GPT4_MINI,
|
|
299
|
-
|
|
300
|
+
u as MODEL_GPT5,
|
|
300
301
|
ce as MODEL_MEMORY_INFERENCE,
|
|
301
302
|
M as MODEL_O4_MINI,
|
|
302
303
|
T as MODEL_SONAR,
|
|
@@ -304,25 +305,25 @@ export {
|
|
|
304
305
|
J as PLAN_FREE,
|
|
305
306
|
Z as PLAN_PLUS,
|
|
306
307
|
Q as PLAN_PREMIUM,
|
|
307
|
-
|
|
308
|
+
fe as POLICY_GRANTS,
|
|
308
309
|
E as PROVIDER_ANTHROPIC,
|
|
309
310
|
y as PROVIDER_GOOGLE,
|
|
310
311
|
L as PROVIDER_MEMORY,
|
|
311
312
|
re as PROVIDER_MISTRAL,
|
|
312
313
|
i as PROVIDER_OPENAI,
|
|
313
|
-
|
|
314
|
-
|
|
314
|
+
d as PROVIDER_PERPLEXITY,
|
|
315
|
+
de as PROVIDER_ROLE_MAP,
|
|
315
316
|
g as PROVIDER_SUMMARY,
|
|
316
317
|
c as ROLE_ASSISTANT,
|
|
317
318
|
te as ROLE_HIDDEN,
|
|
318
319
|
ne as ROLE_INTERNAL,
|
|
319
|
-
|
|
320
|
+
S as ROLE_SYSTEM,
|
|
320
321
|
a as ROLE_USER,
|
|
321
|
-
|
|
322
|
-
|
|
322
|
+
le as SORT_BY_TIMESTAMP,
|
|
323
|
+
pe as SORT_BY_TOKEN_USAGE,
|
|
323
324
|
Re as crypto,
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
325
|
+
Oe as findProvider,
|
|
326
|
+
De as isEntitled,
|
|
327
|
+
Ie as isEntitlementLoaded,
|
|
327
328
|
q as toCapabilitySet
|
|
328
329
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/sassysaint-common",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.10.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": "8432d5ee884ee718374704faed70adac76714140"
|
|
36
36
|
}
|