@versini/sassysaint-common 4.7.1 → 4.8.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 +4 -2
- package/dist/index.js +50 -48
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
@@ -15,6 +15,7 @@ declare const PROVIDER_GOOGLE = "Google";
|
|
15
15
|
declare const PROVIDER_SUMMARY = "Summary";
|
16
16
|
declare const PROVIDER_MEMORY = "Memory";
|
17
17
|
declare const PROVIDER_PERPLEXITY = "Perplexity";
|
18
|
+
declare const PROVIDER_MISTRAL = "Mistral";
|
18
19
|
declare const DEFAULT_PROVIDER = "OpenAI";
|
19
20
|
declare const ALL_PROVIDERS: readonly ["OpenAI", "Anthropic", "Google"];
|
20
21
|
/**
|
@@ -29,6 +30,7 @@ declare const MODEL_GEMINI_FLASH = "gemini-2.5-flash";
|
|
29
30
|
declare const MODEL_GEMINI_PRO = "gemini-2.5-pro";
|
30
31
|
declare const MODEL_SONAR = "sonar";
|
31
32
|
declare const MODEL_SONAR_PRO = "sonar-pro";
|
33
|
+
declare const MODEL_DEV = "mistralai/mistral-small-3.2-24b-instruct:free";
|
32
34
|
/**
|
33
35
|
* List of all models available TODAY.
|
34
36
|
* This is used by the client to display the list of models.
|
@@ -59,7 +61,7 @@ declare const PROVIDER_ROLE_MAP: {
|
|
59
61
|
* Header string for Diggidy Chat Id. Used to identify the chat in the server
|
60
62
|
* when there is a client abort.
|
61
63
|
*/
|
62
|
-
declare const
|
64
|
+
declare const DIGGIDY_CHAT_ID_HEADER = "x-diggidy-chat-id";
|
63
65
|
/**
|
64
66
|
* This function finds the provider associated with a given model name. It
|
65
67
|
* checks the model name against a list of approximate models for each provider.
|
@@ -381,4 +383,4 @@ declare function isEntitlementLoaded(state: EntitlementStateLike | null | undefi
|
|
381
383
|
declare function toCapabilitySet(capabilities: string[] | undefined | null): Set<string> | null;
|
382
384
|
declare function isEntitled(capabilitiesOrSet: string[] | Set<string> | null | undefined, required: CapabilityInput, options?: IsEntitledOptions): boolean;
|
383
385
|
|
384
|
-
export { ALL_MODELS, ALL_PROVIDERS, ALL_REASONING_MODELS, APPLICATION_NAME, CAPABILITIES, type CapabilityInput, DEFAULT_PROVIDER,
|
386
|
+
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_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,22 +1,22 @@
|
|
1
|
-
const
|
1
|
+
const D = "system", a = "user", c = "assistant", te = "hidden", ne = "data", i = "OpenAI", E = "Anthropic", y = "Google", g = "Summary", L = "Memory", u = "Perplexity", re = "Mistral", oe = i, se = [
|
2
2
|
i,
|
3
3
|
E,
|
4
4
|
y
|
5
|
-
], d = "gpt-5",
|
5
|
+
], d = "gpt-5", p = "gpt-4.1-nano", M = "o4-mini", f = "claude-3-5-haiku-20241022", O = "claude-sonnet-4-20250514", 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 = [
|
6
6
|
d,
|
7
|
-
|
8
|
-
|
7
|
+
p,
|
8
|
+
M,
|
9
9
|
f,
|
10
10
|
O,
|
11
11
|
R,
|
12
|
-
|
13
|
-
],
|
12
|
+
l
|
13
|
+
], ie = [
|
14
14
|
d,
|
15
15
|
O,
|
16
|
-
|
17
|
-
],
|
16
|
+
l
|
17
|
+
], w = "claude-sonnet-4", h = "claude-3", b = "gpt-", N = "o3", C = "o4", U = "gemini", v = "sonar", K = {
|
18
18
|
[E]: [
|
19
|
-
|
19
|
+
w,
|
20
20
|
h
|
21
21
|
],
|
22
22
|
[i]: [
|
@@ -26,26 +26,26 @@ const g = "system", a = "user", c = "assistant", te = "hidden", ne = "data", i =
|
|
26
26
|
],
|
27
27
|
[y]: [U],
|
28
28
|
[u]: [v]
|
29
|
-
},
|
30
|
-
[i]: [
|
29
|
+
}, Ee = {
|
30
|
+
[i]: [p, d],
|
31
31
|
[E]: [f, O],
|
32
|
-
[y]: [R,
|
33
|
-
[u]: [
|
34
|
-
},
|
35
|
-
[i]: [
|
32
|
+
[y]: [R, l],
|
33
|
+
[u]: [T, m]
|
34
|
+
}, ye = {
|
35
|
+
[i]: [D, a, c],
|
36
36
|
[E]: [a, c],
|
37
|
-
[
|
37
|
+
[g]: [a, c],
|
38
38
|
[L]: [a, c],
|
39
39
|
[y]: [a, c],
|
40
40
|
[u]: [a, c]
|
41
|
-
},
|
41
|
+
}, Ae = "x-diggidy-chat-id", ue = (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
|
+
}, de = "timestamp", Oe = "tokenUsage", le = "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";
|
@@ -153,7 +153,7 @@ async function F(n, e, r) {
|
|
153
153
|
);
|
154
154
|
}
|
155
155
|
}
|
156
|
-
async function
|
156
|
+
async function V(n, e) {
|
157
157
|
try {
|
158
158
|
const r = Uint8Array.from(
|
159
159
|
atob(n.data),
|
@@ -174,7 +174,7 @@ async function Y(n, e) {
|
|
174
174
|
);
|
175
175
|
}
|
176
176
|
}
|
177
|
-
async function
|
177
|
+
async function Y(n, e, r) {
|
178
178
|
try {
|
179
179
|
const t = await P(
|
180
180
|
n.serverPublicKey
|
@@ -194,7 +194,7 @@ async function H(n, e, r) {
|
|
194
194
|
);
|
195
195
|
}
|
196
196
|
}
|
197
|
-
function
|
197
|
+
function H(n) {
|
198
198
|
return !(!n || !n.clientKeyPair || !n.serverPublicKey);
|
199
199
|
}
|
200
200
|
function x() {
|
@@ -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
|
249
|
+
const pe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, CryptoError: s, DEFAULT_CRYPTO_CONFIG: _, arrayBufferToBase64: $, base64ToArrayBuffer: j, canUseEncryption: X, debugLog: W, decryptFromServer: V, encryptForServer: F, establishCryptoSession: Y, exportPublicKey: G, generateClientKeyPair: k, generateDeviceId: x, importServerPublicKey: P, isCryptoSessionValid: H, isSecureContext: S, isWebCryptoSupported: I, safeParse: z, safeStringify: B }, 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
|
+
}, Re = {
|
254
254
|
TOOL: {
|
255
255
|
DATETIME: "getDateTime",
|
256
256
|
IMAGES: "getImages",
|
@@ -269,57 +269,59 @@ const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
269
269
|
CODEINTERPRETER: "addon:codeinterpreter"
|
270
270
|
}
|
271
271
|
};
|
272
|
-
function
|
272
|
+
function _e(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 Pe(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
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
285
|
+
ce as ALL_MODELS,
|
286
|
+
se as ALL_PROVIDERS,
|
287
|
+
ie as ALL_REASONING_MODELS,
|
288
|
+
le as APPLICATION_NAME,
|
289
|
+
Re as CAPABILITIES,
|
290
|
+
oe as DEFAULT_PROVIDER,
|
291
|
+
Ae as DIGGIDY_CHAT_ID_HEADER,
|
292
|
+
Ee as MODELS_PER_PROVIDER,
|
293
293
|
f as MODEL_CLAUDE_HAIKU,
|
294
294
|
O as MODEL_CLAUDE_SONNET,
|
295
|
+
ae as MODEL_DEV,
|
295
296
|
R as MODEL_GEMINI_FLASH,
|
296
|
-
|
297
|
-
|
297
|
+
l as MODEL_GEMINI_PRO,
|
298
|
+
p as MODEL_GPT4_MINI,
|
298
299
|
d as MODEL_GPT5,
|
299
|
-
|
300
|
-
|
301
|
-
|
300
|
+
M as MODEL_O4_MINI,
|
301
|
+
T as MODEL_SONAR,
|
302
|
+
m as MODEL_SONAR_PRO,
|
302
303
|
J as PLAN_FREE,
|
303
304
|
Z as PLAN_PLUS,
|
304
305
|
Q as PLAN_PREMIUM,
|
305
|
-
|
306
|
+
fe as POLICY_GRANTS,
|
306
307
|
E as PROVIDER_ANTHROPIC,
|
307
308
|
y as PROVIDER_GOOGLE,
|
308
309
|
L as PROVIDER_MEMORY,
|
310
|
+
re as PROVIDER_MISTRAL,
|
309
311
|
i as PROVIDER_OPENAI,
|
310
312
|
u as PROVIDER_PERPLEXITY,
|
311
|
-
|
312
|
-
|
313
|
+
ye as PROVIDER_ROLE_MAP,
|
314
|
+
g as PROVIDER_SUMMARY,
|
313
315
|
c as ROLE_ASSISTANT,
|
314
316
|
te as ROLE_HIDDEN,
|
315
317
|
ne as ROLE_INTERNAL,
|
316
|
-
|
318
|
+
D as ROLE_SYSTEM,
|
317
319
|
a as ROLE_USER,
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
320
|
+
de as SORT_BY_TIMESTAMP,
|
321
|
+
Oe as SORT_BY_TOKEN_USAGE,
|
322
|
+
pe as crypto,
|
323
|
+
ue as findProvider,
|
324
|
+
Pe as isEntitled,
|
325
|
+
_e as isEntitlementLoaded,
|
324
326
|
q as toCapabilitySet
|
325
327
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@versini/sassysaint-common",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.8.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": "c9acb4172e96e234105e1742d41f19dbbee7cd04"
|
36
36
|
}
|