@versini/sassysaint-common 4.5.0 → 4.7.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 -4
- package/dist/index.js +23 -23
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
@@ -55,10 +55,10 @@ declare const PROVIDER_ROLE_MAP: {
|
|
55
55
|
Perplexity: string[];
|
56
56
|
};
|
57
57
|
/**
|
58
|
-
* Header string for
|
58
|
+
* Header string for Diggidy Chat Id. Used to identify the chat in the server
|
59
59
|
* when there is a client abort.
|
60
60
|
*/
|
61
|
-
declare const
|
61
|
+
declare const DIGGITY_CHAT_ID_HEADER = "x-diggidy-chat-id";
|
62
62
|
/**
|
63
63
|
* This function finds the provider associated with a given model name. It
|
64
64
|
* checks the model name against a list of approximate models for each provider.
|
@@ -76,7 +76,7 @@ declare const SORT_BY_TOKEN_USAGE = "tokenUsage";
|
|
76
76
|
/**
|
77
77
|
* Name of the application.
|
78
78
|
*/
|
79
|
-
declare const APPLICATION_NAME = "
|
79
|
+
declare const APPLICATION_NAME = "Diggidy";
|
80
80
|
|
81
81
|
/**
|
82
82
|
* TypeScript interfaces for Server-Mediated Encryption.
|
@@ -380,4 +380,4 @@ declare function isEntitlementLoaded(state: EntitlementStateLike | null | undefi
|
|
380
380
|
declare function toCapabilitySet(capabilities: string[] | undefined | null): Set<string> | null;
|
381
381
|
declare function isEntitled(capabilitiesOrSet: string[] | Set<string> | null | undefined, required: CapabilityInput, options?: IsEntitledOptions): boolean;
|
382
382
|
|
383
|
-
export { ALL_MODELS, ALL_PROVIDERS, ALL_REASONING_MODELS, APPLICATION_NAME,
|
383
|
+
export { ALL_MODELS, ALL_PROVIDERS, ALL_REASONING_MODELS, APPLICATION_NAME, CAPABILITIES, type CapabilityInput, DEFAULT_PROVIDER, DIGGITY_CHAT_ID_HEADER, type EntitlementStateLike, type IsEntitledOptions, MODELS_PER_PROVIDER, MODEL_CLAUDE_HAIKU, MODEL_CLAUDE_SONNET, 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_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,21 +1,21 @@
|
|
1
|
-
const
|
1
|
+
const L = "system", a = "user", c = "assistant", te = "hidden", ne = "data", i = "OpenAI", E = "Anthropic", y = "Google", T = "Summary", M = "Memory", u = "Perplexity", re = i, oe = [
|
2
2
|
i,
|
3
3
|
E,
|
4
4
|
y
|
5
|
-
], d = "gpt-5",
|
5
|
+
], d = "gpt-5", l = "gpt-4.1-nano", w = "o4-mini", f = "claude-3-5-haiku-20241022", O = "claude-sonnet-4-20250514", R = "gemini-2.5-flash", p = "gemini-2.5-pro", _ = "sonar", P = "sonar-pro", se = [
|
6
6
|
d,
|
7
|
-
|
7
|
+
l,
|
8
8
|
w,
|
9
9
|
f,
|
10
10
|
O,
|
11
11
|
R,
|
12
|
-
|
12
|
+
p,
|
13
13
|
_,
|
14
14
|
P
|
15
15
|
], ae = [
|
16
16
|
d,
|
17
17
|
O,
|
18
|
-
|
18
|
+
p
|
19
19
|
], m = "claude-sonnet-4", h = "claude-3", b = "gpt-", N = "o3", C = "o4", U = "gemini", v = "sonar", K = {
|
20
20
|
[E]: [
|
21
21
|
m,
|
@@ -29,25 +29,25 @@ const g = "system", a = "user", c = "assistant", te = "hidden", ne = "data", i =
|
|
29
29
|
[y]: [U],
|
30
30
|
[u]: [v]
|
31
31
|
}, ce = {
|
32
|
-
[i]: [
|
32
|
+
[i]: [l, d],
|
33
33
|
[E]: [f, O],
|
34
|
-
[y]: [R,
|
34
|
+
[y]: [R, p],
|
35
35
|
[u]: [_, P]
|
36
36
|
}, ie = {
|
37
|
-
[i]: [
|
37
|
+
[i]: [L, a, c],
|
38
38
|
[E]: [a, c],
|
39
39
|
[T]: [a, c],
|
40
40
|
[M]: [a, c],
|
41
41
|
[y]: [a, c],
|
42
42
|
[u]: [a, c]
|
43
|
-
}, Ee = "x-
|
43
|
+
}, Ee = "x-diggidy-chat-id", ye = (n) => {
|
44
44
|
for (const [e, r] of Object.entries(
|
45
45
|
K
|
46
46
|
))
|
47
47
|
if (r.some((t) => n.startsWith(t)))
|
48
48
|
return e;
|
49
49
|
return null;
|
50
|
-
}, Ae = "timestamp", ue = "tokenUsage", de = "
|
50
|
+
}, Ae = "timestamp", ue = "tokenUsage", de = "Diggidy";
|
51
51
|
class s extends Error {
|
52
52
|
constructor(e, r, t) {
|
53
53
|
super(e), this.code = r, this.originalError = t, this.name = "CryptoError";
|
@@ -155,7 +155,7 @@ async function F(n, e, r) {
|
|
155
155
|
);
|
156
156
|
}
|
157
157
|
}
|
158
|
-
async function
|
158
|
+
async function Y(n, e) {
|
159
159
|
try {
|
160
160
|
const r = Uint8Array.from(
|
161
161
|
atob(n.data),
|
@@ -176,7 +176,7 @@ async function H(n, e) {
|
|
176
176
|
);
|
177
177
|
}
|
178
178
|
}
|
179
|
-
async function
|
179
|
+
async function H(n, e, r) {
|
180
180
|
try {
|
181
181
|
const t = await S(
|
182
182
|
n.serverPublicKey
|
@@ -196,7 +196,7 @@ async function V(n, e, r) {
|
|
196
196
|
);
|
197
197
|
}
|
198
198
|
}
|
199
|
-
function
|
199
|
+
function V(n) {
|
200
200
|
return !(!n || !n.clientKeyPair || !n.serverPublicKey);
|
201
201
|
}
|
202
202
|
function x() {
|
@@ -209,14 +209,14 @@ function x() {
|
|
209
209
|
const r = Array.from(e).map((t) => t.toString(36)).join("");
|
210
210
|
return `device_${n}_${r}`;
|
211
211
|
}
|
212
|
-
function
|
212
|
+
function g() {
|
213
213
|
return typeof window < "u" && typeof window.crypto < "u" && typeof window.crypto.subtle < "u";
|
214
214
|
}
|
215
215
|
function D() {
|
216
216
|
return typeof window < "u" && (window.isSecureContext || window.location.protocol === "https:");
|
217
217
|
}
|
218
218
|
function X() {
|
219
|
-
return
|
219
|
+
return g() && D();
|
220
220
|
}
|
221
221
|
function $(n) {
|
222
222
|
const e = new Uint8Array(n);
|
@@ -248,11 +248,11 @@ function z(n) {
|
|
248
248
|
function W(n, ...e) {
|
249
249
|
typeof process < "u" && process.env && process.env.NODE_ENV === "development" && console.info(`🔐 [Crypto] ${n}`, ...e);
|
250
250
|
}
|
251
|
-
const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, CryptoError: s, DEFAULT_CRYPTO_CONFIG: I, arrayBufferToBase64: $, base64ToArrayBuffer: j, canUseEncryption: X, debugLog: W, decryptFromServer:
|
251
|
+
const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, CryptoError: s, DEFAULT_CRYPTO_CONFIG: I, arrayBufferToBase64: $, base64ToArrayBuffer: j, canUseEncryption: X, debugLog: W, decryptFromServer: Y, encryptForServer: F, establishCryptoSession: H, exportPublicKey: G, generateClientKeyPair: k, generateDeviceId: x, importServerPublicKey: S, isCryptoSessionValid: V, isSecureContext: D, isWebCryptoSupported: g, safeParse: z, safeStringify: B }, Symbol.toStringTag, { value: "Module" })), J = "sassy:free", Z = "sassy:plus", Q = "sassy:advanced", pe = {
|
252
252
|
PLAN_FREE: J,
|
253
253
|
PLAN_PLUS: Z,
|
254
254
|
PLAN_PREMIUM: Q
|
255
|
-
},
|
255
|
+
}, le = {
|
256
256
|
TOOL: {
|
257
257
|
DATETIME: "getDateTime",
|
258
258
|
IMAGES: "getImages",
|
@@ -288,15 +288,15 @@ export {
|
|
288
288
|
oe as ALL_PROVIDERS,
|
289
289
|
ae as ALL_REASONING_MODELS,
|
290
290
|
de as APPLICATION_NAME,
|
291
|
-
|
292
|
-
pe as CAPABILITIES,
|
291
|
+
le as CAPABILITIES,
|
293
292
|
re as DEFAULT_PROVIDER,
|
293
|
+
Ee as DIGGITY_CHAT_ID_HEADER,
|
294
294
|
ce as MODELS_PER_PROVIDER,
|
295
295
|
f as MODEL_CLAUDE_HAIKU,
|
296
296
|
O as MODEL_CLAUDE_SONNET,
|
297
297
|
R as MODEL_GEMINI_FLASH,
|
298
|
-
|
299
|
-
|
298
|
+
p as MODEL_GEMINI_PRO,
|
299
|
+
l as MODEL_GPT4_MINI,
|
300
300
|
d as MODEL_GPT5,
|
301
301
|
w as MODEL_O4_MINI,
|
302
302
|
_ as MODEL_SONAR,
|
@@ -304,7 +304,7 @@ export {
|
|
304
304
|
J as PLAN_FREE,
|
305
305
|
Z as PLAN_PLUS,
|
306
306
|
Q as PLAN_PREMIUM,
|
307
|
-
|
307
|
+
pe as POLICY_GRANTS,
|
308
308
|
E as PROVIDER_ANTHROPIC,
|
309
309
|
y as PROVIDER_GOOGLE,
|
310
310
|
M as PROVIDER_MEMORY,
|
@@ -315,7 +315,7 @@ export {
|
|
315
315
|
c as ROLE_ASSISTANT,
|
316
316
|
te as ROLE_HIDDEN,
|
317
317
|
ne as ROLE_INTERNAL,
|
318
|
-
|
318
|
+
L as ROLE_SYSTEM,
|
319
319
|
a as ROLE_USER,
|
320
320
|
Ae as SORT_BY_TIMESTAMP,
|
321
321
|
ue as SORT_BY_TOKEN_USAGE,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@versini/sassysaint-common",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.7.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": "ab5a5dd7466eb60e2692450f2e21344d4000226f"
|
36
36
|
}
|