@squidcloud/client 1.0.337 → 1.0.339

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.
Files changed (89) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +290 -62
  3. package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +9 -2
  4. package/dist/internal-common/src/public-types/ai-matchmaking.types.d.ts +6 -0
  5. package/dist/internal-common/src/public-types/backend.public-types.d.ts +13 -0
  6. package/dist/internal-common/src/public-types/communication.public-types.d.ts +7 -0
  7. package/dist/internal-common/src/public-types/context.public-types.d.ts +12 -1
  8. package/dist/internal-common/src/public-types/document.public-types.d.ts +42 -12
  9. package/dist/internal-common/src/public-types/extraction.public-types.d.ts +21 -0
  10. package/dist/internal-common/src/public-types/integration.public-types.d.ts +16 -2
  11. package/dist/internal-common/src/public-types/integrations/api.public-types.d.ts +0 -11
  12. package/dist/internal-common/src/public-types/query.public-types.d.ts +35 -7
  13. package/dist/internal-common/src/public-types/scheduler.public-types.d.ts +13 -4
  14. package/dist/internal-common/src/public-types/secret.public-types.d.ts +24 -7
  15. package/dist/internal-common/src/public-types/serialized-query.public-types.d.ts +12 -0
  16. package/dist/internal-common/src/public-types/typescript.public-types.d.ts +0 -3
  17. package/dist/typescript-client/src/admin-client.d.ts +1 -0
  18. package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +77 -2
  19. package/dist/typescript-client/src/agent/ai-agent-client.d.ts +1 -0
  20. package/dist/typescript-client/src/agent/ai-agent-client.types.d.ts +30 -0
  21. package/dist/typescript-client/src/ai-assistant-client.d.ts +3 -2
  22. package/dist/typescript-client/src/ai-audio-client.d.ts +15 -0
  23. package/dist/typescript-client/src/ai-client.d.ts +5 -0
  24. package/dist/typescript-client/src/ai-image-client.d.ts +16 -1
  25. package/dist/typescript-client/src/ai-matchmaking-client.d.ts +57 -11
  26. package/dist/typescript-client/src/ai.types.d.ts +68 -15
  27. package/dist/typescript-client/src/api-client.d.ts +1 -0
  28. package/dist/typescript-client/src/auth.manager.d.ts +6 -1
  29. package/dist/typescript-client/src/collection-reference.d.ts +4 -0
  30. package/dist/typescript-client/src/connection-details.d.ts +1 -0
  31. package/dist/typescript-client/src/data.manager.d.ts +1 -5
  32. package/dist/typescript-client/src/destruct.manager.d.ts +1 -17
  33. package/dist/typescript-client/src/distributed-lock.manager.d.ts +4 -1
  34. package/dist/typescript-client/src/document-reference.d.ts +1 -0
  35. package/dist/typescript-client/src/document-store.d.ts +1 -17
  36. package/dist/typescript-client/src/extraction-client.d.ts +1 -0
  37. package/dist/typescript-client/src/integration-client.d.ts +1 -0
  38. package/dist/typescript-client/src/observability-client.d.ts +5 -1
  39. package/dist/typescript-client/src/personal-storage-client.d.ts +23 -4
  40. package/dist/typescript-client/src/public-types.d.ts +1 -4
  41. package/dist/typescript-client/src/query/deserializer.d.ts +1 -0
  42. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +46 -8
  43. package/dist/typescript-client/src/query/pagination.d.ts +10 -10
  44. package/dist/typescript-client/src/query/query-builder.factory.d.ts +12 -4
  45. package/dist/typescript-client/src/query/query-subscription.manager.d.ts +1 -2
  46. package/dist/typescript-client/src/query/query.types.d.ts +8 -52
  47. package/dist/typescript-client/src/query/snapshot-emitter.d.ts +5 -0
  48. package/dist/typescript-client/src/query-utils.d.ts +5 -1
  49. package/dist/typescript-client/src/queue.manager.d.ts +5 -0
  50. package/dist/typescript-client/src/scheduler-client.d.ts +1 -0
  51. package/dist/typescript-client/src/secret.client.d.ts +2 -0
  52. package/dist/typescript-client/src/squid-http-client.d.ts +4 -0
  53. package/dist/typescript-client/src/squid.d.ts +16 -4
  54. package/dist/typescript-client/src/storage-client.d.ts +55 -4
  55. package/dist/typescript-client/src/types.d.ts +4 -1
  56. package/dist/typescript-client/src/version.d.ts +2 -1
  57. package/package.json +6 -2
  58. package/dist/internal-common/src/metric-name.d.ts +0 -9
  59. package/dist/internal-common/src/public-types/application.public-types.d.ts +0 -94
  60. package/dist/internal-common/src/public-types/bundle-data.public-types.d.ts +0 -33
  61. package/dist/internal-common/src/public-types/mutation.public-types.d.ts +0 -54
  62. package/dist/internal-common/src/public-types/storage.types.d.ts +0 -9
  63. package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +0 -21
  64. package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +0 -18
  65. package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +0 -127
  66. package/dist/internal-common/src/types/ai-agent.types.d.ts +0 -1
  67. package/dist/internal-common/src/types/ai-assistant.types.d.ts +0 -1
  68. package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +0 -53
  69. package/dist/internal-common/src/types/backend-function.types.d.ts +0 -1
  70. package/dist/internal-common/src/types/communication.types.d.ts +0 -1
  71. package/dist/internal-common/src/types/document.types.d.ts +0 -1
  72. package/dist/internal-common/src/types/mutation.types.d.ts +0 -1
  73. package/dist/internal-common/src/types/observability.types.d.ts +0 -71
  74. package/dist/internal-common/src/types/query.types.d.ts +0 -10
  75. package/dist/internal-common/src/types/secret.types.d.ts +0 -2
  76. package/dist/internal-common/src/types/socket.types.d.ts +0 -1
  77. package/dist/internal-common/src/types/time-units.d.ts +0 -1
  78. package/dist/internal-common/src/utils/array.d.ts +0 -1
  79. package/dist/internal-common/src/utils/e2e-test-utils.d.ts +0 -2
  80. package/dist/internal-common/src/utils/global.utils.d.ts +0 -1
  81. package/dist/internal-common/src/utils/http.d.ts +0 -1
  82. package/dist/internal-common/src/utils/lock.manager.d.ts +0 -14
  83. package/dist/internal-common/src/utils/metric-utils.d.ts +0 -4
  84. package/dist/internal-common/src/utils/metrics.types.d.ts +0 -7
  85. package/dist/internal-common/src/utils/object.d.ts +0 -49
  86. package/dist/internal-common/src/utils/serialization.d.ts +0 -5
  87. package/dist/internal-common/src/utils/squid.constants.d.ts +0 -1
  88. package/dist/internal-common/src/utils/validation.d.ts +0 -19
  89. package/dist/internal-common/src/websocket.impl.d.ts +0 -26
