@squidcloud/client 1.0.423 → 1.0.425

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 (54) 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 +14 -0
  5. package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +81 -13
  6. package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +12 -15
  7. package/dist/internal-common/src/public-types/ai-query.public-types.d.ts +14 -0
  8. package/dist/internal-common/src/public-types/integration.public-types.d.ts +2 -2
  9. package/dist/internal-common/src/public-types/web.public-types.d.ts +26 -0
  10. package/dist/internal-common/src/public-types-backend/api-call.public-context.d.ts +30 -0
  11. package/dist/internal-common/src/public-types-backend/mutation.public-context.d.ts +148 -0
  12. package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +72 -0
  13. package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +177 -0
  14. package/dist/internal-common/src/types/ai-agent.types.d.ts +195 -0
  15. package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +202 -0
  16. package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +59 -0
  17. package/dist/internal-common/src/types/communication.types.d.ts +1 -0
  18. package/dist/internal-common/src/types/document.types.d.ts +1 -0
  19. package/dist/internal-common/src/types/file.types.d.ts +6 -0
  20. package/dist/internal-common/src/types/headers.types.d.ts +17 -0
  21. package/dist/internal-common/src/types/mutation.types.d.ts +1 -0
  22. package/dist/internal-common/src/types/notification.types.d.ts +5 -0
  23. package/dist/internal-common/src/types/observability.types.d.ts +101 -0
  24. package/dist/internal-common/src/types/query.types.d.ts +13 -0
  25. package/dist/internal-common/src/types/secret.types.d.ts +7 -0
  26. package/dist/internal-common/src/types/socket.types.d.ts +1 -0
  27. package/dist/internal-common/src/types/stage.d.ts +9 -0
  28. package/dist/internal-common/src/types/time-units.d.ts +1 -0
  29. package/dist/internal-common/src/types/url-shortener.types.d.ts +45 -0
  30. package/dist/internal-common/src/utils/array.d.ts +7 -0
  31. package/dist/internal-common/src/utils/e2e-test-utils.d.ts +2 -0
  32. package/dist/internal-common/src/utils/file-utils.d.ts +2 -0
  33. package/dist/internal-common/src/utils/global.utils.d.ts +1 -0
  34. package/dist/internal-common/src/utils/http.d.ts +5 -0
  35. package/dist/internal-common/src/utils/lock.manager.d.ts +14 -0
  36. package/dist/internal-common/src/utils/metric-utils.d.ts +4 -0
  37. package/dist/internal-common/src/utils/metrics.types.d.ts +7 -0
  38. package/dist/internal-common/src/utils/object.d.ts +86 -0
  39. package/dist/internal-common/src/utils/serialization.d.ts +18 -0
  40. package/dist/internal-common/src/utils/squid.constants.d.ts +1 -0
  41. package/dist/internal-common/src/utils/trace-id-generator.d.ts +1 -0
  42. package/dist/internal-common/src/utils/validation.d.ts +19 -0
  43. package/dist/internal-common/src/websocket.impl.d.ts +26 -0
  44. package/dist/typescript-client/src/agent/ai-agent-client-reference.d.ts +17 -1
  45. package/dist/typescript-client/src/ai-client.d.ts +0 -7
  46. package/dist/typescript-client/src/index.d.ts +0 -2
  47. package/dist/typescript-client/src/public-types.d.ts +0 -1
  48. package/dist/typescript-client/src/version.d.ts +1 -1
  49. package/dist/typescript-client/src/web-client.d.ts +9 -14
  50. package/package.json +1 -1
  51. package/dist/internal-common/src/public-types/ai-assistant.public-types.d.ts +0 -31
  52. package/dist/node_modules/json-schema-typed/draft-2020-12.d.ts +0 -1239
  53. package/dist/typescript-client/src/ai-assistant-client.d.ts +0 -72
  54. /package/dist/{typescript-client/src/file-utils.d.ts → internal-common/src/types/backend-function.types.d.ts} +0 -0
