@squidcloud/client 1.0.316 → 1.0.317

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 (41) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/internal-common/src/public-types/{ai-chatbot.public-types.d.ts → ai-agent.public-types.d.ts} +45 -15
  3. package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +1 -1
  4. package/dist/internal-common/src/public-types/ai-matchmaking.types.d.ts +1 -1
  5. package/dist/internal-common/src/public-types/integrations/{ai_chatbot.public-types.d.ts → ai_agent.public-types.d.ts} +6 -7
  6. package/dist/typescript-client/src/admin-client.d.ts +0 -4
  7. package/dist/typescript-client/src/ai-agent-client.d.ts +76 -74
  8. package/dist/typescript-client/src/ai-matchmaking-client.d.ts +0 -2
  9. package/dist/typescript-client/src/personal-storage-client.d.ts +1 -1
  10. package/dist/typescript-client/src/public-types.d.ts +2 -2
  11. package/dist/typescript-client/src/version.d.ts +1 -1
  12. package/package.json +1 -1
  13. package/dist/internal-common/src/metric-name.d.ts +0 -9
  14. package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +0 -21
  15. package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +0 -18
  16. package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +0 -123
  17. package/dist/internal-common/src/types/ai-assistant.types.d.ts +0 -1
  18. package/dist/internal-common/src/types/ai-chatbot.types.d.ts +0 -60
  19. package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +0 -34
  20. package/dist/internal-common/src/types/backend-function.types.d.ts +0 -1
  21. package/dist/internal-common/src/types/communication.types.d.ts +0 -1
  22. package/dist/internal-common/src/types/document.types.d.ts +0 -1
  23. package/dist/internal-common/src/types/mutation.types.d.ts +0 -1
  24. package/dist/internal-common/src/types/observability.types.d.ts +0 -71
  25. package/dist/internal-common/src/types/query.types.d.ts +0 -10
  26. package/dist/internal-common/src/types/secret.types.d.ts +0 -2
  27. package/dist/internal-common/src/types/socket.types.d.ts +0 -1
  28. package/dist/internal-common/src/types/time-units.d.ts +0 -1
  29. package/dist/internal-common/src/utils/array.d.ts +0 -1
  30. package/dist/internal-common/src/utils/assert.d.ts +0 -1
  31. package/dist/internal-common/src/utils/e2e-test-utils.d.ts +0 -2
  32. package/dist/internal-common/src/utils/global.utils.d.ts +0 -1
  33. package/dist/internal-common/src/utils/http.d.ts +0 -1
  34. package/dist/internal-common/src/utils/lock.manager.d.ts +0 -14
  35. package/dist/internal-common/src/utils/metric-utils.d.ts +0 -4
  36. package/dist/internal-common/src/utils/metrics.types.d.ts +0 -7
  37. package/dist/internal-common/src/utils/object.d.ts +0 -49
  38. package/dist/internal-common/src/utils/serialization.d.ts +0 -5
  39. package/dist/internal-common/src/utils/squid.constants.d.ts +0 -1
  40. package/dist/internal-common/src/utils/validation.d.ts +0 -20
  41. package/dist/internal-common/src/websocket.impl.d.ts +0 -26
@@ -1,6 +1,6 @@
1
1
  import { FunctionName, FunctionNameWithContext } from './bundle-data.public-types';
2
2
  import { AiAgentId, IntegrationId } from './communication.public-types';
3
- import { AiChatPromptQuotas, AiConnectedAgentMetadata, AiConnectedIntegrationMetadata } from '../types/ai-chatbot.types';
3
+ import { IntegrationType } from './integration.public-types';
4
4
  /** The supported OpenAI models */
5
5
  export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "o1", "o1-mini", "o3-mini"];
6
6
  export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-1.5-pro", "gemini-1.5-flash"];
@@ -105,14 +105,44 @@ export interface AiFileUrl {
105
105
  type: AiFileUrlType;
106
106
  url: string;
107
107
  }