@@ -1,84 +1,205 @@
1
1
  import { AiAgentId, AiContextId, IntegrationId } from './communication.public-types';
2
2
  import { IntegrationType } from './integration.public-types';
3
- import { FunctionName, FunctionNameWithContext } from './bundle-data.public-types';
4
- /** The supported OpenAI models */
3
+ import { FunctionName, FunctionNameWithContext } from './backend.public-types';
4
+ /**
5
+ * The supported OpenAI models.
6
+ * @category AI
7
+ */
5
8
  export declare const OPENAI_O1_CHAT_MODEL_NAMES: readonly ["o1", "o1-mini"];
9
+ /**
10
+ * @category AI
11
+ */
6
12
  export declare const OPENAI_REASONING_CHAT_MODEL_NAMES: readonly ["o1", "o1-mini", "o3-mini"];
13
+ /**
14
+ * @category AI
15
+ */
7
16
  export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "o1", "o1-mini", "o3-mini"];
17
+ /**
18
+ * @category AI
19
+ */
8
20
  export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-1.5-pro", "gemini-2.0-flash"];
21
+ /**
22
+ * @category AI
23
+ */
9
24
  export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-3-5-haiku-latest", "claude-3-5-sonnet-latest"];
10
- /** The supported AI model names. */
25
+ /**
26
+ * The supported AI model names.
27
+ * @category AI
28
+ */
11
29
  export declare const AI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "o1", "o1-mini", "o3-mini", "claude-3-5-haiku-latest", "claude-3-5-sonnet-latest", "gemini-1.5-pro", "gemini-2.0-flash"];
30
+ /**
31
+ * @category AI
32
+ */
12
33
  export declare const OPENAI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small", "text-embedding-3-large", "text-embedding-ada-002"];
34
+ /**
35
+ * @category AI
36
+ */
13
37
  export declare const AI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small", "text-embedding-3-large", "text-embedding-ada-002"];
14
- /** The supported AI image generation model names. */
38
+ /**
39
+ * The supported AI image generation model names.
40
+ * @category AI
41
+ */
15
42
  export declare const OPENAI_IMAGE_MODEL_NAMES: readonly ["dall-e-3"];
