@squidcloud/client 1.0.413 → 1.0.414

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.
@@ -269,6 +269,22 @@ export interface AiAgentMemoryOptions {
269
269
  */
270
270
  expirationMinutes?: number;
271
271
  }
272
+ /**
273
+ * Model specification for integration-based LLM providers like Ollama.
274
+ * @category AI
275
+ */
276
+ export interface IntegrationModelSpec {
277
+ /** The integration ID that provides the LLM */
278
+ integrationId: IntegrationId;
279
+ /** The model name within that integration */
280
+ model: string;
281
+ }
282
+ /**
283
+ * Type for specifying which LLM model to use.
284
+ * Can be either a vendor model name (string) or an integration-based model (object).
285
+ * @category AI
286
+ */
287
+ export type AiChatModelSelection = AiChatModelName | IntegrationModelSpec;
272
288
  /**
273
289
  * The base AI agent chat options, should not be used directly.
274
290
  * @category AI
@@ -329,8 +345,8 @@ export interface BaseAiChatOptions {
329
345
  temperature?: number;
330
346
  /** Preset instruction options that can be toggled on */
331
347
  guardrails?: GuardrailsOptions;
332
- /** The LLM model to use. */
333
- model?: AiChatModelName;
348
+ /** The LLM model to use. Can be a vendor model name (string) or an integration-based model (object). */
349
+ model?: AiChatModelSelection;
334
350
  /** Which provider's reranker to use for reranking the context. Defaults to 'cohere'. */
335
351
  rerankProvider?: AiRerankProvider;
336
352
  /**
@@ -441,6 +457,8 @@ export interface AiAgent<T extends AiChatModelName | undefined = undefined> {
441
457
  options: AiChatOptions<T>;
442
458
  /** The embedding model name used by the agent. */
443
459
  embeddingModelName: AiEmbeddingsModelName;
460
+ /** Optional api key used specifically for operations on this agent */
461
+ apiKey?: string;
444
462
  }
445
463
  /**
446
464
  * @category AI
@@ -496,22 +514,6 @@ export interface AiChatMessage {
496
514
  export declare const AI_STATUS_MESSAGE_PARENT_MESSAGE_ID_TAG = "parent";
497
515
  /** The tag contains a response of the AI tool call. */
498
516
  export declare const AI_STATUS_MESSAGE_RESULT_TAG = "result";
499
- /**
500
- * The options for the AI agent search method.
501
- * @category AI
502
- */
503
- export interface AiSearchOptions {
504
- /** The prompt to search for */
505
- prompt: string;
506
- /** DEPRECATED: A set of filters that will limit the context the AI can access. */
507
- contextMetadataFilter?: AiContextMetadataFilter;
508
- /** A set of filters that will limit the context the AI can access. */
509
- contextMetadataFilterForKnowledgeBase?: Record<AiKnowledgeBaseId, AiContextMetadataFilter>;
510
- /** The maximum number of results to return */
511
- limit?: number;
512
- /** Which provider's reranker to use for reranking the context. Defaults to 'cohere'. */
513
- rerankProvider?: AiRerankProvider;
514
- }
515
517
  /**
516
518
  * A single chunk of data returned from an AI search operation.
517
519
  * @category AI
@@ -170,3 +170,11 @@ export type StableDiffusionModelName = (typeof STABLE_DIFFUSION_MODEL_NAMES)[num
170
170
  * @category AI
171
171
  */
172
172
  export type FluxModelName = (typeof FLUX_MODEL_NAMES)[number];
173
+ /**
174
+ * Type guard to check if a model selection is integration-based.
175
+ * @category AI
176
+ */
177
+ export declare function isIntegrationModelSpec(model: unknown): model is {
178
+ integrationId: string;
179
+ model: string;
180
+ };
@@ -1,6 +1,6 @@
1
1
  import { IntegrationId } from './communication.public-types';
2
2
  /** List of all integration types supported by Squid. */