108
- /** The options for the AI chatbot chat method. */
109
- export interface AiChatbotChatOptions {
108
+ export interface AiConnectedIntegrationMetadata {
109
+ integrationId: IntegrationId;
110
+ /** Type of the connected integration. */
111
+ integrationType: IntegrationType;
112
+ /**
113
+ * Description of the connected integration for the parent agent context.
114
+ * Works as AI function description.
115
+ * If not provided the default one is used.
116
+ */
117
+ description?: string;
118
+ }
119
+ export interface AiConnectedAgentMetadata {
120
+ agentId: AiAgentId;
121
+ /**
122
+ * Description of the connected agent for the parent agent context.
123
+ * Works as AI function description.
124
+ */
125
+ description: string;
126
+ }
127
+ /** Quotas for a single AI chat prompt (`ask()` method call). */
128
+ export interface AiChatPromptQuotas {
129
+ /**
130
+ * Maximum depth of AI call recursion allowed.
131
+ * Recursion occurs when one AI agent calls another.
132
+ * Note that, for simplicity of implementation, this option guarantees only the maximum recursion depth,
133
+ * not the total number of nested AI calls.
134
+ * Default: 5.
135
+ */
136
+ maxAiCallStackSize: number;
137
+ }
138
+ /** The options for the AI chat method. */
139
+ export interface AiAgentChatOptions {
110
140
  /** The maximum number of tokens to use when making the request to the AI model. Default to the max tokens the model can accept. */
111
141
  maxTokens?: number;
112
142
  /** A unique chat ID, if the same chat ID is used again and history is not disabled, it will continue the conversation. */
113
143
  chatId?: string;
114
144
  /**
115
- * Disables history for the chatbot, so each question is answered as
145
+ * Disables history for the agent, so each question is answered as
116
146
  * if it were the first question in the conversation.
117
147
  * Default to false.
118
148
  */
@@ -188,7 +218,7 @@ export interface AiTranscribeAndAskWithVoiceResponse {
188
218
  export interface AiTranscribeAndChatResponse {
189
219
  transcribedPrompt: string;
190
220
  }
191
- /** The options for the AI chatbot search method. */
221
+ /** The options for the AI agent search method. */
192
222
  export interface AiSearchOptions {
193
223
  /** The prompt to search for */
194
224
  prompt: string;
@@ -202,11 +232,11 @@ export interface AiSearchRequest {
202
232
  profileId: string;
203
233
  integrationId: IntegrationId;
204
234
  }
205
- export type AiChatbotMutationType = 'insert' | 'update' | 'delete' | 'append' | 'feedback';
206
- export type AiChatbotResourceType = 'instruction' | 'profile' | 'context' | 'contexts';
207
- export type AiChatbotContextType = 'text' | 'url' | 'file';
208
- export interface AiChatbotContextBase {
209
- type: AiChatbotContextType;
235
+ export type AiMutationType = 'insert' | 'update' | 'delete' | 'append' | 'feedback';
236
+ export type AiResourceType = 'instruction' | 'profile' | 'context' | 'contexts';
237
+ export type AiAgentContextType = 'text' | 'url' | 'file';
238
+ export interface AiAgentContextBase {
239
+ type: AiAgentContextType;
210
240
  data: string;
211
241
  metadata?: AiContextMetadata;
212
242
  password?: string;
@@ -219,16 +249,16 @@ export interface AiSearchResultChunk {
219
249
  metadata?: AiContextMetadata;
220
250
  score: number;
221
251
  }
222
- export interface AiChatbotTextContext extends AiChatbotContextBase {
252
+ export interface AiAgentTextContext extends AiAgentContextBase {
223
253
  type: 'text';
224
254
  }
225
- export interface AiChatbotUrlContext extends AiChatbotContextBase {
255
+ export interface AiAgentUrlContext extends AiAgentContextBase {
226
256
  type: 'url';
227
257
  extractImages?: boolean;
228
258
  minImageWidth?: number;
229
259
  minImageHeight?: number;
230
260
  }
231
- export interface AiChatbotFileContext extends AiChatbotContextBase {
261
+ export interface AiAgentFileContext extends AiAgentContextBase {
232
262
  type: 'file';
233
263
  extractImages?: boolean;
234
264
  minImageWidth?: number;
@@ -236,11 +266,11 @@ export interface AiChatbotFileContext extends AiChatbotContextBase {
236
266
  fullPageAsImage?: boolean;
237
267
  extractionModel?: AiChatModelName;
238
268
  }
239
- export declare class AiChatbotChatContext {
269
+ export declare class AiAgentChatContext {
240
270
  readonly prompt?: string;
241
271
  readonly profileId: AiAgentId;
242
272
  }
243
- export type AiChatbotContext = AiChatbotTextContext | AiChatbotUrlContext | AiChatbotFileContext;
273
+ export type AiAgentContext = AiAgentTextContext | AiAgentUrlContext | AiAgentFileContext;
244
274
  export type AiContextMetadataValue = number | string | boolean | undefined;
245
275
  export type AiContextMetadataValueArray = AiContextMetadataValue[];
246
276
  export interface AiContextMetadataEqFilter {
@@ -1,4 +1,4 @@
1
- import { OpenAiResponseFormat } from './ai-chatbot.public-types';
1
+ import { OpenAiResponseFormat } from './ai-agent.public-types';
2
2
  import { FunctionName } from './bundle-data.public-types';
3
3
  export type AssistantToolType = 'code_interpreter' | 'file_search';
4
4
  /** The options for the AI assistant. */
@@ -1,4 +1,4 @@
1
- import { AiContextMetadata, AiContextMetadataFilter } from './ai-chatbot.public-types';
1
+ import { AiContextMetadata, AiContextMetadataFilter } from './ai-agent.public-types';
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.
@@ -1,10 +1,9 @@
1
- import { AiChatModelName, AiEmbeddingsModelName, VectorDbType } from '../ai-chatbot.public-types';
1
+ import { AiChatModelName, AiConnectedAgentMetadata, AiConnectedIntegrationMetadata, AiEmbeddingsModelName, VectorDbType } from '../ai-agent.public-types';
2
2
  import { FunctionName } from '../bundle-data.public-types';
3
- import { AiConnectedAgentMetadata, AiConnectedIntegrationMetadata } from '../../types/ai-chatbot.types';
4
- export type AiChatbotConfiguration = {
3
+ export type AiAgentConfiguration = {
5
4
  apiKey?: string;
6
5
  };
7
- export type AiChatbotProfileMetadata = {
6
+ export type AiAgentMetadata = {
8
7
  modelName: AiChatModelName;
9
8
  description?: string;
10
9
  isPublic: boolean;
@@ -23,13 +22,13 @@ export type AiChatbotProfileMetadata = {
23
22
  connectedIntegrations?: Array<AiConnectedIntegrationMetadata>;
24
23
  auditLog?: boolean;
25
24
  };
26
- export type AiChatbotContextMetadata = {
25
+ export type AiAgentContextMetadata = {
27
26
  title: string;
28
27
  text: string;
29
28
  preview: boolean;
30
29
  sizeBytes?: number;
31
30
  type?: 'text' | 'url' | 'file';
32
31
  };
33
- export type MutableAiChatbotProfileMetadataFieldsType = keyof Pick<AiChatbotProfileMetadata, 'modelName' | 'description' | 'isPublic' | 'functions' | 'connectedAgents' | 'connectedIntegrations' | 'auditLog'>;
32
+ export type MutableAiAgentMetadataFieldsType = keyof Pick<AiAgentMetadata, 'modelName' | 'description' | 'isPublic' | 'functions' | 'connectedAgents' | 'connectedIntegrations' | 'auditLog'>;
34
33
  /** List of fields that can be updated in runtime via API. */
35
- export declare const MUTABLE_AI_CHATBOT_PROFILE_METADATA_FIELDS: Array<MutableAiChatbotProfileMetadataFieldsType>;
34
+ export declare const MUTABLE_AI_AGENT_METADATA_FIELDS: Array<MutableAiAgentMetadataFieldsType>;
@@ -1,15 +1,11 @@
1
1
  import { IntegrationClient } from './integration-client';
2
- import { RpcManager } from './rpc.manager';
3
2
  import { SecretClient } from './secret.client';
4
- import { SquidRegion } from '../../internal-common/src/public-types/regions.public-types';
5
- import { AppId } from '../../internal-common/src/public-types/communication.public-types';
6
3
  export declare class AdminClient {
7
4
  private readonly rpcManager;
8
5
  private readonly region;
9
6
  private readonly appId;
10
7
  private readonly integrationClient;
11
8
  private readonly secretClient;
12
- constructor(rpcManager: RpcManager, region: SquidRegion, appId: AppId);
13
9
  integrations(): IntegrationClient;
14
10
  secrets(): SecretClient;
15
11
  }
@@ -1,4 +1,4 @@
1
- import { AiAgentId, AiChatbotChatOptions, AiChatbotContext, AiChatbotProfileMetadata, AiObserveStatusOptions, AiSearchOptions, AiSearchResponse, AiStatusMessage, AiTranscribeAndAskResponse, AiTranscribeAndChatResponse, MUTABLE_AI_CHATBOT_PROFILE_METADATA_FIELDS } from './public-types';
1
+ import { AiAgentChatOptions, AiAgentContext, AiAgentId, AiAgentMetadata, AiObserveStatusOptions, AiSearchOptions, AiSearchResponse, AiStatusMessage, AiTranscribeAndAskResponse, AiTranscribeAndChatResponse, MUTABLE_AI_AGENT_METADATA_FIELDS } from './public-types';
2
2
  import { Observable } from 'rxjs';
3
3
  import { BlobAndFilename } from './types';
4
4
  export interface TranscribeAndChatResponse {
@@ -18,24 +18,24 @@ export interface ChatInternalResponse {
18
18
  responseStream: Observable<string>;
19
19
  serverResponse?: Promise<AiTranscribeAndChatResponse>;
20
20
  }
21
- export type ChatOptionsWithoutVoice = Omit<AiChatbotChatOptions, 'voiceOptions'>;
22
- export type AskOptionsWithoutVoice = Omit<AiChatbotChatOptions, 'voiceOptions' | 'smoothTyping'>;
21
+ export type ChatOptionsWithoutVoice = Omit<AiAgentChatOptions, 'voiceOptions'>;
22
+ export type AskOptionsWithoutVoice = Omit<AiAgentChatOptions, 'voiceOptions' | 'smoothTyping'>;
23
23
  export declare class AiAgentClient {
24
24
  private readonly rpcManager;
25
25
  private readonly socketManager;
26
26
  private readonly ongoingChatSequences;
27
27
  private readonly statusUpdates;
28
28
  /**
29
- * Retrieves a profile reference for the provided id. A profile reference
30
- * can be used to create and update profiles, add instructions and context
31
- * and start chats.
29
+ * Retrieves a reference to an agent with the specified ID.
30
+ * The returned agent reference can be used to create and update the agent,
31
+ * add instructions and context, and initiate chats.
32
32
  *
33
- * @param id - The id of the profile.
34
- * @returns The profile reference.
33
+ * @param id - The ID of the agent.
34
+ * @returns A reference to the agent.
35
35
  */
36
- profile(id: string): AiAgentReference;
36
+ agent(id: AiAgentId): AiAgentReference;
37
37
  /**
38
- * Sends a prompt to the specified profile id.
38
+ * Sends a prompt to the specified agent id.
39
39
  *
40
40
  * @param agentId - The agent id.
41
41
  * @param prompt - The prompt.
@@ -46,11 +46,11 @@ export declare class AiAgentClient {
46
46
  chat(agentId: AiAgentId, prompt: string, options?: ChatOptionsWithoutVoice): Observable<string>;
47
47
  transcribeAndChat(agentId: AiAgentId, fileToTranscribe: File, options?: ChatOptionsWithoutVoice): Promise<TranscribeAndChatResponse>;
48
48
  private chatInternal;
49
- search(agentId: string, options: AiSearchOptions): Promise<AiSearchResponse>;
49
+ search(agentId: AiAgentId, options: AiSearchOptions): Promise<AiSearchResponse>;
50
50
  /**
51
- * Sends a prompt to the specified profile id and returns the response as a Promise of string.
51
+ * Sends a prompt to the specified agent id and returns the response as a Promise of string.
52
52
  *
53
- * @param agentId - The agent id (profile id).
53
+ * @param agentId - The agent id.
54
54
  * @param prompt - The prompt.
55
55
  * @param options - The options to send to the chat model.
56
56
  * @returns A promise that resolves when the chat is complete. The resolved value is the entire response.
@@ -58,53 +58,52 @@ export declare class AiAgentClient {
58
58
  ask(agentId: AiAgentId, prompt: string, options?: AskOptionsWithoutVoice): Promise<string>;
59
59
  observeStatusUpdates(agentId: AiAgentId, options?: AiObserveStatusOptions): Observable<AiStatusMessage>;
60
60
  transcribeAndAsk(agentId: AiAgentId, fileToTranscribe: File, options?: AskOptionsWithoutVoice): Promise<AiTranscribeAndAskResponse>;
61
- transcribeAndAskWithVoiceResponse(agentId: AiAgentId, fileToTranscribe: File, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<TranscribeAndAskWithVoiceResponse>;
62
- askWithVoiceResponse(agentId: AiAgentId, prompt: string, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<AskWithVoiceResponse>;
63
- askInternal<T>(agentId: AiAgentId, prompt: string | File, isVoiceResponse: boolean, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<T>;
61
+ transcribeAndAskWithVoiceResponse(agentId: AiAgentId, fileToTranscribe: File, options?: Omit<AiAgentChatOptions, 'smoothTyping'>): Promise<TranscribeAndAskWithVoiceResponse>;
62
+ askWithVoiceResponse(agentId: AiAgentId, prompt: string, options?: Omit<AiAgentChatOptions, 'smoothTyping'>): Promise<AskWithVoiceResponse>;
63
+ askInternal<T>(agentId: AiAgentId, prompt: string | File, isVoiceResponse: boolean, options?: Omit<AiAgentChatOptions, 'smoothTyping'>): Promise<T>;
64
64
  private handleChatResponse;
65
65
  private handleStatusMessage;
66
66
  private createStatusSubject;
67
67
  }
68
68
  export interface AiChatBotContextData {
69
69
  title: string;
70
- context: AiChatbotContext;
70
+ context: AiAgentContext;
71
71
  }
72
72
  export interface AiChatBotContextDataWithId extends AiChatBotContextData {
73
73
  id?: string;
74
74
  }
75
- export type AiProfileData = Pick<AiChatbotProfileMetadata, (typeof MUTABLE_AI_CHATBOT_PROFILE_METADATA_FIELDS)[number]>;
75
+ export type AiAgentData = Pick<AiAgentMetadata, (typeof MUTABLE_AI_AGENT_METADATA_FIELDS)[number]>;
76
76
  export interface InstructionData {
77
77
  instruction: string;
78
78
  }
79
79
  export declare class AiAgentReference {
80
80
  private readonly client;
81
81
  private readonly integrationId;
82
- private readonly profileId;
83
- private readonly rpcManager;
82
+ private readonly agentId;
84
83
  /**
85
- * Sends a prompt to the current profile.
84
+ * Sends a prompt to the current agent.
86
85
  *
87
86
  * @param prompt - The prompt.
88
87
  * @param options - The chat options.
89
88
  * @returns An observable that emits when a new response token is received. The emitted value is the entire response
90
89
  * that has been received so far.
91
90
  */
92
- chat(prompt: string, options?: AiChatbotChatOptions): Observable<string>;
93
- transcribeAndChat(fileToTranscribe: File, options?: AiChatbotChatOptions): Promise<TranscribeAndChatResponse>;
91
+ chat(prompt: string, options?: AiAgentChatOptions): Observable<string>;
92
+ transcribeAndChat(fileToTranscribe: File, options?: AiAgentChatOptions): Promise<TranscribeAndChatResponse>;
94
93
  /**
95
- * Sends a prompt to the current profile and returns the response as a Promise of string.
94
+ * Sends a prompt to the current agent and returns the response.
96
95
  * @param prompt - The prompt.
97
96
  * @param options - The chat options.
98
97
  */
99
- ask(prompt: string, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<string>;
98
+ ask(prompt: string, options?: Omit<AiAgentChatOptions, 'smoothTyping'>): Promise<string>;
100
99
  observeStatusUpdates(options?: AiObserveStatusOptions): Observable<AiStatusMessage>;
101
100
  transcribeAndAsk(fileToTranscribe: File, options?: AskOptionsWithoutVoice): Promise<AiTranscribeAndAskResponse>;
102
- transcribeAndAskWithVoiceResponse(fileToTranscribe: File, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<TranscribeAndAskWithVoiceResponse>;
103
- askWithVoiceResponse(prompt: string, options?: Omit<AiChatbotChatOptions, 'smoothTyping'>): Promise<AskWithVoiceResponse>;
101
+ transcribeAndAskWithVoiceResponse(fileToTranscribe: File, options?: Omit<AiAgentChatOptions, 'smoothTyping'>): Promise<TranscribeAndAskWithVoiceResponse>;
102
+ askWithVoiceResponse(prompt: string, options?: Omit<AiAgentChatOptions, 'smoothTyping'>): Promise<AskWithVoiceResponse>;
104
103
  search(options: AiSearchOptions): Promise<AiSearchResponse>;
105
104
  /**
106
- * Retrieves a context reference for the current profile. A context reference can be used to add a new context entry
107
- * to the profile, or update/delete an existing entry context.
105
+ * Retrieves a context reference for the current agent. A context reference can be used to add a new context entry
106
+ * to the agent, or update/delete an existing entry context.
108
107
  *
109
108
  * @param id - The id of the context entry. If no id is passed, an id will be
110
109
  * generated and the reference will point to a new context entry.
@@ -113,8 +112,8 @@ export declare class AiAgentReference {
113
112
  context(id?: string): AiAgentContextReference;
114
113
  insertContexts(contexts: Array<AiChatBotContextDataWithId>, files?: Array<File | BlobAndFilename>): Promise<void>;
115
114
  /**
116
- * Retrieves an instruction reference for the current profile. An instruction reference can be used to add a new
117
- * instruction entry to the profile, or update/delete an existing instruction entry.
115
+ * Retrieves an instruction reference for the current agent. An instruction reference can be used to add a new
116
+ * instruction entry to the agent, or update/delete an existing instruction entry.
118
117
  *
119
118
  * @param id - The id of the instruction entry. If no id is passed, an id will be
120
119
  * generated and the reference will point to a new instruction entry.
@@ -122,32 +121,33 @@ export declare class AiAgentReference {
122
121
  */
123
122
  instruction(id?: string): AiAgentInstructionReference;
124
123
  /**
125
- * Adds a new profile to the chatbot. This will result in an error if a profile already exists with the same id.
124
+ * Creates a new AI Agent.
125
+ * This will result in an error if an agent already exists with the same id.
126
126
  *
127
- * @param data An object containing options for creating the profile.
127
+ * @param data An object containing options for creating the agent.
128
128
  * @param data.modelName - The name of the AI model (`gpt-3.5, `gpt-4`, `claude-3-5-sonnet-latest` or
129
129
  * `claude-3-5-haiku-latest`, `gemini-1.5-pro` `gemini-1.5-flash`).
130
- * @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
131
- * @returns A promise that resolves when the profile is successfully created.
130
+ * @param data.isPublic - Whether the chat functionality of the agent can be accessed without security rules.
131
+ * @returns A promise that resolves when the agent is successfully created.
132
132
  */
133
- insert(data: AiProfileData): Promise<void>;
133
+ create(data: AiAgentData): Promise<void>;
134
134
  /**
135
- * Updates an existing chatbot profile. This will result in an error if a profile has not yet been created for the
136
- * current profile id.
135
+ * Updates an existing agent.
136
+ * An error will be thrown if the agent has not yet been created for the current agent ID.
137
137
  *
138
- * @param data An object containing options for updating the profile.
139
- * @param data.modelName - The name of the OpenAI model (`gpt-3.5, `gpt-4`, `claude-3-5-sonnet-latest` or
140
- * `claude-3-5-haiku-latest`, `gemini-1.5-pro` `gemini-1.5-flash`).
141
- * @param data.isPublic - Whether the chat functionality of the profile can be accessed without security rules.
142
- * @param file - The file to insert.
143
- * @returns A promise that resolves when the profile is successfully updated.
138
+ * @param data - An object containing options for updating the agent.
139
+ * @param data.modelName - The name of the OpenAI model (`gpt-3.5`, `gpt-4`, `claude-3-5-sonnet-latest`,
140
+ * `claude-3-5-haiku-latest`, `gemini-1.5-pro`, or `gemini-1.5-flash`).
141
+ * @param data.isPublic - Whether the chat functionality of the agent can be accessed without security rules.
142
+ * @param file - The file to upload (optional).
143
+ * @returns A promise that resolves when the agent is successfully updated.
144
144
  */
145
- update(data: Partial<AiProfileData>, file?: File | BlobAndFilename): Promise<void>;
145
+ update(data: Partial<AiAgentData>, file?: File | BlobAndFilename): Promise<void>;
146
146
  /**
147
- * Deletes an existing chatbot profile. This will result in an error if a profile has not yet been created for the
148
- * current profile id.
147
+ * Deletes an existing agent.
148
+ * Throws an error if the agent has not been created for the current agent ID.
149
149
  *
150
- * @returns A promise that resolves when the profile is successfully deleted.
150
+ * @returns A promise that resolves when the agent is successfully deleted.
151
151
  */
152
152
  delete(): Promise<void>;
153
153
  feedback(feedback: string): Promise<void>;
@@ -156,71 +156,73 @@ export declare class AiAgentReference {
156
156
  export declare class AiAgentContextReference {
157
157
  private readonly client;
158
158
  private readonly integrationId;
159
- private readonly profileId;
159
+ private readonly agentId;
160
160
  private readonly id;
161
161
  /**
162
- * Adds a new context entry to the chatbot profile. This will result in an error if an entry already exists with
163
- * the same id.
162
+ * Adds a new context entry to the agent.
163
+ * Throws an error if an entry with the same ID already exists.
164
164
  *
165
- * @param data An object containing options for creating the entry.
165
+ * @param data - An object containing options for creating the entry.
166
166
  * @param data.title - The title of the entry.
167
167
  * @param data.context - The context data.
168
- * @param file - The file to insert.
169
- * @returns A promise that resolves when the context is successfully created.
168
+ * @param file - The file to upload (optional).
169
+ * @returns A promise that resolves when the context entry is successfully created.
170
170
  */
171
171
  insert(data: AiChatBotContextData, file?: File | BlobAndFilename): Promise<void>;
172
172
  /**
173
- * Appends data to an existing context entry on the chatbot profile. This will result in an error if an entry has not
173
+ * Appends data to an existing context entry on the agent.
174
+ * This will result in an error if an entry is not found.
175
+ *
174
176
  * @param data An object containing options for appending the entry.
175
177
  * @param file - The file to append.
176
178
  */
177
179
  append(data: AiChatBotContextData, file?: File): Promise<void>;
178
180
  /**
179
- * Updates an existing context entry on the chatbot profile. This will result in an error if an entry has not yet
180
- * been created for the current context id.
181
+ * Updates an existing context entry for the agent.
182
+ * Throws an error if an entry with the specified context ID does not exist.
181
183
  *
182
- * @param data An object containing options for updating the entry.
184
+ * @param data - An object containing options for updating the entry.
183
185
  * @param data.title - The title of the entry.
184
186
  * @param data.context - The context data.
185
- * @returns A promise that resolves when the context is successfully updated.
187
+ * @returns A promise that resolves when the context entry is successfully updated.
186
188
  */
187
189
  update(data: Partial<AiChatBotContextData>): Promise<void>;
188
190
  /**
189
- * Deletes an existing context entry on the chatbot profile. This will result in an error if an entry has not yet
190
- * been created for the current context id.
191
+ * Deletes an existing context entry for the agent.
192
+ * Throws an error if an entry with the specified context ID does not exist.
191
193
  *
192
- * @returns A promise that resolves when the context is successfully deleted.
194
+ * @returns A promise that resolves when the context entry is successfully deleted.
193
195
  */
194
196
  delete(): Promise<void>;
195
197
  }
196
198
  export declare class AiAgentInstructionReference {
197
199
  private readonly client;
198
200
  private readonly integrationId;
199
- private readonly profileId;
201
+ private readonly agentId;
200
202
  private readonly id;
201
203
  /**
202
- * Adds a new instruction entry to the chatbot profile. This will result in an error if an entry already exists with
203
- * the same id.
204
+ * Adds a new instruction entry to the agent.
205
+ * Throws an error if an entry with the same ID already exists.
204
206
  *
205
- * @param data An object containing options for creating the entry.
207
+ * @param data - An object containing options for creating the entry.
206
208
  * @param data.instruction - The instruction data.
207
- * @returns A promise that resolves when the instruction is successfully created.
209
+ * @returns A promise that resolves when the instruction entry is successfully created.
208
210
  */
209
211
  insert(data: InstructionData): Promise<void>;
210
212
  /**
211
- * Updates an existing instruction entry on the chatbot profile. This will result in an error if an entry has not
212
- * yet been created for the current instruction id.
213
+ * Updates an existing instruction entry for the agent.
214
+ * Throws an error if an entry with the specified instruction ID does not exist.
213
215
  *
214
- * @param data An object containing options for updating the entry.
216
+ * @param data - An object containing options for updating the entry.
215
217
  * @param data.instruction - The instruction data.
216
- * @returns A promise that resolves when the instruction is successfully updated.
218
+ * @returns A promise that resolves when the instruction entry is successfully updated.
217
219
  */
218
220
  update(data: InstructionData): Promise<void>;
219
221
  /**
220
- * Deletes an existing instruction entry on the chatbot profile. This will result in an error if an entry has not
221
- * yet been created for the current instruction id.
222
+ * Deletes an existing instruction entry for the agent.
223
+ * Throws an error if an entry with the specified instruction ID does not exist.
222
224
  *
223
- * @returns A promise that resolves when the instruction is successfully deleted.
225
+ * @returns A promise that resolves when the instruction entry is successfully deleted.
224
226
  */
225
227
  delete(): Promise<void>;
226
228
  }
@@ -1,4 +1,3 @@
1
- import { RpcManager } from './rpc.manager';
2
1
  import { MmEntity, MmEntityMatch, MmFindMatchesOptions, MmListEntitiesOptions, MmMatchMaker } from '../../internal-common/src/public-types/ai-matchmaking.types';
3
2
  /**
4
3
  * Client for the AI Matchmaking service. This service allows you to create matchmakers and insert entities into them.
@@ -6,7 +5,6 @@ import { MmEntity, MmEntityMatch, MmFindMatchesOptions, MmListEntitiesOptions, M
6
5
  */
7
6
  export declare class AiMatchMakingClient {
8
7
  private readonly rpcManager;
9
- constructor(rpcManager: RpcManager);
10
8
  /**
11
9
  * Creates a new matchmaker with the given id, description, and categories.
12
10
  * @param matchMaker The matchmaker to create.
@@ -1,4 +1,4 @@
1
- import { AiContextMetadata } from '../../internal-common/src/public-types/ai-chatbot.public-types';
1
+ import { AiContextMetadata } from '../../internal-common/src/public-types/ai-agent.public-types';
2
2
  import { DocumentTextDataResponse } from '../../internal-common/src/public-types/extraction.public-types';
3
3
  interface PsGetAccessTokenResponse {
4
4
  accessToken: string;
@@ -1,5 +1,5 @@
1
1
  export * from '../../internal-common/src/public-types/ai-assistant.public-types';
2
- export * from '../../internal-common/src/public-types/ai-chatbot.public-types';
2
+ export * from '../../internal-common/src/public-types/ai-agent.public-types';
3
3
  export * from '../../internal-common/src/public-types/api-client.public-types';
4
4
  export * from '../../internal-common/src/public-types/application.public-types';
5
5
  export * from '../../internal-common/src/public-types/bundle-data.public-types';
@@ -8,7 +8,7 @@ export * from '../../internal-common/src/public-types/context.public-types';
8
8
  export * from '../../internal-common/src/public-types/document.public-types';
9
9
  export * from '../../internal-common/src/public-types/http-status.enum';
10
10
  export * from '../../internal-common/src/public-types/integration.public-types';
11
- export * from '../../internal-common/src/public-types/integrations/ai_chatbot.public-types';
11
+ export * from '../../internal-common/src/public-types/integrations/ai_agent.public-types';
12
12
  export * from '../../internal-common/src/public-types/integrations/api.public-types';
13
13
  export * from '../../internal-common/src/public-types/metric.public-types';
14
14
  export * from '../../internal-common/src/public-types/mutation.public-types';
@@ -1 +1 @@
1
- export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.316";
1
+ export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.317";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.316",
3
+ "version": "1.0.317",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/typescript-client/src/index.d.ts",
@@ -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_built_in_db_size", "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_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,21 +0,0 @@
1
- import { ApiEndpointId, HttpMethod } from '../public-types/integrations/api.public-types';
2
- import { IntegrationId } from '../public-types/communication.public-types';
3
- import { ApiOptions } from '../public-types/api-client.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
- export interface CallApiRequest<BodyType = any> {
16
- integrationId: IntegrationId;
17
- endpointId: ApiEndpointId;
18
- body?: BodyType;
19
- overrideMethod?: HttpMethod;
20
- options: ApiOptions;
21
- }
@@ -1,18 +0,0 @@
1
- import { IntegrationId } from '../public-types/communication.public-types';
2
- export type NativeQueryRequestType = 'relational' | 'mongo';
3
- interface BaseNativeQueryContext {
4
- type: NativeQueryRequestType;
5
- integrationId: IntegrationId;
6
- }
7
- export interface RelationalNativeQueryContext extends BaseNativeQueryContext {
8
- type: 'relational';
9
- query: string;
10
- params: Record<string, any>;
11
- }
12
- export interface MongoNativeQueryContext extends BaseNativeQueryContext {
13
- type: 'mongo';
14
- collectionName: string;
15
- aggregationPipeline: Array<any | undefined>;
16
- }
17
- export type NativeQueryContext = RelationalNativeQueryContext | MongoNativeQueryContext;
18
- export {};