@versini/sassysaint-common 4.61.0 → 4.62.1
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 +108 -7
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -24,13 +24,16 @@ export declare const ALL_MODELS: readonly ["gpt-6.1-sol", "gpt-6-luna", "claude-
|
|
|
24
24
|
export declare const ALL_PROVIDERS: readonly ["OpenAI", "Anthropic", "Google"];
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* Despite the name, this list
|
|
28
|
-
* by
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
27
|
+
* Despite the name, this list is read through isReasoningModel by vercelEngine
|
|
28
|
+
* (and by Settings, to decide which providers get a Response Speed row). It
|
|
29
|
+
* affects Google and Anthropic. Google members get thinkingLevel, while
|
|
30
|
+
* non-members get the older numeric thinkingBudget. Anthropic members get an
|
|
31
|
+
* `effort`; non-members get none, because claude-haiku-4-5 rejects the
|
|
32
|
+
* parameter with a 400 ("This model does not support the effort parameter",
|
|
33
|
+
* probed 2026-10-04), so check that a new Anthropic model accepts effort before
|
|
34
|
+
* listing it. The OpenAI entries do not change what vercelEngine sends (it sets
|
|
35
|
+
* reasoningEffort unconditionally), but they decide whether Settings shows an
|
|
36
|
+
* OpenAI Response Speed row, so list every OpenAI chat model.
|
|
34
37
|
*
|
|
35
38
|
* Both Google models are listed because Google documents thinking_level for
|
|
36
39
|
* both ids. This matters more than it looks: our explicit providerOptions
|
|
@@ -206,6 +209,20 @@ export declare type CSSVariables = Record<string, string>;
|
|
|
206
209
|
|
|
207
210
|
export declare const DEFAULT_PROVIDER = "OpenAI";
|
|
208
211
|
|
|
212
|
+
/**
|
|
213
|
+
* What a user who never touched the setting gets. OpenAI and Google keep the
|
|
214
|
+
* `low` they were hard-coded to before the setting existed. Anthropic starts on
|
|
215
|
+
* medium: unchanged for Opus 5.5, whose API default is medium, and one step
|
|
216
|
+
* down from high for Sonnet 5.5, which Anthropic suggests for chat. Defaults
|
|
217
|
+
* are applied on read and never stored, so changing one here moves every user
|
|
218
|
+
* who has not picked a value.
|
|
219
|
+
*/
|
|
220
|
+
export declare const DEFAULT_RESPONSE_SPEED: {
|
|
221
|
+
readonly OpenAI: "fast";
|
|
222
|
+
readonly Anthropic: "balanced";
|
|
223
|
+
readonly Google: "fast";
|
|
224
|
+
};
|
|
225
|
+
|
|
209
226
|
export declare const DEFAULT_TOOL_LOADING_LABEL = "Using tools...";
|
|
210
227
|
|
|
211
228
|
/**
|
|
@@ -848,6 +865,17 @@ export declare const PROVIDER_ROLE_MAP: {
|
|
|
848
865
|
|
|
849
866
|
export declare const PROVIDER_SUMMARY = "Summary";
|
|
850
867
|
|
|
868
|
+
/**
|
|
869
|
+
* The read-marker parts for a persisted message's `readUrls`, skipping entries
|
|
870
|
+
* without a string URL. A record counts as a full read only when `partial` is
|
|
871
|
+
* explicitly false, so malformed data never overstates what was read. The
|
|
872
|
+
* server validates them again before using them.
|
|
873
|
+
*/
|
|
874
|
+
export declare function readUrlParts(readUrls: unknown): {
|
|
875
|
+
type: string;
|
|
876
|
+
data: UrlReadRecord;
|
|
877
|
+
}[];
|
|
878
|
+
|
|
851
879
|
/**
|
|
852
880
|
* Type of a real, SDK-instantiable provider. Use this as the parameter type on
|
|
853
881
|
* any function that performs enum-keyed lookups against `MODELS_PER_PROVIDER`,
|
|
@@ -856,6 +884,45 @@ export declare const PROVIDER_SUMMARY = "Summary";
|
|
|
856
884
|
*/
|
|
857
885
|
export declare type RealProvider = typeof PROVIDER_OPENAI | typeof PROVIDER_ANTHROPIC | typeof PROVIDER_GOOGLE;
|
|
858
886
|
|
|
887
|
+
/**
|
|
888
|
+
* Resolve a stored Response Speed preference into a complete per-provider
|
|
889
|
+
* record. Missing providers and unknown values fall back to
|
|
890
|
+
* DEFAULT_RESPONSE_SPEED, so the result is always safe to map to a provider
|
|
891
|
+
* effort, whatever the DB or a client sent.
|
|
892
|
+
*
|
|
893
|
+
* @example
|
|
894
|
+
* ```ts
|
|
895
|
+
* resolveResponseSpeed({ Anthropic: "thorough", Google: "bogus" });
|
|
896
|
+
* // Returns: { OpenAI: "fast", Anthropic: "thorough", Google: "fast" }
|
|
897
|
+
* ```
|
|
898
|
+
*
|
|
899
|
+
*/
|
|
900
|
+
export declare function resolveResponseSpeed(stored?: Partial<Record<string, unknown>> | null): Record<RealProvider, ResponseSpeed>;
|
|
901
|
+
|
|
902
|
+
export declare const RESPONSE_SPEED_BALANCED = "balanced";
|
|
903
|
+
|
|
904
|
+
/**
|
|
905
|
+
* Response Speed, a per-provider user preference (Settings > Model
|
|
906
|
+
* Customization). The stored values are ours, not a provider's: each one maps
|
|
907
|
+
* to the effort setting every provider names differently (OpenAI
|
|
908
|
+
* reasoningEffort, Anthropic effort, Gemini thinkingLevel), all of which accept
|
|
909
|
+
* low, medium and high on every model in ALL_REASONING_MODELS (probed
|
|
910
|
+
* 2026-10-04).
|
|
911
|
+
*/
|
|
912
|
+
export declare const RESPONSE_SPEED_FAST = "fast";
|
|
913
|
+
|
|
914
|
+
export declare const RESPONSE_SPEED_THOROUGH = "thorough";
|
|
915
|
+
|
|
916
|
+
export declare const RESPONSE_SPEED_TO_EFFORT: {
|
|
917
|
+
readonly fast: "low";
|
|
918
|
+
readonly balanced: "medium";
|
|
919
|
+
readonly thorough: "high";
|
|
920
|
+
};
|
|
921
|
+
|
|
922
|
+
export declare const RESPONSE_SPEEDS: readonly ["fast", "balanced", "thorough"];
|
|
923
|
+
|
|
924
|
+
export declare type ResponseSpeed = (typeof RESPONSE_SPEEDS)[number];
|
|
925
|
+
|
|
859
926
|
export declare const ROLE_ASSISTANT = "assistant";
|
|
860
927
|
|
|
861
928
|
/**
|
|
@@ -930,4 +997,38 @@ export declare interface ThemePalette {
|
|
|
930
997
|
*/
|
|
931
998
|
export declare const TOOL_LOADING_LABELS: Record<string, string>;
|
|
932
999
|
|
|
1000
|
+
/**
|
|
1001
|
+
* The read-marker part for one persisted read. The single builder of that
|
|
1002
|
+
* shape, shared by the server, which makes markers from tool results, and the
|
|
1003
|
+
* client, which rebuilds them from stored `readUrls`.
|
|
1004
|
+
*/
|
|
1005
|
+
export declare function toUrlReadPart(record: UrlReadRecord): {
|
|
1006
|
+
type: string;
|
|
1007
|
+
data: UrlReadRecord;
|
|
1008
|
+
};
|
|
1009
|
+
|
|
1010
|
+
/**
|
|
1011
|
+
* Opening words of the note a URL_READ_PART_TYPE part becomes. The system
|
|
1012
|
+
* prompt quotes them in its own text; a server test (urlReadMarkers.test.ts)
|
|
1013
|
+
* fails if the two drift apart.
|
|
1014
|
+
*/
|
|
1015
|
+
export declare const URL_READ_NOTE_PREFIX = "[Note from the system: you read";
|
|
1016
|
+
|
|
1017
|
+
/**
|
|
1018
|
+
* UI message part that records a page the assistant read with getUrlContent.
|
|
1019
|
+
* The server renders it to the model as a note starting with
|
|
1020
|
+
* URL_READ_NOTE_PREFIX, persists it as a message's `readUrls`, and the client
|
|
1021
|
+
* rebuilds it from `readUrls` when a chat is restored.
|
|
1022
|
+
*/
|
|
1023
|
+
export declare const URL_READ_PART_TYPE = "data-urlRead";
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* One page read, as persisted on a message's `readUrls`. `partial` is true when
|
|
1027
|
+
* the read stopped before the end of the page.
|
|
1028
|
+
*/
|
|
1029
|
+
export declare interface UrlReadRecord {
|
|
1030
|
+
url: string;
|
|
1031
|
+
partial: boolean;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
933
1034
|
export { }
|
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 n
|
|
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 r,n=((r={})[r.NewChat=0]="NewChat",r[r.Prompts=1]="Prompts",r[r.Attachment=2]="Attachment",r[r.PrivateChat=3]="PrivateChat",r[r.Send=4]="Send",r[r.Header=5]="Header",r[r.Provider=6]="Provider",r[r.Logo=7]="Logo",r[r.Placeholder=8]="Placeholder",r[r.Footer=9]="Footer",r);let a="system",O="user",i="assistant",o="OpenAI",s="Anthropic",_="Google",l="Summary",R="Memory",T="Perplexity",S=o,A=[o,s,_],u="gpt-6.1-sol",P="gpt-6-luna",I="claude-opus-5-5",L="claude-sonnet-5-5",g="claude-haiku-4-5",M="gemini-3.8-flash",c="gemini-3.5-flash-lite",N="sonar",d="sonar-pro",h="perplexity-search",D="openai/gpt-oss-20b:free",p="gpt-6-luna",C="gpt-6-luna",m="gemini-3.5-flash-lite",f="gemini-3.8-flash",U="gpt-6.1-sol",G="gpt-6-luna",y="gpt-5.6-luna",H="gemini-3.6-flash",F="text-embedding-3-small",b="gpt-image-2.5-flare",w="gpt-image-2.5-sunburst",B=5,Y=1e4,v=3e3,V={[u]:"GPT-6.1 Sol",[P]:"GPT-6 Luna",[I]:"Claude Opus 5.5",[L]:"Claude Sonnet 5.5",[g]:"Claude Haiku 4.5",[M]:"Gemini 3.8 Flash",[c]:"Gemini 3.5 Flash-Lite",[N]:"Sonar",[d]:"Sonar Pro",[h]:"Perplexity Search",[b]:"GPT Image 2.5 Flare",[w]:"GPT Image 2.5 Sunburst"},k=[u,P,I,L,g,c,M,b,w],W=[u,P,I,L,M,c],X="fast",x="balanced",K="thorough",z=[X,x,K],Z={[X]:"low",[x]:"medium",[K]:"high"},$={[o]:X,[s]:x,[_]:X},j={[o]:[u,P],[s]:[I,g,L],[_]:[c,M],[T]:[N,d,h]},Q={[o]:[a,O,i],[s]:[O,i],[l]:[O,i],[R]:[O,i],[_]:[O,i],[T]:[O,i]},q={[s]:["claude-opus-5","claude-opus-4","claude-sonnet-5","claude-sonnet-4","claude-haiku-4","claude-3"],[o]:["gpt-","o3","o4"],[_]:["gemini"],[T]:["sonar"]},J="x-diggidy-chat-id",ee="x-diggidy-chat-timestamp",et="complete",eE="timestamp",er="tokenUsage",en="Diggidy",ea="sassy:basic",eO="sassy:plus",ei="sassy:advanced",eo={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"}},es={code_interpreter:"Running code...",web_search:"Searching the web...",[eo.TOOL.WEATHER]:"Checking the weather...",[eo.TOOL.POLLUTION]:"Fetching air pollution data...",[eo.TOOL.BUNDLESIZE]:"Analyzing bundle size...",[eo.TOOL.URLCONTENTPARSER]:"Reading a webpage...",[eo.TOOL.WEBSEARCH]:"Searching the web...",[eo.TOOL.GITREPOSITORY]:"Looking up repository...",[eo.TOOL.HOTELS]:"Searching for hotels...",[eo.TOOL.LOCAL_BUSINESSES]:"Searching for local businesses...",[eo.TOOL.PRODUCTS]:"Searching for products...",[eo.TOOL.REVIEW_TRUST]:"Checking reviews...",[eo.TOOL.STREAMING_PICKS]:"Finding movies to stream...",[eo.TOOL.NUTRITION_FACTS]:"Fetching nutrition facts...",[eo.TOOL.GENERATE_IMAGE]:"Generating image...",[eo.TOOL.BARCODE]:"Looking up product...",[eo.TOOL.PRONUNCIATION]:"Generating pronunciation...",[eo.TOOL.HUMANIZE]:"Rewriting text...",[eo.TOOL.IMAGES]:"Searching for images..."},e_="Using tools...",el=1e5,eR=8e5;function eT(e){return e===ei?eR:el}let eS=16384,eA=4,eu=3,eP=8388608,eI="context-compression-summary",eL="data-urlRead",eg="[Note from the system: you read",eM="(?:an?\\s+|another\\s+)?",ec=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+)?${eM}(?:new|fresh)\\s+(?:chat|conversation)|${eM}(?:new|fresh)\\s+(?:thread|session))(?:[\\s,]+(?:please|pls|plz|now|thanks|thank you|thx|ty))*$`),eN=/^[^\p{L}\p{N}]+/u,ed=/[^\p{L}\p{N}]+$/u;function eh(e){if(!e||e.length>120)return!1;let t=e.toLowerCase().replace(/’/g,"'").replace(/\s+/g," ").trim().replace(eN,"").replace(ed,"").trim();return""!==t&&ec.test(t)}function eD(e){return{type:eL,data:e}}function ep(e){return Array.isArray(e)?e.filter(e=>"string"==typeof e?.url).map(e=>eD({url:e.url,partial:!1!==e.partial})):[]}let eC=new Set(["OpenAI",s,"Google"]);function em(e){return"string"==typeof e&&eC.has(e)}let ef=/^auto \((.+)\)$/;function eU(e){let t=e.match(ef);return t?t[1]:e}let eG=e=>{for(let[t,E]of Object.entries(q))if(E.some(t=>e.startsWith(t)))return t;return null},ey=/image|embedding|tts|realtime|transcribe|audio/;function eH(e,{matchUnknownByPrefix:t=!1}){for(let[t,E]of Object.entries(j))if(E.includes(e))return em(t)?t:null;if(!t||k.includes(e)||ey.test(e))return null;let E=eG(e);return em(E)?E:null}let eF=(e,t={})=>{if(!e||0===e.length)return[];let E=new Set;for(let r of e){let e=eH(r,t);e&&E.add(e)}return A.filter(e=>E.has(e))},eb=(e,t={})=>{let E=new Map;if(!e||0===e.length)return E;for(let r of e){let e=eH(r,t);e&&(E.has(e)||E.set(e,[]),E.get(e)?.push(r))}return E},ew=(e,t={})=>{for(let E of eb(e,t).values())if(E.length>1)return!0;return!1},eB=(e,t)=>!!e&&!!t&&0!==t.length&&t.includes(e);function eY(e,t,E){if(!t||Array.isArray(t)&&0===t.length)return!0;let r=e instanceof Set?e:e?new Set(e):null;return!!r&&0!==r.size&&("string"==typeof t?r.has(t):E?.any===!0?t.some(e=>r.has(e)):t.every(e=>r.has(e)))}function ev(e){return W.includes(e)}function eV(e){let t=t=>{let E=e?.[t];return z.includes(E)?E:$[t]};return{OpenAI:t("OpenAI"),[s]:t(s),Google:t("Google")}}export{k as ALL_MODELS,A as ALL_PROVIDERS,W as ALL_REASONING_MODELS,en as APPLICATION_NAME,q as APPROXIMATE_MODELS_PER_PROVIDER,eo as CAPABILITIES,et as CHAT_COMPLETION_MARKER_KEY,el as CONTEXT_COMPRESSION_EMERGENCY_THRESHOLD,eR as CONTEXT_COMPRESSION_EMERGENCY_THRESHOLD_PREMIUM,eu as CONTEXT_COMPRESSION_KEEP_IMAGES,eA as CONTEXT_COMPRESSION_KEEP_RECENT,eP as CONTEXT_COMPRESSION_MAX_DOCUMENT_BYTES,eI as CONTEXT_COMPRESSION_SUMMARY_ID,S as DEFAULT_PROVIDER,$ as DEFAULT_RESPONSE_SPEED,e_ as DEFAULT_TOOL_LOADING_LABEL,J as DIGGIDY_CHAT_ID_HEADER,ee as DIGGIDY_CHAT_TIMESTAMP_HEADER,t as HARD_CATEGORIES,eS as MAX_OUTPUT_TOKENS,B as MAX_SEARCH_QUERIES,e as MEMORY_CATEGORIES,j as MODELS_PER_PROVIDER,g as MODEL_ANTHROPIC_LOW,L as MODEL_ANTHROPIC_MEDIUM,I as MODEL_ANTHROPIC_TOP,C as MODEL_CHAT_SUMMARY,D as MODEL_DEV,V as MODEL_DISPLAY_NAMES,F as MODEL_EMBEDDING_TEXT,b as MODEL_GENERATE_IMAGE,w as MODEL_GENERATE_IMAGE_PRECISE,c as MODEL_GOOGLE_MEDIUM,M as MODEL_GOOGLE_TOP,U as MODEL_HUMANIZE_AUDIT,f as MODEL_HUMANIZE_REWRITE,p as MODEL_MEMORY_INFERENCE,G as MODEL_NUTRITION_SEARCH,P as MODEL_OPENAI_MEDIUM,u as MODEL_OPENAI_TOP,h as MODEL_PERPLEXITY_SEARCH,y as MODEL_REVIEW_TRUST_PANEL,H as MODEL_REVIEW_TRUST_PANEL_GOOGLE,m as MODEL_SEARCH_DECOMPOSER,N as MODEL_SONAR,d as MODEL_SONAR_PRO,ea as PLAN_BASIC,eO as PLAN_PLUS,ei as PLAN_PREMIUM,s as PROVIDER_ANTHROPIC,_ as PROVIDER_GOOGLE,R as PROVIDER_MEMORY,o as PROVIDER_OPENAI,T as PROVIDER_PERPLEXITY,Q as PROVIDER_ROLE_MAP,l as PROVIDER_SUMMARY,z as RESPONSE_SPEEDS,x as RESPONSE_SPEED_BALANCED,X as RESPONSE_SPEED_FAST,K as RESPONSE_SPEED_THOROUGH,Z as RESPONSE_SPEED_TO_EFFORT,i as ROLE_ASSISTANT,a as ROLE_SYSTEM,O as ROLE_USER,v as SEARCH_DECOMPOSE_TIMEOUT_MS,Y as SEARCH_QUERY_TIMEOUT_MS,eE as SORT_BY_TIMESTAMP,er as SORT_BY_TOKEN_USAGE,es as TOOL_LOADING_LABELS,eg as URL_READ_NOTE_PREFIX,eL as URL_READ_PART_TYPE,eG as findProvider,eT as getCompressionEmergencyThreshold,eb as getModelsGroupedByProvider,eF as getProvidersFromModels,ew as hasMultipleModelsPerProvider,eY as isEntitled,eh as isExplicitNewChatRequest,E as isHardCategory,eB as isModelAllowedForPlan,em as isRealProvider,ev as isReasoningModel,ep as readUrlParts,eV as resolveResponseSpeed,eU as stripAutoWrapper,n as ActionColor,eD as toUrlReadPart};
|