43
+ /**
44
+ * @category AI
45
+ */
16
46
  export declare const OPENAI_AUDIO_TRANSCRIPTION_MODEL_NAMES: readonly ["whisper-1"];
47
+ /**
48
+ * @category AI
49
+ */
17
50
  export declare const OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES: readonly ["tts-1", "tts-1-hd"];
51
+ /**
52
+ * @category AI
53
+ */
18
54
  export declare const OPENAI_AUDIO_MODEL_NAMES: readonly ["whisper-1", "tts-1", "tts-1-hd"];
55
+ /**
56
+ * @category AI
57
+ */
19
58
  export declare const STABLE_DIFFUSION_MODEL_NAMES: readonly ["stable-diffusion-core"];
59
+ /**
60
+ * @category AI
61
+ */
20
62
  export declare const FLUX_MODEL_NAMES: readonly ["flux-pro-1.1"];
63
+ /**
64
+ * @category AI
65
+ */
21
66
  export declare const AI_IMAGE_MODEL_NAMES: readonly ["dall-e-3", "stable-diffusion-core", "flux-pro-1.1"];
67
+ /**
68
+ * @category AI
69
+ */
22
70
  export declare const AI_AUDIO_TRANSCRIPTION_MODEL_NAMES: readonly ["whisper-1"];
71
+ /**
72
+ * @category AI
73
+ */
23
74
  export declare const AI_AUDIO_CREATE_SPEECH_MODEL_NAMES: readonly ["tts-1", "tts-1-hd"];
75
+ /**
76
+ * @category AI
77
+ */
24
78
  export declare const OPEN_AI_CREATE_SPEECH_FORMATS: readonly ["mp3", "opus", "aac", "flac", "wav", "pcm"];
79
+ /**
80
+ * @category AI
81
+ */
25
82
  export type AiChatModelName = (typeof AI_CHAT_MODEL_NAMES)[number];
83
+ /**
84
+ * @category AI
85
+ */
26
86
  export type AiEmbeddingsModelName = (typeof AI_EMBEDDINGS_MODEL_NAMES)[number];
87
+ /**
88
+ * @category AI
89
+ */
27
90
  export type OpenAiChatModelName = (typeof OPENAI_CHAT_MODEL_NAMES)[number];
91
+ /**
92
+ * @category AI
93
+ */
28
94
  export type OpenAiReasoningChatModelName = (typeof OPENAI_REASONING_CHAT_MODEL_NAMES)[number];
95
+ /**
96
+ * @category AI
97
+ */
29
98
  export type GeminiChatModelName = (typeof GEMINI_CHAT_MODEL_NAMES)[number];
99
+ /**
100
+ * @category AI
101
+ */
30
102
  export type AnthropicChatModelName = (typeof ANTHROPIC_CHAT_MODEL_NAMES)[number];
103
+ /**
104
+ * @category AI
105
+ */
31
106
  export type AiImageModelName = (typeof AI_IMAGE_MODEL_NAMES)[number];
107
+ /**
108
+ * @category AI
109
+ */
32
110
  export type AiAudioTranscriptionModelName = (typeof AI_AUDIO_TRANSCRIPTION_MODEL_NAMES)[number];
111
+ /**
112
+ * @category AI
113
+ */
33
114
  export type AiAudioCreateSpeechModelName = (typeof OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES)[number];
115
+ /**
116
+ * @category AI
117
+ */
34
118
  export type AiAudioModelName = (typeof OPENAI_AUDIO_MODEL_NAMES)[number];
119
+ /**
120
+ * @category AI
121
+ */
35
122
  export type OpenAiImageModelName = (typeof OPENAI_IMAGE_MODEL_NAMES)[number];
123
+ /**
124
+ * @category AI
125
+ */
36
126
  export type OpenAiAudioTranscriptionModelName = (typeof OPENAI_AUDIO_TRANSCRIPTION_MODEL_NAMES)[number];
127
+ /**
128
+ * @category AI
129
+ */
37
130
  export type OpenAiAudioCreateSpeechModelName = (typeof OPENAI_AUDIO_CREATE_SPEECH_MODEL_NAMES)[number];
131
+ /**
132
+ * @category AI
133
+ */
38
134
  export type OpenAiCreateSpeechFormat = (typeof OPEN_AI_CREATE_SPEECH_FORMATS)[number];
135
+ /**
136
+ * @category AI
137
+ */
39
138
  export type StableDiffusionModelName = (typeof STABLE_DIFFUSION_MODEL_NAMES)[number];
