@squidcloud/client 1.0.420 → 1.0.421
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/cjs/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/internal-common/src/public-types/ai-agent-integrations.public-types.d.ts +16 -0
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +133 -1
- package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +7 -2
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +3 -3
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +42 -0
- package/dist/internal-common/src/public-types/ai-matchmaking.public-types.d.ts +112 -0
- package/dist/internal-common/src/public-utils/id-utils.d.ts +3 -1
- package/dist/typescript-client/src/ai-client.d.ts +2 -2
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/internal-common/src/metric-name.d.ts +0 -9
- package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +0 -30
- package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +0 -148
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +0 -72
- package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +0 -177
- package/dist/internal-common/src/types/ai-agent.types.d.ts +0 -199
- package/dist/internal-common/src/types/ai-assistant.types.d.ts +0 -1
- package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +0 -202
- package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +0 -59
- package/dist/internal-common/src/types/backend-function.types.d.ts +0 -1
- package/dist/internal-common/src/types/communication.types.d.ts +0 -1
- package/dist/internal-common/src/types/document.types.d.ts +0 -1
- package/dist/internal-common/src/types/file.types.d.ts +0 -6
- package/dist/internal-common/src/types/headers.types.d.ts +0 -17
- package/dist/internal-common/src/types/mutation.types.d.ts +0 -1
- package/dist/internal-common/src/types/notification.types.d.ts +0 -5
- package/dist/internal-common/src/types/observability.types.d.ts +0 -78
- package/dist/internal-common/src/types/query.types.d.ts +0 -13
- package/dist/internal-common/src/types/secret.types.d.ts +0 -7
- package/dist/internal-common/src/types/socket.types.d.ts +0 -1
- package/dist/internal-common/src/types/stage.d.ts +0 -9
- package/dist/internal-common/src/types/time-units.d.ts +0 -1
- package/dist/internal-common/src/types/url-shortener.types.d.ts +0 -41
- package/dist/internal-common/src/utils/array.d.ts +0 -7
- package/dist/internal-common/src/utils/e2e-test-utils.d.ts +0 -2
- package/dist/internal-common/src/utils/global.utils.d.ts +0 -1
- package/dist/internal-common/src/utils/http.d.ts +0 -5
- package/dist/internal-common/src/utils/lock.manager.d.ts +0 -14
- package/dist/internal-common/src/utils/metric-utils.d.ts +0 -4
- package/dist/internal-common/src/utils/metrics.types.d.ts +0 -7
- package/dist/internal-common/src/utils/object.d.ts +0 -58
- package/dist/internal-common/src/utils/serialization.d.ts +0 -17
- package/dist/internal-common/src/utils/squid.constants.d.ts +0 -1
- package/dist/internal-common/src/utils/trace-id-generator.d.ts +0 -1
- package/dist/internal-common/src/utils/validation.d.ts +0 -19
- package/dist/internal-common/src/websocket.impl.d.ts +0 -26
|
@@ -17,3 +17,19 @@ export interface AiAgentDatabaseIntegrationOptions {
|
|
|
17
17
|
/** If provided, this agent will be used to generate the query. */
|
|
18
18
|
generateQueryAgentId?: AiAgentId;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Configuration options for AI agent API integration.
|
|
22
|
+
*/
|
|
23
|
+
export interface AiAgentApiIntegrationOptions {
|
|
24
|
+
/**
|
|
25
|
+
* A list of API operation IDs (endpoint IDs) that the AI agent can call.
|
|
26
|
+
*
|
|
27
|
+
* When this list is not provided (i.e., it is `undefined`) or is empty,
|
|
28
|
+
* the AI agent has access to all operations.
|
|
29
|
+
*/
|
|
30
|
+
operationsToUse?: string[];
|
|
31
|
+
/** If true, provides more detailed status updates during API call execution. Default: false. */
|
|
32
|
+
verboseStatusUpdates?: boolean;
|
|
33
|
+
/** If provided, this agent will be used to generate API calls. */
|
|
34
|
+
generateApiCallAgentId?: AiAgentId;
|
|
35
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JSONSchema } from 'json-schema-typed';
|
|
1
2
|
import { AiAudioCreateSpeechModelName, AiAudioTranscriptionModelName, AiChatModelName, AiEmbeddingsModelName, AiImageModelName, AiProviderType, AiRerankProvider, AnthropicChatModelName, GeminiChatModelName, GrokChatModelName, OpenAiAudioCreateSpeechModelName, OpenAiAudioTranscriptionModelName, OpenAiChatModelName, OpenAiCreateSpeechFormat } from './ai-common.public-types';
|
|
2
3
|
import { AiContextMetadata, AiContextMetadataFilter, AiKnowledgeBaseContextType, AiRagType } from './ai-knowledge-base.public-types';
|
|
3
4
|
import { AiFunctionId, AiFunctionIdWithContext, UserAiChatModelName } from './backend.public-types';
|
|
@@ -146,9 +147,76 @@ export interface StableDiffusionCoreOptions extends BaseAiGenerateImageOptions {
|
|
|
146
147
|
*/
|
|
147
148
|
export type ApiKeySource = 'user' | 'system';
|
|
148
149
|
/**
|
|
150
|
+
* Structured output format configuration for AI models that support schema-constrained responses.
|
|
151
|
+
*
|
|
152
|
+
* When used with supported Anthropic models (claude-sonnet-4-5-20250929, claude-opus-4-1-20250805),
|
|
153
|
+
* this guarantees that responses will strictly conform to the provided JSON schema through
|
|
154
|
+
* constrained decoding - the model cannot generate tokens that violate the schema.
|
|
155
|
+
*
|
|
156
|
+
* **Example:**
|
|
157
|
+
* ```typescript
|
|
158
|
+
* {
|
|
159
|
+
* type: 'json_schema',
|
|
160
|
+
* schema: {
|
|
161
|
+
* type: 'object',
|
|
162
|
+
* properties: {
|
|
163
|
+
* name: { type: 'string' },
|
|
164
|
+
* age: { type: 'number' }
|
|
165
|
+
* },
|
|
166
|
+
* required: ['name', 'age'],
|
|
167
|
+
* additionalProperties: false
|
|
168
|
+
* }
|
|
169
|
+
* }
|
|
170
|
+
* ```
|
|
171
|
+
*
|
|
172
|
+
* @see https://docs.anthropic.com/en/docs/build-with-claude/structured-outputs
|
|
149
173
|
* @category AI
|
|
150
174
|
*/
|
|
151
|
-
export
|
|
175
|
+
export interface AiStructuredOutputFormat {
|
|
176
|
+
/**
|
|
177
|
+
* The type of structured output.
|
|
178
|
+
* Currently only 'json_schema' is supported by Anthropic models.
|
|
179
|
+
*/
|
|
180
|
+
type: 'json_schema';
|
|
181
|
+
/**
|
|
182
|
+
* The JSON schema that the AI response must strictly conform to.
|
|
183
|
+
* Uses constrained decoding to guarantee schema compliance.
|
|
184
|
+
*/
|
|
185
|
+
schema: JSONSchema;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Response format for AI agent responses.
|
|
189
|
+
*
|
|
190
|
+
* **Available formats:**
|
|
191
|
+
* - `'text'`: Plain text response (default) - standard conversational output
|
|
192
|
+
* - `'json_object'`: JSON response - model attempts to return valid JSON, but without strict schema validation
|
|
193
|
+
* - `AiStructuredOutputFormat`: Structured output with schema (Anthropic only) - guarantees JSON conforms exactly to provided schema
|
|
194
|
+
*
|
|
195
|
+
* **Structured outputs (Anthropic-specific):**
|
|
196
|
+
* For Anthropic models that support structured outputs, you can pass an object with `type: 'json_schema'`
|
|
197
|
+
* and a JSON schema. This uses constrained decoding to guarantee the response matches your schema perfectly,
|
|
198
|
+
* eliminating parsing errors and validation issues.
|
|
199
|
+
*
|
|
200
|
+
* **Example with structured output:**
|
|
201
|
+
* ```typescript
|
|
202
|
+
* {
|
|
203
|
+
* responseFormat: {
|
|
204
|
+
* type: 'json_schema',
|
|
205
|
+
* schema: {
|
|
206
|
+
* type: 'object',
|
|
207
|
+
* properties: {
|
|
208
|
+
* sentiment: { type: 'string', enum: ['positive', 'negative', 'neutral'] },
|
|
209
|
+
* confidence: { type: 'number', minimum: 0, maximum: 1 }
|
|
210
|
+
* },
|
|
211
|
+
* required: ['sentiment', 'confidence']
|
|
212
|
+
* }
|
|
213
|
+
* }
|
|
214
|
+
* }
|
|
215
|
+
* ```
|
|
216
|
+
*
|
|
217
|
+
* @category AI
|
|
218
|
+
*/
|
|
219
|
+
export type AiAgentResponseFormat = 'text' | 'json_object' | AiStructuredOutputFormat;
|
|
152
220
|
/**
|
|
153
221
|
* @category AI
|
|
154
222
|
*/
|
|
@@ -429,6 +497,32 @@ export type AiReasoningEffort = 'minimal' | 'low' | 'medium' | 'high';
|
|
|
429
497
|
export type AiVerbosityLevel = 'low' | 'medium' | 'high';
|
|
430
498
|
/**
|
|
431
499
|
* Chat options specific to Anthropic models, extending base options.
|
|
500
|
+
*
|
|
501
|
+
* **Structured Outputs:**
|
|
502
|
+
* Anthropic models (claude-sonnet-4-5-20250929, claude-opus-4-1-20250805) support structured outputs
|
|
503
|
+
* through the `responseFormat` field. Pass an object with `type: 'json_schema'` and a JSON schema
|
|
504
|
+
* to guarantee the response conforms exactly to your schema.
|
|
505
|
+
*
|
|
506
|
+
* **Example:**
|
|
507
|
+
* ```typescript
|
|
508
|
+
* {
|
|
509
|
+
* model: 'claude-sonnet-4-5-20250929',
|
|
510
|
+
* responseFormat: {
|
|
511
|
+
* type: 'json_schema',
|
|
512
|
+
* schema: {
|
|
513
|
+
* type: 'object',
|
|
514
|
+
* properties: {
|
|
515
|
+
* name: { type: 'string' },
|
|
516
|
+
* age: { type: 'number' }
|
|
517
|
+
* },
|
|
518
|
+
* required: ['name', 'age'],
|
|
519
|
+
* additionalProperties: false
|
|
520
|
+
* }
|
|
521
|
+
* }
|
|
522
|
+
* }
|
|
523
|
+
* ```
|
|
524
|
+
*
|
|
525
|
+
* @see https://docs.anthropic.com/en/docs/build-with-claude/structured-outputs
|
|
432
526
|
* @category AI
|
|
433
527
|
*/
|
|
434
528
|
export interface AnthropicChatOptions extends BaseAiChatOptions {
|
|
@@ -764,4 +858,42 @@ export type AiSessionContext = {
|
|
|
764
858
|
/** The ID of the job associated with the session. */
|
|
765
859
|
jobId: JobId;
|
|
766
860
|
};
|
|
861
|
+
/**
|
|
862
|
+
* API request to delete an AI agent
|
|
863
|
+
* @category AI
|
|
864
|
+
*/
|
|
865
|
+
export interface DeleteAgentRequest {
|
|
866
|
+
/** The ID of the agent to delete */
|
|
867
|
+
agentId: string;
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* API response from agent ask methods
|
|
871
|
+
* @category AI
|
|
872
|
+
*/
|
|
873
|
+
export interface AiAskResponse {
|
|
874
|
+
/** The response string from the agent */
|
|
875
|
+
responseString: string;
|
|
876
|
+
/** Optional annotations (e.g., file references) in the response */
|
|
877
|
+
annotations?: Record<string, AiAnnotation>;
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* API request to create speech from text
|
|
881
|
+
* @category AI
|
|
882
|
+
*/
|
|
883
|
+
export interface AiAudioCreateSpeechRequest {
|
|
884
|
+
/** The text input to convert to speech */
|
|
885
|
+
input: string;
|
|
886
|
+
/** Options for speech generation */
|
|
887
|
+
options: AiAudioCreateSpeechOptions;
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* API request to generate an image
|
|
891
|
+
* @category AI
|
|
892
|
+
*/
|
|
893
|
+
export interface AiGenerateImageRequest {
|
|
894
|
+
/** The prompt describing the image to generate */
|
|
895
|
+
prompt: string;
|
|
896
|
+
/** Options for image generation */
|
|
897
|
+
options?: AiGenerateImageOptions;
|
|
898
|
+
}
|
|
767
899
|
export {};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AiReasoningEffort } from './ai-agent.public-types';
|
|
2
2
|
import { OpenAiChatModelName } from './ai-common.public-types';
|
|
3
3
|
import { AiFunctionId } from './backend.public-types';
|
|
4
|
+
/**
|
|
5
|
+
* Response format for AI assistant responses.
|
|
6
|
+
* @category AI
|
|
7
|
+
*/
|
|
8
|
+
export type AiAssistantResponseFormat = 'text' | 'json_object';
|
|
4
9
|
/**
|
|
5
10
|
* The type of assistant tool.
|
|
6
11
|
* @category AI
|
|
@@ -16,7 +21,7 @@ export interface QueryAssistantOptions {
|
|
|
16
21
|
/** Specific context provided per AI function, keyed by function ID. */
|
|
17
22
|
functionContexts?: Record<AiFunctionId, Record<string, unknown>>;
|
|
18
23
|
/** The desired format of the AI model's response; defaults to 'text'. */
|
|
19
|
-
responseFormat?:
|
|
24
|
+
responseFormat?: AiAssistantResponseFormat;
|
|
20
25
|
/** The OpenAI chat model to use for the assistant, if specified. */
|
|
21
26
|
model?: OpenAiChatModelName;
|
|
22
27
|
/** The level of reasoning effort to apply, as defined by OpenAI. */
|
|
@@ -36,16 +36,16 @@ export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-2.5-pro", "gemin
|
|
|
36
36
|
*
|
|
37
37
|
* @category AI
|
|
38
38
|
*/
|
|
39
|
-
export declare const GROK_CHAT_MODEL_NAMES: readonly ["grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-4", "grok-4-fast-reasoning", "grok-4-fast-non-reasoning"];
|
|
39
|
+
export declare const GROK_CHAT_MODEL_NAMES: readonly ["grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-4", "grok-4-fast-reasoning", "grok-4-fast-non-reasoning", "grok-4-1-fast-reasoning", "grok-4-1-fast-non-reasoning"];
|
|
40
40
|
/**
|
|
41
41
|
* @category AI
|
|
42
42
|
*/
|
|
43
|
-
export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-3-7-sonnet-latest", "claude-haiku-4-5-20251001", "claude-opus-4-20250514", "claude-opus-4-1-20250805", "claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929"];
|
|
43
|
+
export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-3-7-sonnet-latest", "claude-haiku-4-5-20251001", "claude-opus-4-20250514", "claude-opus-4-1-20250805", "claude-opus-4-5-20251101", "claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929"];
|
|
44
44
|
/**
|
|
45
45
|
* The supported AI model names.
|
|
46
46
|
* @category AI
|
|
47
47
|
*/
|
|
48
|
-
export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["o1", "o3", "o3-mini", "o4-mini", "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-5.1", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "gpt-4o", "gpt-4o-mini", "claude-3-7-sonnet-latest", "claude-haiku-4-5-20251001", "claude-opus-4-20250514", "claude-opus-4-1-20250805", "claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", "grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-4", "grok-4-fast-reasoning", "grok-4-fast-non-reasoning"];
|
|
48
|
+
export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["o1", "o3", "o3-mini", "o4-mini", "gpt-5", "gpt-5-mini", "gpt-5-nano", "gpt-5.1", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "gpt-4o", "gpt-4o-mini", "claude-3-7-sonnet-latest", "claude-haiku-4-5-20251001", "claude-opus-4-20250514", "claude-opus-4-1-20250805", "claude-opus-4-5-20251101", "claude-sonnet-4-20250514", "claude-sonnet-4-5-20250929", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite", "grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-4", "grok-4-fast-reasoning", "grok-4-fast-non-reasoning", "grok-4-1-fast-reasoning", "grok-4-1-fast-non-reasoning"];
|
|
49
49
|
/**
|
|
50
50
|
* Check if the given model name is a global AI chat model name.
|
|
51
51
|
*/
|
|
@@ -386,4 +386,46 @@ export type AiKnowledgeBaseWithOptionalChatModel = Omit<AiKnowledgeBase, 'chatMo
|
|
|
386
386
|
chatModel?: AiKnowledgeBase['chatModel'];
|
|
387
387
|
name?: string;
|
|
388
388
|
};
|
|
389
|
+
/**
|
|
390
|
+
* API request for deleting an AiKnowledgeBase
|
|
391
|
+
* @category AI
|
|
392
|
+
*/
|
|
393
|
+
export interface DeleteAiKnowledgeBaseRequest {
|
|
394
|
+
/** The id of the AiKnowledgeBase */
|
|
395
|
+
id: string;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* API request for upserting an AiKnowledgeBase
|
|
399
|
+
* @category AI
|
|
400
|
+
*/
|
|
401
|
+
export interface UpsertAiKnowledgeBaseRequest {
|
|
402
|
+
/** The AiKnowledgeBase to upsert */
|
|
403
|
+
knowledgeBase: Omit<AiKnowledgeBaseWithOptionalChatModel, 'appId' | 'updatedAt'>;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* API request for deleting AiKnowledgeBaseContexts
|
|
407
|
+
* @category AI
|
|
408
|
+
*/
|
|
409
|
+
export interface DeleteAiKnowledgeBaseContextsRequest {
|
|
410
|
+
/** The id of the AiKnowledgeBase */
|
|
411
|
+
knowledgeBaseId: string;
|
|
412
|
+
/** An array of AiKnowledgeBaseContext ids */
|
|
413
|
+
contextIds: Array<string>;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* API response to list AiKnowledgeBaseContexts
|
|
417
|
+
* @category AI
|
|
418
|
+
*/
|
|
419
|
+
export interface ListAiKnowledgeBaseContextsResponse {
|
|
420
|
+
/** The list of AiKnowledgeBaseContexts */
|
|
421
|
+
contexts: Array<AiKnowledgeBaseContext>;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* API response for searching an AiKnowledgeBase
|
|
425
|
+
* @category AI
|
|
426
|
+
*/
|
|
427
|
+
export interface AiKnowledgeBaseSearchResponse {
|
|
428
|
+
/** Array of result chunks from the search */
|
|
429
|
+
chunks: Array<AiKnowledgeBaseSearchResultChunk>;
|
|
430
|
+
}
|
|
389
431
|
export {};
|
|
@@ -72,3 +72,115 @@ export interface MmListEntitiesOptions {
|
|
|
72
72
|
/** The maximum number of entities to return; defaults to 100. */
|
|
73
73
|
limit?: number;
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* API request to delete a matchmaker
|
|
77
|
+
* @category AI
|
|
78
|
+
*/
|
|
79
|
+
export interface MmDeleteMatchMakerRequest {
|
|
80
|
+
/** The ID of the matchmaker to delete */
|
|
81
|
+
matchMakerId: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* API response for getting a matchmaker
|
|
85
|
+
* @category AI
|
|
86
|
+
*/
|
|
87
|
+
export interface MmGetMatchMakerResponse {
|
|
88
|
+
/** The matchmaker, if found */
|
|
89
|
+
matchMaker: MmMatchMaker | undefined;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* API request to delete an entity
|
|
93
|
+
* @category AI
|
|
94
|
+
*/
|
|
95
|
+
export interface MmDeleteEntityRequest {
|
|
96
|
+
/** The ID of the matchmaker */
|
|
97
|
+
matchMakerId: string;
|
|
98
|
+
/** The ID of the entity to delete */
|
|
99
|
+
entityId: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* API request to insert multiple entities
|
|
103
|
+
* @category AI
|
|
104
|
+
*/
|
|
105
|
+
export interface MmInsertEntitiesRequest {
|
|
106
|
+
/** The ID of the matchmaker */
|
|
107
|
+
matchMakerId: string;
|
|
108
|
+
/** Array of entities to insert */
|
|
109
|
+
entities: Array<MmEntity>;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* API request to find matches for an entity
|
|
113
|
+
* @category AI
|
|
114
|
+
*/
|
|
115
|
+
export interface MmFindMatchesRequest {
|
|
116
|
+
/** The ID of the matchmaker */
|
|
117
|
+
matchMakerId: string;
|
|
118
|
+
/** The ID of the entity to find matches for */
|
|
119
|
+
entityId: string;
|
|
120
|
+
/** Options for finding matches */
|
|
121
|
+
options: MmFindMatchesOptions;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* API response for finding matches
|
|
125
|
+
* @category AI
|
|
126
|
+
*/
|
|
127
|
+
export interface MmFindMatchesResponse {
|
|
128
|
+
/** Array of matching entities */
|
|
129
|
+
matches: Array<MmEntityMatch>;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* API request to find matches for an entity not yet inserted
|
|
133
|
+
* @category AI
|
|
134
|
+
*/
|
|
135
|
+
export interface MmFindMatchesForEntityRequest {
|
|
136
|
+
/** The ID of the matchmaker */
|
|
137
|
+
matchMakerId: string;
|
|
138
|
+
/** The entity to find matches for */
|
|
139
|
+
entity: Omit<MmEntity, 'metadata' | 'id'>;
|
|
140
|
+
/** Options for finding matches */
|
|
141
|
+
options: MmFindMatchesOptions;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* API response for finding matches for an entity
|
|
145
|
+
* @category AI
|
|
146
|
+
*/
|
|
147
|
+
export interface MmFindMatchesForEntityResponse {
|
|
148
|
+
/** Array of matching entities */
|
|
149
|
+
matches: Array<MmEntityMatch>;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* API response for listing matchmakers
|
|
153
|
+
* @category AI
|
|
154
|
+
*/
|
|
155
|
+
export interface MmListMatchMakersResponse {
|
|
156
|
+
/** Array of matchmakers */
|
|
157
|
+
matchMakers: Array<MmMatchMaker>;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* API request to list entities
|
|
161
|
+
* @category AI
|
|
162
|
+
*/
|
|
163
|
+
export interface MmListEntitiesRequest {
|
|
164
|
+
/** The ID of the matchmaker */
|
|
165
|
+
matchMakerId: string;
|
|
166
|
+
/** The ID of the category */
|
|
167
|
+
categoryId: string;
|
|
168
|
+
/** Options for listing entities */
|
|
169
|
+
options: MmListEntitiesOptions;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* API response for listing entities
|
|
173
|
+
* @category AI
|
|
174
|
+
*/
|
|
175
|
+
export interface MmListEntitiesResponse {
|
|
176
|
+
/** Array of entities */
|
|
177
|
+
entities: Array<MmEntity>;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* API response for getting an entity
|
|
181
|
+
* @category AI
|
|
182
|
+
*/
|
|
183
|
+
export interface MmGetEntityResponse {
|
|
184
|
+
/** The entity, if found */
|
|
185
|
+
entity: MmEntity | undefined;
|
|
186
|
+
}
|
|
@@ -13,8 +13,10 @@ export declare const DEFAULT_SHORT_ID_LENGTH = 18;
|
|
|
13
13
|
/**
|
|
14
14
|
* Generates an ID of the given `length` using lowercase latin letters and digits.
|
|
15
15
|
* If the 'prefix' provided replaces the first generated characters with the prefix.
|
|
16
|
+
* If the 'prefixToAvoid' provided, ensures the generated ID does not start with this prefix.
|
|
17
|
+
* When both 'prefix' and 'prefixToAvoid' are provided, 'prefixToAvoid' must be longer than 'prefix'.
|
|
16
18
|
*/
|
|
17
|
-
export declare function generateShortId(length?: number, prefix?: string): string;
|
|
19
|
+
export declare function generateShortId(length?: number, prefix?: string, prefixToAvoid?: string): string;
|
|
18
20
|
/**
|
|
19
21
|
* Generates a set of unique IDs under the same behavior as `generateShortId`.
|
|
20
22
|
*
|
|
@@ -7,7 +7,7 @@ import { AiFilesClient } from './ai-files-client';
|
|
|
7
7
|
import { AiImageClient } from './ai-image-client';
|
|
8
8
|
import { AiKnowledgeBaseReference } from './ai-knowledge-base/ai-knowledge-base-client-reference';
|
|
9
9
|
import { AiMatchMakingClient } from './ai-matchmaking-client';
|
|
10
|
-
import { AiAgent, AiAgentId, AiFileProviderType, AiKnowledgeBase, AiKnowledgeBaseId, AiProviderType, ApplicationAiSettings, IntegrationId, SecretKey } from './public-types';
|
|
10
|
+
import { AiAgent, AiAgentId, AiFileProviderType, AiKnowledgeBase, AiKnowledgeBaseId, AiProviderType, AiSessionContext, ApplicationAiSettings, IntegrationId, SecretKey } from './public-types';
|
|
11
11
|
/**
|
|
12
12
|
* AiClient class serves as a facade for interacting with different AI services.
|
|
13
13
|
* It provides simplified access to AI chatbot and assistant functionalities
|
|
@@ -102,7 +102,7 @@ export declare class AiClient {
|
|
|
102
102
|
* Request to execute an AI-powered API call.
|
|
103
103
|
* Allows specifying allowed endpoints and whether to provide an explanation.
|
|
104
104
|
*/
|
|
105
|
-
executeAiApiCall(integrationId: IntegrationId, prompt: string, allowedEndpoints?: string[], provideExplanation?: boolean): Promise<ExecuteAiApiResponse>;
|
|
105
|
+
executeAiApiCall(integrationId: IntegrationId, prompt: string, allowedEndpoints?: string[], provideExplanation?: boolean, generateApiCallAgentId?: AiAgentId, sessionContext?: AiSessionContext): Promise<ExecuteAiApiResponse>;
|
|
106
106
|
/**
|
|
107
107
|
* Returns name of the secret that stores API key for the given AI provider type.
|
|
108
108
|
* This API key is used for all requests to the AI provider done from the application.
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Names of the Squid metrics.
|
|
3
|
-
* Should be in sync with MetricName.kt.
|
|
4
|
-
* See MetricName.kt for documentation on each value.
|
|
5
|
-
*/
|
|
6
|
-
export declare const ALL_SQUID_METRIC_NAMES: readonly ["squid_functionExecution_count", "squid_functionExecution_time", "squid_aiChatbotContext_size", "squid_aiChatbotChatInputTokens_count", "squid_aiChatbotChatOutputTokens_count", "squid_aiChatbotChatOutcome_count", "squid_aiImageGeneration_count", "squid_aiImageGeneration_time", "squid_aiRemoveBackground_count", "squid_aiRemoveBackground_time", "squid_aiAudioTranscribe_count", "squid_aiAudioTranscribe_time", "squid_aiAudioCreateSpeech_count", "squid_aiAudioCreateSpeech_time", "squid_aiIntegrationData_count", "squid_aiIntegrationData_time", "squid_aiIntegrationApi_count", "squid_aiIntegrationApi_time", "squid_apiControllerCall_count", "squid_apiControllerCall_time", "squid_aiContextUpsert_count", "squid_aiContextDelete_count", "squid_codeInitialization_count", "squid_codeInitialization_time", "squid_deleteApiKey_count", "squid_deleteApiKey_time", "squid_deleteSecret_count", "squid_deleteSecret_time", "squid_discoverGraphQLConnectionSchema_count", "squid_discoverGraphQLConnectionSchema_time", "squid_discoverOpenApiSchema_count", "squid_discoverOpenApiSchema_time", "squid_discoverOpenApiSchemaFromFile_count", "squid_discoverOpenApiSchemaFromFile_time", "squid_executeBackendFunction_count", "squid_executeBackendFunction_time", "squid_getAiChatbotProfiles_count", "squid_getAiChatbotProfiles_time", "squid_getAllApiKeys_count", "squid_getAllApiKeys_time", "squid_getAllSecrets_count", "squid_getAllSecrets_time", "squid_getAppApiKey_count", "squid_getAppApiKey_time", "squid_getSecret_count", "squid_getSecret_time", "squid_graphql_count", "squid_graphql_time", "squid_graphqlQuery_count", "squid_graphqlQuery_time", "squid_integrationCount_value", "squid_acquireLock_count", "squid_releaseLock_count", "squid_mutate_count", "squid_mutate_time", "squid_metricQuery_count", "squid_metricQuery_time", "squid_metricReport_count", "squid_metricReport_time", "squid_nativeQuery_count", "squid_nativeQuery_time", "squid_openapi_count", "squid_openapi_time", "squid_produceTopicMessage_count", "squid_produceTopicMessage_time", "squid_query_count", "squid_query_time", "squid_registerQuery_count", "squid_registerQuery_time", "squid_rerankChunks_count", "squid_rerankChunks_time", "squid_schedulerJob_count", "squid_schedulerJob_time", "squid_schema_size", "squid_secrets_entries", "squid_storageDeleteFiles_count", "squid_storageDeleteFiles_time", "squid_storageGetDownloadUrl_count", "squid_storageGetDownloadUrl_time", "squid_storageGetFileMetadata_count", "squid_storageGetFileMetadata_time", "squid_storageListDirectoryContents_count", "squid_storageListDirectoryContents_time", "squid_storageUploadFile_count", "squid_storageUploadFile_time", "squid_subscribeToTopic_count", "squid_subscribeToTopic_time", "squid_testGraphQLConnection_count", "squid_testGraphQLConnection_time", "squid_testAgentProtocolConnection_count", "squid_testAgentProtocolConnection_time", "squid_trigger_count", "squid_trigger_time", "squid_upsertApiKey_count", "squid_upsertApiKey_time", "squid_upsertSecret_count", "squid_upsertSecret_time", "squid_vectorChunks_count", "squid_vectorChunks_time", "squid_webhook_count", "squid_webhook_time"];
|
|
7
|
-
export type MetricName = (typeof ALL_SQUID_METRIC_NAMES)[number];
|
|
8
|
-
/** Common prefix for all Squid metrics. */
|
|
9
|
-
export declare const SQUID_METRIC_NAME_PREFIX = "squid_";
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ApiOptions } from '../public-types/api-client.public-types';
|
|
2
|
-
import { ApiEndpointId, HttpMethod } from '../public-types/api.public-types';
|
|
3
|
-
import { IntegrationId } from '../public-types/communication.public-types';
|
|
4
|
-
/** The headers of an API call. */
|
|
5
|
-
export type ApiHeaders = Record<string, string | number | boolean>;
|
|
6
|
-
/** The context of an API call. */
|
|
7
|
-
export declare class ApiCallContext {
|
|
8
|
-
readonly integrationId: IntegrationId;
|
|
9
|
-
readonly endpointId: ApiEndpointId;
|
|
10
|
-
readonly url: string;
|
|
11
|
-
readonly method: HttpMethod;
|
|
12
|
-
readonly body: unknown;
|
|
13
|
-
readonly options: ApiOptions;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Represents a request to call an API through a specified integration and endpoint.
|
|
17
|
-
* Includes optional method override and additional request options.
|
|
18
|
-
*/
|
|
19
|
-
export interface CallApiRequest<BodyType = any> {
|
|
20
|
-
/** The identifier of the integration through which the API is called. */
|
|
21
|
-
integrationId: IntegrationId;
|
|
22
|
-
/** Target API endpoint to invoke. */
|
|
23
|
-
endpointId: ApiEndpointId;
|
|
24
|
-
/** Optional request payload. */
|
|
25
|
-
body?: BodyType;
|
|
26
|
-
/** Optional HTTP method override. Default is POST. */
|
|
27
|
-
overrideMethod?: HttpMethod;
|
|
28
|
-
/** Additional request options. */
|
|
29
|
-
options: ApiOptions;
|
|
30
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { SquidDocIdObj, SquidDocument } from '../public-types/document.public-types';
|
|
2
|
-
import { Paths } from '../public-types/typescript.public-types';
|
|
3
|
-
/**
|
|
4
|
-
* The mutation type.
|
|
5
|
-
* @category Database
|
|
6
|
-
*/
|
|
7
|
-
export declare const MUTATION_TYPES: readonly ["insert", "update", "delete"];
|
|
8
|
-
/**
|
|
9
|
-
* @category Database
|
|
10
|
-
*/
|
|
11
|
-
export type MutationType = (typeof MUTATION_TYPES)[number];
|
|
12
|
-
interface BaseMutation {
|
|
13
|
-
type: MutationType;
|
|
14
|
-
squidDocIdObj: SquidDocIdObj;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* A mutation on a document.
|
|
18
|
-
* @category Database
|
|
19
|
-
*/
|
|
20
|
-
export type Mutation<T = any> = UpdateMutation<T> | InsertMutation<T> | DeleteMutation;
|
|
21
|
-
/**
|
|
22
|
-
* Represents a delete mutation on a document.
|
|
23
|
-
* @category Database
|
|
24
|
-
*/
|
|
25
|
-
export interface DeleteMutation extends BaseMutation {
|
|
26
|
-
/** Specifies that the mutation is a deletion. */
|
|
27
|
-
type: 'delete';
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Represents an update mutation on a document.
|
|
31
|
-
* @category Database
|
|
32
|
-
*/
|
|
33
|
-
export interface UpdateMutation<T = any> extends BaseMutation {
|
|
34
|
-
/** Specifies that the mutation is an update. */
|
|
35
|
-
type: 'update';
|
|
36
|
-
/** The updated properties */
|
|
37
|
-
properties: {
|
|
38
|
-
[key in keyof T & string]?: Array<PropertyMutation<T[key]>>;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Represents an insert mutation on a document.
|
|
43
|
-
* @category Database
|
|
44
|
-
*/
|
|
45
|
-
export interface InsertMutation<T = any> extends BaseMutation {
|
|
46
|
-
/** Specifies that the mutation is an insertion. */
|
|
47
|
-
type: 'insert';
|
|
48
|
-
/** The inserted document */
|
|
49
|
-
properties: T;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* A representation of a single property update.
|
|
53
|
-
* @category Database
|
|
54
|
-
*/
|
|
55
|
-
export type PropertyMutation<Value = any> = ApplyNumericFnPropertyMutation | ApplyStringFnPropertyMutation | ValueUpdatePropertyMutation<Value> | RemovePropertyMutation;
|
|
56
|
-
/**
|
|
57
|
-
* A value update property mutation.
|
|
58
|
-
* @category Database
|
|
59
|
-
*/
|
|
60
|
-
export interface ValueUpdatePropertyMutation<Value = any> {
|
|
61
|
-
/** Specifies that the mutation updates a value. */
|
|
62
|
-
type: 'update';
|
|
63
|
-
/** New value to be set. */
|
|
64
|
-
value: Value;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Applying a numeric function to a property.
|
|
68
|
-
* @category Database
|
|
69
|
-
*/
|
|
70
|
-
export interface ApplyNumericFnPropertyMutation {
|
|
71
|
-
/** Specifies that the mutation applies a numeric function. */
|
|
72
|
-
type: 'applyNumericFn';
|
|
73
|
-
/** Numeric function to apply. */
|
|
74
|
-
fn: 'increment';
|
|
75
|
-
/** Value to use in the numeric function. */
|
|
76
|
-
value: number;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* A property update that removes a property from a document.
|
|
80
|
-
* @category Database
|
|
81
|
-
*/
|
|
82
|
-
export interface RemovePropertyMutation {
|
|
83
|
-
/** Specifies that the mutation removes a property. */
|
|
84
|
-
type: 'removeProperty';
|
|
85
|
-
}
|
|
86
|
-
interface ApplyExtendString {
|
|
87
|
-
/** Specifies that the mutation applies a string function. */
|
|
88
|
-
type: 'applyStringFn';
|
|
89
|
-
/** String function to extend the existing string. */
|
|
90
|
-
fn: 'extendString';
|
|
91
|
-
/** String value to append. */
|
|
92
|
-
value: string;
|
|
93
|
-
}
|
|
94
|
-
interface ApplyTrimString {
|
|
95
|
-
/** Specifies that the mutation applies a string function. */
|
|
96
|
-
type: 'applyStringFn';
|
|
97
|
-
/** String function to trim the existing string. */
|
|
98
|
-
fn: 'trim';
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* A property mutation that modifies a string.
|
|
102
|
-
* @category Database
|
|
103
|
-
*/
|
|
104
|
-
export type ApplyStringFnPropertyMutation = ApplyExtendString | ApplyTrimString;
|
|
105
|
-
/**
|
|
106
|
-
* The before and after documents of a document change.
|
|
107
|
-
* @category Database
|
|
108
|
-
*/
|
|
109
|
-
export interface BeforeAndAfterDocs<T = SquidDocument> {
|
|
110
|
-
/** Document state before the mutation. */
|
|
111
|
-
before: T | undefined;
|
|
112
|
-
/** Document state after the mutation. */
|
|
113
|
-
after: T | undefined;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* The mutation context that will be provided to the security function.
|
|
117
|
-
* @category Database
|
|
118
|
-
*/
|
|
119
|
-
export declare class MutationContext<T = any> {
|
|
120
|
-
readonly mutation: Mutation<T>;
|
|
121
|
-
readonly beforeAndAfterDocs: BeforeAndAfterDocs<T>;
|
|
122
|
-
readonly serverTimeStamp: Date;
|
|
123
|
-
/**
|
|
124
|
-
* Returns the state of the document before the mutation was applied.
|
|
125
|
-
*/
|
|
126
|
-
get before(): T | undefined;
|
|
127
|
-
/**
|
|
128
|
-
* Returns the state of the document after the mutation was applied.
|
|
129
|
-
*/
|
|
130
|
-
get after(): T | undefined;
|
|
131
|
-
/**
|
|
132
|
-
* Returns the type of the mutation (insert, update, or delete).
|
|
133
|
-
*/
|
|
134
|
-
getMutationType(): MutationType;
|
|
135
|
-
/** Returns true if the mutation affects the provided path. */
|
|
136
|
-
affectsPath(path: Paths<T>): boolean;
|
|
137
|
-
/**
|
|
138
|
-
* Find all affected paths starting from a root path.
|
|
139
|
-
*
|
|
140
|
-
* @example
|
|
141
|
-
* doc before - { a: { b: 1, c: 2 }, d: 3 }
|
|
142
|
-
* doc after - { a: { b: 1, c: 3 }, d: 4 }
|
|
143
|
-
* doc.affectedPaths('a') // ['a.c']
|
|
144
|
-
*/
|
|
145
|
-
affectedPaths(startingRoot?: Paths<T> | string): Array<Paths<T>>;
|
|
146
|
-
private checkPath;
|
|
147
|
-
}
|
|
148
|
-
export {};
|