@squidcloud/client 1.0.409 → 1.0.411

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.
@@ -1,3 +1,4 @@
1
+ import { AiAgentId } from './communication.public-types';
1
2
  /**
2
3
  * Configuration options for AI agent database integration.
3
4
  */
@@ -11,4 +12,8 @@ export interface AiAgentDatabaseIntegrationOptions {
11
12
  * When this list is not provided (i.e., it is `undefined`) or is empty, the AI agent has access to all collections.
12
13
  */
13
14
  collectionsToUse?: string[];
15
+ /** If true, provides more detailed status updates during AI query execution. Default: false. */
16
+ verboseStatusUpdates?: boolean;
17
+ /** If provided, this agent will be used to generate the query. */
18
+ generateQueryAgentId?: AiAgentId;
14
19
  }
@@ -740,4 +740,15 @@ export interface AiFileAnnotation {
740
740
  /** The AI file with the URL to the file */
741
741
  aiFileUrl: AiFileUrl;
742
742
  }
743
+ /**
744
+ * Context for an AI session
745
+ */
746
+ export type AiSessionContext = {
747
+ /** The ID of the client initiating the session. */
748
+ clientId: string;
749
+ /** The ID of the AI agent involved in the session. */
750
+ agentId: string;
751
+ /** The ID of the job associated with the session. */
752
+ jobId: JobId;
753
+ };
743
754
  export {};
@@ -31,7 +31,7 @@ export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-2.5-pro", "gemin
31
31
  *
32
32
  * @category AI
33
33
  */
34
- export declare const GROK_CHAT_MODEL_NAMES: readonly ["grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-4"];
34
+ 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"];
35
35
  /**
36
36
  * @category AI
37
37
  */
@@ -40,7 +40,7 @@ export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-3-7-sonnet-la
40
40
  * The supported AI model names.
41
41
  * @category AI
42
42
  */
43
- export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["o1", "o3", "o3-mini", "o4-mini", "gpt-5", "gpt-5-mini", "gpt-5-nano", "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"];
43
+ export declare const VENDOR_AI_CHAT_MODEL_NAMES: readonly ["o1", "o3", "o3-mini", "o4-mini", "gpt-5", "gpt-5-mini", "gpt-5-nano", "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"];
44
44
  /**
45
45
  * Check if the given model name is a global AI chat model name.
46
46
  */
@@ -1,6 +1,6 @@
1
- import { AiChatOptions } from './ai-agent.public-types';
1
+ import { AiChatOptions, AiSessionContext } from './ai-agent.public-types';
2
2
  import { ApiOptions } from './api-client.public-types';
3
- import { IntegrationId } from './communication.public-types';
3
+ import { AiAgentId, IntegrationId } from './communication.public-types';
4
4
  /**
5
5
  * Request to execute an AI query using a specific integration.
6
6
  * Supports additional query execution options.
@@ -35,6 +35,8 @@ export interface AiQueryOptions {
35
35
  generateQueryOptions?: AiQueryGenerateQueryOptions;
36
36
  /** Options specify how to query result should be analyzed (processed) before returning it to user. */
37
37
  analyzeResultsOptions?: AiQueryAnalyzeResultsOptions;
38
+ /** Session information for the AI query execution. */
39
+ sessionContext?: AiSessionContext;
38
40
  }
39
41
  /**
40
42
  * Options for the collection selection stage.
@@ -71,6 +73,10 @@ export interface AiQueryGenerateQueryOptions {
71
73
  aiOptions?: AiChatOptions;
72
74
  /** Number of retries due to errors in a generated AI query. Default: 2. */
73
75
  maxErrorCorrections?: number;
76
+ /**
77
+ * If provided, the AI Query process will use this agent to generate a query.
78
+ */
79
+ agentId?: AiAgentId;
74
80
  }
75
81
  /** Options for the query result analysis. */
