@versini/sassysaint-common 4.7.1 → 4.8.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 -2
- package/dist/index.js +58 -55
- 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,8 @@ 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";
|
34
|
+
declare const MODEL_MEMORY_INFERENCE = "gpt-4o-mini";
|
32
35
|
/**
|
33
36
|
* List of all models available TODAY.
|
34
37
|
* This is used by the client to display the list of models.
|
@@ -59,7 +62,7 @@ declare const PROVIDER_ROLE_MAP: {
|
|
59
62
|
* Header string for Diggidy Chat Id. Used to identify the chat in the server
|
60
63
|
* when there is a client abort.
|
61
64
|
*/
|
62
|
-
declare const
|
65
|
+
declare const DIGGIDY_CHAT_ID_HEADER = "x-diggidy-chat-id";
|
63
66
|
/**
|
64
67
|
* This function finds the provider associated with a given model name. It
|
65
68
|
* checks the model name against a list of approximate models for each provider.
|
@@ -381,4 +384,4 @@ declare function isEntitlementLoaded(state: EntitlementStateLike | null | undefi
|
|
381
384
|
declare function toCapabilitySet(capabilities: string[] | undefined | null): Set<string> | null;
|
382
385
|
declare function isEntitled(capabilitiesOrSet: string[] | Set<string> | null | undefined, required: CapabilityInput, options?: IsEntitledOptions): boolean;
|
383
386
|
|
384
|
-
export { ALL_MODELS, ALL_PROVIDERS, ALL_REASONING_MODELS, APPLICATION_NAME, CAPABILITIES, type CapabilityInput, DEFAULT_PROVIDER,
|
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 };
|
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", R = "claude-3-5-haiku-20241022", O = "claude-sonnet-4-20250514", _ = "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 = [
|
6
6
|
d,
|
7
|
-
|
8
|
-
|
9
|
-
f,
|
10
|
-
O,
|
7
|
+
p,
|
8
|
+
M,
|
11
9
|
R,
|
12
|
-
|
13
|
-
|
10
|
+
O,
|
11
|
+
_,
|
12
|
+
l
|
13
|
+
], Ee = [
|
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,37 +26,37 @@ 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]: [
|
31
|
-
[E]: [
|
32
|
-
[y]: [
|
33
|
-
[u]: [
|
34
|
-
},
|
35
|
-
[i]: [
|
29
|
+
}, ye = {
|
30
|
+
[i]: [p, d],
|
31
|
+
[E]: [R, O],
|
32
|
+
[y]: [_, l],
|
33
|
+
[u]: [T, m]
|
34
|
+
}, Ae = {
|
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
|
+
}, ue = "x-diggidy-chat-id", de = (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
|
+
}, Oe = "timestamp", le = "tokenUsage", pe = "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";
|
52
52
|
}
|
53
53
|
}
|
54
|
-
const
|
54
|
+
const f = {
|
55
55
|
keySize: 4096,
|
56
56
|
debug: !1
|
57
57
|
};
|
58
58
|
async function k(n = {}) {
|
59
|
-
const e = { ...
|
59
|
+
const e = { ...f, ...n };
|
60
60
|
try {
|
61
61
|
const r = {
|
62
62
|
modulusLength: e.keySize,
|
@@ -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 Re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, CryptoError: s, DEFAULT_CRYPTO_CONFIG: f, 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", _e = {
|
250
250
|
PLAN_FREE: J,
|
251
251
|
PLAN_PLUS: Z,
|
252
252
|
PLAN_PREMIUM: Q
|
253
|
-
},
|
253
|
+
}, fe = {
|
254
254
|
TOOL: {
|
255
255
|
DATETIME: "getDateTime",
|
256
256
|
IMAGES: "getImages",
|
@@ -269,57 +269,60 @@ const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
269
269
|
CODEINTERPRETER: "addon:codeinterpreter"
|
270
270
|
}
|
271
271
|
};
|
272
|
-
function
|
272
|
+
function Pe(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 Ie(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
|
-
|
293
|
-
|
285
|
+
ie as ALL_MODELS,
|
286
|
+
se as ALL_PROVIDERS,
|
287
|
+
Ee as ALL_REASONING_MODELS,
|
288
|
+
pe as APPLICATION_NAME,
|
289
|
+
fe as CAPABILITIES,
|
290
|
+
oe as DEFAULT_PROVIDER,
|
291
|
+
ue as DIGGIDY_CHAT_ID_HEADER,
|
292
|
+
ye as MODELS_PER_PROVIDER,
|
293
|
+
R as MODEL_CLAUDE_HAIKU,
|
294
294
|
O as MODEL_CLAUDE_SONNET,
|
295
|
-
|
296
|
-
|
297
|
-
l as
|
295
|
+
ae as MODEL_DEV,
|
296
|
+
_ as MODEL_GEMINI_FLASH,
|
297
|
+
l as MODEL_GEMINI_PRO,
|
298
|
+
p as MODEL_GPT4_MINI,
|
298
299
|
d as MODEL_GPT5,
|
299
|
-
|
300
|
-
M as
|
301
|
-
|
300
|
+
ce as MODEL_MEMORY_INFERENCE,
|
301
|
+
M as MODEL_O4_MINI,
|
302
|
+
T as MODEL_SONAR,
|
303
|
+
m as MODEL_SONAR_PRO,
|
302
304
|
J as PLAN_FREE,
|
303
305
|
Z as PLAN_PLUS,
|
304
306
|
Q as PLAN_PREMIUM,
|
305
|
-
|
307
|
+
_e as POLICY_GRANTS,
|
306
308
|
E as PROVIDER_ANTHROPIC,
|
307
309
|
y as PROVIDER_GOOGLE,
|
308
310
|
L as PROVIDER_MEMORY,
|
311
|
+
re as PROVIDER_MISTRAL,
|
309
312
|
i as PROVIDER_OPENAI,
|
310
313
|
u as PROVIDER_PERPLEXITY,
|
311
|
-
|
312
|
-
|
314
|
+
Ae as PROVIDER_ROLE_MAP,
|
315
|
+
g as PROVIDER_SUMMARY,
|
313
316
|
c as ROLE_ASSISTANT,
|
314
317
|
te as ROLE_HIDDEN,
|
315
318
|
ne as ROLE_INTERNAL,
|
316
|
-
|
319
|
+
D as ROLE_SYSTEM,
|
317
320
|
a as ROLE_USER,
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
321
|
+
Oe as SORT_BY_TIMESTAMP,
|
322
|
+
le as SORT_BY_TOKEN_USAGE,
|
323
|
+
Re as crypto,
|
324
|
+
de as findProvider,
|
325
|
+
Ie as isEntitled,
|
326
|
+
Pe as isEntitlementLoaded,
|
324
327
|
q as toCapabilitySet
|
325
328
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@versini/sassysaint-common",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.8.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": "4e1bebb3b69c6a0b8869804bb04c11b444b4fef6"
|
36
36
|
}
|