139
+ /**
140
+ * @category AI
141
+ */
40
142
  export type FluxModelName = (typeof FLUX_MODEL_NAMES)[number];
143
+ /**
144
+ * @category AI
145
+ */
41
146
  export type AiGenerateImageOptions = DallEOptions | StableDiffusionCoreOptions | FluxOptions;
147
+ /**
148
+ * @category AI
149
+ */
42
150
  export type AiAudioTranscribeOptions = WhisperOptions;
151
+ /**
152
+ * @category AI
153
+ */
43
154
  export type AiAudioCreateSpeechOptions = OpenAiCreateSpeechOptions;
44
- export declare const VECTOR_DB_TYPES: readonly ["postgres"];
45
- export type VectorDbType = (typeof VECTOR_DB_TYPES)[number];
46
- export interface AiAudioCreateSpeechResponse {
47
- mimeType: string;
48
- extension: string;
49
- base64File: string;
50
- }
51
- export interface AiAudioCreateSpeechRequest {
52
- input: string;
53
- options: AiAudioCreateSpeechOptions;
54
- }
155
+ /**
156
+ * @category AI
157
+ */
55
158
  export interface BaseAiGenerateImageOptions {
56
159
  modelName: AiImageModelName;
57
160
  }
161
+ /**
162
+ * @category AI
163
+ */
58
164
  export interface BaseAiAudioTranscribeOptions {
59
165
  modelName: AiAudioTranscriptionModelName;
60
166
  }
167
+ /**
168
+ * @category AI
169
+ */
61
170
  export interface BaseAiAudioCreateSpeechOptions {
62
171
  modelName: AiAudioCreateSpeechModelName;
63
172
  }
173
+ /**
174
+ * @category AI
175
+ */
64
176
  export interface DallEOptions extends BaseAiGenerateImageOptions {
65
177
  modelName: 'dall-e-3';
66
178
  quality?: 'hd' | 'standard';
67
179
  size?: '1024x1024' | '1792x1024' | '1024x1792';
68
180
  numberOfImagesToGenerate?: 1;
69
181
  }
182
+ /**
183
+ * @category AI
184
+ */
70
185
  export interface WhisperOptions extends BaseAiAudioTranscribeOptions {
71
186
  modelName: 'whisper-1';
72
187
  responseFormat?: 'json' | 'text' | 'srt' | 'verbose_json' | 'vtt';
73
188
  temperature?: number;
74
189
  prompt?: string;
75
190
  }
191
+ /**
192
+ * @category AI
193
+ */
76
194
  export interface OpenAiCreateSpeechOptions extends BaseAiAudioCreateSpeechOptions {
77
195
  modelName: OpenAiAudioCreateSpeechModelName;
78
196
  voice?: 'alloy' | 'echo' | 'fable' | 'onyx' | 'nova' | 'shimmer';
79
197
  responseFormat?: OpenAiCreateSpeechFormat;
80
198
  speed?: number;
81
199
  }