76
82
  export interface AiQueryAnalyzeResultsOptions {
@@ -78,6 +84,10 @@ export interface AiQueryAnalyzeResultsOptions {
78
84
  enableCodeInterpreter?: boolean;
79
85
  /** Customizes AI agent behavior used by the stage. */
80
86
  aiOptions?: AiChatOptions;
87
+ /**
88
+ * If provided, the AI Query process will use this agent to analyze the query result and provide the final answer.
89
+ */
90
+ agentId?: AiAgentId;
81
91
  }
82
92
  /**
83
93
  * Response from an AI query execution.
@@ -51,11 +51,11 @@ export type DocTimestamp = number;
51
51
  * @category Database
52
52
  */
53
53
  export interface SquidDocument {
54
+ [fieldName: string]: FieldType | undefined;
54
55
  /** The unique identifier of the document. */
55
56
  __docId__: DocId;
56
57
  /** The timestamp of the document, typically in milliseconds. */
57
58
  __ts__: DocTimestamp;
58
- [fieldName: string]: FieldType | undefined;
59
59
  }
60
60
  /**
61
61
  * The full document identifier, combining collection name, document ID, and integration ID.
@@ -120,10 +120,6 @@ export declare class MutationContext<T = any> {
120
120
  readonly mutation: Mutation<T>;
121
121
  readonly beforeAndAfterDocs: BeforeAndAfterDocs<T>;
122
122
  readonly serverTimeStamp: Date;
123
- /**
124
- * Returns the type of the mutation (insert, update, or delete).
125
- */
126
- getMutationType(): MutationType;
127
123
  /**
128
124
  * Returns the state of the document before the mutation was applied.
129
125
  */
@@ -132,6 +128,10 @@ export declare class MutationContext<T = any> {
132
128
  * Returns the state of the document after the mutation was applied.
133
129
  */
134
130
  get after(): T | undefined;
131
+ /**
132
+ * Returns the type of the mutation (insert, update, or delete).
133
+ */
134
+ getMutationType(): MutationType;
135
135
  /** Returns true if the mutation affects the provided path. */
136
136
  affectsPath(path: Paths<T>): boolean;
137
137
  /**
@@ -103,6 +103,11 @@ export interface DisconnectAgentKnowledgeBaseRequest {
103
103
  export interface DeleteAgentRequest {
104
104
  agentId: AiAgentId;
105
105
  }
106
+ export interface SetAgentOptionInPathRequest {
107
+ agentId: AiAgentId;
108
+ path: string;
109
+ value: unknown;
110
+ }
106
111
  export interface ListAgentContextsRequest {
107
112
  agentId: AiAgentId;
108
113
  }
@@ -124,13 +129,6 @@ export interface UpsertAgentCustomGuardrailsRequest {
124
129
  export interface DeleteAgentCustomGuardrailsRequest {
125
130
  agentId: AiAgentId;
126
131
  }
127
- export interface ProvideAgentFeedbackRequest {
128
- agentId: AiAgentId;
129
- feedback: string;
130
- }
131
- export interface ResetAgentFeedbackRequest {
132
- agentId: AiAgentId;
133
- }
134
132
  export interface ListAgentsResponse {
135
133
  agents: Array<AiAgent>;
136
134
  }
@@ -164,3 +162,7 @@ export interface GetChatHistoryRequest {
164
162
  export interface GetChatHistoryResponse {
165
163
  messages: Array<AiChatMessage>;
166
164
  }
165
+ export interface ProvideAgentFeedbackRequest {
166
+ agentId: string;
167
+ feedback: string;
168
+ }
@@ -8,4 +8,10 @@ export declare function decodeValueForMapping(encodedString: string): any;
8
8
  * This function should not be used with objects with circular references.
9
9
  * Returns true if the object are equal.
10
10
  */
11
- export declare function compareByNormalizedJsonValue<T>(v1: T, v2: T): boolean;
11
+ export declare function compareByNormalizedJsonValue<T>(v1: T | undefined, v2: T | undefined): boolean;
12
+ /**
13
+ * Compares 2 objects by their normalized JSON value for specific fields only.
14
+ * This function should not be used with objects with circular references.
15
+ * Returns true if the specified fields are equal.
16
+ */
17
+ export declare function compareByNormalizedJsonValueForFields<T>(v1: T | undefined, v2: T | undefined, fields: Array<keyof T>): boolean;
@@ -1,7 +1,8 @@
1
1
  import { Observable } from 'rxjs';
2
- import { AiAgent, AiChatMessage, AiConnectedAgentMetadata, AiSearchOptions, AiSearchResultChunk, AiStatusMessage, AiTranscribeAndAskResponse, GuardrailsOptions, UpsertAgentRequest } from '../../../internal-common/src/public-types/ai-agent.public-types';
2
+ import { AiAgent, AiChatMessage, AiConnectedAgentMetadata, AiSearchOptions, AiSearchResultChunk, AiStatusMessage, AiTranscribeAndAskResponse, AllAiAgentChatOptions, GuardrailsOptions, UpsertAgentRequest } from '../../../internal-common/src/public-types/ai-agent.public-types';
3
3
  import { AiChatModelName } from '../../../internal-common/src/public-types/ai-common.public-types';
4
4
  import { JobId } from '../../../internal-common/src/public-types/job.public-types';
5
+ import { Paths } from '../../../internal-common/src/public-types/typescript.public-types';
5
6
  import { AiAskOptions, AiAskOptionsWithVoice, AiChatOptionsWithoutVoice, AskResponse, AskWithVoiceResponse, TranscribeAndAskWithVoiceResponse, TranscribeAndChatResponse } from './ai-agent-client.types';
6
7
  /**
7
8
  * Parameters for creating or updating an AI agent.
@@ -21,6 +22,7 @@ export declare class AiAgentReference {
21
22
  private readonly rpcManager;
22
23
  private readonly socketManager;
23
24
  private readonly jobClient;
25
+ private readonly backendFunctionManager;
24
26
  /**
25
27
  * Retrieves metadata and configuration of the AI agent.
26
28
  */
@@ -45,14 +47,6 @@ export declare class AiAgentReference {
45
47
  * Updates the list of agents connected to this agent.
46
48
  */
47
49
  updateConnectedAgents(connectedAgents: Array<AiConnectedAgentMetadata>): Promise<void>;
48
- /**
49
- * Sends user feedback to the agent.
50
- */
51
- provideFeedback(feedback: string): Promise<void>;
52
- /**
53
- * Resets any feedback previously provided to the agent.
54
- */
55
- resetFeedback(): Promise<void>;
56
50
  /**
57
51
  * Updates the agent's guardrails with the provided options.
58
52
  */
@@ -96,13 +90,6 @@ export declare class AiAgentReference {
96
90
  * knows it can look up the job’s status.
97
91
  */
98
92
  ask<T extends AiChatModelName | undefined = undefined>(prompt: string, options?: AiAskOptions<T>, jobId?: JobId): Promise<string>;
99
- /**
100
- * Helper to replace ${id:fileId} tags in the AI output with their corresponding Markdown.
101
- * @param aiResponse
102
- * @param annotations
103
- * @private
104
- */
105
- private replaceFileTags;
106
93
  /**
107
94
  * Sends a prompt and returns the string response and file annotations.
108
95
  * @param prompt The text prompt to send to the agent.
@@ -159,6 +146,23 @@ export declare class AiAgentReference {
159
146
  * knows it can look up the job’s status.
160
147
  */
161
148
  askWithVoiceResponse<T extends AiChatModelName | undefined>(prompt: string, options?: AiAskOptionsWithVoice<T>, jobId?: JobId): Promise<AskWithVoiceResponse>;
149
+ /**
150
+ * Sets a value at a specific path within the agent's options.
151
+ */
152
+ setAgentOptionInPath(path: Paths<AllAiAgentChatOptions> | string, value: unknown): Promise<void>;
153
+ /**
154
+ * Submits a feedback string for the agent. Requires an API Key.
155
+ * This feedback may update the agent's instructions, connected integrations, and may be forwarded to connected agents.
156
+ * @param feedback The feedback to provide for the agent.
157
+ */
158
+ provideFeedback(feedback: string): Promise<string>;
159
+ /**
160
+ * Helper to replace ${id:fileId} tags in the AI output with their corresponding Markdown.
161
+ * @param aiResponse
162
+ * @param annotations
163
+ * @private
164
+ */
165
+ private replaceFileTags;
162
166
  private askInternal;
163
167
  private chatInternal;
164
168
  }
@@ -10,6 +10,7 @@ export declare class AiAgentClient {
10
10
  private readonly rpcManager;
11
11
  private readonly socketManager;
12
12
  private readonly jobClient;
13
+ private readonly backendFunctionManager;
13
14
  private readonly ongoingChatSequences;
14
15
  /**
15
16
  * Retrieves an instance of AiAgentReference for a specific agent ID.
@@ -16,6 +16,7 @@ export declare class AiClient {
16
16
  private readonly socketManager;
17
17
  private readonly rpcManager;
18
18
  private readonly jobClient;
19
+ private readonly backendFunctionManager;
19
20
  private readonly aiAssistantClient;
20
21
  private aiAgentClient?;
21
22
  private aiKnowledgeBaseClient?;
@@ -70,7 +70,6 @@ export declare class DocumentReference<T extends DocumentData = any> {
70
70
  * @returns Whether the locally available version of the document may not be the latest version on the server.
71
71
  */
72
72
  isDirty(): boolean;
73
- private isTracked;
74
73
  /**
75
74
  * Updates the document with the given data.
76
75
  * The `update` will be reflected optimistically locally and will be applied to the server later.
@@ -147,5 +146,6 @@ export declare class DocumentReference<T extends DocumentData = any> {
147
146
  * immediately.
148
147
  */
149
148
  delete(transactionId?: TransactionId): Promise<void>;
149
+ private isTracked;
150
150
  private hasSquidPlaceholderId;
151
151
  }
@@ -293,7 +293,6 @@ export declare class GroupedJoin<Aliases extends Record<Alias, Alias[]>, ReturnT
293
293
  peek(): Array<Grouped<Aliases, WithDocumentReferences<ReturnType>, RootAlias>>;
294
294
  /** @inheritDoc */
295
295
  dereference(): SnapshotEmitter<Grouped<Aliases, ReturnType, RootAlias>>;
296
- private groupData;
297
296
  /** @inheritDoc */
298
297
  getSortOrders(): Array<FieldSort<any>>;
299
298
  /** @inheritDoc */
@@ -313,4 +312,5 @@ export declare class GroupedJoin<Aliases extends Record<Alias, Alias[]>, ReturnT
313
312
  * @returns A {@link Pagination} object for fetching paginated results.
314
313
  */
315
314
  paginate(options?: Partial<PaginationOptions>): Pagination<Grouped<Aliases, WithDocumentReferences<ReturnType>, RootAlias>>;
315
+ private groupData;
316
316
  }
@@ -36,15 +36,8 @@ export declare class Pagination<ReturnType> {
36
36
  private onFirstPage;
37
37
  private navigatingToLastPage;
38
38
  private lastElement;
39
- private goToFirstPage;
40
- private compareObjects;
41
- private dataReceived;
42
- private doNewQuery;
43
- private waitForInternalState;
44
- private internalStateToState;
45
39
  /** Unsubscribes from the pagination. */
46
40
  unsubscribe(): void;
47
- private prevInternal;
48
41
  /** Returns a promise that resolves when the previous page of data is available. */
49
42
  prev(): Promise<PaginationState<ReturnType>>;
50
43
  /** Returns a promise that resolves when the next page of data is available. */
@@ -62,4 +55,11 @@ export declare class Pagination<ReturnType> {
62
55
  * underlying query, regardless of whether the total document count is evenly divisible by the page size.
63
56
  */
64
57
  last(): Promise<PaginationState<ReturnType>>;
58
+ private goToFirstPage;
59
+ private compareObjects;
60
+ private dataReceived;
61
+ private doNewQuery;
62
+ private waitForInternalState;
63
+ private internalStateToState;
64
+ private prevInternal;
65
65
  }
@@ -20,14 +20,6 @@ export interface HasDereference {
20
20
  * @category Database
21
21
  */
22
22
  export declare abstract class BaseQueryBuilder<MyDocType extends DocumentData> {
23
- /**
24
- * Adds a condition to the query.
25
- * @param fieldName The name of the field to query.
26
- * @param operator The operator to use.
27
- * @param value The value to compare against.
28
- * @returns The query builder.
29
- */
30
- abstract where(fieldName: (keyof MyDocType & FieldName) | string, operator: Operator | 'in' | 'not in', value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
31
23
  /**
32
24
  * A shortcut for `where(fieldName, '==', value)`
33
25
  *
@@ -131,6 +123,14 @@ export declare abstract class BaseQueryBuilder<MyDocType extends DocumentData> {
131
123
  * @returns The query builder.
132
124
  */
133
125
  arrayNotIncludes(fieldName: (keyof MyDocType & FieldName) | string, values: Array<PrimitiveFieldType>): this;
126
+ /**
127
+ * Adds a condition to the query.
128
+ * @param fieldName The name of the field to query.
129
+ * @param operator The operator to use.
130
+ * @param value The value to compare against.
131
+ * @returns The query builder.
132
+ */
133
+ abstract where(fieldName: (keyof MyDocType & FieldName) | string, operator: Operator | 'in' | 'not in', value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
134
134
  /**
135
135
  * Sets a limit to the number of results returned by the query. The maximum limit is 20,000 and the default is 1,000
136
136
  * if none is provided.
@@ -165,6 +165,13 @@ export declare class QueryBuilder<DocumentType extends DocumentData> extends Bas
165
165
  private readonly queryBuilderFactory;
166
166
  private readonly documentIdentityService;
167
167
  private forceFetchFromServer;
168
+ /**
169
+ * A unique hash for the query. Identical queries should return the same hash
170
+ * value.
171
+ *
172
+ * @returns The query's hash string.
173
+ */
174
+ get hash(): string;
168
175
  /** @inheritDoc */
169
176
  where(fieldName: (keyof DocumentType & FieldName) | string, operator: Operator, value: PrimitiveFieldType | Array<PrimitiveFieldType>): this;
170
177
  /** @inheritDoc */
@@ -175,7 +182,6 @@ export declare class QueryBuilder<DocumentType extends DocumentData> extends Bas
175
182
  sortBy(fieldName: (keyof DocumentType & FieldName) | string, asc?: boolean): this;
176
183
  /** @inheritDoc */
177
184
  build(): Query;
178
- private mergeConditions;
179
185
  getSortOrder(): FieldSort<DocumentType>[];
180
186
  /**
181
187
  * @inheritDoc
@@ -198,13 +204,6 @@ export declare class QueryBuilder<DocumentType extends DocumentData> extends Bas
198
204
  * @inheritDoc
199
205
  */
200
206
  changes(): Observable<Changes<DocumentType>>;
201
- /**
202
- * A unique hash for the query. Identical queries should return the same hash
203
- * value.
204
- *
205
- * @returns The query's hash string.
206
- */
207
- get hash(): string;
208
207
  /** @inheritDoc */
209
208
  dereference(): SnapshotEmitter<DocumentType>;
210
209
  getSortOrders(): Array<FieldSort<any>>;
@@ -213,6 +212,7 @@ export declare class QueryBuilder<DocumentType extends DocumentData> extends Bas
213
212
  flipSortOrder(): QueryBuilder<DocumentType>;
214
213
  serialize(): SerializedSimpleQuery;
215
214
  paginate(options?: Partial<PaginationOptions>): Pagination<DocumentReference<DocumentType>>;
215
+ private mergeConditions;
216
216
  }
217
217
  /**
218
218
  * Describes the changes to a query result.
@@ -6,6 +6,12 @@ import { SecretEntry, SecretKey, SecretValue, SetSecretRequestEntry } from './pu
6
6
  */
7
7
  export declare class SecretClient {
8
8
  private readonly rpcManager;
9
+ /**
10
+ * Provides access to API key secret management operations.
11
+ *
12
+ * @returns An instance of {@link ApiKeysSecretClient} for managing API keys.
13
+ */
14
+ get apiKeys(): ApiKeysSecretClient;
9
15
  /**
10
16
  * Retrieves a stored custom secret by its key.
11
17
  *
@@ -54,12 +60,6 @@ export declare class SecretClient {
54
60
  * @returns A promise that resolves when the deletion request is complete.
55
61
  */
56
62
  deleteMany(keys: Array<SecretKey>, force?: boolean): Promise<void>;
57
- /**
58
- * Provides access to API key secret management operations.
59
- *
60
- * @returns An instance of {@link ApiKeysSecretClient} for managing API keys.
61
- */
62
- get apiKeys(): ApiKeysSecretClient;
63
63
  }
64
64
  /**
65
65
  * ApiKeysSecretClient manages API key secrets, providing methods
@@ -2,4 +2,4 @@
2
2
  * The current version of the SquidCloud client package.
3
3
  * @category Platform
4
4
  */
5
- export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.409";
5
+ export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.411";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.409",
3
+ "version": "1.0.411",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",