@squidcloud/client 1.0.415 → 1.0.416

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.
@@ -15,6 +15,11 @@ export declare const AI_PROVIDER_TYPES: readonly ["anthropic", "flux", "gemini",
15
15
  * chat/search/transcribe etc...).
16
16
  */
17
17
  export type AiProviderType = (typeof AI_PROVIDER_TYPES)[number];
18
+ /**
19
+ * Type of AI provider that supports file upload operations.
20
+ * Only a subset of AI providers support file management features.
21
+ */
22
+ export type AiFileProviderType = Extract<AiProviderType, 'openai' | 'gemini' | 'anthropic'>;
18
23
  /**
19
24
  * @category AI
20
25
  */
@@ -138,6 +138,8 @@ export type AiContextMetadataFilter = AiContextMetadataFieldFilter | AiContextMe
138
138
  export interface AiKnowledgeBaseContext {
139
139
  /** The unique identifier of the context entry. */
140
140
  id: string;
141
+ /** The application id of the context entry */
142
+ appId: AppId;
141
143
  /** The knowledge base id of the context entry */
142
144
  knowledgeBaseId: AiKnowledgeBaseId;
143
145
  /** The date and time the context was created. */
@@ -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
+ }
@@ -20,4 +20,8 @@ export interface DistributedLock {
20
20
  * @returns An observable that emits when the lock is released.
21
21
  */
22
22
  observeRelease(): Observable<void>;
23
+ /** The resource identifier (mutex name) that was locked. */
24
+ get resourceId(): string;
25
+ /** Unique lock instance ID within the system. */
26
+ get lockId(): string;
23
27
  }
@@ -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';
@@ -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.415";
5
+ export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.416";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.415",
3
+ "version": "1.0.416",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",