@versini/sassysaint-common 4.42.0 → 4.44.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 +25 -60
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare enum ActionColor {
|
|
|
20
20
|
* List of all models available TODAY. This is used by the client to display the
|
|
21
21
|
* list of models.
|
|
22
22
|
*/
|
|
23
|
-
export declare const ALL_MODELS: readonly ["gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "claude-opus-4-8", "claude-sonnet-
|
|
23
|
+
export declare const ALL_MODELS: readonly ["gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "claude-opus-4-8", "claude-sonnet-5", "claude-haiku-4-5", "gemini-3-flash-preview", "gemini-3.1-pro-preview", "gemini-3-pro-image"];
|
|
24
24
|
|
|
25
25
|
export declare const ALL_PROVIDERS: readonly ["OpenAI", "Anthropic", "Google"];
|
|
26
26
|
|
|
@@ -37,7 +37,7 @@ export declare const APPLICATION_NAME = "Diggidy";
|
|
|
37
37
|
* versions change over time.
|
|
38
38
|
*/
|
|
39
39
|
export declare const APPROXIMATE_MODELS_PER_PROVIDER: {
|
|
40
|
-
readonly Anthropic: readonly ["claude-opus-4", "claude-sonnet-4", "claude-haiku-4", "claude-3"];
|
|
40
|
+
readonly Anthropic: readonly ["claude-opus-4", "claude-sonnet-5", "claude-sonnet-4", "claude-haiku-4", "claude-3"];
|
|
41
41
|
readonly OpenAI: readonly ["gpt-", "o3", "o4"];
|
|
42
42
|
readonly Google: readonly ["gemini"];
|
|
43
43
|
readonly Perplexity: readonly ["sonar"];
|
|
@@ -432,10 +432,10 @@ export declare const isModelAllowedForPlan: (selectedModel: string | undefined |
|
|
|
432
432
|
|
|
433
433
|
/**
|
|
434
434
|
* Runtime guard: true only for a real, SDK-instantiable provider literal.
|
|
435
|
-
* Returns false for
|
|
436
|
-
*
|
|
437
|
-
*
|
|
438
|
-
*
|
|
435
|
+
* Returns false for undefined, null, and anything else. Shared by the server
|
|
436
|
+
* provider guard and the provider picker (client) so both agree on what counts
|
|
437
|
+
* as a real, selectable provider — and so neither lets an unknown value leak
|
|
438
|
+
* into enum-keyed lookups.
|
|
439
439
|
*/
|
|
440
440
|
export declare function isRealProvider(value: unknown): value is RealProvider;
|
|
441
441
|
|
|
@@ -480,46 +480,13 @@ export declare const MEMORY_CATEGORIES: readonly ["preference", "identity", "con
|
|
|
480
480
|
|
|
481
481
|
export declare type MemoryCategory = (typeof MEMORY_CATEGORIES)[number];
|
|
482
482
|
|
|
483
|
-
export declare const MODEL_AUTO_RESPONDER_ANTHROPIC = "claude-sonnet-4-6";
|
|
484
|
-
|
|
485
|
-
export declare const MODEL_AUTO_RESPONDER_GOOGLE = "gemini-3-flash-preview";
|
|
486
|
-
|
|
487
|
-
/**
|
|
488
|
-
* Responder models for the Auto router's lower ("cheap") tier. Distinct from
|
|
489
|
-
* the classifier models above: these are the models that actually answer the
|
|
490
|
-
* user, so they MUST be tool-capable. The minimal tier (nano / haiku) cannot
|
|
491
|
-
* call tools, which breaks tool continuity — once a conversation has used a
|
|
492
|
-
* tool, a tool-less follow-up model derails the flow. So the lower tier uses
|
|
493
|
-
* the provider's mid model instead of its smallest:
|
|
494
|
-
* - OpenAI: gpt-5.4-mini (premium tier stays gpt-5.4)
|
|
495
|
-
* - Anthropic: claude-sonnet (premium tier stays claude-opus)
|
|
496
|
-
* - Google: gemini-flash (premium tier stays gemini-pro; Google has no
|
|
497
|
-
* tier between Flash and Pro, and Flash is already tool-capable)
|
|
498
|
-
* The premium tier always falls through to the plan-default top model.
|
|
499
|
-
*/
|
|
500
|
-
export declare const MODEL_AUTO_RESPONDER_OPENAI = "gpt-5.4-mini";
|
|
501
|
-
|
|
502
|
-
export declare const MODEL_AUTO_ROUTER_ANTHROPIC = "claude-haiku-4-5";
|
|
503
|
-
|
|
504
|
-
export declare const MODEL_AUTO_ROUTER_GOOGLE = "gemini-3-flash-preview";
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* Classifier models used by the Auto routing feature. One per real provider
|
|
508
|
-
* to preserve brand-loyalty (Anthropic-preferred users get an Anthropic
|
|
509
|
-
* classifier, etc.) and to let provider-native prompt caching hit on the
|
|
510
|
-
* classifier system prompt. These are the cheapest models per provider — the
|
|
511
|
-
* classifier only emits a small JSON object, so it never needs tools and the
|
|
512
|
-
* minimal tier keeps latency under the hard timeout and cost negligible.
|
|
513
|
-
*/
|
|
514
|
-
export declare const MODEL_AUTO_ROUTER_OPENAI = "gpt-5.4-nano";
|
|
515
|
-
|
|
516
483
|
export declare const MODEL_CHAT_SUMMARY = "gpt-5.4-nano";
|
|
517
484
|
|
|
518
485
|
export declare const MODEL_CLAUDE_HAIKU = "claude-haiku-4-5";
|
|
519
486
|
|
|
520
487
|
export declare const MODEL_CLAUDE_OPUS = "claude-opus-4-8";
|
|
521
488
|
|
|
522
|
-
export declare const MODEL_CLAUDE_SONNET = "claude-sonnet-
|
|
489
|
+
export declare const MODEL_CLAUDE_SONNET = "claude-sonnet-5";
|
|
523
490
|
|
|
524
491
|
export declare const MODEL_DEV = "openai/gpt-oss-20b:free";
|
|
525
492
|
|
|
@@ -561,7 +528,7 @@ export declare const MODEL_TEACHER = "mistral-large-latest";
|
|
|
561
528
|
*/
|
|
562
529
|
export declare const MODELS_PER_PROVIDER: {
|
|
563
530
|
readonly OpenAI: readonly ["gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano"];
|
|
564
|
-
readonly Anthropic: readonly ["claude-opus-4-8", "claude-haiku-4-5", "claude-sonnet-
|
|
531
|
+
readonly Anthropic: readonly ["claude-opus-4-8", "claude-haiku-4-5", "claude-sonnet-5"];
|
|
565
532
|
readonly Google: readonly ["gemini-3-flash-preview", "gemini-3.1-pro-preview"];
|
|
566
533
|
readonly Perplexity: readonly ["sonar", "sonar-pro"];
|
|
567
534
|
};
|
|
@@ -586,15 +553,6 @@ export declare const PLAN_PREMIUM = "sassy:advanced";
|
|
|
586
553
|
|
|
587
554
|
export declare const PROVIDER_ANTHROPIC = "Anthropic";
|
|
588
555
|
|
|
589
|
-
/**
|
|
590
|
-
* Pseudo-provider value exposed in the UI for the Auto routing feature. When
|
|
591
|
-
* a request carries `provider: "Auto"`, the server resolves it to a real
|
|
592
|
-
* provider via `resolveEffectiveProvider` BEFORE any enum-keyed lookup
|
|
593
|
-
* (`MODELS_PER_PROVIDER`, `PROVIDER_ROLE_MAP`, `getModel` branches). This
|
|
594
|
-
* value MUST NOT appear in those maps.
|
|
595
|
-
*/
|
|
596
|
-
export declare const PROVIDER_AUTO = "Auto";
|
|
597
|
-
|
|
598
556
|
export declare const PROVIDER_GOOGLE = "Google";
|
|
599
557
|
|
|
600
558
|
export declare const PROVIDER_MEMORY = "Memory";
|
|
@@ -626,9 +584,8 @@ export declare const PROVIDER_SUMMARY = "Summary";
|
|
|
626
584
|
/**
|
|
627
585
|
* Type of a real, SDK-instantiable provider. Use this as the parameter type on
|
|
628
586
|
* any function that performs enum-keyed lookups against `MODELS_PER_PROVIDER`,
|
|
629
|
-
* `PROVIDER_ROLE_MAP`, or provider-branched logic.
|
|
630
|
-
*
|
|
631
|
-
* build time. Runtime guards stay as backup for any `as any` escape hatches.
|
|
587
|
+
* `PROVIDER_ROLE_MAP`, or provider-branched logic. Runtime guards
|
|
588
|
+
* (`isRealProvider`) stay as backup for any `as any` escape hatches.
|
|
632
589
|
*/
|
|
633
590
|
export declare type RealProvider = typeof PROVIDER_OPENAI | typeof PROVIDER_ANTHROPIC | typeof PROVIDER_GOOGLE | typeof PROVIDER_MISTRAL;
|
|
634
591
|
|
|
@@ -658,6 +615,21 @@ export declare const SORT_BY_TIMESTAMP = "timestamp";
|
|
|
658
615
|
|
|
659
616
|
export declare const SORT_BY_TOKEN_USAGE = "tokenUsage";
|
|
660
617
|
|
|
618
|
+
/**
|
|
619
|
+
* Strip the legacy `auto (<model>)` wrapper. Returns the raw model id when the
|
|
620
|
+
* wrapper matches, the input unchanged otherwise. Idempotent for non-wrapped
|
|
621
|
+
* values. Shared by the client (chat-history rendering) and the server (usage
|
|
622
|
+
* pricing / aggregation) so historical Auto data resolves to its real model.
|
|
623
|
+
*
|
|
624
|
+
* Examples:
|
|
625
|
+
* - `"auto (gpt-5.4-nano)"` → `"gpt-5.4-nano"`
|
|
626
|
+
* - `"claude-opus-4-8"` → `"claude-opus-4-8"`
|
|
627
|
+
* - `""` → `""`
|
|
628
|
+
* - `"auto ("` (malformed) → `"auto ("` (no match, returned as-is)
|
|
629
|
+
*
|
|
630
|
+
*/
|
|
631
|
+
export declare function stripAutoWrapper(modelName: string): string;
|
|
632
|
+
|
|
661
633
|
/**
|
|
662
634
|
* Complete theme palette containing all variants. This is the structure sent
|
|
663
635
|
* from the server to the client via getUserPreferences.
|
|
@@ -683,11 +655,4 @@ export declare interface ThemePalette {
|
|
|
683
655
|
*/
|
|
684
656
|
export declare const TOOL_LOADING_LABELS: Record<string, string>;
|
|
685
657
|
|
|
686
|
-
/**
|
|
687
|
-
* Type of a provider value as it may arrive from the client in a request body.
|
|
688
|
-
* Includes the Auto pseudo-value. `resolveEffectiveProvider` is the single
|
|
689
|
-
* authoritative function for mapping `UserFacingProvider` to `RealProvider`.
|
|
690
|
-
*/
|
|
691
|
-
export declare type UserFacingProvider = RealProvider | typeof PROVIDER_AUTO;
|
|
692
|
-
|
|
693
658
|
export { }
|
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.Reasoning=4]="Reasoning",n[n.Send=5]="Send",n[n.Header=6]="Header",n[n.Provider=7]="Provider",n[n.Logo=8]="Logo",n[n.Placeholder=9]="Placeholder",n[n.Footer=10]="Footer",n);let i="system",O="user",o="assistant",a="OpenAI",s="Anthropic",R="Google",_="Summary",T="Memory",A="Perplexity",l="Mistral",I=a,S=[a,s,R],M="gpt-5.4",L="gpt-5.4-mini",P="gpt-5.4-nano",g="claude-opus-4-8",N="claude-sonnet-5",d="claude-haiku-4-5",D="gemini-3-flash-preview",c="gemini-3.1-pro-preview",u="sonar",C="sonar-pro",h="openai/gpt-oss-20b:free",p="mistral-large-latest",m="gpt-5.4-mini",G="gpt-5.4-nano",H="gpt-5.4-mini",f="text-embedding-3-small",U="gemini-3-pro-image",y=5,Y=3e4,B={[M]:"GPT-5.4",[L]:"GPT-5.4 Mini",[P]:"GPT-5.4 Nano",[g]:"Claude Opus 4.8",[N]:"Claude Sonnet 5",[d]:"Claude Haiku 4.5",[c]:"Gemini 3.1 Pro",[D]:"Gemini 3 Flash",[u]:"Sonar",[C]:"Sonar Pro",[U]:"Nano Banana 3 Pro",[p]:"Mistral Large"},b=[M,L,P,g,N,d,D,c,U],v=[M,L,P,g,N,c],F={[a]:[M,L,P],[s]:[g,d,N],[R]:[D,c],[A]:[u,C]},w={[a]:[i,O,o],[s]:[O,o],[_]:[O,o],[T]:[O,o],[R]:[O,o],[A]:[O,o],[l]:[O,o]},V={[s]:["claude-opus-4","claude-sonnet-5","claude-sonnet-4","claude-haiku-4","claude-3"],[a]:["gpt-","o3","o4"],[R]:["gemini"],[A]:["sonar"],[l]:["mistral"]},X="x-diggidy-chat-id",k="x-diggidy-chat-timestamp",W="complete",x="timestamp",K="tokenUsage",z="Diggidy",Z="sassy:basic",j="sassy:plus",Q="sassy:advanced",$={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"}},q={code_interpreter:"Running code...",web_search:"Searching the web...",[$.TOOL.WEATHER]:"Checking the weather...",[$.TOOL.POLLUTION]:"Fetching air pollution data...",[$.TOOL.BUNDLESIZE]:"Analyzing bundle size...",[$.TOOL.URLCONTENTPARSER]:"Reading a webpage...",[$.TOOL.WEBSEARCH]:"Searching the web...",[$.TOOL.GITREPOSITORY]:"Looking up repository...",[$.TOOL.HOTELS]:"Searching for hotels...",[$.TOOL.NUTRITION_FACTS]:"Fetching nutrition facts...",[$.TOOL.GENERATE_IMAGE]:"Generating image...",[$.TOOL.BARCODE]:"Looking up product...",[$.TOOL.PRONUNCIATION]:"Generating pronunciation...",[$.TOOL.HUMANIZE]:"Rewriting text...",[$.TOOL.IMAGES]:"Searching for images..."},J="Using tools...",ee=5e4,et=1e5,eE=8e5;function en(e){return e===Q?eE:et}let er=16384,ei=4,eO=3,eo="context-compression-summary",ea=new Set(["OpenAI",s,"Google",l]);function es(e){return"string"==typeof e&&ea.has(e)}let eR=/^auto \((.+)\)$/;function e_(e){let t=e.match(eR);return t?t[1]:e}let eT=e=>{for(let[t,E]of Object.entries(V))if(E.some(t=>e.startsWith(t)))return t;return null},eA=e=>{if(!e||0===e.length)return[];let t=new Set;for(let E of e)for(let[e,n]of Object.entries(F))n.includes(E)&&("OpenAI"===e||e===s||"Google"===e)&&t.add(e);return S.filter(e=>t.has(e))},el=e=>{let t=new Map;if(!e||0===e.length)return t;for(let E of e)for(let[e,n]of Object.entries(F))if(n.includes(E)){t.has(e)||t.set(e,[]),t.get(e)?.push(E);break}return t},eI=e=>{for(let t of el(e).values())if(t.length>1)return!0;return!1},eS=(e,t)=>!!e&&!!t&&0!==t.length&&t.includes(e);function eM(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 eL(e){return v.includes(e)}export{b as ALL_MODELS,S as ALL_PROVIDERS,v as ALL_REASONING_MODELS,z as APPLICATION_NAME,V as APPROXIMATE_MODELS_PER_PROVIDER,$ as CAPABILITIES,W as CHAT_COMPLETION_MARKER_KEY,et as CONTEXT_COMPRESSION_EMERGENCY_THRESHOLD,eE as CONTEXT_COMPRESSION_EMERGENCY_THRESHOLD_PREMIUM,eO as CONTEXT_COMPRESSION_KEEP_IMAGES,ei as CONTEXT_COMPRESSION_KEEP_RECENT,eo as CONTEXT_COMPRESSION_SUMMARY_ID,ee as CONTEXT_COMPRESSION_THRESHOLD,I as DEFAULT_PROVIDER,J as DEFAULT_TOOL_LOADING_LABEL,X as DIGGIDY_CHAT_ID_HEADER,k as DIGGIDY_CHAT_TIMESTAMP_HEADER,t as HARD_CATEGORIES,er as MAX_OUTPUT_TOKENS,y as MAX_SEARCH_QUERIES,e as MEMORY_CATEGORIES,F as MODELS_PER_PROVIDER,G as MODEL_CHAT_SUMMARY,d as MODEL_CLAUDE_HAIKU,g as MODEL_CLAUDE_OPUS,N as MODEL_CLAUDE_SONNET,h as MODEL_DEV,B as MODEL_DISPLAY_NAMES,f as MODEL_EMBEDDING_TEXT,D as MODEL_GEMINI_FLASH,c as MODEL_GEMINI_PRO,U as MODEL_GENERATE_IMAGE,M as MODEL_GPT5,L as MODEL_GPT5_MINI,P as MODEL_GPT5_NANO,m as MODEL_MEMORY_INFERENCE,H as MODEL_SEARCH_DECOMPOSER,u as MODEL_SONAR,C as MODEL_SONAR_PRO,p as MODEL_TEACHER,Z as PLAN_BASIC,j as PLAN_PLUS,Q as PLAN_PREMIUM,s as PROVIDER_ANTHROPIC,R as PROVIDER_GOOGLE,T as PROVIDER_MEMORY,l as PROVIDER_MISTRAL,a as PROVIDER_OPENAI,A as PROVIDER_PERPLEXITY,w as PROVIDER_ROLE_MAP,_ as PROVIDER_SUMMARY,o as ROLE_ASSISTANT,i as ROLE_SYSTEM,O as ROLE_USER,Y as SEARCH_QUERY_TIMEOUT_MS,x as SORT_BY_TIMESTAMP,K as SORT_BY_TOKEN_USAGE,q as TOOL_LOADING_LABELS,eT as findProvider,en as getCompressionEmergencyThreshold,el as getModelsGroupedByProvider,eA as getProvidersFromModels,eI as hasMultipleModelsPerProvider,eM as isEntitled,E as isHardCategory,eS as isModelAllowedForPlan,es as isRealProvider,eL as isReasoningModel,e_ as stripAutoWrapper,r as ActionColor};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/sassysaint-common",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.44.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": "c545dbaa1cac2ee0b6a2094e8566e56091c4a775"
|
|
36
36
|
}
|