@squidcloud/client 1.0.410 → 1.0.412

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 (53) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/esm/index.js +1 -1
  3. package/dist/internal-common/src/metric-name.d.ts +9 -0
  4. package/dist/internal-common/src/public-types/ai-agent-integrations.public-types.d.ts +3 -0
  5. package/dist/internal-common/src/public-types/ai-query.public-types.d.ts +9 -1
  6. package/dist/internal-common/src/public-types/document.public-types.d.ts +1 -1
  7. package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +30 -0
  8. package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +148 -0
  9. package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +72 -0
  10. package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +177 -0
  11. package/dist/internal-common/src/types/ai-agent.types.d.ts +168 -0
  12. package/dist/internal-common/src/types/ai-assistant.types.d.ts +1 -0
  13. package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +202 -0
  14. package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +59 -0
  15. package/dist/internal-common/src/types/backend-function.types.d.ts +1 -0
  16. package/dist/internal-common/src/types/communication.types.d.ts +1 -0
  17. package/dist/internal-common/src/types/document.types.d.ts +1 -0
  18. package/dist/internal-common/src/types/file.types.d.ts +6 -0
  19. package/dist/internal-common/src/types/headers.types.d.ts +17 -0
  20. package/dist/internal-common/src/types/mutation.types.d.ts +1 -0
  21. package/dist/internal-common/src/types/notification.types.d.ts +5 -0
  22. package/dist/internal-common/src/types/observability.types.d.ts +78 -0
  23. package/dist/internal-common/src/types/query.types.d.ts +13 -0
  24. package/dist/internal-common/src/types/secret.types.d.ts +2 -0
  25. package/dist/internal-common/src/types/socket.types.d.ts +1 -0
  26. package/dist/internal-common/src/types/stage.d.ts +9 -0
  27. package/dist/internal-common/src/types/time-units.d.ts +1 -0
  28. package/dist/internal-common/src/types/url-shortener.types.d.ts +41 -0
  29. package/dist/internal-common/src/utils/array.d.ts +7 -0
  30. package/dist/internal-common/src/utils/e2e-test-utils.d.ts +2 -0
  31. package/dist/internal-common/src/utils/global.utils.d.ts +1 -0
  32. package/dist/internal-common/src/utils/http.d.ts +5 -0
  33. package/dist/internal-common/src/utils/lock.manager.d.ts +14 -0
  34. package/dist/internal-common/src/utils/metric-utils.d.ts +4 -0
  35. package/dist/internal-common/src/utils/metrics.types.d.ts +7 -0
  36. package/dist/internal-common/src/utils/object.d.ts +58 -0
  37. package/dist/internal-common/src/utils/serialization.d.ts +17 -0
  38. package/dist/internal-common/src/utils/squid.constants.d.ts +1 -0
  39. package/dist/internal-common/src/utils/trace-id-generator.d.ts +1 -0
  40. package/dist/internal-common/src/utils/validation.d.ts +19 -0
  41. package/dist/internal-common/src/websocket.impl.d.ts +26 -0
  42. package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +20 -16
  43. package/dist/typescript-client/src/agent/ai-agent-client.d.ts +1 -0
  44. package/dist/typescript-client/src/ai-client.d.ts +1 -0
  45. package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts +1 -1
  46. package/dist/typescript-client/src/document-reference.d.ts +1 -1
  47. package/dist/typescript-client/src/integration-client.d.ts +9 -1
  48. package/dist/typescript-client/src/query/join-query-builder.factory.d.ts +1 -1
  49. package/dist/typescript-client/src/query/pagination.d.ts +7 -7
  50. package/dist/typescript-client/src/query/query-builder.factory.d.ts +16 -16
  51. package/dist/typescript-client/src/secret.client.d.ts +6 -6
  52. package/dist/typescript-client/src/version.d.ts +1 -1
  53. package/package.json +1 -1
@@ -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?;
@@ -36,7 +36,7 @@ export declare class AiKnowledgeBaseReference {
36
36
  /**
37
37
  * Lists all contexts associated with the knowledge base.
38
38
  */
39
- listContexts(): Promise<Array<AiKnowledgeBaseContext>>;
39
+ listContexts(truncateTextAfter?: number): Promise<Array<AiKnowledgeBaseContext>>;
40
40
  /**
41
41
  * Lists the ids for all contexts associated with the knowledge base.
42
42
  */
@@ -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
  }
@@ -27,7 +27,15 @@ export declare class IntegrationClient {
27
27
  * @param integrationId - The ID of the integration to retrieve.
28
28
  * @returns A promise that resolves with the integration schema, or `undefined` if not found.
29
29
  */
30
- getIntegrationSchema<ConfigurationType = Record<string, any>>(integrationId: IntegrationId): Promise<IntegrationInfo<ConfigurationType> | undefined>;
30
+ getIntegrationSchema<SchemaType = Record<string, any>>(integrationId: IntegrationId): Promise<SchemaType | undefined>;
31
+ /**
32
+ * Sets the integration's schema by its ID.
33
+ *
34
+ * @param integrationId - The ID of the integration to update.
35
+ * @param schema - The schema to set for the integration.
36
+ * @returns A promise that resolves when the schema has been updated.
37
+ */
38
+ setIntegrationSchema<SchemaType = Record<string, any>>(integrationId: IntegrationId, schema: SchemaType): Promise<void>;
31
39
  /**
32
40
  * Deletes the integration with the given ID.
33
41
  *
@@ -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.410";
5
+ export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.412";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.410",
3
+ "version": "1.0.412",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",