@versini/sassysaint-common 4.55.0 → 4.57.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 +58 -10
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -442,6 +442,54 @@ declare interface IsEntitledOptions {
|
|
|
442
442
|
set?: Set<string>;
|
|
443
443
|
}
|
|
444
444
|
|
|
445
|
+
/**
|
|
446
|
+
* Deterministic detection of an explicit "start a new chat" request typed into
|
|
447
|
+
* the composer.
|
|
448
|
+
*
|
|
449
|
+
* Some users ask for a new chat in prose instead of clicking the New Chat
|
|
450
|
+
* button. Honoring that is helpful, but starting a new chat is DISRUPTIVE: the
|
|
451
|
+
* current conversation is left behind and the composer is reset. So the client
|
|
452
|
+
* never acts on a match directly — it opens a confirmation dialog, and the user
|
|
453
|
+
* decides.
|
|
454
|
+
*
|
|
455
|
+
* That still makes a false positive expensive: a dialog thrown in the user's
|
|
456
|
+
* face mid-thought, over a sentence that merely mentioned the words. This
|
|
457
|
+
* predicate is therefore tuned hard for PRECISION over recall. A missed
|
|
458
|
+
* phrasing costs nothing — the New Chat button is right there — while a wrong
|
|
459
|
+
* fire interrupts.
|
|
460
|
+
*
|
|
461
|
+
* **A request must BE the sentence, not appear in it.** That single rule is
|
|
462
|
+
* what makes the predicate safe, and it was learned the hard way: an earlier
|
|
463
|
+
* cut also matched "start a new chat" anywhere in a sentence, on the theory
|
|
464
|
+
* that "chat" and "conversation" could only ever mean this app. Measured
|
|
465
|
+
* against real phrasings, that fired on `Translate to French: please start a
|
|
466
|
+
* new chat.`, `can you write code to open a new chat window?`, `the docs say to
|
|
467
|
+
* start a new chat` and `why did you start a new chat` — an assistant that
|
|
468
|
+
* answers programming and writing questions sees these constantly. Requiring
|
|
469
|
+
* the whole sentence removes the entire class, and it removes it for every noun
|
|
470
|
+
* at once, which is why there is one noun list here instead of the
|
|
471
|
+
* safe/ambiguous split an unanchored pattern needed.
|
|
472
|
+
*
|
|
473
|
+
* Deliberately NOT handled: "clear this chat", "reset", "start over". Those are
|
|
474
|
+
* different asks with different blast radii.
|
|
475
|
+
*
|
|
476
|
+
*/
|
|
477
|
+
/**
|
|
478
|
+
* True when the text reads as an explicit instruction to start a new chat.
|
|
479
|
+
*
|
|
480
|
+
* The WHOLE message must be the request. An earlier cut split on sentence
|
|
481
|
+
* terminators and fired if any fragment matched, which meant a long paste
|
|
482
|
+
* ending in "Create a new thread." silently reset the chat — the terminator
|
|
483
|
+
* manufactured a bare-looking fragment out of ordinary prose. Requiring the
|
|
484
|
+
* entire composer to be the request removes that class outright, and it is what
|
|
485
|
+
* makes skipping the confirmation on an empty chat honest: if the message is
|
|
486
|
+
* nothing but "new chat", there is genuinely nothing to lose.
|
|
487
|
+
*
|
|
488
|
+
* @param text - Raw composer input.
|
|
489
|
+
*
|
|
490
|
+
*/
|
|
491
|
+
export declare function isExplicitNewChatRequest(text: string): boolean;
|
|
492
|
+
|
|
445
493
|
/**
|
|
446
494
|
* True when `category` is a hard (auto-persist) category.
|
|
447
495
|
*/
|
|
@@ -736,8 +784,8 @@ export declare const MODELS_PER_PROVIDER: {
|
|
|
736
784
|
};
|
|
737
785
|
|
|
738
786
|
/**
|
|
739
|
-
*
|
|
740
|
-
*
|
|
787
|
+
* Color class mappings and CSS variables for the theme. Covers both color
|
|
788
|
+
* schemes at once, via Tailwind `dark:` prefixes inside the class strings.
|
|
741
789
|
*/
|
|
742
790
|
export declare interface Palette {
|
|
743
791
|
colors: ColorMap;
|
|
@@ -838,20 +886,20 @@ export declare const SORT_BY_TOKEN_USAGE = "tokenUsage";
|
|
|
838
886
|
export declare function stripAutoWrapper(modelName: string): string;
|
|
839
887
|
|
|
840
888
|
/**
|
|
841
|
-
* Complete theme palette
|
|
842
|
-
*
|
|
889
|
+
* Complete theme palette. This is the structure sent from the server to the
|
|
890
|
+
* client via getUserPreferences.
|
|
843
891
|
*
|
|
844
|
-
*
|
|
845
|
-
*
|
|
846
|
-
* - oled: OLED display mode with enhanced contrast
|
|
892
|
+
* The palette uses Tailwind dark: prefixes for automatic color scheme
|
|
893
|
+
* adaptation at runtime. The client does not need to index by color scheme.
|
|
847
894
|
*
|
|
848
|
-
*
|
|
849
|
-
*
|
|
895
|
+
* `normal` is a single-field wrapper rather than a bare `Palette` on purpose:
|
|
896
|
+
* it is the GraphQL shape clients already select (`themePalette { normal }`),
|
|
897
|
+
* so collapsing it would be a second breaking schema change for no behavior
|
|
898
|
+
* gain. Keep the level until there is another reason to touch the schema.
|
|
850
899
|
*
|
|
851
900
|
*/
|
|
852
901
|
export declare interface ThemePalette {
|
|
853
902
|
normal: Palette;
|
|
854
|
-
oled: Palette;
|
|
855
903
|
}
|
|
856
904
|
|
|
857
905
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
let e=["preference","identity","constraint","habit","bio","device","location","finance","professional","interest","style","behavior","other"],
|
|
1
|
+
let e=["preference","identity","constraint","habit","bio","device","location","finance","professional","interest","style","behavior","other"],t=["identity","bio","constraint","professional"],E=e=>t.includes(e);var n,r=((n={})[n.NewChat=0]="NewChat",n[n.Prompts=1]="Prompts",n[n.Attachment=2]="Attachment",n[n.PrivateChat=3]="PrivateChat",n[n.Send=4]="Send",n[n.Header=5]="Header",n[n.Provider=6]="Provider",n[n.Logo=7]="Logo",n[n.Placeholder=8]="Placeholder",n[n.Footer=9]="Footer",n);let O="system",a="user",i="assistant",o="OpenAI",s="Anthropic",_="Google",T="Summary",R="Memory",l="Perplexity",S=o,A=[o,s,_],I="gpt-5.6-sol",L="gpt-5.6-terra",M="gpt-5.6-luna",g="claude-opus-5",P="claude-sonnet-5",u="claude-haiku-4-5",c="gemini-3.7-flash",N="gemini-3.5-flash-lite",h="sonar",d="sonar-pro",D="perplexity-search",C="openai/gpt-oss-20b:free",p="gpt-5.6-luna",m="gpt-5.6-luna",U="gemini-3.5-flash-lite",f="gemini-3.7-flash",G="gpt-5.6-terra",H="gpt-5.6-luna",y="gpt-5.6-luna",B="gemini-3.6-flash",w="text-embedding-3-small",Y="gemini-3-pro-image",b=5,v=1e4,F=3e3,V={[I]:"GPT-5.6 Sol",[L]:"GPT-5.6 Terra",[M]:"GPT-5.6 Luna",[g]:"Claude Opus 5",[P]:"Claude Sonnet 5",[u]:"Claude Haiku 4.5",[c]:"Gemini 3.7 Flash",[N]:"Gemini 3.5 Flash-Lite",[h]:"Sonar",[d]:"Sonar Pro",[D]:"Perplexity Search",[Y]:"Nano Banana 3 Pro"},k=[I,L,M,g,P,u,N,c,Y],W=[I,L,M,g,P,c,N],X={[o]:[I,L,M],[s]:[g,u,P],[_]:[N,c],[l]:[h,d,D]},x={[o]:[O,a,i],[s]:[a,i],[T]:[a,i],[R]:[a,i],[_]:[a,i],[l]:[a,i]},K={[s]:["claude-opus-5","claude-opus-4","claude-sonnet-5","claude-sonnet-4","claude-haiku-4","claude-3"],[o]:["gpt-","o3","o4"],[_]:["gemini"],[l]:["sonar"]},z="x-diggidy-chat-id",Z="x-diggidy-chat-timestamp",$="complete",j="timestamp",Q="tokenUsage",q="Diggidy",J="sassy:basic",ee="sassy:plus",et="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",LOCAL_BUSINESSES:"getLocalBusinesses",PRODUCTS:"getProducts",REVIEW_TRUST:"getReviewTrust",STREAMING_PICKS:"getStreamingPicks",PRONUNCIATION:"getPronunciation",FRENCH_TEACHINGS:"getFrenchTeachings"},ADDON:{ATTACHMENTS:"addon:attachments",CODEINTERPRETER:"addon:codeinterpreter",SHARE_CHAT:"addon:share-chat"}},en={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.LOCAL_BUSINESSES]:"Searching for local businesses...",[eE.TOOL.PRODUCTS]:"Searching for products...",[eE.TOOL.REVIEW_TRUST]:"Checking reviews...",[eE.TOOL.STREAMING_PICKS]:"Finding movies to stream...",[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..."},er="Using tools...",eO=1e5,ea=8e5;function ei(e){return e===et?ea:eO}let eo=16384,es=4,e_=3,eT=8388608,eR="context-compression-summary",el="(?:an?\\s+|another\\s+)?",eS=RegExp(`^(?:(?:ok(?:ay)?|alright|right|hey|hi|hello|yes|yep|yeah|sure|thanks|thank you|please|claude|diggidy)[\\s,]+)*(?:(?:(?:let'?s\\s+|can you\\s+|could you\\s+|can we\\s+|please\\s+)?(?:start|begin|create|open)\\s+)?${el}(?:new|fresh)\\s+(?:chat|conversation)|${el}(?:new|fresh)\\s+(?:thread|session))(?:[\\s,]+(?:please|pls|plz|now|thanks|thank you|thx|ty))*$`),eA=/^[^\p{L}\p{N}]+/u,eI=/[^\p{L}\p{N}]+$/u;function eL(e){if(!e||e.length>120)return!1;let t=e.toLowerCase().replace(/’/g,"'").replace(/\s+/g," ").trim().replace(eA,"").replace(eI,"").trim();return""!==t&&eS.test(t)}let eM=new Set(["OpenAI",s,"Google"]);function eg(e){return"string"==typeof e&&eM.has(e)}let eP=/^auto \((.+)\)$/;function eu(e){let t=e.match(eP);return t?t[1]:e}let ec=e=>{for(let[t,E]of Object.entries(K))if(E.some(t=>e.startsWith(t)))return t;return null},eN=e=>{if(!e||0===e.length)return[];let t=new Set;for(let E of e)for(let[e,n]of Object.entries(X))n.includes(E)&&("OpenAI"===e||e===s||"Google"===e)&&t.add(e);return A.filter(e=>t.has(e))},eh=e=>{let t=new Map;if(!e||0===e.length)return t;for(let E of e)for(let[e,n]of Object.entries(X))if(n.includes(E)){t.has(e)||t.set(e,[]),t.get(e)?.push(E);break}return t},ed=e=>{for(let t of eh(e).values())if(t.length>1)return!0;return!1},eD=(e,t)=>!!e&&!!t&&0!==t.length&&t.includes(e);function eC(e,t,E){if(!t||Array.isArray(t)&&0===t.length)return!0;let n=e instanceof Set?e:e?new Set(e):null;return!!n&&0!==n.size&&("string"==typeof t?n.has(t):E?.any===!0?t.some(e=>n.has(e)):t.every(e=>n.has(e)))}function ep(e){return W.includes(e)}export{k as ALL_MODELS,A as ALL_PROVIDERS,W as ALL_REASONING_MODELS,q as APPLICATION_NAME,K as APPROXIMATE_MODELS_PER_PROVIDER,eE as CAPABILITIES,$ as CHAT_COMPLETION_MARKER_KEY,eO as CONTEXT_COMPRESSION_EMERGENCY_THRESHOLD,ea as CONTEXT_COMPRESSION_EMERGENCY_THRESHOLD_PREMIUM,e_ as CONTEXT_COMPRESSION_KEEP_IMAGES,es as CONTEXT_COMPRESSION_KEEP_RECENT,eT as CONTEXT_COMPRESSION_MAX_DOCUMENT_BYTES,eR as CONTEXT_COMPRESSION_SUMMARY_ID,S as DEFAULT_PROVIDER,er as DEFAULT_TOOL_LOADING_LABEL,z as DIGGIDY_CHAT_ID_HEADER,Z as DIGGIDY_CHAT_TIMESTAMP_HEADER,t as HARD_CATEGORIES,eo as MAX_OUTPUT_TOKENS,b as MAX_SEARCH_QUERIES,e as MEMORY_CATEGORIES,X as MODELS_PER_PROVIDER,u as MODEL_ANTHROPIC_LOW,P as MODEL_ANTHROPIC_MEDIUM,g as MODEL_ANTHROPIC_TOP,m as MODEL_CHAT_SUMMARY,C as MODEL_DEV,V as MODEL_DISPLAY_NAMES,w as MODEL_EMBEDDING_TEXT,Y as MODEL_GENERATE_IMAGE,N as MODEL_GOOGLE_MEDIUM,c as MODEL_GOOGLE_TOP,G as MODEL_HUMANIZE_AUDIT,f as MODEL_HUMANIZE_REWRITE,p as MODEL_MEMORY_INFERENCE,H as MODEL_NUTRITION_SEARCH,M as MODEL_OPENAI_LOW,L as MODEL_OPENAI_MEDIUM,I as MODEL_OPENAI_TOP,D as MODEL_PERPLEXITY_SEARCH,y as MODEL_REVIEW_TRUST_PANEL,B as MODEL_REVIEW_TRUST_PANEL_GOOGLE,U as MODEL_SEARCH_DECOMPOSER,h as MODEL_SONAR,d as MODEL_SONAR_PRO,J as PLAN_BASIC,ee as PLAN_PLUS,et as PLAN_PREMIUM,s as PROVIDER_ANTHROPIC,_ as PROVIDER_GOOGLE,R as PROVIDER_MEMORY,o as PROVIDER_OPENAI,l as PROVIDER_PERPLEXITY,x as PROVIDER_ROLE_MAP,T as PROVIDER_SUMMARY,i as ROLE_ASSISTANT,O as ROLE_SYSTEM,a as ROLE_USER,F as SEARCH_DECOMPOSE_TIMEOUT_MS,v as SEARCH_QUERY_TIMEOUT_MS,j as SORT_BY_TIMESTAMP,Q as SORT_BY_TOKEN_USAGE,en as TOOL_LOADING_LABELS,ec as findProvider,ei as getCompressionEmergencyThreshold,eh as getModelsGroupedByProvider,eN as getProvidersFromModels,ed as hasMultipleModelsPerProvider,eC as isEntitled,eL as isExplicitNewChatRequest,E as isHardCategory,eD as isModelAllowedForPlan,eg as isRealProvider,ep as isReasoningModel,eu as stripAutoWrapper,r as ActionColor};
|