@versini/sassysaint-common 4.39.1 → 4.40.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 +31 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -93,6 +93,22 @@ export declare type CapabilityInput = string | readonly string[];
|
|
|
93
93
|
*/
|
|
94
94
|
export declare type ColorMap = Partial<Record<ActionColor, string>>;
|
|
95
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Hard safety floor that triggers compression even when a user has disabled it
|
|
98
|
+
* via their `enableCompression` preference. Disabling compression maximises
|
|
99
|
+
* fidelity, but an unbounded conversation would eventually exceed the model's
|
|
100
|
+
* context window and fail the request opaquely. These ceilings let uncompressed
|
|
101
|
+
* chats grow well past the normal threshold while still forcing a last-resort
|
|
102
|
+
* compression before the context overflows.
|
|
103
|
+
*
|
|
104
|
+
* The default protects smaller (~128k) context windows. Premium plans unlock
|
|
105
|
+
* large-context (~1M token) models, so their floor is far higher — a flat low
|
|
106
|
+
* value would compress those chats needlessly early and defeat the opt-out.
|
|
107
|
+
*/
|
|
108
|
+
export declare const CONTEXT_COMPRESSION_EMERGENCY_THRESHOLD = 100000;
|
|
109
|
+
|
|
110
|
+
export declare const CONTEXT_COMPRESSION_EMERGENCY_THRESHOLD_PREMIUM = 800000;
|
|
111
|
+
|
|
96
112
|
/**
|
|
97
113
|
* Maximum number of the most recent images carried forward when older messages
|
|
98
114
|
* are compressed into a text summary. Compression flattens older turns into
|
|
@@ -169,6 +185,13 @@ export declare const DIGGIDY_CHAT_TIMESTAMP_HEADER = "x-diggidy-chat-timestamp";
|
|
|
169
185
|
*/
|
|
170
186
|
export declare const findProvider: (modelName: string) => null | typeof PROVIDER_ANTHROPIC | typeof PROVIDER_MISTRAL | typeof PROVIDER_OPENAI | typeof PROVIDER_GOOGLE;
|
|
171
187
|
|
|
188
|
+
/**
|
|
189
|
+
* Resolve the emergency compression floor for a plan. Premium gets the high
|
|
190
|
+
* ceiling (its models carry ~1M token windows); every other plan falls back to
|
|
191
|
+
* the conservative default that protects smaller windows.
|
|
192
|
+
*/
|
|
193
|
+
export declare function getCompressionEmergencyThreshold(plan?: string): number;
|
|
194
|
+
|
|
172
195
|
/**
|
|
173
196
|
* Groups allowed models by their respective providers. This function is used to
|
|
174
197
|
* create nested menu structures in the UI where users can select specific
|
|
@@ -577,7 +600,14 @@ export declare const ROLE_SYSTEM = "system";
|
|
|
577
600
|
|
|
578
601
|
export declare const ROLE_USER = "user";
|
|
579
602
|
|
|
580
|
-
|
|
603
|
+
/**
|
|
604
|
+
* Per-sub-query deadline for the parallel search fan-out. sonar-pro routinely
|
|
605
|
+
* takes 14-22s to answer a decomposed query (it runs its own search + synthesis
|
|
606
|
+
* with medium context), so a tighter bound kills every sub-query before the
|
|
607
|
+
* provider responds and the whole search reports a false failure. 30s leaves
|
|
608
|
+
* headroom over the observed tail while still bounding a genuinely hung request.
|
|
609
|
+
*/
|
|
610
|
+
export declare const SEARCH_QUERY_TIMEOUT_MS = 30000;
|
|
581
611
|
|
|
582
612
|
/**
|
|
583
613
|
* Sort capabilities are shared across client and server.
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,E=((e={})[e.NewChat=0]="NewChat",e[e.Prompts=1]="Prompts",e[e.Attachment=2]="Attachment",e[e.PrivateChat=3]="PrivateChat",e[e.Reasoning=4]="Reasoning",e[e.Send=5]="Send",e[e.Header=6]="Header",e[e.Provider=7]="Provider",e[e.Logo=8]="Logo",e[e.Placeholder=9]="Placeholder",e[e.Footer=10]="Footer",e);let O="
|
|
1
|
+
var e,E=((e={})[e.NewChat=0]="NewChat",e[e.Prompts=1]="Prompts",e[e.Attachment=2]="Attachment",e[e.PrivateChat=3]="PrivateChat",e[e.Reasoning=4]="Reasoning",e[e.Send=5]="Send",e[e.Header=6]="Header",e[e.Provider=7]="Provider",e[e.Logo=8]="Logo",e[e.Placeholder=9]="Placeholder",e[e.Footer=10]="Footer",e);let O="system",t="user",n="assistant",r="OpenAI",o="Anthropic",i="Google",a="Summary",_="Memory",R="Perplexity",T="Mistral",A="Auto",s=r,L=[r,o,i],I="gpt-5.4",M="gpt-5.4-mini",S="gpt-5.4-nano",P="claude-opus-4-8",l="claude-sonnet-4-6",N="claude-haiku-4-5",g="gemini-3-flash-preview",D="gemini-3.1-pro-preview",d="sonar",u="sonar-pro",C="openai/gpt-oss-20b:free",c="mistral-large-latest",h="gpt-5.4-nano",p="gpt-5.4-nano",G="gpt-5.4-mini",U="text-embedding-3-small",m="gemini-3-pro-image",H=S,f=N,y=g,B=M,Y=l,F=g,v=5,w=3e4,V={[I]:"GPT-5.4",[M]:"GPT-5.4 Mini",[S]:"GPT-5.4 Nano",[P]:"Claude Opus 4.8",[l]:"Claude Sonnet 4.6",[N]:"Claude Haiku 4.5",[D]:"Gemini 3.1 Pro",[g]:"Gemini 3 Flash",[d]:"Sonar",[u]:"Sonar Pro",[m]:"Nano Banana 3 Pro",[c]:"Mistral Large"},b=[I,M,S,P,l,N,g,D,m],X=[I,M,S,P,l,D],k={[r]:[I,M,S],[o]:[P,N,l],[i]:[g,D],[R]:[d,u]},x={[r]:[O,t,n],[o]:[t,n],[a]:[t,n],[_]:[t,n],[i]:[t,n],[R]:[t,n],[T]:[t,n]},W={[o]:["claude-opus-4","claude-sonnet-4","claude-haiku-4","claude-3"],[r]:["gpt-","o3","o4"],[i]:["gemini"],[R]:["sonar"],[T]:["mistral"]},z="x-diggidy-chat-id",K="x-diggidy-chat-timestamp",Z="timestamp",j="tokenUsage",Q="Diggidy",q="sassy:basic",J="sassy:plus",$="sassy:advanced",ee={TOOL:{BARCODE:"getProductByBarcode",BUNDLESIZE:"getBundleSize",DATETIME:"getDateTime",GENERATE_IMAGE:"generateImage",IMAGES:"getImages",NUTRITION_FACTS:"getNutritionFacts",POLLUTION:"getAirPollution",WEATHER:"getWeather",URLCONTENTPARSER:"getUrlContent",MEMORIES:"getUserMemories",HUMANIZE:"humanize",WEBSEARCH:"getWebSearch",GITREPOSITORY:"getGitRepoDetails",HOTELS:"getHotelDetails",PRONUNCIATION:"getPronunciation",FRENCH_TEACHINGS:"getFrenchTeachings"},ADDON:{ATTACHMENTS:"addon:attachments",REASONING:"addon:reasoning",CODEINTERPRETER:"addon:codeinterpreter",SHARE_CHAT:"addon:share-chat"}},eE={code_interpreter:"Running code...",web_search:"Searching the web...",[ee.TOOL.WEATHER]:"Checking the weather...",[ee.TOOL.POLLUTION]:"Fetching air pollution data...",[ee.TOOL.BUNDLESIZE]:"Analyzing bundle size...",[ee.TOOL.URLCONTENTPARSER]:"Reading a webpage...",[ee.TOOL.WEBSEARCH]:"Searching the web...",[ee.TOOL.GITREPOSITORY]:"Looking up repository...",[ee.TOOL.HOTELS]:"Searching for hotels...",[ee.TOOL.NUTRITION_FACTS]:"Fetching nutrition facts...",[ee.TOOL.GENERATE_IMAGE]:"Generating image...",[ee.TOOL.BARCODE]:"Looking up product...",[ee.TOOL.PRONUNCIATION]:"Generating pronunciation...",[ee.TOOL.HUMANIZE]:"Rewriting text...",[ee.TOOL.IMAGES]:"Searching for images..."},eO="Using tools...",et=5e4,en=1e5,er=8e5;function eo(e){return e===$?er:en}let ei=16384,ea=4,e_=3,eR="context-compression-summary",eT=new Set(["OpenAI",o,"Google",T]);function eA(e){return"string"==typeof e&&eT.has(e)}let es=e=>{for(let[E,O]of Object.entries(W))if(O.some(E=>e.startsWith(E)))return E;return null},eL=e=>{if(!e||0===e.length)return[];let E=new Set;for(let O of e)for(let[e,t]of Object.entries(k))t.includes(O)&&("OpenAI"===e||e===o||"Google"===e)&&E.add(e);return L.filter(e=>E.has(e))},eI=e=>{let E=new Map;if(!e||0===e.length)return E;for(let O of e)for(let[e,t]of Object.entries(k))if(t.includes(O)){E.has(e)||E.set(e,[]),E.get(e)?.push(O);break}return E},eM=e=>{for(let E of eI(e).values())if(E.length>1)return!0;return!1},eS=(e,E)=>!!e&&!!E&&0!==E.length&&E.includes(e);function eP(e,E,O){if(!E||Array.isArray(E)&&0===E.length)return!0;let t=e instanceof Set?e:e?new Set(e):null;return!!t&&0!==t.size&&("string"==typeof E?t.has(E):O?.any===!0?E.some(e=>t.has(e)):E.every(e=>t.has(e)))}function el(e){return X.includes(e)}export{b as ALL_MODELS,L as ALL_PROVIDERS,X as ALL_REASONING_MODELS,Q as APPLICATION_NAME,W as APPROXIMATE_MODELS_PER_PROVIDER,ee as CAPABILITIES,en as CONTEXT_COMPRESSION_EMERGENCY_THRESHOLD,er as CONTEXT_COMPRESSION_EMERGENCY_THRESHOLD_PREMIUM,e_ as CONTEXT_COMPRESSION_KEEP_IMAGES,ea as CONTEXT_COMPRESSION_KEEP_RECENT,eR as CONTEXT_COMPRESSION_SUMMARY_ID,et as CONTEXT_COMPRESSION_THRESHOLD,s as DEFAULT_PROVIDER,eO as DEFAULT_TOOL_LOADING_LABEL,z as DIGGIDY_CHAT_ID_HEADER,K as DIGGIDY_CHAT_TIMESTAMP_HEADER,ei as MAX_OUTPUT_TOKENS,v as MAX_SEARCH_QUERIES,k as MODELS_PER_PROVIDER,Y as MODEL_AUTO_RESPONDER_ANTHROPIC,F as MODEL_AUTO_RESPONDER_GOOGLE,B as MODEL_AUTO_RESPONDER_OPENAI,f as MODEL_AUTO_ROUTER_ANTHROPIC,y as MODEL_AUTO_ROUTER_GOOGLE,H as MODEL_AUTO_ROUTER_OPENAI,p as MODEL_CHAT_SUMMARY,N as MODEL_CLAUDE_HAIKU,P as MODEL_CLAUDE_OPUS,l as MODEL_CLAUDE_SONNET,C as MODEL_DEV,V as MODEL_DISPLAY_NAMES,U as MODEL_EMBEDDING_TEXT,g as MODEL_GEMINI_FLASH,D as MODEL_GEMINI_PRO,m as MODEL_GENERATE_IMAGE,I as MODEL_GPT5,M as MODEL_GPT5_MINI,S as MODEL_GPT5_NANO,h as MODEL_MEMORY_INFERENCE,G as MODEL_SEARCH_DECOMPOSER,d as MODEL_SONAR,u as MODEL_SONAR_PRO,c as MODEL_TEACHER,q as PLAN_BASIC,J as PLAN_PLUS,$ as PLAN_PREMIUM,o as PROVIDER_ANTHROPIC,A as PROVIDER_AUTO,i as PROVIDER_GOOGLE,_ as PROVIDER_MEMORY,T as PROVIDER_MISTRAL,r as PROVIDER_OPENAI,R as PROVIDER_PERPLEXITY,x as PROVIDER_ROLE_MAP,a as PROVIDER_SUMMARY,n as ROLE_ASSISTANT,O as ROLE_SYSTEM,t as ROLE_USER,w as SEARCH_QUERY_TIMEOUT_MS,Z as SORT_BY_TIMESTAMP,j as SORT_BY_TOKEN_USAGE,eE as TOOL_LOADING_LABELS,es as findProvider,eo as getCompressionEmergencyThreshold,eI as getModelsGroupedByProvider,eL as getProvidersFromModels,eM as hasMultipleModelsPerProvider,eP as isEntitled,eS as isModelAllowedForPlan,eA as isRealProvider,el as isReasoningModel,E as ActionColor};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/sassysaint-common",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.40.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": "4bffea24dc109af0924c880a1a3fd98a6bea43fe"
|
|
36
36
|
}
|