@versini/sassysaint-common 4.54.1 → 4.56.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 +73 -7
- package/dist/index.js +1 -1
- package/package.json +34 -35
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare enum ActionColor {
|
|
|
19
19
|
* List of all models available TODAY. This is used by the client to display the
|
|
20
20
|
* list of models.
|
|
21
21
|
*/
|
|
22
|
-
export declare const ALL_MODELS: readonly ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "claude-opus-5", "claude-sonnet-5", "claude-haiku-4-5", "gemini-3.5-flash-lite", "gemini-3.
|
|
22
|
+
export declare const ALL_MODELS: readonly ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "claude-opus-5", "claude-sonnet-5", "claude-haiku-4-5", "gemini-3.5-flash-lite", "gemini-3.7-flash", "gemini-3-pro-image"];
|
|
23
23
|
|
|
24
24
|
export declare const ALL_PROVIDERS: readonly ["OpenAI", "Anthropic", "Google"];
|
|
25
25
|
|
|
@@ -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
|
*/
|
|
@@ -575,7 +623,7 @@ export declare const MODEL_GENERATE_IMAGE = "gemini-3-pro-image";
|
|
|
575
623
|
|
|
576
624
|
export declare const MODEL_GOOGLE_MEDIUM = "gemini-3.5-flash-lite";
|
|
577
625
|
|
|
578
|
-
export declare const MODEL_GOOGLE_TOP = "gemini-3.
|
|
626
|
+
export declare const MODEL_GOOGLE_TOP = "gemini-3.7-flash";
|
|
579
627
|
|
|
580
628
|
/**
|
|
581
629
|
* The humanizer's audit pass deliberately runs on a different model FAMILY than
|
|
@@ -593,7 +641,7 @@ export declare const MODEL_HUMANIZE_AUDIT = "gpt-5.6-terra";
|
|
|
593
641
|
* silently move it (it previously rode MODEL_GOOGLE_MEDIUM and was downgraded
|
|
594
642
|
* to Flash-Lite by exactly that).
|
|
595
643
|
*/
|
|
596
|
-
export declare const MODEL_HUMANIZE_REWRITE = "gemini-3.
|
|
644
|
+
export declare const MODEL_HUMANIZE_REWRITE = "gemini-3.7-flash";
|
|
597
645
|
|
|
598
646
|
/**
|
|
599
647
|
* Bumped nano→mini (Track 2 T7): memory extraction now emits structured
|
|
@@ -685,14 +733,32 @@ export declare const MODEL_PERPLEXITY_SEARCH = "perplexity-search";
|
|
|
685
733
|
*/
|
|
686
734
|
export declare const MODEL_REVIEW_TRUST_PANEL = "gpt-5.6-luna";
|
|
687
735
|
|
|
736
|
+
/**
|
|
737
|
+
* The Google seat on the same panel, split out for the same reason as the
|
|
738
|
+
* OpenAI seat above: it read MODEL_GOOGLE_TOP, so a Google catalog bump moved a
|
|
739
|
+
* rater without anyone deciding to. It is pinned to the id that actually
|
|
740
|
+
* labelled both fixtures, so unlike the OpenAI seat this pin PRESERVES
|
|
741
|
+
* comparability rather than breaking it — `panel` in each fixture records
|
|
742
|
+
* gemini-3.6-flash, and README.md's per-rater marginals and leave-one-out table
|
|
743
|
+
* describe that id.
|
|
744
|
+
*
|
|
745
|
+
* No picker tier holds this id any more, so its price comes from the historical
|
|
746
|
+
* EXACT row in modelPricing.ts rather than from a tier row. Keep that row as
|
|
747
|
+
* long as this slot points here.
|
|
748
|
+
*
|
|
749
|
+
*/
|
|
750
|
+
export declare const MODEL_REVIEW_TRUST_PANEL_GOOGLE = "gemini-3.6-flash";
|
|
751
|
+
|
|
688
752
|
/**
|
|
689
753
|
* The decomposer sits in front of every complex search, so its latency is paid
|
|
690
754
|
* on the critical path before a single result exists. Measured over 7 fixtures
|
|
691
755
|
* x 3 runs (GH #3018): Flash-Lite p50 644ms / p90 720ms, against gpt-5.4-mini's
|
|
692
756
|
* p50 1186ms / p90 1515ms and gemini-3.6-flash's p50 2037ms — the Google TOP
|
|
693
|
-
* tier
|
|
694
|
-
*
|
|
695
|
-
*
|
|
757
|
+
* tier of the day was SLOWER than either, so this slot must not be pointed at
|
|
758
|
+
* it. That tier has since moved to gemini-3.7-flash and has not been
|
|
759
|
+
* re-measured, so treat the gap as unverified rather than closed. Flash-Lite
|
|
760
|
+
* also decomposed better, splitting on real axes (one query per country) where
|
|
761
|
+
* mini emitted near-duplicate rewordings of the whole question.
|
|
696
762
|
*/
|
|
697
763
|
export declare const MODEL_SEARCH_DECOMPOSER = "gemini-3.5-flash-lite";
|
|
698
764
|
|
|
@@ -713,7 +779,7 @@ export declare const MODEL_SONAR_PRO = "sonar-pro";
|
|
|
713
779
|
export declare const MODELS_PER_PROVIDER: {
|
|
714
780
|
readonly OpenAI: readonly ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna"];
|
|
715
781
|
readonly Anthropic: readonly ["claude-opus-5", "claude-haiku-4-5", "claude-sonnet-5"];
|
|
716
|
-
readonly Google: readonly ["gemini-3.5-flash-lite", "gemini-3.
|
|
782
|
+
readonly Google: readonly ["gemini-3.5-flash-lite", "gemini-3.7-flash"];
|
|
717
783
|
readonly Perplexity: readonly ["sonar", "sonar-pro", "perplexity-search"];
|
|
718
784
|
};
|
|
719
785
|
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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};
|
package/package.json
CHANGED
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
2
|
+
"name": "@versini/sassysaint-common",
|
|
3
|
+
"version": "4.56.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"author": "Arno Versini",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build:check": "tsc",
|
|
17
|
+
"build:common": "npm-run-all build",
|
|
18
|
+
"build:js": "rslib build",
|
|
19
|
+
"build:types": "echo 'Types now built with rslib'",
|
|
20
|
+
"build": "npm-run-all --serial clean build:check build:js",
|
|
21
|
+
"clean": "rimraf dist tmp",
|
|
22
|
+
"comments:fix": "comments \"src/**/*.ts*\" --merge-line-comments",
|
|
23
|
+
"dev:js": "rslib build --watch",
|
|
24
|
+
"dev:types": "echo 'Types now watched with rslib'",
|
|
25
|
+
"dev": "rslib build --watch",
|
|
26
|
+
"fix": "npm-run-all lint:fix comments:fix",
|
|
27
|
+
"lint": "biome lint src",
|
|
28
|
+
"lint:fix": "biome check src --write --no-errors-on-unmatched",
|
|
29
|
+
"test": "vitest run",
|
|
30
|
+
"test:coverage": "vitest run --coverage",
|
|
31
|
+
"test:coverage:ui": "vitest --coverage --ui",
|
|
32
|
+
"test:watch": "vitest",
|
|
33
|
+
"watch": "npm-run-all dev"
|
|
34
|
+
}
|
|
35
|
+
}
|