@squidcloud/client 1.0.415 → 1.0.417
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/metric-name.d.ts +9 -0
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +5 -0
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +2 -0
- package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +30 -0
- package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +148 -0
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +72 -0
- package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +177 -0
- package/dist/internal-common/src/types/ai-agent.types.d.ts +184 -0
- package/dist/internal-common/src/types/ai-assistant.types.d.ts +1 -0
- package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +202 -0
- package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +59 -0
- package/dist/internal-common/src/types/backend-function.types.d.ts +1 -0
- package/dist/internal-common/src/types/communication.types.d.ts +1 -0
- package/dist/internal-common/src/types/document.types.d.ts +1 -0
- package/dist/internal-common/src/types/file.types.d.ts +6 -0
- package/dist/internal-common/src/types/headers.types.d.ts +17 -0
- package/dist/internal-common/src/types/mutation.types.d.ts +1 -0
- package/dist/internal-common/src/types/notification.types.d.ts +5 -0
- package/dist/internal-common/src/types/observability.types.d.ts +78 -0
- package/dist/internal-common/src/types/query.types.d.ts +13 -0
- package/dist/internal-common/src/types/secret.types.d.ts +7 -0
- package/dist/internal-common/src/types/socket.types.d.ts +1 -0
- package/dist/internal-common/src/types/stage.d.ts +9 -0
- package/dist/internal-common/src/types/time-units.d.ts +1 -0
- package/dist/internal-common/src/types/url-shortener.types.d.ts +41 -0
- package/dist/internal-common/src/utils/array.d.ts +7 -0
- package/dist/internal-common/src/utils/e2e-test-utils.d.ts +2 -0
- package/dist/internal-common/src/utils/global.utils.d.ts +1 -0
- package/dist/internal-common/src/utils/http.d.ts +5 -0
- package/dist/internal-common/src/utils/lock.manager.d.ts +14 -0
- package/dist/internal-common/src/utils/metric-utils.d.ts +4 -0
- package/dist/internal-common/src/utils/metrics.types.d.ts +7 -0
- package/dist/internal-common/src/utils/object.d.ts +58 -0
- package/dist/internal-common/src/utils/serialization.d.ts +17 -0
- package/dist/internal-common/src/utils/squid.constants.d.ts +1 -0
- package/dist/internal-common/src/utils/trace-id-generator.d.ts +1 -0
- package/dist/internal-common/src/utils/validation.d.ts +19 -0
- package/dist/internal-common/src/websocket.impl.d.ts +26 -0
- package/dist/typescript-client/src/ai-client.d.ts +15 -1
- package/dist/typescript-client/src/ai-files-client.d.ts +33 -0
- package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts +2 -0
- package/dist/typescript-client/src/distributed-lock.manager.d.ts +17 -1
- package/dist/typescript-client/src/index.d.ts +1 -0
- package/dist/typescript-client/src/squid.d.ts +4 -2
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -3,10 +3,11 @@ import { AiAgentClientOptions } from './agent/ai-agent-client';
|
|
|
3
3
|
import { AiAgentReference } from './agent/ai-agent-client-reference';
|
|
4
4
|
import { AiAssistantClient } from './ai-assistant-client';
|
|
5
5
|
import { AiAudioClient } from './ai-audio-client';
|
|
6
|
+
import { AiFilesClient } from './ai-files-client';
|
|
6
7
|
import { AiImageClient } from './ai-image-client';
|
|
7
8
|
import { AiKnowledgeBaseReference } from './ai-knowledge-base/ai-knowledge-base-client-reference';
|
|
8
9
|
import { AiMatchMakingClient } from './ai-matchmaking-client';
|
|
9
|
-
import { AiAgent, AiAgentId, AiKnowledgeBase, AiKnowledgeBaseId, AiProviderType, ApplicationAiSettings, IntegrationId, SecretKey } from './public-types';
|
|
10
|
+
import { AiAgent, AiAgentId, AiFileProviderType, AiKnowledgeBase, AiKnowledgeBaseId, AiProviderType, ApplicationAiSettings, IntegrationId, SecretKey } from './public-types';
|
|
10
11
|
/**
|
|
11
12
|
* AiClient class serves as a facade for interacting with different AI services.
|
|
12
13
|
* It provides simplified access to AI chatbot and assistant functionalities
|
|
@@ -56,6 +57,19 @@ export declare class AiClient {
|
|
|
56
57
|
* @deprecated - Use `knowledgebase('kbId').searchContextsWith*()` instead.
|
|
57
58
|
*/
|
|
58
59
|
matchMaking(): AiMatchMakingClient;
|
|
60
|
+
/**
|
|
61
|
+
* Creates a client to manage files for a specific AI provider.
|
|
62
|
+
*
|
|
63
|
+
* @param provider - The AI provider (openai, gemini, or anthropic).
|
|
64
|
+
* @returns An AiFilesClient bound to the specified provider.
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* const openaiFiles = squid.ai().files('openai');
|
|
68
|
+
* const fileId = await openaiFiles.uploadFile({ file });
|
|
69
|
+
* await openaiFiles.deleteFile(fileId);
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
files(provider: AiFileProviderType): AiFilesClient;
|
|
59
73
|
/**
|
|
60
74
|
* Executes an AI query using a specific DB integration, sending a prompt to the AI and returning its response.
|
|
61
75
|
* This function allows for direct interaction with the AI's capabilities by sending text prompts and receiving
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for uploading a file to an AI provider.
|
|
3
|
+
* @category AI
|
|
4
|
+
*/
|
|
5
|
+
export interface UploadAiFileOptions {
|
|
6
|
+
/** The file to upload. */
|
|
7
|
+
file: File;
|
|
8
|
+
/** Optional expiration time in seconds for automatic cleanup. */
|
|
9
|
+
expirationInSeconds?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* AiFilesClient provides methods for managing files with a specific AI provider.
|
|
13
|
+
* The provider is bound when the client is created via `squid.ai().files(provider)`.
|
|
14
|
+
* @category AI
|
|
15
|
+
*/
|
|
16
|
+
export declare class AiFilesClient {
|
|
17
|
+
private readonly provider;
|
|
18
|
+
private readonly rpcManager;
|
|
19
|
+
/**
|
|
20
|
+
* Uploads a file to the AI provider for use with AI features like code interpreter.
|
|
21
|
+
*
|
|
22
|
+
* @param options - Options for uploading the file.
|
|
23
|
+
* @returns A Promise that resolves to the file ID assigned by the provider.
|
|
24
|
+
*/
|
|
25
|
+
uploadFile(options: UploadAiFileOptions): Promise<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Deletes a file from the AI provider's storage.
|
|
28
|
+
*
|
|
29
|
+
* @param fileId - The ID of the file to delete.
|
|
30
|
+
* @returns A Promise that resolves to true if the file was deleted, false if it didn't exist.
|
|
31
|
+
*/
|
|
32
|
+
deleteFile(fileId: string): Promise<boolean>;
|
|
33
|
+
}
|
package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts
CHANGED
|
@@ -69,10 +69,12 @@ export declare class AiKnowledgeBaseReference {
|
|
|
69
69
|
}): Promise<Array<AiKnowledgeBaseSearchResultChunk>>;
|
|
70
70
|
/**
|
|
71
71
|
* Performs a semantic search in the knowledge base and returns contexts with reasoning.
|
|
72
|
+
* Can be used for matchmaking or similarity search.
|
|
72
73
|
*/
|
|
73
74
|
searchContextsWithPrompt(request: Omit<AiKnowledgeBaseSearchContextsWithPromptRequest, 'knowledgeBaseId'>): Promise<Array<AiKnowledgeBaseContextWithReasoning>>;
|
|
74
75
|
/**
|
|
75
76
|
* Performs a semantic search in the knowledge base and returns contexts with reasoning.
|
|
77
|
+
* Can be used for matchmaking or similarity search.
|
|
76
78
|
*/
|
|
77
79
|
searchContextsWithContextId(request: Omit<AiKnowledgeBaseSearchContextsWithContextIdRequest, 'knowledgeBaseId'>): Promise<Array<AiKnowledgeBaseContextWithReasoning>>;
|
|
78
80
|
/**
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
/**
|
|
3
|
+
* Options for acquiring a distributed lock.
|
|
4
|
+
* @category Platform
|
|
5
|
+
*/
|
|
6
|
+
export interface DistributedLockOptions {
|
|
7
|
+
/**
|
|
8
|
+
* The maximum time the lock can be held before it is automatically released.
|
|
9
|
+
* If not specified, the lock will be held until explicitly released or the connection is lost.
|
|
10
|
+
* @default undefined (no limit).
|
|
11
|
+
*/
|
|
12
|
+
maxHoldTimeMillis?: number;
|
|
13
|
+
}
|
|
2
14
|
/**
|
|
3
15
|
* A handler for a distributed lock that can be released.
|
|
4
16
|
* @category Platform
|
|
@@ -9,7 +21,7 @@ export interface DistributedLock {
|
|
|
9
21
|
* The release process runs asynchronously. Use `observeRelease()` to be notified when the release completes.
|
|
10
22
|
* @returns A promise that resolves when the release message is sent, or undefined for backward compatibility.
|
|
11
23
|
*/
|
|
12
|
-
release(): Promise<void
|
|
24
|
+
release(): Promise<void>;
|
|
13
25
|
/**
|
|
14
26
|
* Whether the lock has been released.
|
|
15
27
|
* @returns True if the lock has been released.
|
|
@@ -20,4 +32,8 @@ export interface DistributedLock {
|
|
|
20
32
|
* @returns An observable that emits when the lock is released.
|
|
21
33
|
*/
|
|
22
34
|
observeRelease(): Observable<void>;
|
|
35
|
+
/** The resource identifier (mutex name) that was locked. */
|
|
36
|
+
get resourceId(): string;
|
|
37
|
+
/** Unique lock instance ID within the system. */
|
|
38
|
+
get lockId(): string;
|
|
23
39
|
}
|
|
@@ -5,6 +5,7 @@ export * from './agent/ai-agent-client.types';
|
|
|
5
5
|
export * from './ai-assistant-client';
|
|
6
6
|
export * from './ai-audio-client';
|
|
7
7
|
export * from './ai-client';
|
|
8
|
+
export * from './ai-files-client';
|
|
8
9
|
export * from './ai-image-client';
|
|
9
10
|
export * from './ai-knowledge-base/ai-knowledge-base-client';
|
|
10
11
|
export * from './ai-knowledge-base/ai-knowledge-base-client-reference';
|
|
@@ -3,7 +3,7 @@ import { AiClient } from './ai-client';
|
|
|
3
3
|
import { ApiClient } from './api-client';
|
|
4
4
|
import { CollectionReference } from './collection-reference';
|
|
5
5
|
import { ConnectionDetails } from './connection-details';
|
|
6
|
-
import { DistributedLock } from './distributed-lock.manager';
|
|
6
|
+
import { DistributedLock, DistributedLockOptions } from './distributed-lock.manager';
|
|
7
7
|
import { ExecuteFunctionOptions } from './execute-function-options';
|
|
8
8
|
import { ExternalAuthClient } from './external-auth-client';
|
|
9
9
|
import { ExtractionClient } from './extraction-client';
|
|
@@ -349,9 +349,11 @@ export declare class Squid {
|
|
|
349
349
|
* The lock will be released when the release method on the returned object is invoked or whenever the connection
|
|
350
350
|
* with the server is lost.
|
|
351
351
|
* @param mutex A string that uniquely identifies the lock.
|
|
352
|
+
* @param options Optional configuration for the lock, including maxHoldTimeMillis to automatically release the lock
|
|
353
|
+
* after a specified duration.
|
|
352
354
|
* @returns A promise that resolves with the lock object. The promise will reject if failed to acquire the lock.
|
|
353
355
|
*/
|
|
354
|
-
acquireLock(mutex: string): Promise<DistributedLock>;
|
|
356
|
+
acquireLock(mutex: string, options?: DistributedLockOptions): Promise<DistributedLock>;
|
|
355
357
|
/**
|
|
356
358
|
* Executes the given callback while holding a lock for the given mutex. The lock will be released when the callback
|
|
357
359
|
* finishes.
|