200
+ /**
201
+ * @category AI
202
+ */
82
203
  export interface FluxOptions extends BaseAiGenerateImageOptions {
83
204
  modelName: 'flux-pro-1.1';
84
205
  /** Must be a multiple of 32. Min 256, max 1440 - default to 1024 */
@@ -92,6 +213,9 @@ export interface FluxOptions extends BaseAiGenerateImageOptions {
92
213
  /** 1 is most strict and 5 is most permissive */
93
214
  safety_tolerance?: number;
94
215
  }
216
+ /**
217
+ * @category AI
218
+ */
95
219
  export interface StableDiffusionCoreOptions extends BaseAiGenerateImageOptions {
96
220
  modelName: 'stable-diffusion-core';
97
221
  aspectRatio?: '16:9' | '1:1' | '21:9' | '2:3' | '3:2' | '4:5' | '5:4' | '9:16' | '9:21';
@@ -100,14 +224,29 @@ export interface StableDiffusionCoreOptions extends BaseAiGenerateImageOptions {
100
224
  stylePreset?: 'analog-film' | 'anime' | 'cinematic' | 'comic-book' | 'digital-art' | 'enhance' | 'fantasy-art' | 'isometric' | 'line-art' | 'low-poly' | 'modeling-compound' | 'neon-punk' | 'origami' | 'photographic' | 'pixel-art' | 'tile-texture';
101
225
  outputFormat?: 'jpeg' | 'png' | 'webp';
102
226
  }
103
- /** The possible sources for the LLM provider API key. */
227
+ /**
228
+ * The possible sources for the LLM provider API key.
229
+ * @category AI
230
+ */
104
231
  export type ApiKeySource = 'user' | 'system';
232
+ /**
233
+ * @category AI
234
+ */
105
235
  export type AiAgentResponseFormat = 'text' | 'json_object';
236
+ /**
237
+ * @category AI
238
+ */
106
239
  export type AiFileUrlType = 'image';
240
+ /**
241
+ * @category AI
242
+ */
107
243
  export interface AiFileUrl {
108
244
  type: AiFileUrlType;
109
245
  url: string;
110
246
  }
247
+ /**
248
+ * @category AI
249
+ */
111
250
  export interface AiConnectedIntegrationMetadata {
112
251
  integrationId: IntegrationId;
113
252
  /** Type of the connected integration. */
@@ -118,7 +257,15 @@ export interface AiConnectedIntegrationMetadata {
118
257
  * If not provided the default one is used.
119
258
  */
120
259
  description?: string;
260
+ /**
261
+ * Instructions for the connected integration agent.
262
+ * If not provided the default one is used.
263
+ */
264
+ instructions?: string;
121
265
  }
266
+ /**
267
+ * @category AI
268
+ */
122
269
  export interface AiConnectedAgentMetadata {
123
270
  agentId: AiAgentId;
124
271
  /**
@@ -127,7 +274,10 @@ export interface AiConnectedAgentMetadata {
127
274
  */
128
275
  description: string;
129
276
  }
130
- /** Quotas for a single AI chat prompt (`ask()` method call). */
277
+ /**
278
+ * Quotas for a single AI chat prompt (`ask()` method call).
279
+ * @category AI
280
+ */
131
281
  export interface AiChatPromptQuotas {
132
282
  /**
133
283
  * Maximum depth of AI call recursion allowed.
@@ -138,7 +288,11 @@ export interface AiChatPromptQuotas {
138
288
  */
139
289
  maxAiCallStackSize: number;
140
290
  }
141
- interface BaseAiAgentChatOptions {
291
+ /**
292
+ * The base AI agent chat options, should not be used directly.
293
+ * @category AI
294
+ */
295
+ export interface BaseAiAgentChatOptions {
142
296
  /** The maximum number of tokens to use when making the request to the AI model. Default to the max tokens the model can accept. */
143
297
  maxTokens?: number;
144
298
  /** A unique chat ID, if the same chat ID is used again and history is not disabled, it will continue the conversation. */
@@ -182,31 +336,66 @@ interface BaseAiAgentChatOptions {
182
336
  includeMetadata?: boolean;
183
337
  /** The temperature to use when sampling from the model. Default to 0.5. */
184
338
  temperature?: number;
339
+ /** Preset instruction options that can be toggled on */
340
+ guardrails?: GuardrailsOptions;
185
341
  model?: AiChatModelName;
186
342
  }
343
+ /**
344
+ * Each model-specific options interface now “anchors” the overrideModel property.
345
+ * @category AI
346
+ */
187
347
  export interface GeminiChatOptions extends BaseAiAgentChatOptions {
188
348
  model?: GeminiChatModelName;
189
349
  groundingWithWebSearch?: boolean;
190
350
  }
351
+ /**
352
+ * @category AI
353
+ */
191
354
  export interface OpenAiChatOptions extends BaseAiAgentChatOptions {
192
355
  model?: OpenAiChatModelName;
193
356
  fileUrls?: Array<AiFileUrl>;
194
357
  }
358
+ /**
359
+ * @category AI
360
+ */
195
361
  export type OpenAiReasoningEffort = 'low' | 'medium' | 'high';
362
+ /**
363
+ * @category AI
364
+ */
196
365
  export interface OpenAiReasoningChatOptions extends OpenAiChatOptions {
197
366
  model?: OpenAiReasoningChatModelName;
198
367
  reasoningEffort?: OpenAiReasoningEffort;
199
368
  }
369
+ /**
370
+ * @category AI
371
+ */
200
372
  export interface AnthropicChatOptions extends BaseAiAgentChatOptions {
201
373
  model?: AnthropicChatModelName;
202
374
  }
375
+ /**
376
+ * @category AI
377
+ */
203
378
  export type AiSessionOptions = Partial<{
204
379
  traceId: string;
205
380
  clientId: string;
206
381
  agentId: string;
207
382
  }>;
383
+ /**
384
+ * The generic options type. When no generic is provided,
385
+ * the type is inferred from the provided overrideModel (or falls back to BaseAiAgentChatOptions).
386
+ * @category AI
387
+ */
208
388
  export type AiAgentChatOptions<T extends AiChatModelName | undefined = undefined> = T extends undefined ? BaseAiAgentChatOptions | GeminiChatOptions | OpenAiReasoningChatOptions | OpenAiChatOptions | AnthropicChatOptions : T extends GeminiChatModelName ? GeminiChatOptions : T extends OpenAiReasoningChatModelName ? OpenAiReasoningChatOptions : T extends OpenAiChatModelName ? OpenAiChatOptions : T extends AnthropicChatModelName ? AnthropicChatOptions : never;
209
- /** A definition of an AI agent. */
389
+ /**
390
+ * @category AI
391
+ */
392
+ export type AllAiAgentChatOptions = {
393
+ [K in keyof BaseAiAgentChatOptions | keyof GeminiChatOptions | keyof OpenAiReasoningChatOptions | keyof OpenAiChatOptions | keyof AnthropicChatOptions]?: (K extends keyof BaseAiAgentChatOptions ? BaseAiAgentChatOptions[K] : never) | (K extends keyof GeminiChatOptions ? GeminiChatOptions[K] : never) | (K extends keyof OpenAiReasoningChatOptions ? OpenAiReasoningChatOptions[K] : never) | (K extends keyof OpenAiChatOptions ? OpenAiChatOptions[K] : never) | (K extends keyof AnthropicChatOptions ? AnthropicChatOptions[K] : never);
394
+ };
395
+ /**
396
+ * A definition of an AI agent.
397
+ * @category AI
398
+ */
210
399
  export interface AiAgent<T extends AiChatModelName | undefined = undefined> {
211
400
  id: AiAgentId;
212
401
  createdAt: Date;
@@ -217,39 +406,32 @@ export interface AiAgent<T extends AiChatModelName | undefined = undefined> {
217
406
  /** The default options of the agent - can be overridden by the user when using the agent. */
218
407
  options: AiAgentChatOptions<T>;
219
408
  }
409
+ /**
410
+ * @category AI
411
+ */
220
412
  export type UpsertAgentRequest = Omit<AiAgent, 'createdAt' | 'updatedAt' | 'options'> & {
221
413
  options?: AiAgentChatOptions;
222
414
  };
415
+ /**
416
+ * @category AI
417
+ */
223
418
  export interface AiObserveStatusOptions {
224
419
  /** A unique chat ID for the conversation. */
225
420
  chatId?: string;
226
421
  }
422
+ /**
423
+ * @category AI
424
+ */
227
425
  export interface AiStatusMessage {
228
426
  agentId: string;
229
427
  chatId?: string;
230
428
  title: string;
231
429
  tags?: Record<string, any>;
232
430
  }
233
- export interface AiAskResponse {
234
- responseString: string;
235
- }
236
- export interface AiTranscribeAndAskResponse {
237
- responseString: string;
238
- transcribedPrompt: string;
239
- }
240
- export interface AiAskWithVoiceResponse {
241
- responseString: string;
242
- voiceResponse: AiAudioCreateSpeechResponse;
243
- }
244
- export interface AiTranscribeAndAskWithVoiceResponse {
245
- transcribedPrompt: string;
246
- responseString: string;
247
- voiceResponse: AiAudioCreateSpeechResponse;
248
- }
249
- export interface AiTranscribeAndChatResponse {
250
- transcribedPrompt: string;
251
- }
252
- /** The options for the AI agent search method. */
431
+ /**
432
+ * The options for the AI agent search method.
433
+ * @category AI
434
+ */
253
435
  export interface AiSearchOptions {
254
436
  /** The prompt to search for */
255
437
  prompt: string;
@@ -258,26 +440,17 @@ export interface AiSearchOptions {
258
440
  /** The maximum number of results to return */
259
441
  limit?: number;
260
442
  }
261
- export interface AiSearchRequest {
262
- options: AiSearchOptions;
263
- agentId: AiAgentId;
264
- }
265
- export interface AiSearchResponse {
266
- chunks: Array<AiSearchResultChunk>;
267
- }
443
+ /**
444
+ * @category AI
445
+ */
268
446
  export interface AiSearchResultChunk {
269
447
  data: string;
270
448
  metadata?: AiContextMetadata;
271
449
  score: number;
272
450
  }
273
451
  /**
274
- * Provides context to the security rules of an AI Agent for each new user prompt.
275
- * Refer to the `@secureAiAgent` annotation for more details.
452
+ * @category AI
276
453
  */
277
- export declare class SecureAiAgentContext {
278
- readonly prompt?: string;
279
- readonly agentId: AiAgentId;
280
- }
281
454
  export interface AiAgentContext {
282
455
  id: AiContextId;
283
456
  createdAt: Date;
@@ -290,18 +463,30 @@ export interface AiAgentContext {
290
463
  sizeBytes: number;
291
464
  metadata: AiContextMetadata;
292
465
  }
466
+ /**
467
+ * @category AI
468
+ */
293
469
  export type AgentContextRequest = TextContextRequest | FileContextRequest;
294
- export interface BaseContextRequest {
470
+ interface BaseContextRequest {
295
471
  contextId: string;
296
472
  type: AiContextType;
297
473
  metadata?: AiContextMetadata;
298
474
  }
475
+ /**
476
+ * @category AI
477
+ */
299
478
  export type AiContextType = 'text' | 'file';
479
+ /**
480
+ * @category AI
481
+ */
300
482
  export interface TextContextRequest extends BaseContextRequest {
301
483
  type: 'text';
302
484
  title: string;
303
485
  text: string;
304
486
  }
487
+ /**
488
+ * @category AI
489
+ */
305
490
  export interface FileContextRequest extends BaseContextRequest {
306
491
  type: 'file';
307
492
  extractImages?: boolean;
@@ -311,45 +496,88 @@ export interface FileContextRequest extends BaseContextRequest {
311
496
  extractionModel?: AiChatModelName;
312
497
  password?: string;
313
498
  }
499
+ /**
500
+ * @category AI
501
+ */
314
502
  export type AiContextMetadataValue = number | string | boolean | undefined;
503
+ /**
504
+ * @category AI
505
+ */
315
506
  export type AiContextMetadataValueArray = AiContextMetadataValue[];
316
- export interface AiContextMetadataEqFilter {
507
+ interface AiContextMetadataEqFilter {
317
508
  $eq: AiContextMetadataValue;
318
509
  }
319
- export interface AiContextMetadataNeFilter {
510
+ interface AiContextMetadataNeFilter {
320
511
  $ne: AiContextMetadataValue;
321
512
  }
322
- export interface AiContextMetadataGtFilter {
513
+ interface AiContextMetadataGtFilter {
323
514
  $gt: number;
324
515
  }
325
- export interface AiContextMetadataGteFilter {
516
+ interface AiContextMetadataGteFilter {
326
517
  $gte: number;
327
518
  }
328
- export interface AiContextMetadataLtFilter {
519
+ interface AiContextMetadataLtFilter {
329
520
  $lt: number;
330
521
  }
331
- export interface AiContextMetadataLteFilter {
522
+ interface AiContextMetadataLteFilter {
332
523
  $lte: number;
333
524
  }
334
- export interface AiContextMetadataInFilter {
525
+ interface AiContextMetadataInFilter {
335
526
  $in: AiContextMetadataValueArray;
336
527
  }
337
- export interface AiContextMetadataNinFilter {
528
+ interface AiContextMetadataNinFilter {
338
529
  $nin: AiContextMetadataValueArray;
339
530
  }
340
- export interface AiContextMetadataExistsFilter {
531
+ interface AiContextMetadataExistsFilter {
341
532
  $exists: boolean;
342
533
  }
534
+ /**
535
+ * @category AI
536
+ */
343
537
  export type AiContextMetadataSimpleFilter = AiContextMetadataEqFilter | AiContextMetadataNeFilter | AiContextMetadataGtFilter | AiContextMetadataGteFilter | AiContextMetadataLtFilter | AiContextMetadataLteFilter | AiContextMetadataInFilter | AiContextMetadataNinFilter | AiContextMetadataExistsFilter;
538
+ /**
539
+ * @category AI
540
+ */
344
541
  export interface AiContextMetadataFieldFilter {
345
542
  [field: string]: AiContextMetadataSimpleFilter | AiContextMetadataValue;
346
543
  }
544
+ /**
545
+ * @category AI
546
+ */
347
547
  export interface AiContextMetadataAndFilter {
348
548
  $and: AiContextMetadataFilter[];
349
549
  }
550
+ /**
551
+ * @category AI
552
+ */
350
553
  export interface AiContextMetadataOrFilter {
351
554
  $or: AiContextMetadataFilter[];
352
555
  }
556
+ /**
557
+ * @category AI
558
+ */
353
559
  export type AiContextMetadataFilter = AiContextMetadataFieldFilter | AiContextMetadataAndFilter | AiContextMetadataOrFilter;
560
+ /**
561
+ * @category AI
562
+ */
354
563
  export type AiContextMetadata = Record<string, AiContextMetadataValue>;
564
+ /**
565
+ * @category AI
566
+ */
567
+ export type GuardrailKeysType = 'disableProfanity' | 'offTopicAnswers' | 'professionalTone' | 'disablePii';
568
+ /**
569
+ * @category AI
570
+ */
571
+ export type GuardrailsOptions = {
572
+ [k in GuardrailKeysType]?: boolean;
573
+ } & {
574
+ custom?: string;
575
+ };
576
+ /**
577
+ * @category AI
578
+ */
579
+ export interface AiTranscribeAndAskResponse {
580
+ responseString: string;
581
+ transcribedPrompt: string;
582
+ }
355
583
  export {};
@@ -1,7 +1,14 @@
1
1
  import { OpenAiChatModelName, OpenAiReasoningEffort, AiAgentResponseFormat } from './ai-agent.public-types';
2
- import { FunctionName } from './bundle-data.public-types';
2
+ import { FunctionName } from './backend.public-types';
3
+ /**
4
+ * The type of assistant tool.
5
+ * @category AI
6
+ */
3
7
  export type AssistantToolType = 'code_interpreter' | 'file_search';
4
- /** The options for the AI assistant. */
8
+ /**
9
+ * The options for the AI assistant.
10
+ * @category AI
11
+ */
5
12
  export interface QueryAssistantOptions {
6
13
  /** Extra context passed to all AI functions. */
7
14
  agentContext?: Record<string, unknown>;
@@ -2,6 +2,7 @@ import { AiContextMetadata, AiContextMetadataFilter } from './ai-agent.public-ty
2
2
  /**
3
3
  * Represents a category in the matchmaker.
4
4
  * The description is used by the AI to extract features from the content.
5
+ * @category AI
5
6
  */
6
7
  export interface MmCategory {
7
8
  id: string;
@@ -10,6 +11,7 @@ export interface MmCategory {
10
11
  /**
11
12
  * Represents a matchmaker entity for a given category.
12
13
  * The metadata is used to filter the entities when finding matches.
14
+ * @category AI
13
15
  */
14
16
  export interface MmEntity {
15
17
  id: string;
@@ -22,6 +24,7 @@ export interface MmEntity {
22
24
  * The description is used to describe the matchmaker and by the AI to better understand the domain.
23
25
  * The categories represent the types of entities that can be matched (it is possible to match items in the same
24
26
  * category).
27
+ * @category AI
25
28
  */
26
29
  export interface MmMatchMaker {
27
30
  id: string;
@@ -34,6 +37,7 @@ export interface MmMatchMaker {
34
37
  }
35
38
  /**
36
39
  * Represents a matchmaker entity match. A high score indicates a good match.
40
+ * @category AI
37
41
  */
38
42
  export interface MmEntityMatch extends MmEntity {
39
43
  /** The score of the match between 0 and 100 - 100 represents best match. */
@@ -42,6 +46,7 @@ export interface MmEntityMatch extends MmEntity {
42
46
  }
43
47
  /**
44
48
  * Represents options for finding matches.
49
+ * @category AI
45
50
  */
46
51
  export interface MmFindMatchesOptions {
47
52
  /** Metadata filter conditions - defaults to none */
@@ -56,6 +61,7 @@ export interface MmFindMatchesOptions {
56
61
  }
57
62
  /**
58
63
  * Represents options for listing entities.
64
+ * @category AI
59
65
  */
60
66
  export interface MmListEntitiesOptions {
61
67
  /** Metadata filter conditions - defaults to none */
@@ -0,0 +1,13 @@
1
+ /** Backend related public types that should be available on the client SDK */
2
+ /**
3
+ * @category Queue
4
+ */
5
+ export type TopicName = string;
6
+ export type ServiceName = string;
7
+ export type FunctionName = string;
8
+ /** Function name with the contextual data. The data must be a serializable JSON. */
9
+ export interface FunctionNameWithContext {
10
+ name: FunctionName;
11
+ context: Record<string, unknown>;
12
+ }
13
+ export type ServiceFunctionName = `${ServiceName}:${FunctionName}`;
@@ -10,5 +10,12 @@ export type SquidDocId = string;
10
10
  export type ClientRequestId = string;
11
11
  /** ID of AI agent. Also known as AI profile id. */
12
12
  export type AiAgentId = string;
13
+ /**
14
+ * The built-in agent id. Cannot be customized.
15
+ * @category AI
16
+ */
13
17
  export declare const BUILT_IN_AGENT_ID = "built_in_agent";
18
+ /**
19
+ * @category AI
20
+ */
14
21
  export type AiContextId = string;