@versini/sassysaint-common 4.18.2 → 4.18.4
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 +1 -104
- package/dist/index.js +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -74,14 +74,6 @@ export declare const CAPABILITIES: {
|
|
|
74
74
|
*/
|
|
75
75
|
export declare type CapabilityInput = string | readonly string[];
|
|
76
76
|
|
|
77
|
-
/**
|
|
78
|
-
* Color scheme constants based on system preference (light/dark mode).
|
|
79
|
-
*/
|
|
80
|
-
export declare const COLOR_SCHEME: {
|
|
81
|
-
readonly LIGHT: "light";
|
|
82
|
-
readonly DARK: "dark";
|
|
83
|
-
};
|
|
84
|
-
|
|
85
77
|
/**
|
|
86
78
|
* Maps each ActionColor to its corresponding Tailwind CSS class string. These
|
|
87
79
|
* are complete class strings (e.g., "fill-[#7A9BC4]", "text-copy-medium") that
|
|
@@ -92,11 +84,6 @@ export declare const COLOR_SCHEME: {
|
|
|
92
84
|
*/
|
|
93
85
|
export declare type ColorMap = Partial<Record<ActionColor, string>>;
|
|
94
86
|
|
|
95
|
-
/**
|
|
96
|
-
* Color scheme based on system preference (light/dark mode).
|
|
97
|
-
*/
|
|
98
|
-
export declare type ColorScheme = "light" | "dark";
|
|
99
|
-
|
|
100
87
|
/**
|
|
101
88
|
* CSS variables that can be dynamically applied to document.documentElement.
|
|
102
89
|
* Variable names must include the -- prefix (e.g., "--av-focus-light").
|
|
@@ -111,39 +98,6 @@ export declare const DEFAULT_PROVIDER = "OpenAI";
|
|
|
111
98
|
*/
|
|
112
99
|
export declare const DIGGIDY_CHAT_ID_HEADER = "x-diggidy-chat-id";
|
|
113
100
|
|
|
114
|
-
/**
|
|
115
|
-
* Display mode constants for OLED optimization.
|
|
116
|
-
*/
|
|
117
|
-
export declare const DISPLAY_MODE: {
|
|
118
|
-
readonly NORMAL: "normal";
|
|
119
|
-
readonly OLED: "oled";
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Display mode for OLED optimization.
|
|
124
|
-
*/
|
|
125
|
-
export declare type DisplayMode = "normal" | "oled";
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Represents the shape of an entitlement state object, used for checking
|
|
129
|
-
* capability loading status. This interface is intentionally flexible to work
|
|
130
|
-
* with various entitlement state implementations across client and server.
|
|
131
|
-
*/
|
|
132
|
-
export declare interface EntitlementStateLike {
|
|
133
|
-
/**
|
|
134
|
-
* Array of capability strings granted to the user.
|
|
135
|
-
*/
|
|
136
|
-
capabilities?: string[];
|
|
137
|
-
/**
|
|
138
|
-
* Version number of the entitlement state for cache invalidation.
|
|
139
|
-
*/
|
|
140
|
-
version?: number;
|
|
141
|
-
/**
|
|
142
|
-
* Current status of the entitlement (e.g., "active", "expired").
|
|
143
|
-
*/
|
|
144
|
-
status?: string;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
101
|
/**
|
|
148
102
|
* Identifies the AI provider associated with a given model name by matching
|
|
149
103
|
* against known model prefixes. This function provides backward compatibility
|
|
@@ -333,7 +287,7 @@ export declare function isEntitled(capabilitiesOrSet: string[] | Set<string> | n
|
|
|
333
287
|
* Configuration options for the isEntitled function to control how capability
|
|
334
288
|
* checks are evaluated.
|
|
335
289
|
*/
|
|
336
|
-
|
|
290
|
+
declare interface IsEntitledOptions {
|
|
337
291
|
/**
|
|
338
292
|
* When true, grants entitlement if ANY of the required capabilities match
|
|
339
293
|
* (logical OR). When false (default), requires ALL capabilities to match
|
|
@@ -347,31 +301,6 @@ export declare interface IsEntitledOptions {
|
|
|
347
301
|
set?: Set<string>;
|
|
348
302
|
}
|
|
349
303
|
|
|
350
|
-
/**
|
|
351
|
-
* Checks whether an entitlement state object has been successfully loaded and
|
|
352
|
-
* contains valid capability data. This function verifies the state is defined
|
|
353
|
-
* and has a capabilities array (even if empty).
|
|
354
|
-
*
|
|
355
|
-
* Use this function before performing capability checks to ensure the
|
|
356
|
-
* entitlement data is available and initialized properly.
|
|
357
|
-
*
|
|
358
|
-
* @param state - The entitlement state object to check, which may be null or
|
|
359
|
-
* undefined during initial loading.
|
|
360
|
-
* @returns True if the state is loaded and contains a capabilities array,
|
|
361
|
-
* false otherwise.
|
|
362
|
-
*
|
|
363
|
-
* @example
|
|
364
|
-
* ```ts
|
|
365
|
-
* const entitlementState = await fetchEntitlements();
|
|
366
|
-
* if (isEntitlementLoaded(entitlementState)) {
|
|
367
|
-
* // Safe to check capabilities
|
|
368
|
-
* const hasFeature = isEntitled(entitlementState.capabilities, "premium");
|
|
369
|
-
* }
|
|
370
|
-
* ```
|
|
371
|
-
*
|
|
372
|
-
*/
|
|
373
|
-
export declare function isEntitlementLoaded(state: EntitlementStateLike | null | undefined): boolean;
|
|
374
|
-
|
|
375
304
|
/**
|
|
376
305
|
* Validates if a selected model is allowed for the user based on their current
|
|
377
306
|
* plan's allowed models. This function is used to prevent users from using
|
|
@@ -492,8 +421,6 @@ export declare const PROVIDER_GOOGLE = "Google";
|
|
|
492
421
|
|
|
493
422
|
export declare const PROVIDER_MEMORY = "Memory";
|
|
494
423
|
|
|
495
|
-
export declare const PROVIDER_MISTRAL = "Mistral";
|
|
496
|
-
|
|
497
424
|
/**
|
|
498
425
|
* List of available providers.
|
|
499
426
|
*/
|
|
@@ -517,10 +444,6 @@ export declare const PROVIDER_SUMMARY = "Summary";
|
|
|
517
444
|
|
|
518
445
|
export declare const ROLE_ASSISTANT = "assistant";
|
|
519
446
|
|
|
520
|
-
export declare const ROLE_HIDDEN = "hidden";
|
|
521
|
-
|
|
522
|
-
export declare const ROLE_INTERNAL = "data";
|
|
523
|
-
|
|
524
447
|
/**
|
|
525
448
|
* List of available roles.
|
|
526
449
|
*/
|
|
@@ -563,30 +486,4 @@ export declare interface ThemePalette {
|
|
|
563
486
|
oled: Palette;
|
|
564
487
|
}
|
|
565
488
|
|
|
566
|
-
/**
|
|
567
|
-
* Converts an array of capability strings into a Set for efficient lookup
|
|
568
|
-
* operations. Returns null if the input is null, undefined, or not an array.
|
|
569
|
-
*
|
|
570
|
-
* Using a Set for capability checks provides O(1) lookup performance compared
|
|
571
|
-
* to O(n) for array includes, which is beneficial when checking multiple
|
|
572
|
-
* capabilities or performing frequent checks.
|
|
573
|
-
*
|
|
574
|
-
* @param capabilities - Array of capability strings to convert, or null/
|
|
575
|
-
* undefined.
|
|
576
|
-
* @returns A Set containing the capability strings, or null if input is
|
|
577
|
-
* invalid.
|
|
578
|
-
*
|
|
579
|
-
* @example
|
|
580
|
-
* ```ts
|
|
581
|
-
* const caps = ["read:posts", "write:posts", "admin"];
|
|
582
|
-
* const capSet = toCapabilitySet(caps);
|
|
583
|
-
* // capSet.has("read:posts") is now O(1) instead of O(n)
|
|
584
|
-
*
|
|
585
|
-
* toCapabilitySet(null); // Returns null
|
|
586
|
-
* toCapabilitySet(undefined); // Returns null
|
|
587
|
-
* ```
|
|
588
|
-
*
|
|
589
|
-
*/
|
|
590
|
-
export declare function toCapabilitySet(capabilities: string[] | undefined | null): Set<string> | null;
|
|
591
|
-
|
|
592
489
|
export { }
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
let e="standard"
|
|
1
|
+
let e="standard";var t,r=((t={})[t.NewChat=0]="NewChat",t[t.Prompts=1]="Prompts",t[t.Attachment=2]="Attachment",t[t.PrivateChat=3]="PrivateChat",t[t.Reasoning=4]="Reasoning",t[t.Send=5]="Send",t[t.Header=6]="Header",t[t.Provider=7]="Provider",t[t.Logo=8]="Logo",t[t.Placeholder=9]="Placeholder",t[t.Footer=10]="Footer",t);let E="system",n="user",o="assistant",a="OpenAI",i="Anthropic",s="Google",O="Summary",_="Memory",l="Perplexity",P=a,R=[a,i,s],A="gpt-5",M="gpt-5-mini",d="gpt-5-nano",D="gpt-4.1-nano",L="claude-haiku-4-5",I="claude-sonnet-4-5",T="gemini-2.5-flash",S="gemini-3-pro-preview",g="sonar",N="sonar-pro",u="openai/gpt-oss-20b:free",h="gpt-4o-mini",c="text-embedding-3-small",p={[A]:"GPT-5",[M]:"GPT-5 Mini",[d]:"GPT-5 Nano",[D]:"GPT-4.1 Nano",[L]:"Claude Haiku 4.5",[I]:"Claude Sonnet 4.5",[T]:"Gemini 2.5 Flash",[S]:"Gemini 3 Pro",[g]:"Sonar",[N]:"Sonar Pro"},m=[A,M,d,L,I,T,S],f=[A,M,d,I,S],G={[a]:[D,A,M,d],[i]:[L,I],[s]:[T,S],[l]:[g,N]},C={[a]:[E,n,o],[i]:[n,o],[O]:[n,o],[_]:[n,o],[s]:[n,o],[l]:[n,o]},H={[i]:["claude-sonnet-4","claude-haiku-4","claude-3"],[a]:["gpt-","o3","o4"],[s]:["gemini"],[l]:["sonar"]},U="x-diggidy-chat-id",y="timestamp",v="tokenUsage",V="Diggidy",b="sassy:basic",Y="sassy:plus",B="sassy:advanced",w={TOOL:{DATETIME:"getDateTime",IMAGES:"getImages",POLLUTION:"getAirPollution",WEATHER:"getWeather",URLCONTENTPARSER:"getUrlContent",MEMORIES:"getUserMemories",HUMANIZE:"humanize",WEBSEARCH:"getWebSearch",GITREPOSITORY:"getGitRepoDetails",HOTELS:"getHotelDetails"},ADDON:{ATTACHMENTS:"addon:attachments",REASONING:"addon:reasoning",CODEINTERPRETER:"addon:codeinterpreter"}},F=e=>{for(let[t,r]of Object.entries(H))if(r.some(t=>e.startsWith(t)))return t;return null},k=e=>{if(!e||0===e.length)return[];let t=new Set;for(let r of e)for(let[e,E]of Object.entries(G))E.includes(r)&&(e===a||e===i||e===s)&&t.add(e);return R.filter(e=>t.has(e))},x=e=>{let t=new Map;if(!e||0===e.length)return t;for(let r of e)for(let[e,E]of Object.entries(G))if(E.includes(r)){t.has(e)||t.set(e,[]),t.get(e)?.push(r);break}return t},W=e=>{for(let t of x(e).values())if(t.length>1)return!0;return!1},j=(e,t)=>!!e&&!!t&&0!==t.length&&t.includes(e);function X(e,t,r){if(!t||Array.isArray(t)&&0===t.length)return!0;let E=e instanceof Set?e:e?new Set(e):null;return!!E&&0!==E.size&&("string"==typeof t?E.has(t):r?.any===!0?t.some(e=>E.has(e)):t.every(e=>E.has(e)))}function z(e){return f.includes(e)}var K="subtle";export{m as ALL_MODELS,R as ALL_PROVIDERS,f as ALL_REASONING_MODELS,V as APPLICATION_NAME,H as APPROXIMATE_MODELS_PER_PROVIDER,r as ActionColor,w as CAPABILITIES,P as DEFAULT_PROVIDER,U as DIGGIDY_CHAT_ID_HEADER,G as MODELS_PER_PROVIDER,L as MODEL_CLAUDE_HAIKU,I as MODEL_CLAUDE_SONNET,u as MODEL_DEV,p as MODEL_DISPLAY_NAMES,c as MODEL_EMBEDDING_TEXT,T as MODEL_GEMINI_FLASH,S as MODEL_GEMINI_PRO,D as MODEL_GPT4_NANO,A as MODEL_GPT5,M as MODEL_GPT5_MINI,d as MODEL_GPT5_NANO,h as MODEL_MEMORY_INFERENCE,g as MODEL_SONAR,N as MODEL_SONAR_PRO,b as PLAN_BASIC,Y as PLAN_PLUS,B as PLAN_PREMIUM,i as PROVIDER_ANTHROPIC,s as PROVIDER_GOOGLE,_ as PROVIDER_MEMORY,a as PROVIDER_OPENAI,l as PROVIDER_PERPLEXITY,C as PROVIDER_ROLE_MAP,O as PROVIDER_SUMMARY,o as ROLE_ASSISTANT,E as ROLE_SYSTEM,n as ROLE_USER,y as SORT_BY_TIMESTAMP,v as SORT_BY_TOKEN_USAGE,e as THEME_STANDARD,F as findProvider,x as getModelsGroupedByProvider,k as getProvidersFromModels,W as hasMultipleModelsPerProvider,X as isEntitled,j as isModelAllowedForPlan,z as isReasoningModel,K as THEME_SUBTLE};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/sassysaint-common",
|
|
3
|
-
"version": "4.18.
|
|
3
|
+
"version": "4.18.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"watch": "npm-run-all dev"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@microsoft/api-extractor": "7.55.
|
|
37
|
-
"@rslib/core": "0.18.
|
|
36
|
+
"@microsoft/api-extractor": "7.55.2",
|
|
37
|
+
"@rslib/core": "0.18.3"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "6038790e8a900664fde14dd2b8bcf3a9c47ca008"
|
|
40
40
|
}
|