@squidcloud/twilio-client 1.0.493

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.
@@ -0,0 +1,298 @@
1
+ import { UserAiChatModelName } from './backend.public-types';
2
+ /**
3
+ * @category AI
4
+ */
5
+ export declare const RERANK_PROVIDERS: readonly ["cohere", "voyage", "none"];
6
+ /**
7
+ * @category AI
8
+ */
9
+ export type AiRerankProvider = (typeof RERANK_PROVIDERS)[number];
10
+ /** List of available AI provider types. See AiProviderType. */
11
+ export declare const AI_PROVIDER_TYPES: readonly ["anthropic", "bedrock", "claude-code", "codex", "cohere", "flux", "gemini", "openai", "openai-compatible", "grok", "stability", "voyage", "mistral", "textract", "azure_document_intelligence", "vertex", "external"];
12
+ /**
13
+ * Type of the AI provider.
14
+ * References a single AI service, regardless of the model or other AI function it provides (like
15
+ * chat/search/transcribe etc...).
16
+ */
17
+ export type AiProviderType = (typeof AI_PROVIDER_TYPES)[number];
18
+ /**
19
+ * Canonical reasoning-effort levels, ordered from least to most effort.
20
+ * @category AI
21
+ */
22
+ export type CanonicalReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
23
+ /**
24
+ * The AI providers that support file upload operations, and so are the only ones that resolve a
25
+ * pre-uploaded file id. Declared as the list, with the type derived from it, so the two cannot drift:
26
+ * a provider added to one is added to both.
27
+ */
28
+ export declare const AI_FILE_PROVIDER_TYPES: readonly ["openai", "gemini", "anthropic", "grok"];
29
+ /**
30
+ * Type of AI provider that supports file upload operations.
31
+ * Only a subset of AI providers support file management features.
32
+ */
33
+ export type AiFileProviderType = (typeof AI_FILE_PROVIDER_TYPES)[number];
34
+ /**
35
+ * True when the provider resolves pre-uploaded file ids. Every other provider — the integration-backed
36
+ * and user-defined ones, which report no vendor identity of their own — ignores `fileIds` outright, so
37
+ * for them the ids are inert rather than wrong.
38
+ */
39
+ export declare function isFileCapableProviderType(type: AiProviderType): type is AiFileProviderType;
40
+ /**
41
+ * Public OpenAI chat model names (active models only).
42
+ * @category AI
43
+ */
44
+ export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-astra"];
45
+ /**
46
+ * Public Gemini chat model names (active models only).
47
+ * @category AI
48
+ */
49
+ export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-3.1-pro", "gemini-3.8-flash", "gemini-3.5-flash-lite"];
50
+ /**
51
+ * Public Grok chat model names (active models only).
52
+ * @category AI
53
+ */
54
+ export declare const GROK_CHAT_MODEL_NAMES: readonly ["grok-4.6", "grok-4-1-fast-reasoning", "grok-4-1-fast-non-reasoning"];
55
+ /**
56
+ * Public Anthropic chat model names (active models only).
57
+ * @category AI
58
+ */
59
+ export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-fable-5", "claude-fable-5-1", "claude-haiku-4-5-20251001", "claude-opus-5", "claude-sonnet-5"];
60
+ /**
61
+ * The supported AI model names.
62
+ * @category AI
63
+ */
64
+ export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-astra", "claude-fable-5", "claude-fable-5-1", "claude-haiku-4-5-20251001", "claude-opus-5", "claude-sonnet-5", "gemini-3.1-pro", "gemini-3.8-flash", "gemini-3.5-flash-lite", "grok-4.6", "grok-4-1-fast-reasoning", "grok-4-1-fast-non-reasoning"];
65
+ /** Checks if the given model name is a global AI chat model name. */
66
+ export declare function isVendorAiChatModelName(modelName: unknown): modelName is VendorAiChatModelName;
67
+ /**
68
+ * @category AI
69
+ */
70
+ export declare const OPENAI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small"];
71
+ /**
72
+ * @category AI
73
+ */
74
+ export declare const VOYAGE_EMBEDDING_MODEL_NAMES: readonly ["voyage-3-large", "voyage-4-large", "voyage-4"];
75
+ /**
76
+ * @category AI
77
+ */
78
+ export declare const BEDROCK_EMBEDDING_MODEL_NAMES: readonly ["titan-embed-text-v2"];
79
+ /**
80
+ * @category AI
81
+ */
82
+ export declare const AI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small", "voyage-3-large", "voyage-4-large", "voyage-4", "titan-embed-text-v2"];
83
+ /**
84
+ * Checks if the given model name is a valid AI embeddings model name.
85
+ * @category AI
86
+ */
87
+ export declare function isAiEmbeddingsModelName(modelName: unknown): modelName is AiEmbeddingsModelName;
88
+ /**
89
+ * Represents an embedding model provided by an OpenAI-compatible integration.
90
+ * Unlike chat's `IntegrationModelSpec`, this includes `dimensions` because the same
91
+ * embedding model can be configured with different output dimensions.
92
+ * @category AI
93
+ */
94
+ export interface IntegrationEmbeddingModelSpec {
95
+ /** The ID of the integration providing the embedding model. */
96
+ integrationId: string;
97
+ /** The model name as recognized by the provider. */
98
+ model: string;
99
+ /** The number of dimensions in the embedding vector output. */
100
+ dimensions: number;
101
+ }
102
+ /**
103
+ * Type guard for `IntegrationEmbeddingModelSpec`.
104
+ * @category AI
105
+ */
106
+ export declare function isIntegrationEmbeddingModelSpec(model: unknown): model is IntegrationEmbeddingModelSpec;
107
+ /**
108
+ * Type for specifying which embedding model to use.
109
+ * Can be either a vendor model name (string) or an integration-based embedding model (object).
110
+ * @category AI
111
+ */
112
+ export type AiEmbeddingsModelSelection = AiEmbeddingsModelName | IntegrationEmbeddingModelSpec;
113
+ /**
114
+ * The supported AI image generation model names.
115
+ * @category AI
116
+ */
117
+ export declare const OPENAI_IMAGE_MODEL_NAMES: readonly ["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5", "gpt-image-2", "gpt-image-2-2026-04-21", "chatgpt-image-latest"];
118
+ /**
119
+ * @category AI
120
+ */
121
+ export declare const OPENAI_AUDIO_TRANSCRIPTION_MODEL_NAMES: readonly ["whisper-1", "gpt-4o-transcribe", "gpt-4o-mini-transcribe"];
122
+ /**
123
+ * @category AI
124
+ */
125
+ export declare const OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES: readonly ["tts-1", "tts-1-hd", "gpt-4o-mini-tts"];
126
+ /**
127
+ * @category AI
128
+ */
129
+ export declare const OPENAI_AUDIO_MODEL_NAMES: readonly ["whisper-1", "gpt-4o-transcribe", "gpt-4o-mini-transcribe", "tts-1", "tts-1-hd", "gpt-4o-mini-tts"];
130
+ /**
131
+ * @category AI
132
+ */
133
+ export declare const STABLE_DIFFUSION_MODEL_NAMES: readonly ["stable-diffusion-core"];
134
+ /**
135
+ * @category AI
136
+ */
137
+ export declare const FLUX_MODEL_NAMES: readonly ["flux-pro-1.1", "flux-kontext-pro"];
138
+ /**
139
+ * @category AI
140
+ */
141
+ export declare const AI_IMAGE_MODEL_NAMES: readonly ["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5", "gpt-image-2", "gpt-image-2-2026-04-21", "chatgpt-image-latest", "stable-diffusion-core", "flux-pro-1.1", "flux-kontext-pro"];
142
+ /**
143
+ * @category AI
144
+ */
145
+ export declare const AI_AUDIO_TRANSCRIPTION_MODEL_NAMES: readonly ["whisper-1", "gpt-4o-transcribe", "gpt-4o-mini-transcribe"];
146
+ /**
147
+ * @category AI
148
+ */
149
+ export declare const AI_AUDIO_CREATE_SPEECH_MODEL_NAMES: readonly ["tts-1", "tts-1-hd", "gpt-4o-mini-tts"];
150
+ /**
151
+ * @category AI
152
+ */
153
+ export declare const OPEN_AI_CREATE_SPEECH_FORMATS: readonly ["mp3", "opus", "aac", "flac", "wav", "pcm"];
154
+ /**
155
+ * @category AI
156
+ */
157
+ export type VendorAiChatModelName = (typeof VENDOR_AI_CHAT_MODEL_NAMES)[number];
158
+ /**
159
+ * @category AI
160
+ */
161
+ export type AiChatModelName = VendorAiChatModelName | UserAiChatModelName;
162
+ /**
163
+ * @category AI
164
+ */
165
+ export type AiEmbeddingsModelName = (typeof AI_EMBEDDINGS_MODEL_NAMES)[number];
166
+ /**
167
+ * @category AI
168
+ */
169
+ export type AiVoyageEmbeddingsModelName = (typeof VOYAGE_EMBEDDING_MODEL_NAMES)[number];
170
+ /**
171
+ * @category AI
172
+ */
173
+ export type OpenAiChatModelName = (typeof OPENAI_CHAT_MODEL_NAMES)[number];
174
+ /**
175
+ * @category AI
176
+ */
177
+ export type GeminiChatModelName = (typeof GEMINI_CHAT_MODEL_NAMES)[number];
178
+ /**
179
+ * @category AI
180
+ */
181
+ export type GrokChatModelName = (typeof GROK_CHAT_MODEL_NAMES)[number];
182
+ /**
183
+ * @category AI
184
+ */
185
+ export type AnthropicChatModelName = (typeof ANTHROPIC_CHAT_MODEL_NAMES)[number];
186
+ /**
187
+ * @category AI
188
+ */
189
+ export type AiImageModelName = (typeof AI_IMAGE_MODEL_NAMES)[number];
190
+ /**
191
+ * @category AI
192
+ */
193
+ export type AiAudioTranscriptionModelName = (typeof AI_AUDIO_TRANSCRIPTION_MODEL_NAMES)[number];
194
+ /**
195
+ * @category AI
196
+ */
197
+ export type AiAudioCreateSpeechModelName = (typeof OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES)[number];
198
+ /**
199
+ * @category AI
200
+ */
201
+ export type AiAudioModelName = (typeof OPENAI_AUDIO_MODEL_NAMES)[number];
202
+ /**
203
+ * @category AI
204
+ */
205
+ export type OpenAiImageModelName = (typeof OPENAI_IMAGE_MODEL_NAMES)[number];
206
+ /**
207
+ * @category AI
208
+ */
209
+ export type OpenAiAudioTranscriptionModelName = (typeof OPENAI_AUDIO_TRANSCRIPTION_MODEL_NAMES)[number];
210
+ /**
211
+ * @category AI
212
+ */
213
+ export type OpenAiAudioCreateSpeechModelName = (typeof OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES)[number];
214
+ /**
215
+ * @category AI
216
+ */
217
+ export type OpenAiCreateSpeechFormat = (typeof OPEN_AI_CREATE_SPEECH_FORMATS)[number];
218
+ /**
219
+ * @category AI
220
+ */
221
+ export type StableDiffusionModelName = (typeof STABLE_DIFFUSION_MODEL_NAMES)[number];
222
+ /**
223
+ * @category AI
224
+ */
225
+ export type FluxModelName = (typeof FLUX_MODEL_NAMES)[number];
226
+ /**
227
+ * Where a chat model offered to an app comes from. See {@link ModelIdSpec.source}.
228
+ * @category AI
229
+ */
230
+ export declare const AI_MODEL_SOURCES: readonly ["vendor", "connector", "custom"];
231
+ /**
232
+ * @category AI
233
+ */
234
+ export type AiModelSource = (typeof AI_MODEL_SOURCES)[number];
235
+ /** Represents an AI model. */
236
+ export interface ModelIdSpec {
237
+ /** The model ID used for API calls. */
238
+ modelId: AiChatModelName;
239
+ /** The provider serving this model when Squid can determine it from the model registry. */
240
+ providerType?: AiProviderType;
241
+ /** Canonical reasoning-effort levels accepted natively by this model. */
242
+ reasoningEfforts?: CanonicalReasoningEffort[];
243
+ /** The integration ID if this model comes from an integration (OpenAI-compatible, Bedrock). Is undefined for Squid-provided models. */
244
+ integrationId?: string;
245
+ /** Human-readable display name for the model (e.g. "GPT-4o"). */
246
+ displayName?: string;
247
+ /** Short human-readable description of the model. Undefined for custom integration models. */
248
+ description?: string;
249
+ /**
250
+ * Set only for deprecated models: the active model that calls to this model are routed to.
251
+ * Undefined for active models.
252
+ */
253
+ replacedBy?: AiChatModelName;
254
+ /**
255
+ * Where the model comes from. Always set on `listChatModels()` results:
256
+ * - 'vendor': a Squid-provided model from the vendor model registry.
257
+ * - 'connector': provided by an integration configured on the app (OpenAI-compatible, Bedrock, Vertex).
258
+ * - 'custom': a user-added model from the app's bundle (e.g. CLI agent models like Claude Code or Codex).
259
+ */
260
+ source?: AiModelSource;
261
+ }
262
+ /**
263
+ * An embedding model a new knowledge base can be created on. `modelId` alone is not an identity: an
264
+ * integration can serve the same model name as a vendor, so `(modelId, integrationId)` is.
265
+ * @category AI
266
+ */
267
+ export interface EmbeddingModelIdSpec {
268
+ /** The embedding model ID used for API calls. */
269
+ modelId: string;
270
+ /** The integration ID if this model comes from an integration. Undefined for Squid-provided models. */
271
+ integrationId?: string;
272
+ /** The embedding dimensions, present for integration-based models. */
273
+ dimensions?: number;
274
+ /** Human-readable display name for the model. */
275
+ displayName: string;
276
+ /** Where the model comes from: 'vendor' (Squid-provided) or 'connector' (an integration configured on the app). */
277
+ source: AiModelSource;
278
+ /**
279
+ * Set only on a deprecated vendor model, which is listed on request: the model a new knowledge base
280
+ * asking for this one is created on. Undefined for active models.
281
+ */
282
+ replacedBy?: AiEmbeddingsModelName;
283
+ /** True on exactly one entry of a non-empty list: the model to create on when the caller has no preference. */
284
+ isDefault?: boolean;
285
+ }
286
+ /**
287
+ * The `embeddingModel` a knowledge base is created with for a listed model.
288
+ * @category AI
289
+ */
290
+ export declare function embeddingModelSelectionOf(model: EmbeddingModelIdSpec): AiEmbeddingsModelSelection;
291
+ /**
292
+ * Type guard to check if a model selection is integration-based.
293
+ * @category AI
294
+ */
295
+ export declare function isIntegrationModelSpec(model: unknown): model is {
296
+ integrationId: string;
297
+ model: string;
298
+ };