@@ -0,0 +1,101 @@
1
+ import { MetricName } from '../metric-name';
2
+ import { AppId } from '../public-types/communication.public-types';
3
+ export interface ObservableNameMetrics {
4
+ count: MetricName;
5
+ time: MetricName;
6
+ }
7
+ export declare const ObservableNames: {
8
+ readonly functionExecution: ObservableNameMetrics;
9
+ readonly codeInitialization: ObservableNameMetrics;
10
+ readonly getAiChatbotProfiles: ObservableNameMetrics;
11
+ readonly aiImageGeneration: ObservableNameMetrics;
12
+ readonly aiRemoveBackground: ObservableNameMetrics;
13
+ readonly aiAudioTranscribe: ObservableNameMetrics;
14
+ readonly aiAudioCreateSpeech: ObservableNameMetrics;
15
+ readonly discoverGraphQLConnectionSchema: ObservableNameMetrics;
16
+ readonly discoverOpenApiSchema: ObservableNameMetrics;
17
+ readonly discoverOpenApiSchemaFromFile: ObservableNameMetrics;
18
+ readonly graphqlQuery: ObservableNameMetrics;
19
+ readonly testGraphQLConnection: ObservableNameMetrics;
20
+ readonly testAgentProtocolConnection: ObservableNameMetrics;
21
+ readonly graphql: ObservableNameMetrics;
22
+ };
23
+ export type ObservableName = keyof typeof ObservableNames;
24
+ export interface MetricEvent {
25
+ appId: AppId;
26
+ name: MetricName;
27
+ tags: Record<string, string>;
28
+ timestamp: Date;
29
+ value: number;
30
+ isExposedToUser: boolean;
31
+ }
32
+ export interface LogEvent {
33
+ message: string;
34
+ level: string;
35
+ tags: Record<string, string>;
36
+ timestamp: Date;
37
+ isExposedToUser: boolean;
38
+ host: string;
39
+ source?: string;
40
+ service?: string;
41
+ }
42
+ export declare const AUDIT_LOG_EVENT_NAMES: readonly ["ai_agent"];
43
+ export type AuditLogEventName = (typeof AUDIT_LOG_EVENT_NAMES)[number];
44
+ export interface AuditLogEvent {
45
+ appId: AppId;
46
+ name: AuditLogEventName;
47
+ timestamp: Date;
48
+ context: {
49
+ clientId?: string;
50
+ userId: string;
51
+ };
52
+ tags: Record<string, string>;
53
+ }
54
+ /** Agent audit log entry - one per agent invocation */
55
+ export interface AgentAuditLogEvent {
56
+ appId: AppId;
57
+ agentId: string;
58
+ jobId: string;
59
+ prompt: string;
60
+ tags: Record<string, string>;
61
+ createdAt: Date;
62
+ }
63
+ export type AgentAuditLogUpdateType = 'statusUpdate' | 'response';
64
+ /** Agent audit log update entry - status updates and responses for agent invocations */
65
+ export interface AgentAuditLogUpdateEvent {
66
+ appId: AppId;
67
+ agentId: string;
68
+ jobId: string;
69
+ statusUpdateId: string;
70
+ title: string;
71
+ parentStatusUpdateId?: string;
72
+ tags: Record<string, string>;
73
+ body: string;
74
+ type: AgentAuditLogUpdateType;
75
+ createdAt: Date;
76
+ }
77
+ /** Tag for metric events. Value: '0' - not an error, '1' - is an error. */
78
+ export declare const O11Y_TAG_IS_ERROR = "isError";
79
+ /** Tag for log events. Metrics have an explicit appId field. */
80
+ export declare const O11Y_TAG_APP_ID = "appId";
81
+ /** Tag for metric and log events. */
82
+ export declare const O11Y_TAG_INTEGRATION_ID = "integrationId";
83
+ /** Tag for AI events. */
84
+ export declare const O11Y_TAG_AI_MODEL = "aiModel";
85
+ export declare const O11Y_TAG_AI_PROFILE = "aiProfile";
86
+ /** Tag for AI KnowledgeBase events */
87
+ export declare const O11Y_TAG_AI_KNOWLEDGE_BASE_MODEL = "aiKnowledgeBaseModel";
88
+ export declare const O11Y_TAG_API_KEY_SOURCE = "apiKeySource";
89
+ /** Tag for metric and log events. Value: '0' - not a tenant originated, '1' - is a tenant originated. */
90
+ export declare const O11Y_TAG_IS_TENANT_ORIGINATED = "isTenantOriginated";
91
+ /** Contains a full (with a service name) function name for backend functions. */
92
+ export declare const O11Y_TAG_FUNCTION_NAME = "functionName";
93
+ /** Contains a type of the function name for backend functions (See ExecuteFunctionAnnotationType.). */
94
+ export declare const O11Y_TAG_FUNCTION_TYPE = "functionType";
95
+ /** Tag for the trace ID. Used in logs. */
96
+ export declare const O11Y_TAG_TRACE_ID = "trace_id";
97
+ /** Tag for the span ID. Used in logs. */
98
+ export declare const O11Y_TAG_SPAN_ID = "span_id";
99
+ export declare function getBooleanMetricTagValue(value: boolean): string;
100
+ export declare const COUNT_METRIC_SUFFIXES: string[];
101
+ export declare const GAUGE_METRIC_SUFFIXES: string[];
@@ -0,0 +1,13 @@
1
+ import { Condition, SimpleCondition } from '../public-types/query.public-types';
2
+ /**
3
+ * Generates the regex pattern, handling special characters as follows:
4
+ * - `_` is replaced with a `.`
5
+ * - `%` is replaced with `[\s\S]*`.
6
+ * - The above characters can be escaped with \, eg. `\_` is replaced with `_` and `\%` with `%`.
7
+ * - All special characters in regex (-, /, \, ^, $, *, +, ?, ., (, ), |, [, ], {, }) get escaped with \
8
+ *
9
+ * Exported for testing purposes.
10
+ * */
11
+ export declare function replaceSpecialCharacters(input: string): string;
12
+ /** Returns true if the condition is a 'SimpleCondition' or false otherwise. */
13
+ export declare function isSimpleCondition(condition: Condition): condition is SimpleCondition;
@@ -0,0 +1,7 @@
1
+ import { ApiKeyEntry } from '../public-types/secret.public-types';
2
+ export declare const BACKEND_API_KEY = "_BACKEND_API_KEY";
3
+ export declare const APP_API_KEY = "APP_API_KEY";
4
+ export declare const AGENT_API_HEADER = "x-squid-agent-api-key";
5
+ export interface AgentSecrets {
6
+ apiKey: ApiKeyEntry | undefined;
7
+ }
@@ -0,0 +1 @@
1
+ export declare const SOCKET_RECONNECT_TIMEOUT: number;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Stage of the Squid deployment:
3
+ * - 'local' - Squid is run locally.
4
+ * - 'prod' - Production environment (https://console.getsquid.ai).
5
+ * - 'sandbox' - One of the sandbox environments (https://console.sandbox.squid.cloud).
6
+ * - 'staging' - One of the staging environments (https://console.staging.squid.cloud).
7
+ */
8
+ export declare const STAGES: readonly ["local", "prod", "sandbox", "staging"];
9
+ export type Stage = (typeof STAGES)[number];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,45 @@
1
+ import { AppId } from '../public-types/communication.public-types';
2
+ /**
3
+ * Request to create a shortened URL.
4
+ */
5
+ export interface ShortUrlRequest {
6
+ /** The URL to shorten. It must be a valid URL and should include the protocol (start with http:// or https://). */
7
+ url: string;
8
+ /** The application ID that will own this shortened URL. */
9
+ appId: AppId;
10
+ /** Seconds to live for the shortened URL. If set to 0, the URL will never expire. Defaults to 1 day. */
11
+ secondsToLive?: number;
12
+ /** Optional file extension to include in the shortened URL ID (e.g., 'pdf', 'html'). The extension becomes part of the ID, so 'abc123.pdf' and 'abc123.jpg' are distinct URLs. */
13
+ fileExtension?: string;
14
+ }
15
+ /**
16
+ * Request to create shortened URLs.
17
+ */
18
+ export interface ShortUrlBulkRequest {
19
+ /** The URLs to shorten. They must be valid URLs and should include the protocol (start with http:// or https://). */
20
+ urls: string[];
21
+ /** The application ID that will own these shortened URLs. */
22
+ appId: AppId;
23
+ /** Seconds to live for all shortened URLs. If set to 0, the URLs will never expire. Defaults to 1 day. */
24
+ secondsToLive?: number;
25
+ /** Optional file extension to include in all shortened URL IDs (e.g., 'pdf', 'html'). The extension becomes part of each ID, so 'abc123.pdf' and 'abc123.jpg' are distinct URLs. */
26
+ fileExtension?: string;
27
+ }
28
+ /**
29
+ * Request to delete a shortened URL.
30
+ */
31
+ export interface ShortUrlDeleteRequest {
32
+ /** The ID of the shortened URL to delete. */
33
+ id: string;
34
+ /** The application ID that owns the shortened URL. */
35
+ appId: AppId;
36
+ }
37
+ /**
38
+ * Request to delete a shortened URL.
39
+ */
40
+ export interface ShortUrlBulkDeleteRequest {
41
+ /** The IDs of the shortened URLs to delete. */
42
+ ids: string[];
43
+ /** The application ID that owns the shortened URLs. */
44
+ appId: AppId;
45
+ }
@@ -0,0 +1,7 @@
1
+ export declare function truncateOrPadArray(arr: number[], length: number): number[];
2
+ /**
3
+ * Computes a single “recommended” chunk size so that if you loop
4
+ * `for (let i = 0; i < length; i += chunkSize)`,
5
+ * no slice will exceed `maxChunkSize` and all chunk sizes are 'almost' equal.
6
+ */
7
+ export declare function computeRecommendedChunkSize(length: number, maxChunkSize: number): number;
@@ -0,0 +1,2 @@
1
+ /** Returns true if the application is run by a Playwright test. */
2
+ export declare function isPlaywrightTestMode(): boolean | undefined;
@@ -0,0 +1,2 @@
1
+ /** Gets file extension from filename. */
2
+ export declare function getFileExtension(filename: string): string | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { AppId } from '../public-types/communication.public-types';
2
+ import { Stage } from '../types/stage';
3
+ export declare const KOTLIN_CONTROLLERS: string[];
4
+ export declare function getEnvironmentPrefix(shard: string | undefined, region: string, cloudId: string, stage: Stage): string;
5
+ export declare function getApplicationUrl(environmentPrefix: string, appId: string, path: string, appIdPlaceholder?: AppId, environmentPrefixPlaceholder?: string, forceKotlin?: boolean): string;
@@ -0,0 +1,14 @@
1
+ type LockMutex = string;
2
+ /**
3
+ * A simple lock manager that locks a list of mutexes.
4
+ * When locking a list of mutexes, the lock will start only when all the mutexes are available - preventing partial lock
5
+ * and potential deadlocks.
6
+ */
7
+ export declare class LockManager {
8
+ private readonly locks;
9
+ lock(...mutexes: LockMutex[]): Promise<void>;
10
+ release(...mutexes: LockMutex[]): void;
11
+ canGetLock(...mutexes: LockMutex[]): boolean;
12
+ lockSync(...mutexes: LockMutex[]): void;
13
+ }
14
+ export {};
@@ -0,0 +1,4 @@
1
+ import { QueryMetricsRequestCommon, QueryMetricsResultGroup } from '../public-types/metric.public-types';
2
+ export type QueryMetricsRequestIntervals = Required<Pick<QueryMetricsRequestCommon, 'fillValue' | 'fn' | 'groupByTags' | 'periodEndSeconds' | 'periodStartSeconds' | 'pointIntervalAlignment' | 'pointIntervalSeconds' | 'tagDomains' | 'noDataBehavior'>>;
3
+ /** Adds missed known tag domain groups and fills all missed points with a request.fillValue. */
4
+ export declare function fillMissedPoints(request: QueryMetricsRequestIntervals, resultGroups: Array<QueryMetricsResultGroup>): void;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Type suffixes defines the type of the metric and can be used for
3
+ * metric value validation for incoming metrics.
4
+ */
5
+ export declare const SQUID_METRIC_TYPE_SUFFIXES: readonly ["_count", "_time", "_size", "_entries", "_value"];
6
+ /** Returns true if the given metric has a valid metric type. */
7
+ export declare function hasValidMetricTypeSuffix(metricName: string): boolean;
@@ -0,0 +1,86 @@
1
+ /** Returns a value by the `path`. Works with array indexes, like a.b[0]. */
2
+ export declare function getInPath(obj: unknown, path: string): any;
3
+ export declare function isDateObject(value: unknown): value is Date;
4
+ /** Sets a value by path . Does not support array indexes. */
5
+ export declare function setInPath(obj: object, path: string, value: unknown, delimiter?: string): void;
6
+ export declare function deleteInPath(obj: object, path: string, delimiter?: string): void;
7
+ export declare function replaceKeyInMap<K, T>(map: Map<K, T | undefined>, a: K, b: K): void;
8
+ export declare function replaceKeyInRecord<K extends keyof any, T>(record: Record<K, T>, a: K, b: K): void;
9
+ export declare function isNil(obj: unknown): obj is null | undefined;
10
+ export declare function isEqual(a: unknown, b: unknown): boolean;
11
+ export declare function isEmpty(a: unknown): boolean;
12
+ export declare function omit<T extends object, K extends PropertyKey[]>(object: T | null | undefined, ...fieldsToRemove: K): Pick<T, Exclude<keyof T, K[number]>>;
13
+ export type CloneCustomizer = (value: unknown) => unknown | undefined;
14
+ /**
15
+ * Creates a deep copy of the specified object, including all nested objects and specifically handling Date, Map, and
16
+ * Set fields.
17
+ *
18
+ * The customizer function can modify the cloning process for the object and its fields. If the customizer
19
+ * returns 'undefined' for any input, the function falls back to the standard cloning logic.
20
+ *
21
+ * The cloning process is recursive, ensuring deep cloning of all objects.
22
+ *
23
+ * Note: This function does not support cloning objects with circular dependencies and will throw a system stack
24
+ * overflow error if encountered.
25
+ */
26
+ export declare function cloneDeep<R = unknown>(value: R, customizer?: CloneCustomizer): R;
27
+ /** Creates a shallow clone of the object. */
28
+ export declare function cloneShallow<T>(value: T): T;
29
+ export declare function deepMerge<T extends object, U extends object>(target: T, source: U): T & U;
30
+ /** Returns true if the `value` is a defined object and is not an array. */
31
+ export declare function isPlainObject(value: unknown): value is object;
32
+ /** Compares 2 values. 'null' and 'undefined' values are considered equal and are less than any other values. */
33
+ export declare function compareValues(v1: unknown, v2: unknown): number;
34
+ /** Returns a new object with all top-level object fields re-mapped using `valueMapperFn`. */
35
+ export declare function mapValues<ResultType extends object = Record<string, unknown>, InputType extends Record<string, unknown> = Record<string, unknown>>(obj: InputType, valueMapperFn: (value: any, key: keyof InputType, obj: InputType) => unknown): ResultType;
36
+ /** Groups elements of the array by key. See _.groupBy for details. */
37
+ export declare function groupBy<T, K extends PropertyKey>(array: T[], getKey: (item: T) => K): Record<K, T[]>;
38
+ /**
39
+ * Picks selected fields from the object and returns a new object with the fields selected.
40
+ * The selected fields are assigned by reference (there is no cloning).
41
+ */
42
+ export declare function pick<T extends object, K extends keyof T>(obj: T, keys: ReadonlyArray<K>): Pick<T, K>;
43
+ /** Inverts the record: swaps keys and values. */
44
+ export declare function invert<K extends string | number, V extends string | number>(record: Record<K, V>): Record<V, K>;
45
+ /**
46
+ * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end.
47
+ * If end is less than start a zero-length range is created unless a negative step is specified.
48
+ *
49
+ * Same as lodash range but with an additional parameter: `maximumNumberOfItems`.
50
+ */
51
+ export declare function range(start: number, end: number, step: number, maximumNumberOfItems?: number): number[];
52
+ /** Returns count of top level properties in object. */
53
+ export declare function countObjectKeys(obj: object | undefined): number;
54
+ /** Returns object entries sorted by name. */
55
+ export declare function getSortedEntries<T>(record: Record<string, T>): Array<[string, T]>;
56
+ /** Removes top level fields which are empty objects. May be used for value formatting. */
57
+ export declare function removeEmptyTopLevelRecords<T extends object>(record: T): Partial<T>;
58
+ export declare function removeUndefinedValues<V>(tags: Record<string, V | undefined>): Record<string, V>;
59
+ export declare function extractKey(line: string | undefined): string | null;
60
+ /** Represents a line in a diff output */
61
+ export interface DiffLine {
62
+ lineNumber: number;
63
+ text: string;
64
+ type: 'unchanged' | 'added' | 'removed' | 'changed';
65
+ }
66
+ /** Result of computing a line-by-line diff between two objects */
67
+ export interface DiffResult {
68
+ leftLines: Array<DiffLine>;
69
+ rightLines: Array<DiffLine>;
70
+ hasChanges: boolean;
71
+ }
72
+ /**
73
+ * Computes a line-by-line diff between two objects.
74
+ * Objects are serialized to JSON with sorted keys for consistent comparison.
75
+ * @param before The previous/left object (can be undefined for new objects)
76
+ * @param after The current/right object
77
+ * @returns DiffResult with left and right lines and whether there are changes
78
+ */
79
+ export declare function computeObjectDiff(before: unknown, after: unknown): DiffResult;
80
+ /**
81
+ * Formats an object as diff lines (all unchanged).
82
+ * Useful for displaying a single object without comparison.
83
+ * @param obj The object to format
84
+ * @returns Array of DiffLine with all lines marked as unchanged
85
+ */
86
+ export declare function formatObjectAsLines(obj: unknown): Array<DiffLine>;
@@ -0,0 +1,18 @@
1
+ export declare function sortKeys(json: unknown): any;
2
+ export declare function normalizeJsonAsString(json: unknown): string;
3
+ export declare function serializeObj(obj: unknown): string;
4
+ export declare function deserializeObj<T = any>(str: string): T;
5
+ export declare function encodeValueForMapping(value: unknown): string;
6
+ export declare function decodeValueForMapping(encodedString: string): any;
7
+ /**
8
+ * Compares 2 objects by their normalized JSON value.
9
+ * This function should not be used with objects with circular references.
10
+ * Returns true if the object are equal.
11
+ */
12
+ export declare function compareByNormalizedJsonValue<T>(v1: T | undefined, v2: T | undefined): boolean;
13
+ /**
14
+ * Compares 2 objects by their normalized JSON value for specific fields only.
15
+ * This function should not be used with objects with circular references.
16
+ * Returns true if the specified fields are equal.
17
+ */
18
+ export declare function compareByNormalizedJsonValueForFields<T>(v1: T | undefined, v2: T | undefined, fields: Array<keyof T>): boolean;
@@ -0,0 +1 @@
1
+ export declare const SQUID_SUPPORT_EMAIL = "support@getsquid.ai";
@@ -0,0 +1 @@
1
+ export declare function generateTraceId(prefix?: string): string;
@@ -0,0 +1,19 @@
1
+ import { HttpStatusCode } from '../public-types/http-status.public-types';
2
+ export declare class ValidationError extends Error {
3
+ readonly statusCode: HttpStatusCode;
4
+ readonly details?: any;
5
+ constructor(error: string, statusCode: HttpStatusCode, details?: Record<string, unknown>);
6
+ }
7
+ export declare function isValidId(id: unknown, maxLength?: number): boolean;
8
+ export declare function validateFieldSort(fieldSort: unknown): void;
9
+ export declare function validateQueryLimit(limit: unknown): void;
10
+ /**
11
+ * All type names returned by 'typeof' supported by JavaScript:
12
+ * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof}.
13
+ * and a few other supported types.
14
+ */
15
+ export type JavascriptTypeName = 'undefined' | 'object' | 'boolean' | 'number' | 'bigint' | 'string' | 'symbol' | 'function';
16
+ /** Returns true if 'typeof' of the 'value' is 'type' or 'type[]'. */
17
+ export declare function isRightType(value: unknown, type: JavascriptTypeName): boolean;
18
+ /** Returns true if 'obj' has only keys listed in the 'keys'. Object can't be an array. */
19
+ export declare function hasOnlyKeys(obj: object, keys: string[]): boolean;
@@ -0,0 +1,26 @@
1
+ interface Options {
2
+ maxAttempts?: number;
3
+ protocols?: string[];
4
+ onmessage?: (event: any) => void;
5
+ onopen?: (event: any) => void;
6
+ onclose?: (event: any) => void;
7
+ onerror?: (event: any) => void;
8
+ onreconnect?: (event: any) => void;
9
+ onmaximum?: (event: any) => void;
10
+ timeoutMillis?: number;
11
+ }
12
+ export interface WebSocketWrapper {
13
+ open: () => void;
14
+ reconnect: (e: any) => void;
15
+ json: (x: any) => void;
16
+ send: (x: string) => void;
17
+ close: (x?: number, y?: string) => void;
18
+ connected: boolean;
19
+ /**
20
+ * Websocket is explicitly closed by calling socket.close().
21
+ * Used to ignore errors after socket.closed() is called.
22
+ */
23
+ closeCalled: boolean;
24
+ }
25
+ export declare function createWebSocketWrapper(url: string, opts?: Options): WebSocketWrapper;
26
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { Observable } from 'rxjs';
2
- import { AiAgent, AiChatMessage, AiChatModelSelection, AiConnectedAgentMetadata, 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, ListAgentRevisionsResponse, 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';
@@ -72,6 +72,22 @@ export declare class AiAgentReference {
72
72
  * @returns the api key if one exists
73
73
  */
74
74
  getApiKey(): Promise<string | undefined>;
75
+ /**
76
+ * Lists all revisions (history) of the agent.
77
+ * @returns the list of revisions sorted by newest first
78
+ */
79
+ listRevisions(): Promise<ListAgentRevisionsResponse>;
80
+ /**
81
+ * Restores the agent to a previous revision.
82
+ * This will create a new revision with the current state before restoring.
83
+ * @param revisionNumber The revision number to restore to
84
+ */
85
+ restoreRevision(revisionNumber: number): Promise<void>;
86
+ /**
87
+ * Deletes a specific revision.
88
+ * @param revisionNumber The revision number to delete
89
+ */
90
+ deleteRevision(revisionNumber: number): Promise<void>;
75
91
  /**
76
92
  * Sends a prompt to the agent and receives streamed text responses.
77
93
  * @param prompt The text prompt to send to the agent.
@@ -1,7 +1,6 @@
1
1
  import { AiQueryOptions, AiQueryResponse, ExecuteAiApiResponse } from '../../internal-common/src/public-types/ai-query.public-types';
2
2
  import { AiAgentClientOptions } from './agent/ai-agent-client';
3
3
  import { AiAgentReference } from './agent/ai-agent-client-reference';
4
- import { AiAssistantClient } from './ai-assistant-client';
5
4
  import { AiAudioClient } from './ai-audio-client';
6
5
  import { AiFilesClient } from './ai-files-client';
7
6
  import { AiImageClient } from './ai-image-client';
@@ -19,7 +18,6 @@ export declare class AiClient {
19
18
  private readonly rpcManager;
20
19
  private readonly jobClient;
21
20
  private readonly backendFunctionManager;
22
- private readonly aiAssistantClient;
23
21
  private aiAgentClient?;
24
22
  private aiKnowledgeBaseClient?;
25
23
  /**
@@ -39,11 +37,6 @@ export declare class AiClient {
39
37
  * Lists all available AI agents.
40
38
  */
41
39
  listKnowledgeBases(): Promise<Array<AiKnowledgeBase>>;
42
- /**
43
- * Retrieves the AI assistant client.
44
- * @returns An instance of AiAssistantClient.
45
- */
46
- assistant(): AiAssistantClient;
47
40
  /**
48
41
  * Retrieves an AI image client.
49
42
  */
@@ -2,7 +2,6 @@ export * from './admin-client';
2
2
  export * from './agent/ai-agent-client';
3
3
  export * from './agent/ai-agent-client-reference';
4
4
  export * from './agent/ai-agent-client.types';
5
- export * from './ai-assistant-client';
6
5
  export * from './ai-audio-client';
7
6
  export * from './ai-client';
8
7
  export * from './ai-files-client';
@@ -30,7 +29,6 @@ export * from './execute-function-options';
30
29
  export * from './external-auth-client';
31
30
  export * from './extraction-client';
32
31
  export * from './file-args-transformer';
33
- export * from './file-utils';
34
32
  export * from './integration-client';
35
33
  export * from './job-client';
36
34
  export * from './mutation/mutation-sender';
@@ -1,6 +1,5 @@
1
1
  export * from '../../internal-common/src/public-types/ai-agent-integrations.public-types';
2
2
  export * from '../../internal-common/src/public-types/ai-agent.public-types';
3
- export * from '../../internal-common/src/public-types/ai-assistant.public-types';
4
3
  export * from '../../internal-common/src/public-types/ai-common.public-types';
5
4
  export * from '../../internal-common/src/public-types/ai-knowledge-base.public-types';
6
5
  export * from '../../internal-common/src/public-types/ai-matchmaking.public-types';
@@ -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.423";
5
+ export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.425";
@@ -1,4 +1,4 @@
1
- import { WebAiSearchResponse, WebShortUrlBulkResponse, WebShortUrlResponse } from '../../internal-common/src/public-types/web.public-types';
1
+ import { CreateShortUrlOptions, CreateShortUrlsOptions, WebAiSearchResponse, WebShortUrlBulkResponse, WebShortUrlResponse } from '../../internal-common/src/public-types/web.public-types';
2
2
  /**
3
3
  * WebClient provides methods to interact with web-related functionalities.
4
4
  * @category Platform
@@ -9,6 +9,8 @@ export declare class WebClient {
9
9
  private readonly appId;
10
10
  private readonly apiKey;
11
11
  private readonly consoleRegion;
12
+ /** Headers for short URL API requests. Only use after asserting apiKey is defined. */
13
+ private get shortUrlHeaders();
12
14
  /**
13
15
  * Search the web using AI. Returns a response containing Markdown text and cited URLs.
14
16
  * @param query The keywords or query string to search for.
@@ -22,28 +24,21 @@ export declare class WebClient {
22
24
  /**
23
25
  * Creates a shortened URL for the given URL.
24
26
  *
25
- * Defaults to a 1 day expiration if no expiry is provided via the `secondsToLive` field.
27
+ * Defaults to a 1-day expiration if no expiry is provided via the `secondsToLive` field.
26
28
  * If `secondsToLive` is set to 0, the URL will never expire.
27
29
  *
28
- * @param url The URL to shorten. It must be a valid URL and should include the protocol (start with http:// or
29
- * https://).
30
- * @param secondsToLive Seconds to live for the shortened URL. If set to 0, the URL will never expire. Defaults to 30
31
- * days.
30
+ * @param urlOrOptions - Either a URL string or an options object with url and all available options.
32
31
  */
33
- createShortUrl(url: string, secondsToLive?: number): Promise<WebShortUrlResponse>;
32
+ createShortUrl(urlOrOptions: string | CreateShortUrlOptions): Promise<WebShortUrlResponse>;
34
33
  /**
35
34
  * Creates shortened URLs for the given URLs.
36
35
  *
37
- * Defaults to a 1 day expiration if no expiry is provided via the `secondsToLive` field.
36
+ * Defaults to a 1-day expiration if no expiry is provided via the `secondsToLive` field.
38
37
  * If `secondsToLive` is set to 0, the URL will never expire.
39
38
  *
40
- * The parameter arrays should be of the same length and in the same order
41
- *
42
- * @param urls The URLs to shorten. It must be a valid URL and should include the protocol (start with http:// or
43
- * https://).
44
- * @param secondsToLive Seconds to live for each shortened URL. If set to 0, the URL will never expire.
39
+ * @param urlsOrOptions - Either an array of URL strings or an options object and all available options.
45
40
  */
46
- createShortUrls(urls: string[], secondsToLive?: number): Promise<WebShortUrlBulkResponse>;
41
+ createShortUrls(urlsOrOptions: string[] | CreateShortUrlsOptions): Promise<WebShortUrlBulkResponse>;
47
42
  /**
48
43
  * Deletes a shortened URL by its ID.
49
44
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.423",
3
+ "version": "1.0.425",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,31 +0,0 @@
1
- import { AiReasoningEffort } from './ai-agent.public-types';
2
- import { OpenAiChatModelName } from './ai-common.public-types';
3
- import { AiFunctionId } from './backend.public-types';
4
- /**
5
- * Response format for AI assistant responses.
6
- * @category AI
7
- */
8
- export type AiAssistantResponseFormat = 'text' | 'json_object';
9
- /**
10
- * The type of assistant tool.
11
- * @category AI
12
- */
13
- export type AssistantToolType = 'code_interpreter' | 'file_search';
14
- /**
15
- * The options for configuring an AI assistant's behavior and response.
16
- * @category AI
17
- */
18
- export interface QueryAssistantOptions {
19
- /** Additional context provided to all AI functions for processing. */
20
- agentContext?: Record<string, unknown>;
21
- /** Specific context provided per AI function, keyed by function ID. */
22
- functionContexts?: Record<AiFunctionId, Record<string, unknown>>;
23
- /** The desired format of the AI model's response; defaults to 'text'. */
24
- responseFormat?: AiAssistantResponseFormat;
25
- /** The OpenAI chat model to use for the assistant, if specified. */
26
- model?: OpenAiChatModelName;
27
- /** The level of reasoning effort to apply, as defined by OpenAI. */
28
- reasoningEffort?: AiReasoningEffort;
29
- /** Custom instructions to guide the assistant's behavior, if provided. */
30
- instructions?: string;
31
- }