@versini/sassysaint-common 4.4.1 → 4.6.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 +34 -33
- 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 Diggity 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-diggity-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 = "Diggity";
|
80
80
|
|
81
81
|
/**
|
82
82
|
* TypeScript interfaces for Server-Mediated Encryption.
|
@@ -353,6 +353,7 @@ declare const CAPABILITIES: {
|
|
353
353
|
readonly ADDON: {
|
354
354
|
readonly ATTACHMENTS: "addon:attachments";
|
355
355
|
readonly REASONING: "addon:reasoning";
|
356
|
+
readonly CODEINTERPRETER: "addon:codeinterpreter";
|
356
357
|
};
|
357
358
|
};
|
358
359
|
/**
|
@@ -379,4 +380,4 @@ declare function isEntitlementLoaded(state: EntitlementStateLike | null | undefi
|
|
379
380
|
declare function toCapabilitySet(capabilities: string[] | undefined | null): Set<string> | null;
|
380
381
|
declare function isEntitled(capabilitiesOrSet: string[] | Set<string> | null | undefined, required: CapabilityInput, options?: IsEntitledOptions): boolean;
|
381
382
|
|
382
|
-
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
|
-
_,
|
12
|
-
l,
|
13
11
|
R,
|
12
|
+
p,
|
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]: [
|
35
|
-
[u]: [
|
34
|
+
[y]: [R, p],
|
35
|
+
[u]: [_, P]
|
36
36
|
}, ie = {
|
37
|
-
[i]: [
|
37
|
+
[i]: [L, a, c],
|
38
38
|
[E]: [a, c],
|
39
|
-
[M]: [a, c],
|
40
39
|
[T]: [a, c],
|
40
|
+
[M]: [a, c],
|
41
41
|
[y]: [a, c],
|
42
42
|
[u]: [a, c]
|
43
|
-
}, Ee = "x-
|
43
|
+
}, Ee = "x-diggity-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 = "Diggity";
|
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",
|
@@ -267,7 +267,8 @@ const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
267
267
|
},
|
268
268
|
ADDON: {
|
269
269
|
ATTACHMENTS: "addon:attachments",
|
270
|
-
REASONING: "addon:reasoning"
|
270
|
+
REASONING: "addon:reasoning",
|
271
|
+
CODEINTERPRETER: "addon:codeinterpreter"
|
271
272
|
}
|
272
273
|
};
|
273
274
|
function fe(n) {
|
@@ -276,7 +277,7 @@ function fe(n) {
|
|
276
277
|
function q(n) {
|
277
278
|
return n ? new Set(n) : null;
|
278
279
|
}
|
279
|
-
function
|
280
|
+
function Re(n, e, r) {
|
280
281
|
if (!e || Array.isArray(e) && e.length === 0)
|
281
282
|
return !0;
|
282
283
|
const t = n instanceof Set ? n : q(n);
|
@@ -287,40 +288,40 @@ export {
|
|
287
288
|
oe as ALL_PROVIDERS,
|
288
289
|
ae as ALL_REASONING_MODELS,
|
289
290
|
de as APPLICATION_NAME,
|
290
|
-
|
291
|
-
pe as CAPABILITIES,
|
291
|
+
le as CAPABILITIES,
|
292
292
|
re as DEFAULT_PROVIDER,
|
293
|
+
Ee as DIGGITY_CHAT_ID_HEADER,
|
293
294
|
ce as MODELS_PER_PROVIDER,
|
294
295
|
f as MODEL_CLAUDE_HAIKU,
|
295
296
|
O as MODEL_CLAUDE_SONNET,
|
296
|
-
|
297
|
-
|
298
|
-
|
297
|
+
R as MODEL_GEMINI_FLASH,
|
298
|
+
p as MODEL_GEMINI_PRO,
|
299
|
+
l as MODEL_GPT4_MINI,
|
299
300
|
d as MODEL_GPT5,
|
300
301
|
w as MODEL_O4_MINI,
|
301
|
-
|
302
|
+
_ as MODEL_SONAR,
|
302
303
|
P as MODEL_SONAR_PRO,
|
303
304
|
J as PLAN_FREE,
|
304
305
|
Z as PLAN_PLUS,
|
305
306
|
Q as PLAN_PREMIUM,
|
306
|
-
|
307
|
+
pe as POLICY_GRANTS,
|
307
308
|
E as PROVIDER_ANTHROPIC,
|
308
309
|
y as PROVIDER_GOOGLE,
|
309
|
-
|
310
|
+
M as PROVIDER_MEMORY,
|
310
311
|
i as PROVIDER_OPENAI,
|
311
312
|
u as PROVIDER_PERPLEXITY,
|
312
313
|
ie as PROVIDER_ROLE_MAP,
|
313
|
-
|
314
|
+
T as PROVIDER_SUMMARY,
|
314
315
|
c as ROLE_ASSISTANT,
|
315
316
|
te as ROLE_HIDDEN,
|
316
317
|
ne as ROLE_INTERNAL,
|
317
|
-
|
318
|
+
L as ROLE_SYSTEM,
|
318
319
|
a as ROLE_USER,
|
319
320
|
Ae as SORT_BY_TIMESTAMP,
|
320
321
|
ue as SORT_BY_TOKEN_USAGE,
|
321
322
|
Oe as crypto,
|
322
323
|
ye as findProvider,
|
323
|
-
|
324
|
+
Re as isEntitled,
|
324
325
|
fe as isEntitlementLoaded,
|
325
326
|
q as toCapabilitySet
|
326
327
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@versini/sassysaint-common",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.6.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": "fe1cb01957760bbd3d9601b6f09b6c386f40e67c"
|
36
36
|
}
|