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