3
- export declare const INTEGRATION_TYPES: readonly ["active_directory", "ai_agents", "ai_chatbot", "algolia", "alloydb", "api", "auth0", "azure_cosmosdb", "azure_postgresql", "azure_sql", "bigquery", "built_in_db", "built_in_gcs", "built_in_queue", "built_in_s3", "cassandra", "clickhouse", "cloudsql", "cockroach", "cognito", "connected_knowledgebases", "confluence", "confluent", "datadog", "db2", "descope", "documentdb", "dynamodb", "elasticsearch", "firebase_auth", "firestore", "gcs", "google_calendar", "google_docs", "google_drive", "graphql", "hubspot", "jira", "jwt_hmac", "jwt_rsa", "kafka", "linear", "mariadb", "monday", "mongo", "mssql", "databricks", "mysql", "newrelic", "okta", "onedrive", "oracledb", "pinecone", "postgres", "redis", "s3", "salesforce_crm", "sap_hana", "sentry", "servicenow", "snowflake", "spanner", "xata", "zendesk", "mail", "slack", "mcp", "a2a", "legend"];
3
+ export declare const INTEGRATION_TYPES: readonly ["active_directory", "ai_agents", "ai_chatbot", "algolia", "alloydb", "api", "auth0", "azure_cosmosdb", "azure_postgresql", "azure_sql", "bigquery", "built_in_db", "built_in_gcs", "built_in_queue", "built_in_s3", "cassandra", "clickhouse", "cloudsql", "cockroach", "cognito", "connected_knowledgebases", "confluence", "confluent", "datadog", "db2", "descope", "documentdb", "dynamodb", "elasticsearch", "firebase_auth", "firestore", "gcs", "google_calendar", "google_docs", "google_drive", "graphql", "hubspot", "jira", "jwt_hmac", "jwt_rsa", "kafka", "keycloak", "linear", "mariadb", "monday", "mongo", "mssql", "databricks", "mysql", "newrelic", "okta", "onedrive", "oracledb", "pinecone", "postgres", "redis", "s3", "salesforce_crm", "sap_hana", "sentry", "servicenow", "snowflake", "spanner", "xata", "zendesk", "mail", "slack", "mcp", "a2a", "legend", "ollama"];
4
4
  /**
5
5
  * @category Database
6
6
  */
