@versini/sassysaint-common 4.15.0 → 4.16.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 +487 -428
- package/dist/index.js +1 -177
- package/package.json +12 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,428 +1,487 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* List of available
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const
|
|
6
|
-
|
|
7
|
-
declare const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
declare const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
declare const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
*
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
*
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* "claude-
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
* @
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
* //
|
|
170
|
-
* getProvidersFromModels([MODEL_GPT4_NANO, MODEL_CLAUDE_HAIKU]);
|
|
171
|
-
* // Returns: [PROVIDER_OPENAI, PROVIDER_ANTHROPIC]
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* //
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
*
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
* @
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
* //
|
|
203
|
-
*
|
|
204
|
-
* //
|
|
205
|
-
*
|
|
206
|
-
* //
|
|
207
|
-
*
|
|
208
|
-
* // Returns:
|
|
209
|
-
*
|
|
210
|
-
* //
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
* //
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
* ```
|
|
268
|
-
*
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
*
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
*
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
*
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
*
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
*
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
*
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
*
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
1
|
+
/**
|
|
2
|
+
* List of all models available TODAY. This is used by the client to display the
|
|
3
|
+
* list of models.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ALL_MODELS: readonly ["gpt-5", "gpt-5-mini", "gpt-5-nano", "claude-haiku-4-5", "claude-sonnet-4-5", "gemini-2.5-flash", "gemini-2.5-pro"];
|
|
6
|
+
|
|
7
|
+
export declare const ALL_PROVIDERS: readonly ["OpenAI", "Anthropic", "Google"];
|
|
8
|
+
|
|
9
|
+
export declare const ALL_REASONING_MODELS: string[];
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Name of the application.
|
|
13
|
+
*/
|
|
14
|
+
export declare const APPLICATION_NAME = "Diggidy";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Mapping of AI providers to their approximate model name prefixes. This
|
|
18
|
+
* enables provider identification from model names even when exact model
|
|
19
|
+
* versions change over time.
|
|
20
|
+
*/
|
|
21
|
+
export declare const APPROXIMATE_MODELS_PER_PROVIDER: {
|
|
22
|
+
readonly Anthropic: readonly ["claude-sonnet-4", "claude-haiku-4", "claude-3"];
|
|
23
|
+
readonly OpenAI: readonly ["gpt-", "o3", "o4"];
|
|
24
|
+
readonly Google: readonly ["gemini"];
|
|
25
|
+
readonly Perplexity: readonly ["sonar"];
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Capability constants (single source of truth for string ids).
|
|
30
|
+
* NOTE: these map 1:1 to tool names in ALL_TOOLS from @sassysaint/tools
|
|
31
|
+
* therefore each tools needs to import this file to name its tool correctly.
|
|
32
|
+
*/
|
|
33
|
+
export declare const CAPABILITIES: {
|
|
34
|
+
readonly TOOL: {
|
|
35
|
+
readonly DATETIME: "getDateTime";
|
|
36
|
+
readonly IMAGES: "getImages";
|
|
37
|
+
readonly POLLUTION: "getAirPollution";
|
|
38
|
+
readonly WEATHER: "getWeather";
|
|
39
|
+
readonly URLCONTENTPARSER: "getUrlContent";
|
|
40
|
+
readonly MEMORIES: "getUserMemories";
|
|
41
|
+
readonly HUMANIZE: "humanize";
|
|
42
|
+
readonly WEBSEARCH: "getWebSearch";
|
|
43
|
+
readonly GITREPOSITORY: "getGitRepoDetails";
|
|
44
|
+
readonly HOTELS: "getHotelDetails";
|
|
45
|
+
};
|
|
46
|
+
readonly ADDON: {
|
|
47
|
+
readonly ATTACHMENTS: "addon:attachments";
|
|
48
|
+
readonly REASONING: "addon:reasoning";
|
|
49
|
+
readonly CODEINTERPRETER: "addon:codeinterpreter";
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Input type for capability checks. Can be a single capability string or an
|
|
55
|
+
* array of capability strings for checking multiple capabilities at once.
|
|
56
|
+
*/
|
|
57
|
+
export declare type CapabilityInput = string | readonly string[];
|
|
58
|
+
|
|
59
|
+
export declare const DEFAULT_PROVIDER = "OpenAI";
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Header string for Diggidy Chat Id. Used to identify the chat in the server
|
|
63
|
+
* when there is a client abort.
|
|
64
|
+
*/
|
|
65
|
+
export declare const DIGGIDY_CHAT_ID_HEADER = "x-diggidy-chat-id";
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Represents the shape of an entitlement state object, used for checking
|
|
69
|
+
* capability loading status. This interface is intentionally flexible to work
|
|
70
|
+
* with various entitlement state implementations across client and server.
|
|
71
|
+
*/
|
|
72
|
+
export declare interface EntitlementStateLike {
|
|
73
|
+
/**
|
|
74
|
+
* Array of capability strings granted to the user.
|
|
75
|
+
*/
|
|
76
|
+
capabilities?: string[];
|
|
77
|
+
/**
|
|
78
|
+
* Version number of the entitlement state for cache invalidation.
|
|
79
|
+
*/
|
|
80
|
+
version?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Current status of the entitlement (e.g., "active", "expired").
|
|
83
|
+
*/
|
|
84
|
+
status?: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Identifies the AI provider associated with a given model name by matching
|
|
89
|
+
* against known model prefixes. This function provides backward compatibility
|
|
90
|
+
* for older model naming schemes while correctly identifying the provider.
|
|
91
|
+
*
|
|
92
|
+
* The function iterates through approximate model prefixes for each provider
|
|
93
|
+
* and returns the first matching provider. This approach handles cases where
|
|
94
|
+
* model version numbers change but the provider remains the same.
|
|
95
|
+
*
|
|
96
|
+
* @param modelName - The full model name to identify (e.g.,
|
|
97
|
+
* "claude-3-5-sonnet-20241022").
|
|
98
|
+
* @returns The provider constant (PROVIDER_ANTHROPIC, PROVIDER_OPENAI, or
|
|
99
|
+
* PROVIDER_GOOGLE) if a match is found, or null if no provider matches.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* findProvider("claude-3-5-sonnet-latest"); // Returns PROVIDER_ANTHROPIC
|
|
104
|
+
* findProvider("gpt-4-turbo"); // Returns PROVIDER_OPENAI
|
|
105
|
+
* findProvider("gemini-1.5-pro"); // Returns PROVIDER_GOOGLE
|
|
106
|
+
* findProvider("unknown-model"); // Returns null
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
*/
|
|
110
|
+
export declare const findProvider: (modelName: string) => null | typeof PROVIDER_ANTHROPIC | typeof PROVIDER_OPENAI | typeof PROVIDER_GOOGLE;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Groups allowed models by their respective providers. This function is used to
|
|
114
|
+
* create nested menu structures in the UI where users can select specific
|
|
115
|
+
* models within each provider category.
|
|
116
|
+
*
|
|
117
|
+
* The function analyzes the given array of model names and organizes them into
|
|
118
|
+
* a map where keys are provider names and values are arrays of models available
|
|
119
|
+
* for that provider. Only models that exist in the MODELS_PER_PROVIDER mapping
|
|
120
|
+
* are included.
|
|
121
|
+
*
|
|
122
|
+
* @param models - Array of model names available to the user (e.g., from
|
|
123
|
+
* allowedModels in policy configuration).
|
|
124
|
+
* @returns Map where keys are provider names (PROVIDER_OPENAI,
|
|
125
|
+
* PROVIDER_ANTHROPIC, PROVIDER_GOOGLE) and values are arrays of model names
|
|
126
|
+
* available for that provider. Returns empty map if no models are provided.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```ts
|
|
130
|
+
* // User has multiple models per provider:
|
|
131
|
+
* getModelsGroupedByProvider([MODEL_GPT5, MODEL_GPT5_MINI, MODEL_CLAUDE_HAIKU]);
|
|
132
|
+
* // Returns: Map {
|
|
133
|
+
* // "OpenAI" => ["gpt-5", "gpt-5-mini"],
|
|
134
|
+
* // "Anthropic" => ["claude-haiku-4-5"]
|
|
135
|
+
* // }
|
|
136
|
+
*
|
|
137
|
+
* // Single model per provider:
|
|
138
|
+
* getModelsGroupedByProvider([MODEL_GPT5, MODEL_CLAUDE_HAIKU]);
|
|
139
|
+
* // Returns: Map {
|
|
140
|
+
* // "OpenAI" => ["gpt-5"],
|
|
141
|
+
* // "Anthropic" => ["claude-haiku-4-5"]
|
|
142
|
+
* // }
|
|
143
|
+
*
|
|
144
|
+
* // Empty models array:
|
|
145
|
+
* getModelsGroupedByProvider([]);
|
|
146
|
+
* // Returns: Map {}
|
|
147
|
+
* ```
|
|
148
|
+
*
|
|
149
|
+
*/
|
|
150
|
+
export declare const getModelsGroupedByProvider: (models: string[]) => Map<string, string[]>;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Derives the list of available AI providers from a given array of model names.
|
|
154
|
+
* This function enables automatic filtering of provider options in the UI based
|
|
155
|
+
* on which models are available in a user's subscription plan.
|
|
156
|
+
*
|
|
157
|
+
* The function cross-references each model against the MODELS_PER_PROVIDER
|
|
158
|
+
* mapping to determine which providers should be available. Results are
|
|
159
|
+
* returned in a consistent order matching ALL_PROVIDERS to ensure UI stability.
|
|
160
|
+
*
|
|
161
|
+
* @param models - Array of model names available to the user (e.g., from
|
|
162
|
+
* allowedModels in policy configuration).
|
|
163
|
+
* @returns Array of provider constants (PROVIDER_OPENAI, PROVIDER_ANTHROPIC,
|
|
164
|
+
* PROVIDER_GOOGLE) that have at least one available model. Returns empty
|
|
165
|
+
* array if no models are provided.
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```ts
|
|
169
|
+
* // User's plan includes GPT and Claude models:
|
|
170
|
+
* getProvidersFromModels([MODEL_GPT4_NANO, MODEL_CLAUDE_HAIKU]);
|
|
171
|
+
* // Returns: [PROVIDER_OPENAI, PROVIDER_ANTHROPIC]
|
|
172
|
+
*
|
|
173
|
+
* // Gemini models removed from plan:
|
|
174
|
+
* getProvidersFromModels([MODEL_GPT4_NANO, MODEL_CLAUDE_HAIKU]);
|
|
175
|
+
* // Returns: [PROVIDER_OPENAI, PROVIDER_ANTHROPIC]
|
|
176
|
+
* // (PROVIDER_GOOGLE is excluded)
|
|
177
|
+
*
|
|
178
|
+
* // Empty models array:
|
|
179
|
+
* getProvidersFromModels([]);
|
|
180
|
+
* // Returns: []
|
|
181
|
+
* ```
|
|
182
|
+
*
|
|
183
|
+
*/
|
|
184
|
+
export declare const getProvidersFromModels: (models: string[]) => Array<typeof PROVIDER_OPENAI | typeof PROVIDER_ANTHROPIC | typeof PROVIDER_GOOGLE>;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Checks if the user has multiple models available for at least one provider.
|
|
188
|
+
* This function is used to determine if the nested model selection feature
|
|
189
|
+
* should be available to the user.
|
|
190
|
+
*
|
|
191
|
+
* The function groups models by provider and checks if any provider has more
|
|
192
|
+
* than one model. This enables the UI to conditionally show the nested model
|
|
193
|
+
* selection toggle only to users who would benefit from it.
|
|
194
|
+
*
|
|
195
|
+
* @param models - Array of model names available to the user (e.g., from
|
|
196
|
+
* allowedModels in policy configuration).
|
|
197
|
+
* @returns True if at least one provider has multiple models available, false
|
|
198
|
+
* otherwise.
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```ts
|
|
202
|
+
* // Premium plan with multiple models per provider:
|
|
203
|
+
* hasMultipleModelsPerProvider([MODEL_GPT5, MODEL_GPT5_MINI, MODEL_CLAUDE_HAIKU]);
|
|
204
|
+
* // Returns: true (OpenAI has 2 models)
|
|
205
|
+
*
|
|
206
|
+
* // Plus plan with one model per provider:
|
|
207
|
+
* hasMultipleModelsPerProvider([MODEL_GPT5_MINI, MODEL_CLAUDE_HAIKU, MODEL_GEMINI_FLASH]);
|
|
208
|
+
* // Returns: false (each provider has only 1 model)
|
|
209
|
+
*
|
|
210
|
+
* // Basic plan with single model:
|
|
211
|
+
* hasMultipleModelsPerProvider([MODEL_GPT5_NANO]);
|
|
212
|
+
* // Returns: false
|
|
213
|
+
* ```
|
|
214
|
+
*
|
|
215
|
+
*/
|
|
216
|
+
export declare const hasMultipleModelsPerProvider: (models: string[]) => boolean;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Checks whether a user has the required capability or capabilities based on
|
|
220
|
+
* their entitlement. This function is used throughout the application to
|
|
221
|
+
* control access to features based on subscription plans or permission levels.
|
|
222
|
+
*
|
|
223
|
+
* The function supports multiple modes of operation:
|
|
224
|
+
* - Single capability check: Pass a string to check one capability
|
|
225
|
+
* - Multiple capability check (AND): Pass an array to require ALL capabilities
|
|
226
|
+
* - Multiple capability check (OR): Pass an array with options.any=true to
|
|
227
|
+
* require ANY capability
|
|
228
|
+
* - Performance optimization: Pass a pre-computed Set via options.set
|
|
229
|
+
*
|
|
230
|
+
* An empty requirements array or empty string always returns true, treating it
|
|
231
|
+
* as "no specific entitlement required".
|
|
232
|
+
*
|
|
233
|
+
* @param capabilitiesOrSet - User's capabilities as an array, a Set, or null/
|
|
234
|
+
* undefined if not loaded.
|
|
235
|
+
* @param required - The capability or capabilities to check. Can be a single
|
|
236
|
+
* string or an array of strings.
|
|
237
|
+
* @param options - Optional configuration for the check behavior (any mode, pre-
|
|
238
|
+
* computed Set).
|
|
239
|
+
* @returns True if the user has the required capability/capabilities according
|
|
240
|
+
* to the specified logic, false otherwise.
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* ```ts
|
|
244
|
+
* const userCaps = ["read:posts", "write:posts"];
|
|
245
|
+
*
|
|
246
|
+
* // Single capability check:
|
|
247
|
+
* isEntitled(userCaps, "read:posts"); // true
|
|
248
|
+
* isEntitled(userCaps, "admin"); // false
|
|
249
|
+
*
|
|
250
|
+
* // Multiple capabilities (AND - all required):
|
|
251
|
+
* isEntitled(userCaps, ["read:posts", "write:posts"]); // true
|
|
252
|
+
* isEntitled(userCaps, ["read:posts", "admin"]); // false
|
|
253
|
+
*
|
|
254
|
+
* // Multiple capabilities (OR - any required):
|
|
255
|
+
* isEntitled(userCaps, ["admin", "read:posts"], { any: true }); // true
|
|
256
|
+
* isEntitled(userCaps, ["admin", "super:user"], { any: true }); // false
|
|
257
|
+
*
|
|
258
|
+
* // Performance optimization with pre-computed Set:
|
|
259
|
+
* const capSet = toCapabilitySet(userCaps);
|
|
260
|
+
* isEntitled(capSet, "read:posts"); // true (faster lookup)
|
|
261
|
+
*
|
|
262
|
+
* // Edge cases:
|
|
263
|
+
* isEntitled(userCaps, ""); // true (no requirement)
|
|
264
|
+
* isEntitled(userCaps, []); // true (no requirement)
|
|
265
|
+
* isEntitled(null, "read:posts"); // false (no capabilities)
|
|
266
|
+
* isEntitled([], "read:posts"); // false (empty capabilities)
|
|
267
|
+
* ```
|
|
268
|
+
*
|
|
269
|
+
*/
|
|
270
|
+
export declare function isEntitled(capabilitiesOrSet: string[] | Set<string> | null | undefined, required: CapabilityInput, options?: IsEntitledOptions): boolean;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Configuration options for the isEntitled function to control how capability
|
|
274
|
+
* checks are evaluated.
|
|
275
|
+
*/
|
|
276
|
+
export declare interface IsEntitledOptions {
|
|
277
|
+
/**
|
|
278
|
+
* When true, grants entitlement if ANY of the required capabilities match
|
|
279
|
+
* (logical OR). When false (default), requires ALL capabilities to match
|
|
280
|
+
* (logical AND).
|
|
281
|
+
*/
|
|
282
|
+
any?: boolean;
|
|
283
|
+
/**
|
|
284
|
+
* Pre-computed capability Set for performance optimization. If provided, skips
|
|
285
|
+
* building a new Set from the capabilities array.
|
|
286
|
+
*/
|
|
287
|
+
set?: Set<string>;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Checks whether an entitlement state object has been successfully loaded and
|
|
292
|
+
* contains valid capability data. This function verifies the state is defined
|
|
293
|
+
* and has a capabilities array (even if empty).
|
|
294
|
+
*
|
|
295
|
+
* Use this function before performing capability checks to ensure the
|
|
296
|
+
* entitlement data is available and initialized properly.
|
|
297
|
+
*
|
|
298
|
+
* @param state - The entitlement state object to check, which may be null or
|
|
299
|
+
* undefined during initial loading.
|
|
300
|
+
* @returns True if the state is loaded and contains a capabilities array,
|
|
301
|
+
* false otherwise.
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* ```ts
|
|
305
|
+
* const entitlementState = await fetchEntitlements();
|
|
306
|
+
* if (isEntitlementLoaded(entitlementState)) {
|
|
307
|
+
* // Safe to check capabilities
|
|
308
|
+
* const hasFeature = isEntitled(entitlementState.capabilities, "premium");
|
|
309
|
+
* }
|
|
310
|
+
* ```
|
|
311
|
+
*
|
|
312
|
+
*/
|
|
313
|
+
export declare function isEntitlementLoaded(state: EntitlementStateLike | null | undefined): boolean;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Validates if a selected model is allowed for the user based on their current
|
|
317
|
+
* plan's allowed models. This function is used to prevent users from using
|
|
318
|
+
* models they selected under a previous (higher) plan after downgrading.
|
|
319
|
+
*
|
|
320
|
+
* The function checks if the model exists in the user's allowedModels array.
|
|
321
|
+
* Returns false if the model is undefined, null, or not in the allowed list.
|
|
322
|
+
*
|
|
323
|
+
* @param selectedModel - The model the user has selected (may be null/undefined
|
|
324
|
+
* if no selection was made).
|
|
325
|
+
* @param allowedModels - Array of model names the user is entitled to use based
|
|
326
|
+
* on their current plan.
|
|
327
|
+
* @returns True if the selected model is in the allowed models list, false
|
|
328
|
+
* otherwise.
|
|
329
|
+
*
|
|
330
|
+
* @example
|
|
331
|
+
* ```ts
|
|
332
|
+
* // User downgrades from Premium to Plus:
|
|
333
|
+
* const selectedModel = "gpt-4o"; // Was selected when user had Premium
|
|
334
|
+
* const allowedModels = ["gpt-4o-mini"]; // Plus plan only has mini model
|
|
335
|
+
* isModelAllowedForPlan(selectedModel, allowedModels); // Returns: false
|
|
336
|
+
*
|
|
337
|
+
* // Model is still allowed:
|
|
338
|
+
* isModelAllowedForPlan("gpt-4o-mini", ["gpt-4o-mini", "claude-haiku"]);
|
|
339
|
+
* // Returns: true
|
|
340
|
+
*
|
|
341
|
+
* // No model selected:
|
|
342
|
+
* isModelAllowedForPlan(undefined, ["gpt-4o-mini"]);
|
|
343
|
+
* // Returns: false
|
|
344
|
+
* ```
|
|
345
|
+
*
|
|
346
|
+
*/
|
|
347
|
+
export declare const isModelAllowedForPlan: (selectedModel: string | undefined | null, allowedModels: string[]) => boolean;
|
|
348
|
+
|
|
349
|
+
export declare const MODEL_CLAUDE_HAIKU = "claude-haiku-4-5";
|
|
350
|
+
|
|
351
|
+
export declare const MODEL_CLAUDE_SONNET = "claude-sonnet-4-5";
|
|
352
|
+
|
|
353
|
+
export declare const MODEL_DEV = "mistralai/mistral-small-3.2-24b-instruct:free";
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Maps model constants to user-friendly display names. Used by client UI to
|
|
357
|
+
* show readable model names in plan descriptions and settings.
|
|
358
|
+
*/
|
|
359
|
+
export declare const MODEL_DISPLAY_NAMES: Record<string, string>;
|
|
360
|
+
|
|
361
|
+
export declare const MODEL_EMBEDDING_TEXT = "text-embedding-3-small";
|
|
362
|
+
|
|
363
|
+
export declare const MODEL_GEMINI_FLASH = "gemini-2.5-flash";
|
|
364
|
+
|
|
365
|
+
export declare const MODEL_GEMINI_PRO = "gemini-2.5-pro";
|
|
366
|
+
|
|
367
|
+
export declare const MODEL_GPT4_NANO = "gpt-4.1-nano";
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* List of available models TODAY.
|
|
371
|
+
*/
|
|
372
|
+
export declare const MODEL_GPT5 = "gpt-5";
|
|
373
|
+
|
|
374
|
+
export declare const MODEL_GPT5_MINI = "gpt-5-mini";
|
|
375
|
+
|
|
376
|
+
export declare const MODEL_GPT5_NANO = "gpt-5-nano";
|
|
377
|
+
|
|
378
|
+
export declare const MODEL_MEMORY_INFERENCE = "gpt-4o-mini";
|
|
379
|
+
|
|
380
|
+
export declare const MODEL_SONAR = "sonar";
|
|
381
|
+
|
|
382
|
+
export declare const MODEL_SONAR_PRO = "sonar-pro";
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* List of models available according to the providers.
|
|
386
|
+
*/
|
|
387
|
+
export declare const MODELS_PER_PROVIDER: {
|
|
388
|
+
readonly OpenAI: readonly ["gpt-4.1-nano", "gpt-5", "gpt-5-mini", "gpt-5-nano"];
|
|
389
|
+
readonly Anthropic: readonly ["claude-haiku-4-5", "claude-sonnet-4-5"];
|
|
390
|
+
readonly Google: readonly ["gemini-2.5-flash", "gemini-2.5-pro"];
|
|
391
|
+
readonly Perplexity: readonly ["sonar", "sonar-pro"];
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* List of all plans available.
|
|
396
|
+
*/
|
|
397
|
+
export declare const PLAN_BASIC = "sassy:basic";
|
|
398
|
+
|
|
399
|
+
export declare const PLAN_PLUS = "sassy:plus";
|
|
400
|
+
|
|
401
|
+
export declare const PLAN_PREMIUM = "sassy:advanced";
|
|
402
|
+
|
|
403
|
+
export declare const PROVIDER_ANTHROPIC = "Anthropic";
|
|
404
|
+
|
|
405
|
+
export declare const PROVIDER_GOOGLE = "Google";
|
|
406
|
+
|
|
407
|
+
export declare const PROVIDER_MEMORY = "Memory";
|
|
408
|
+
|
|
409
|
+
export declare const PROVIDER_MISTRAL = "Mistral";
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* List of available providers.
|
|
413
|
+
*/
|
|
414
|
+
export declare const PROVIDER_OPENAI = "OpenAI";
|
|
415
|
+
|
|
416
|
+
export declare const PROVIDER_PERPLEXITY = "Perplexity";
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* List of roles available according to the provider.
|
|
420
|
+
*/
|
|
421
|
+
export declare const PROVIDER_ROLE_MAP: {
|
|
422
|
+
OpenAI: string[];
|
|
423
|
+
Anthropic: string[];
|
|
424
|
+
Summary: string[];
|
|
425
|
+
Memory: string[];
|
|
426
|
+
Google: string[];
|
|
427
|
+
Perplexity: string[];
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
export declare const PROVIDER_SUMMARY = "Summary";
|
|
431
|
+
|
|
432
|
+
export declare const ROLE_ASSISTANT = "assistant";
|
|
433
|
+
|
|
434
|
+
export declare const ROLE_HIDDEN = "hidden";
|
|
435
|
+
|
|
436
|
+
export declare const ROLE_INTERNAL = "data";
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* List of available roles.
|
|
440
|
+
*/
|
|
441
|
+
export declare const ROLE_SYSTEM = "system";
|
|
442
|
+
|
|
443
|
+
export declare const ROLE_USER = "user";
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* Sort capabilities are shared across client and server.
|
|
447
|
+
*/
|
|
448
|
+
export declare const SORT_BY_TIMESTAMP = "timestamp";
|
|
449
|
+
|
|
450
|
+
export declare const SORT_BY_TOKEN_USAGE = "tokenUsage";
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Theme constants used across client and server.
|
|
454
|
+
*/
|
|
455
|
+
export declare const THEME_STANDARD = "standard";
|
|
456
|
+
|
|
457
|
+
export declare const THEME_SUBTLE = "subtle";
|
|
458
|
+
|
|
459
|
+
export declare type ThemeMode = typeof THEME_STANDARD | typeof THEME_SUBTLE;
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Converts an array of capability strings into a Set for efficient lookup
|
|
463
|
+
* operations. Returns null if the input is null, undefined, or not an array.
|
|
464
|
+
*
|
|
465
|
+
* Using a Set for capability checks provides O(1) lookup performance compared
|
|
466
|
+
* to O(n) for array includes, which is beneficial when checking multiple
|
|
467
|
+
* capabilities or performing frequent checks.
|
|
468
|
+
*
|
|
469
|
+
* @param capabilities - Array of capability strings to convert, or null/
|
|
470
|
+
* undefined.
|
|
471
|
+
* @returns A Set containing the capability strings, or null if input is
|
|
472
|
+
* invalid.
|
|
473
|
+
*
|
|
474
|
+
* @example
|
|
475
|
+
* ```ts
|
|
476
|
+
* const caps = ["read:posts", "write:posts", "admin"];
|
|
477
|
+
* const capSet = toCapabilitySet(caps);
|
|
478
|
+
* // capSet.has("read:posts") is now O(1) instead of O(n)
|
|
479
|
+
*
|
|
480
|
+
* toCapabilitySet(null); // Returns null
|
|
481
|
+
* toCapabilitySet(undefined); // Returns null
|
|
482
|
+
* ```
|
|
483
|
+
*
|
|
484
|
+
*/
|
|
485
|
+
export declare function toCapabilitySet(capabilities: string[] | undefined | null): Set<string> | null;
|
|
486
|
+
|
|
487
|
+
export { }
|
package/dist/index.js
CHANGED
|
@@ -1,177 +1 @@
|
|
|
1
|
-
|
|
2
|
-
r,
|
|
3
|
-
O,
|
|
4
|
-
c
|
|
5
|
-
], _ = "gpt-5", A = "gpt-5-mini", a = "gpt-5-nano", T = "gpt-4.1-nano", D = "claude-haiku-4-5", R = "claude-sonnet-4-5", L = "gemini-2.5-flash", P = "gemini-2.5-pro", l = "sonar", u = "sonar-pro", k = "mistralai/mistral-small-3.2-24b-instruct:free", W = "gpt-4o-mini", x = "text-embedding-3-small", j = {
|
|
6
|
-
[_]: "GPT-5",
|
|
7
|
-
[A]: "GPT-5 Mini",
|
|
8
|
-
[a]: "GPT-5 Nano",
|
|
9
|
-
[T]: "GPT-4.1 Nano",
|
|
10
|
-
[D]: "Claude Haiku 4.5",
|
|
11
|
-
[R]: "Claude Sonnet 4.5",
|
|
12
|
-
[L]: "Gemini 2.5 Flash",
|
|
13
|
-
[P]: "Gemini 2.5 Pro",
|
|
14
|
-
[l]: "Sonar",
|
|
15
|
-
[u]: "Sonar Pro"
|
|
16
|
-
}, K = [
|
|
17
|
-
_,
|
|
18
|
-
A,
|
|
19
|
-
a,
|
|
20
|
-
D,
|
|
21
|
-
R,
|
|
22
|
-
L,
|
|
23
|
-
P
|
|
24
|
-
], w = [
|
|
25
|
-
_,
|
|
26
|
-
A,
|
|
27
|
-
a,
|
|
28
|
-
R,
|
|
29
|
-
P
|
|
30
|
-
], N = {
|
|
31
|
-
[r]: [
|
|
32
|
-
T,
|
|
33
|
-
_,
|
|
34
|
-
A,
|
|
35
|
-
a
|
|
36
|
-
],
|
|
37
|
-
[O]: [D, R],
|
|
38
|
-
[c]: [L, P],
|
|
39
|
-
[I]: [l, u]
|
|
40
|
-
}, z = {
|
|
41
|
-
[r]: [S, e, E],
|
|
42
|
-
[O]: [e, E],
|
|
43
|
-
[d]: [e, E],
|
|
44
|
-
[g]: [e, E],
|
|
45
|
-
[c]: [e, E],
|
|
46
|
-
[I]: [e, E]
|
|
47
|
-
}, p = "claude-sonnet-4", G = "claude-haiku-4", m = "claude-3", h = "gpt-", y = "o3", C = "o4", U = "gemini", v = "sonar", H = {
|
|
48
|
-
[O]: [
|
|
49
|
-
p,
|
|
50
|
-
G,
|
|
51
|
-
m
|
|
52
|
-
],
|
|
53
|
-
[r]: [
|
|
54
|
-
h,
|
|
55
|
-
y,
|
|
56
|
-
C
|
|
57
|
-
],
|
|
58
|
-
[c]: [U],
|
|
59
|
-
[I]: [v]
|
|
60
|
-
}, Z = "x-diggidy-chat-id", J = "timestamp", Q = "tokenUsage", $ = "Diggidy", q = "sassy:basic", tt = "sassy:plus", nt = "sassy:advanced", ot = {
|
|
61
|
-
TOOL: {
|
|
62
|
-
DATETIME: "getDateTime",
|
|
63
|
-
IMAGES: "getImages",
|
|
64
|
-
POLLUTION: "getAirPollution",
|
|
65
|
-
WEATHER: "getWeather",
|
|
66
|
-
URLCONTENTPARSER: "getUrlContent",
|
|
67
|
-
MEMORIES: "getUserMemories",
|
|
68
|
-
HUMANIZE: "humanize",
|
|
69
|
-
WEBSEARCH: "getWebSearch",
|
|
70
|
-
GITREPOSITORY: "getGitRepoDetails",
|
|
71
|
-
HOTELS: "getHotelDetails"
|
|
72
|
-
},
|
|
73
|
-
ADDON: {
|
|
74
|
-
ATTACHMENTS: "addon:attachments",
|
|
75
|
-
REASONING: "addon:reasoning",
|
|
76
|
-
CODEINTERPRETER: "addon:codeinterpreter"
|
|
77
|
-
}
|
|
78
|
-
}, st = (t) => {
|
|
79
|
-
for (const [n, s] of Object.entries(
|
|
80
|
-
H
|
|
81
|
-
))
|
|
82
|
-
if (s.some((o) => t.startsWith(o)))
|
|
83
|
-
return n;
|
|
84
|
-
return null;
|
|
85
|
-
}, et = (t) => {
|
|
86
|
-
if (!t || t.length === 0)
|
|
87
|
-
return [];
|
|
88
|
-
const n = /* @__PURE__ */ new Set();
|
|
89
|
-
for (const s of t)
|
|
90
|
-
for (const [o, i] of Object.entries(
|
|
91
|
-
N
|
|
92
|
-
))
|
|
93
|
-
i.includes(s) && (o === r || o === O || o === c) && n.add(o);
|
|
94
|
-
return f.filter((s) => n.has(s));
|
|
95
|
-
}, V = (t) => {
|
|
96
|
-
const n = /* @__PURE__ */ new Map();
|
|
97
|
-
if (!t || t.length === 0)
|
|
98
|
-
return n;
|
|
99
|
-
for (const s of t)
|
|
100
|
-
for (const [o, i] of Object.entries(
|
|
101
|
-
N
|
|
102
|
-
))
|
|
103
|
-
if (i.includes(s)) {
|
|
104
|
-
n.has(o) || n.set(o, []), n.get(o)?.push(s);
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
return n;
|
|
108
|
-
}, Et = (t) => {
|
|
109
|
-
const n = V(t);
|
|
110
|
-
for (const s of n.values())
|
|
111
|
-
if (s.length > 1)
|
|
112
|
-
return !0;
|
|
113
|
-
return !1;
|
|
114
|
-
}, rt = (t, n) => !t || !n || n.length === 0 ? !1 : n.includes(t);
|
|
115
|
-
function Ot(t) {
|
|
116
|
-
return !!t && Array.isArray(t.capabilities) && t.capabilities.length >= 0;
|
|
117
|
-
}
|
|
118
|
-
function X(t) {
|
|
119
|
-
return t ? new Set(t) : null;
|
|
120
|
-
}
|
|
121
|
-
function ct(t, n, s) {
|
|
122
|
-
if (!n || Array.isArray(n) && n.length === 0)
|
|
123
|
-
return !0;
|
|
124
|
-
const o = t instanceof Set ? t : X(t);
|
|
125
|
-
return !o || o.size === 0 ? !1 : typeof n == "string" ? o.has(n) : s?.any === !0 ? n.some((M) => o.has(M)) : n.every((M) => o.has(M));
|
|
126
|
-
}
|
|
127
|
-
export {
|
|
128
|
-
K as ALL_MODELS,
|
|
129
|
-
f as ALL_PROVIDERS,
|
|
130
|
-
w as ALL_REASONING_MODELS,
|
|
131
|
-
$ as APPLICATION_NAME,
|
|
132
|
-
H as APPROXIMATE_MODELS_PER_PROVIDER,
|
|
133
|
-
ot as CAPABILITIES,
|
|
134
|
-
F as DEFAULT_PROVIDER,
|
|
135
|
-
Z as DIGGIDY_CHAT_ID_HEADER,
|
|
136
|
-
N as MODELS_PER_PROVIDER,
|
|
137
|
-
D as MODEL_CLAUDE_HAIKU,
|
|
138
|
-
R as MODEL_CLAUDE_SONNET,
|
|
139
|
-
k as MODEL_DEV,
|
|
140
|
-
j as MODEL_DISPLAY_NAMES,
|
|
141
|
-
x as MODEL_EMBEDDING_TEXT,
|
|
142
|
-
L as MODEL_GEMINI_FLASH,
|
|
143
|
-
P as MODEL_GEMINI_PRO,
|
|
144
|
-
T as MODEL_GPT4_NANO,
|
|
145
|
-
_ as MODEL_GPT5,
|
|
146
|
-
A as MODEL_GPT5_MINI,
|
|
147
|
-
a as MODEL_GPT5_NANO,
|
|
148
|
-
W as MODEL_MEMORY_INFERENCE,
|
|
149
|
-
l as MODEL_SONAR,
|
|
150
|
-
u as MODEL_SONAR_PRO,
|
|
151
|
-
q as PLAN_BASIC,
|
|
152
|
-
tt as PLAN_PLUS,
|
|
153
|
-
nt as PLAN_PREMIUM,
|
|
154
|
-
O as PROVIDER_ANTHROPIC,
|
|
155
|
-
c as PROVIDER_GOOGLE,
|
|
156
|
-
g as PROVIDER_MEMORY,
|
|
157
|
-
B as PROVIDER_MISTRAL,
|
|
158
|
-
r as PROVIDER_OPENAI,
|
|
159
|
-
I as PROVIDER_PERPLEXITY,
|
|
160
|
-
z as PROVIDER_ROLE_MAP,
|
|
161
|
-
d as PROVIDER_SUMMARY,
|
|
162
|
-
E as ROLE_ASSISTANT,
|
|
163
|
-
Y as ROLE_HIDDEN,
|
|
164
|
-
b as ROLE_INTERNAL,
|
|
165
|
-
S as ROLE_SYSTEM,
|
|
166
|
-
e as ROLE_USER,
|
|
167
|
-
J as SORT_BY_TIMESTAMP,
|
|
168
|
-
Q as SORT_BY_TOKEN_USAGE,
|
|
169
|
-
st as findProvider,
|
|
170
|
-
V as getModelsGroupedByProvider,
|
|
171
|
-
et as getProvidersFromModels,
|
|
172
|
-
Et as hasMultipleModelsPerProvider,
|
|
173
|
-
ct as isEntitled,
|
|
174
|
-
Ot as isEntitlementLoaded,
|
|
175
|
-
rt as isModelAllowedForPlan,
|
|
176
|
-
X as toCapabilitySet
|
|
177
|
-
};
|
|
1
|
+
let e="user",_="assistant",t="OpenAI",E="Anthropic",a="Google",r="Summary",s="Perplexity",n="Mistral",O=[t,E,a],i="gpt-5",o="gpt-5-mini",R="gpt-5-nano",l="gpt-4.1-nano",A="claude-haiku-4-5",I="claude-sonnet-4-5",M="gemini-2.5-flash",D="gemini-2.5-pro",L="sonar",P="sonar-pro",T="mistralai/mistral-small-3.2-24b-instruct:free",S="gpt-4o-mini",p="text-embedding-3-small",d={[i]:"GPT-5",[o]:"GPT-5 Mini",[R]:"GPT-5 Nano",[l]:"GPT-4.1 Nano",[A]:"Claude Haiku 4.5",[I]:"Claude Sonnet 4.5",[M]:"Gemini 2.5 Flash",[D]:"Gemini 2.5 Pro",[L]:"Sonar",[P]:"Sonar Pro"},N=[i,o,R,A,I,M,D],u=[i,o,R,I,D],g={[t]:[l,i,o,R],[E]:[A,I],[a]:[M,D],[s]:[L,P]},c={[t]:["system",e,_],[E]:[e,_],[r]:[e,_],Memory:[e,_],[a]:[e,_],[s]:[e,_]},G={[E]:["claude-sonnet-4","claude-haiku-4","claude-3"],[t]:["gpt-","o3","o4"],[a]:["gemini"],[s]:["sonar"]},m="x-diggidy-chat-id",f="timestamp",h="tokenUsage",b="Diggidy",y="sassy:basic",U="sassy:plus",H="sassy:advanced",V={TOOL:{DATETIME:"getDateTime",IMAGES:"getImages",POLLUTION:"getAirPollution",WEATHER:"getWeather",URLCONTENTPARSER:"getUrlContent",MEMORIES:"getUserMemories",HUMANIZE:"humanize",WEBSEARCH:"getWebSearch",GITREPOSITORY:"getGitRepoDetails",HOTELS:"getHotelDetails"},ADDON:{ATTACHMENTS:"addon:attachments",REASONING:"addon:reasoning",CODEINTERPRETER:"addon:codeinterpreter"}},k="standard",C=e=>{for(let[_,t]of Object.entries(G))if(t.some(_=>e.startsWith(_)))return _;return null},w=e=>{if(!e||0===e.length)return[];let _=new Set;for(let t of e)for(let[e,a]of Object.entries(g))a.includes(t)&&("OpenAI"===e||e===E||"Google"===e)&&_.add(e);return O.filter(e=>_.has(e))},x=e=>{let _=new Map;if(!e||0===e.length)return _;for(let t of e)for(let[e,E]of Object.entries(g))if(E.includes(t)){_.has(e)||_.set(e,[]),_.get(e)?.push(t);break}return _},Y=e=>{for(let _ of x(e).values())if(_.length>1)return!0;return!1},B=(e,_)=>!!e&&!!_&&0!==_.length&&_.includes(e);function v(e){return!!e&&Array.isArray(e.capabilities)&&e.capabilities.length>=0}function F(e){return e?new Set(e):null}function W(e,_,t){if(!_||Array.isArray(_)&&0===_.length)return!0;let E=e instanceof Set?e:F(e);return!!E&&0!==E.size&&("string"==typeof _?E.has(_):t?.any===!0?_.some(e=>E.has(e)):_.every(e=>E.has(e)))}var j="OpenAI",X="gpt-5",z="sonar",K="Google",Z="Memory",q="OpenAI",J="hidden",Q="data",$="system",ee="user",e_="subtle";export{N as ALL_MODELS,O as ALL_PROVIDERS,u as ALL_REASONING_MODELS,b as APPLICATION_NAME,G as APPROXIMATE_MODELS_PER_PROVIDER,V as CAPABILITIES,m as DIGGIDY_CHAT_ID_HEADER,g as MODELS_PER_PROVIDER,A as MODEL_CLAUDE_HAIKU,I as MODEL_CLAUDE_SONNET,T as MODEL_DEV,d as MODEL_DISPLAY_NAMES,p as MODEL_EMBEDDING_TEXT,M as MODEL_GEMINI_FLASH,D as MODEL_GEMINI_PRO,l as MODEL_GPT4_NANO,o as MODEL_GPT5_MINI,R as MODEL_GPT5_NANO,S as MODEL_MEMORY_INFERENCE,P as MODEL_SONAR_PRO,y as PLAN_BASIC,U as PLAN_PLUS,H as PLAN_PREMIUM,E as PROVIDER_ANTHROPIC,n as PROVIDER_MISTRAL,s as PROVIDER_PERPLEXITY,c as PROVIDER_ROLE_MAP,r as PROVIDER_SUMMARY,_ as ROLE_ASSISTANT,f as SORT_BY_TIMESTAMP,h as SORT_BY_TOKEN_USAGE,k as THEME_STANDARD,C as findProvider,x as getModelsGroupedByProvider,w as getProvidersFromModels,Y as hasMultipleModelsPerProvider,W as isEntitled,v as isEntitlementLoaded,B as isModelAllowedForPlan,F as toCapabilitySet,j as DEFAULT_PROVIDER,X as MODEL_GPT5,z as MODEL_SONAR,K as PROVIDER_GOOGLE,Z as PROVIDER_MEMORY,q as PROVIDER_OPENAI,J as ROLE_HIDDEN,Q as ROLE_INTERNAL,$ as ROLE_SYSTEM,ee as ROLE_USER,e_ as THEME_SUBTLE};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/sassysaint-common",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.16.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build:check": "tsc",
|
|
17
17
|
"build:common": "npm-run-all build",
|
|
18
|
-
"build:js": "
|
|
19
|
-
"build:types": "
|
|
20
|
-
"build": "npm-run-all --serial clean build:check build:js
|
|
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
21
|
"clean": "rimraf dist tmp",
|
|
22
22
|
"comments:fix": "comments \"src/**/*.ts*\" --merge-line-comments",
|
|
23
|
-
"dev:js": "
|
|
24
|
-
"dev:types": "
|
|
25
|
-
"dev": "
|
|
23
|
+
"dev:js": "rslib build --watch",
|
|
24
|
+
"dev:types": "echo 'Types now watched with rslib'",
|
|
25
|
+
"dev": "rslib build --watch",
|
|
26
26
|
"fix": "npm-run-all lint:fix comments:fix",
|
|
27
27
|
"lint": "biome lint src",
|
|
28
28
|
"lint:fix": "biome check src --write --no-errors-on-unmatched",
|
|
@@ -32,5 +32,9 @@
|
|
|
32
32
|
"test:watch": "vitest",
|
|
33
33
|
"watch": "npm-run-all dev"
|
|
34
34
|
},
|
|
35
|
-
"
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@microsoft/api-extractor": "7.54.0",
|
|
37
|
+
"@rslib/core": "0.17.1"
|
|
38
|
+
},
|
|
39
|
+
"gitHead": "fa0a42023398b3ba72c6a3c130e69496433af8fe"
|
|
36
40
|
}
|