@squidcloud/client 1.0.301 → 1.0.303
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/internal-common/src/public-types/ai-chatbot.public-types.d.ts +4 -2
- package/dist/internal-common/src/public-types/bundle-data.public-types.d.ts +9 -0
- package/dist/internal-common/src/public-types/integrations/ai_chatbot.public-types.d.ts +3 -3
- package/dist/internal-common/src/types/ai-chatbot.types.d.ts +2 -0
- package/dist/typescript-client/src/admin-client.d.ts +15 -0
- package/dist/typescript-client/src/console-utils.d.ts +1 -0
- package/dist/typescript-client/src/index.d.ts +2 -0
- package/dist/typescript-client/src/integration-client.d.ts +5 -1
- package/dist/typescript-client/src/squid-http-client.d.ts +29 -0
- package/dist/typescript-client/src/squid.d.ts +3 -6
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +3 -3
|
@@ -2,11 +2,11 @@ import { FunctionName, FunctionNameWithContext } from './bundle-data.public-type
|
|
|
2
2
|
import { IntegrationId } from './communication.public-types';
|
|
3
3
|
import { AiChatPromptQuotas, AiConnectedAgentMetadata } from '../types/ai-chatbot.types';
|
|
4
4
|
/** The supported OpenAI models */
|
|
5
|
-
export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "o1
|
|
5
|
+
export declare const OPENAI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "o1", "o1-mini"];
|
|
6
6
|
export declare const GEMINI_CHAT_MODEL_NAMES: readonly ["gemini-1.5-pro", "gemini-1.5-flash"];
|
|
7
7
|
export declare const ANTHROPIC_CHAT_MODEL_NAMES: readonly ["claude-3-5-haiku-latest", "claude-3-5-sonnet-latest"];
|
|
8
8
|
/** The supported AI model names. */
|
|
9
|
-
export declare const AI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "o1
|
|
9
|
+
export declare const AI_CHAT_MODEL_NAMES: readonly ["gpt-4o", "gpt-4o-mini", "o1", "o1-mini", "claude-3-5-haiku-latest", "claude-3-5-sonnet-latest", "gemini-1.5-pro", "gemini-1.5-flash"];
|
|
10
10
|
export declare const OPENAI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small", "text-embedding-3-large", "text-embedding-ada-002"];
|
|
11
11
|
export declare const AI_EMBEDDINGS_MODEL_NAMES: readonly ["text-embedding-3-small", "text-embedding-3-large", "text-embedding-ada-002"];
|
|
12
12
|
/** The supported AI image generation model names. */
|
|
@@ -133,6 +133,8 @@ export interface AiChatbotChatOptions {
|
|
|
133
133
|
overrideModel?: AiChatModelName;
|
|
134
134
|
/** File URLs (only images supported at the moment). */
|
|
135
135
|
fileUrls?: Array<AiFileUrl>;
|
|
136
|
+
/** Constrains effort on reasoning for reasoning models. o1 models only. */
|
|
137
|
+
reasoningEffort?: 'low' | 'medium' | 'high';
|
|
136
138
|
/** Global context passed to the agent and all AI functions of the agent. */
|
|
137
139
|
agentContext?: Record<string, unknown>;
|
|
138
140
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IntegrationType } from './integration.public-types';
|
|
1
2
|
/** The different types of actions that can be performed on a database. */
|
|
2
3
|
export type DatabaseActionType = 'read' | 'write' | 'update' | 'insert' | 'delete' | 'all';
|
|
3
4
|
/** The different types of actions that can be performed for storage. */
|
|
@@ -15,6 +16,14 @@ export interface AiFunctionParam {
|
|
|
15
16
|
type: AiFunctionParamType;
|
|
16
17
|
required: boolean;
|
|
17
18
|
}
|
|
19
|
+
/** Additional optional readonly metadata for AI function. */
|
|
20
|
+
export interface AiFunctionAttributes {
|
|
21
|
+
/**
|
|
22
|
+
* Type of integration this function is used for.
|
|
23
|
+
* Functions with defined 'integrationType' require 'integrationId' to be passed as part of the function context.
|
|
24
|
+
*/
|
|
25
|
+
integrationType?: IntegrationType;
|
|
26
|
+
}
|
|
18
27
|
export type TopicName = string;
|
|
19
28
|
export type FunctionName = string;
|
|
20
29
|
/** Function name with the contextual data. The data must be a serializable JSON. */
|
|
@@ -16,8 +16,8 @@ export type AiChatbotProfileMetadata = {
|
|
|
16
16
|
vectorDbType?: VectorDbType;
|
|
17
17
|
/** List of AI functions attached to the profile by default. */
|
|
18
18
|
functions?: Array<FunctionName>;
|
|
19
|
-
/** List of child AI
|
|
20
|
-
|
|
19
|
+
/** List of child AI agents that can be used by the current agent. */
|
|
20
|
+
connectedAgents?: Array<AiConnectedAgentMetadata>;
|
|
21
21
|
auditLog?: boolean;
|
|
22
22
|
};
|
|
23
23
|
export type AiChatbotContextMetadata = {
|
|
@@ -26,6 +26,6 @@ export type AiChatbotContextMetadata = {
|
|
|
26
26
|
preview: boolean;
|
|
27
27
|
sizeBytes?: number;
|
|
28
28
|
};
|
|
29
|
-
export type MutableAiChatbotProfileMetadataFieldsType = keyof Pick<AiChatbotProfileMetadata, 'modelName' | 'isPublic' | 'functions' | '
|
|
29
|
+
export type MutableAiChatbotProfileMetadataFieldsType = keyof Pick<AiChatbotProfileMetadata, 'modelName' | 'isPublic' | 'functions' | 'connectedAgents' | 'auditLog'>;
|
|
30
30
|
/** List of fields that can be updated in runtime via API. */
|
|
31
31
|
export declare const MUTABLE_AI_CHATBOT_PROFILE_METADATA_FIELDS: Array<MutableAiChatbotProfileMetadataFieldsType>;
|
|
@@ -10,6 +10,8 @@ export interface AiChatOptions {
|
|
|
10
10
|
instructions: Array<string>;
|
|
11
11
|
clientId: string;
|
|
12
12
|
fileUrls: Array<AiFileUrl>;
|
|
13
|
+
/** Constrains effort on reasoning for reasoning models. o1 models only. */
|
|
14
|
+
reasoningEffort?: 'low' | 'medium' | 'high';
|
|
13
15
|
/** Current AI profile ID (AI agent ID). */
|
|
14
16
|
agentId?: AiAgentId;
|
|
15
17
|
/** Global per-agent context passed to all AI functions. Must be a serializable JSON. */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IntegrationClient } from './integration-client';
|
|
2
|
+
import { RpcManager } from './rpc.manager';
|
|
3
|
+
import { SecretClient } from './secret.client';
|
|
4
|
+
import { SquidRegion } from '../../internal-common/src/public-types/regions.public-types';
|
|
5
|
+
import { AppId } from '../../internal-common/src/public-types/communication.public-types';
|
|
6
|
+
export declare class AdminClient {
|
|
7
|
+
private readonly rpcManager;
|
|
8
|
+
private readonly region;
|
|
9
|
+
private readonly appId;
|
|
10
|
+
private readonly integrationClient;
|
|
11
|
+
private readonly secretClient;
|
|
12
|
+
constructor(rpcManager: RpcManager, region: SquidRegion, appId: AppId);
|
|
13
|
+
integrations(): IntegrationClient;
|
|
14
|
+
secrets(): SecretClient;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getConsoleBaseUrl(appRegion: string, path?: string): string;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { IntegrationId, IntegrationInfo, IntegrationType } from './public-types';
|
|
2
2
|
export declare class IntegrationClient {
|
|
3
3
|
private readonly rpcManager;
|
|
4
|
+
private readonly iacBaseUrl;
|
|
4
5
|
list<ConfigurationType = Record<string, any>>(type?: IntegrationType): Promise<Array<IntegrationInfo<ConfigurationType>>>;
|
|
5
|
-
get<ConfigurationType = Record<string, any>>(
|
|
6
|
+
get<ConfigurationType = Record<string, any>>(integrationId: IntegrationId): Promise<IntegrationInfo<ConfigurationType> | undefined>;
|
|
7
|
+
delete(integrationId: IntegrationId): Promise<void>;
|
|
8
|
+
deleteMany(integrationIds: Array<IntegrationId>): Promise<void>;
|
|
9
|
+
upsertIntegration<ConfigurationType = Record<string, any>>(integration: IntegrationInfo<ConfigurationType>): Promise<void>;
|
|
6
10
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BlobAndFilename } from './types';
|
|
1
2
|
export declare class RpcError<BodyType = unknown> extends Error {
|
|
2
3
|
readonly statusCode: number;
|
|
3
4
|
readonly statusText: string;
|
|
@@ -5,6 +6,23 @@ export declare class RpcError<BodyType = unknown> extends Error {
|
|
|
5
6
|
readonly headers: Record<string, string>;
|
|
6
7
|
readonly body: BodyType;
|
|
7
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* A more general request interface for other HTTP methods
|
|
11
|
+
* (GET, PUT, PATCH, DELETE).
|
|
12
|
+
*/
|
|
13
|
+
interface HttpRequestInput<RequestBodyType = unknown> {
|
|
14
|
+
url: string;
|
|
15
|
+
headers: Record<string, string>;
|
|
16
|
+
message?: RequestBodyType;
|
|
17
|
+
files?: Array<File | BlobAndFilename>;
|
|
18
|
+
filesFieldName?: string;
|
|
19
|
+
extractErrorMessage: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Which method to use. E.g. 'GET', 'PUT', 'PATCH', 'DELETE'...
|
|
22
|
+
* For POST, we still use `HttpPostInput` for backward-compat.
|
|
23
|
+
*/
|
|
24
|
+
method: string;
|
|
25
|
+
}
|
|
8
26
|
/** A response object with type T for the body. */
|
|
9
27
|
export interface HttpResponse<BodyType = unknown> {
|
|
10
28
|
status: number;
|
|
@@ -12,3 +30,14 @@ export interface HttpResponse<BodyType = unknown> {
|
|
|
12
30
|
headers: Record<string, string>;
|
|
13
31
|
body: BodyType;
|
|
14
32
|
}
|
|
33
|
+
export declare function rawSquidHttpGet<ResponseType = unknown, RequestType = unknown>(input: Omit<HttpRequestInput<RequestType>, 'method' | 'files' | 'filesFieldName'>): Promise<HttpResponse<ResponseType>>;
|
|
34
|
+
export declare function rawSquidHttpPut<ResponseType = unknown, RequestType = unknown>(input: Omit<HttpRequestInput<RequestType>, 'method'> & {
|
|
35
|
+
files?: Array<File | BlobAndFilename>;
|
|
36
|
+
filesFieldName?: string;
|
|
37
|
+
}): Promise<HttpResponse<ResponseType>>;
|
|
38
|
+
export declare function rawSquidHttpPatch<ResponseType = unknown, RequestType = unknown>(input: Omit<HttpRequestInput<RequestType>, 'method'> & {
|
|
39
|
+
files?: Array<File | BlobAndFilename>;
|
|
40
|
+
filesFieldName?: string;
|
|
41
|
+
}): Promise<HttpResponse<ResponseType>>;
|
|
42
|
+
export declare function rawSquidHttpDelete<ResponseType = unknown, RequestType = unknown>(input: Omit<HttpRequestInput<RequestType>, 'method' | 'files' | 'filesFieldName'>): Promise<HttpResponse<ResponseType>>;
|
|
43
|
+
export {};
|
|
@@ -5,14 +5,13 @@ import { ConnectionDetails } from './connection-details';
|
|
|
5
5
|
import { DistributedLock } from './distributed-lock.manager';
|
|
6
6
|
import { ApiKey, AppId, CollectionName, DocumentData, EnvironmentId, IntegrationId, SquidDeveloperId, SquidRegion } from './public-types';
|
|
7
7
|
import { QueueManager } from './queue.manager';
|
|
8
|
-
import { SecretClient } from './secret.client';
|
|
9
8
|
import { StorageClient } from './storage-client';
|
|
10
9
|
import { TransactionId } from './types';
|
|
11
10
|
import { ObservabilityClient } from './observability-client';
|
|
12
11
|
import { ExtractionClient } from './extraction-client';
|
|
13
12
|
import { PersonalStorageClient } from './personal-storage-client';
|
|
14
13
|
import { SchedulerClient } from './scheduler-client';
|
|
15
|
-
import {
|
|
14
|
+
import { AdminClient } from './admin-client';
|
|
16
15
|
/** The different options that can be used to initialize a Squid instance. */
|
|
17
16
|
export interface SquidOptions {
|
|
18
17
|
/**
|
|
@@ -98,15 +97,14 @@ export declare class Squid {
|
|
|
98
97
|
private readonly clientIdService;
|
|
99
98
|
private readonly aiClientFactory;
|
|
100
99
|
private readonly _connectionDetails;
|
|
101
|
-
private readonly secretClient;
|
|
102
100
|
private readonly querySender;
|
|
103
101
|
private static readonly squidInstancesMap;
|
|
104
102
|
private readonly aiClient;
|
|
105
103
|
private readonly apiClient;
|
|
104
|
+
private readonly adminClient;
|
|
106
105
|
private readonly observabilityClient;
|
|
107
106
|
private readonly queueManagerFactory;
|
|
108
107
|
private readonly schedulerClient;
|
|
109
|
-
private readonly integrationClient;
|
|
110
108
|
private readonly _appId;
|
|
111
109
|
/**
|
|
112
110
|
* Creates a new instance of Squid with the given options.
|
|
@@ -207,13 +205,12 @@ export declare class Squid {
|
|
|
207
205
|
*/
|
|
208
206
|
ai(): AiClient;
|
|
209
207
|
api(): ApiClient;
|
|
208
|
+
admin(): AdminClient;
|
|
210
209
|
storage(integrationId?: IntegrationId): StorageClient;
|
|
211
210
|
personalStorage(integrationId: IntegrationId): PersonalStorageClient;
|
|
212
211
|
extraction(): ExtractionClient;
|
|
213
|
-
get secrets(): SecretClient;
|
|
214
212
|
get observability(): ObservabilityClient;
|
|
215
213
|
get schedulers(): SchedulerClient;
|
|
216
|
-
get integrations(): IntegrationClient;
|
|
217
214
|
get appId(): AppId;
|
|
218
215
|
/**
|
|
219
216
|
* Returns a distributed lock for the given mutex. The lock can be used to synchronize access to a shared resource.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.
|
|
1
|
+
export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.303";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squidcloud/client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.303",
|
|
4
4
|
"description": "A typescript implementation of the Squid client",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"types": "dist/typescript-client/src/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"license": "ISC",
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"json-schema-typed": "^8.0.1",
|
|
41
|
-
"ws": "^8.
|
|
41
|
+
"ws": "^8.17.1"
|
|
42
42
|
},
|
|
43
43
|
"optionalDependencies": {
|
|
44
44
|
"bufferutil": "^4.0.8",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"otrie": "^1.1.3",
|
|
57
57
|
"tsconfig-paths-webpack-plugin": "^4.1.0",
|
|
58
58
|
"tscpaths": "^0.0.9",
|
|
59
|
-
"webpack": "^5.
|
|
59
|
+
"webpack": "^5.96.0",
|
|
60
60
|
"webpack-cli": "^5.1.4"
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|