@@ -8,7 +8,7 @@ export declare const DATA_INTEGRATION_TYPES: readonly ["bigquery", "built_in_db"
8
8
  /**
9
9
  * @category Auth
10
10
  */
11
- export declare const AUTH_INTEGRATION_TYPES: readonly ["auth0", "jwt_rsa", "jwt_hmac", "cognito", "okta", "descope", "firebase_auth"];
11
+ export declare const AUTH_INTEGRATION_TYPES: readonly ["auth0", "jwt_rsa", "jwt_hmac", "cognito", "okta", "keycloak", "descope", "firebase_auth"];
12
12
  /** Supported integration types for GraphQL-based services. */
13
13
  export declare const GRAPHQL_INTEGRATION_TYPES: readonly ["graphql", "linear"];
14
14
  /** Supported integration types for HTTP-based services. */
@@ -1,5 +1,5 @@
1
1
  import { Observable } from 'rxjs';
2
- import { AiAgent, AiChatMessage, AiConnectedAgentMetadata, AiSearchOptions, AiSearchResultChunk, AiStatusMessage, AiTranscribeAndAskResponse, AllAiAgentChatOptions, GuardrailsOptions, UpsertAgentRequest } from '../../../internal-common/src/public-types/ai-agent.public-types';
2
+ import { AiAgent, AiChatMessage, AiChatModelSelection, AiConnectedAgentMetadata, 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
5
  import { Paths } from '../../../internal-common/src/public-types/typescript.public-types';
@@ -18,6 +18,7 @@ export type UpsertAgentRequestParams = Omit<UpsertAgentRequest, 'id'>;
18
18
  */
19
19
  export declare class AiAgentReference {
20
20
  private readonly agentId;
21
+ private readonly agentApiKey;
21
22
  private readonly ongoingChatSequences;
22
23
  private readonly rpcManager;
23
24
  private readonly socketManager;
@@ -42,7 +43,7 @@ export declare class AiAgentReference {
42
43
  /**
43
44
  * Changes the AI model used by the agent.
44
45
  */
45
- updateModel(model: AiChatModelName): Promise<void>;
46
+ updateModel(model: AiChatModelSelection): Promise<void>;
46
47
  /**
47
48
  * Updates the list of agents connected to this agent.
48
49
  */
@@ -59,6 +60,18 @@ export declare class AiAgentReference {
59
60
  * Deletes the custom guardrails for the agent.
60
61
  */
61
62
  deleteCustomGuardrail(): Promise<void>;
63
+ /**
64
+ * Regenerates the api key for the agent.
65
+ * Will throw an error if the agent does not exist.
66
+ *
67
+ * @returns the new api key
68
+ */
69
+ regenerateApiKey(): Promise<string>;
70
+ /**
71
+ * Fetches the default api key for the agent
72
+ * @returns the api key if one exists
73
+ */
74
+ getApiKey(): Promise<string | undefined>;
62
75
  /**
63
76
  * Sends a prompt to the agent and receives streamed text responses.
64
77
  * @param prompt The text prompt to send to the agent.
@@ -77,10 +90,6 @@ export declare class AiAgentReference {
77
90
  * knows it can look up the job’s status.
78
91
  */
79
92
  transcribeAndChat(fileToTranscribe: File, options?: AiChatOptionsWithoutVoice, jobId?: JobId): Promise<TranscribeAndChatResponse>;
80
- /**
81
- * Performs a semantic search using the agent's knowledge base.
82
- */
83
- search(options: AiSearchOptions): Promise<Array<AiSearchResultChunk>>;
84
93
  /**
85
94
  * Sends a prompt and returns a full string response.
86
95
  * @param prompt The text prompt to send to the agent.
@@ -165,4 +174,8 @@ export declare class AiAgentReference {
165
174
  private replaceFileTags;
166
175
  private askInternal;
167
176
  private chatInternal;
177
+ /**
178
+ * Calls rpcManager post but with the agent api key if one was given during construction
179
+ */
180
+ private post;
168
181
  }
@@ -1,5 +1,16 @@
1
1
  import { AiAgent, AiAgentId } from '../public-types';
2
2
  import { AiAgentReference } from './ai-agent-client-reference';
3
+ /**
4
+ * Allows the user to provide custom options to the agent client
5
+ *
6
+ * @category AI
7
+ */
8
+ export type AiAgentClientOptions = {
9
+ /**
10
+ * Allows providing an agent API key that can be used instead of the app API key
11
+ */
12
+ apiKey?: string;
13
+ };
3
14
  /**
4
15
  * AiAgentClient manages AI agent interactions, including listing agents,
5
16
  * handling real-time chat responses, and processing AI status updates
@@ -16,7 +27,7 @@ export declare class AiAgentClient {
16
27
  * Retrieves an instance of AiAgentReference for a specific agent ID.
17
28
  * This reference provides methods for interacting with the agent.
18
29
  */
19
- agent(id: AiAgentId): AiAgentReference;
30
+ agent(id: AiAgentId, options?: AiAgentClientOptions | undefined): AiAgentReference;
20
31
  /**
21
32
  * Lists all agents available in the system.
22
33
  * @returns A promise that resolves to an array of AiAgent instances.
@@ -1,4 +1,5 @@
1
1
  import { AiQueryOptions, AiQueryResponse, ExecuteAiApiResponse } from '../../internal-common/src/public-types/ai-query.public-types';
2
+ import { AiAgentClientOptions } from './agent/ai-agent-client';
2
3
  import { AiAgentReference } from './agent/ai-agent-client-reference';
3
4
  import { AiAssistantClient } from './ai-assistant-client';
4
5
  import { AiAudioClient } from './ai-audio-client';
@@ -24,7 +25,7 @@ export declare class AiClient {
24
25
  * Returns a reference to the specified AI agent.
25
26
  * If no ID is provided, the built-in agent is used by default.
26
27
  */
27
- agent(agentId?: AiAgentId): AiAgentReference;
28
+ agent(agentId?: AiAgentId, options?: AiAgentClientOptions | undefined): AiAgentReference;
28
29
  /**
29
30
  * Returns a reference to the specified AI knowledge base.
30
31
  */
@@ -4,8 +4,12 @@ import { Observable } from 'rxjs';
4
4
  * @category Platform
5
5
  */
6
6
  export interface DistributedLock {
7
- /** Releases the lock. */
8
- release(): void;
7
+ /**
8
+ * Releases the lock by sending a release message to the server.
9
+ * The release process runs asynchronously. Use `observeRelease()` to be notified when the release completes.
10
+ * @returns A promise that resolves when the release message is sent, or undefined for backward compatibility.
11
+ */
12
+ release(): Promise<void> | void;
9
13
  /**
10
14
  * Whether the lock has been released.
11
15
  * @returns True if the lock has been released.
@@ -363,6 +363,8 @@ export declare class Squid {
363
363
  * @returns A promise that resolves when the destruct process is complete.
364
364
  */
365
365
  destruct(): Promise<void>;
366
+ /** Set to true if the client was destructured. */
367
+ get isDestructed(): boolean;
366
368
  /** Provides information about the connection to the Squid Server. */
367
369
  connectionDetails(): ConnectionDetails;
368
370
  /** Returns the notification client for handling (publishing and receiving) custom messages. */
@@ -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.413";
5
+ export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.414";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.413",
3
+ "version": "1.0.414",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",