@squidcloud/client 1.0.483 → 1.0.485
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/ai/system-openai-compatible.d.ts +35 -0
- package/dist/internal-common/src/metric-name.d.ts +14 -0
- package/dist/internal-common/src/public-types/ai-agent.public-types.d.ts +79 -3
- package/dist/internal-common/src/public-types/ai-common.public-types.d.ts +9 -0
- package/dist/internal-common/src/public-types/ai-function.public-types.d.ts +36 -0
- package/dist/internal-common/src/public-types/ai-knowledge-base.public-types.d.ts +141 -2
- package/dist/internal-common/src/public-types/connector.public-types.d.ts +1 -1
- package/dist/internal-common/src/public-types/extraction.public-types.d.ts +9 -2
- package/dist/internal-common/src/public-types/integration.public-types.d.ts +7 -1
- package/dist/internal-common/src/public-types/source-code.public-types.d.ts +196 -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 +161 -0
- package/dist/internal-common/src/public-types-backend/native-query.public-context.d.ts +75 -0
- package/dist/internal-common/src/public-types-backend/query.public-context.d.ts +193 -0
- package/dist/internal-common/src/types/ai-agent.types.d.ts +253 -0
- package/dist/internal-common/src/types/ai-knowledge-base.types.d.ts +306 -0
- package/dist/internal-common/src/types/ai-matchmaking.types.d.ts +19 -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 +41 -0
- package/dist/internal-common/src/types/management-api-key.types.d.ts +92 -0
- package/dist/internal-common/src/types/mutation.types.d.ts +1 -0
- package/dist/internal-common/src/types/notification.types.d.ts +19 -0
- package/dist/internal-common/src/types/observability.types.d.ts +168 -0
- package/dist/internal-common/src/types/query.types.d.ts +15 -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 +45 -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/file-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 +10 -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 +86 -0
- package/dist/internal-common/src/utils/serialization.d.ts +24 -0
- package/dist/internal-common/src/utils/squid.constants.d.ts +6 -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/agent/ai-agent-client-reference.d.ts +12 -1
- package/dist/typescript-client/src/ai-knowledge-base/ai-knowledge-base-client-reference.d.ts +9 -1
- package/dist/typescript-client/src/distributed-lock.manager.d.ts +3 -2
- package/dist/typescript-client/src/integration-client.d.ts +5 -1
- package/dist/typescript-client/src/public-types.d.ts +1 -0
- package/dist/typescript-client/src/version.d.ts +1 -1
- package/package.json +1 -3
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* System-level OpenAI-compatible backends ("slots") for Squid's own internal AI calls.
|
|
3
|
+
*
|
|
4
|
+
* Generic plumbing for pointing an internal model at ANY OpenAI-compatible HTTP endpoint —
|
|
5
|
+
* primarily Squid's own self-hosted models, but any OpenAI-compatible backend works. The
|
|
6
|
+
* non-secret part of a slot (base URL, optional headers/extra body) is hardcoded here on purpose
|
|
7
|
+
* (changing a backend is a reviewed code change); only the API key lives in Vault under
|
|
8
|
+
* `SystemSecrets['openai-compatible'][slotName].apiKey`.
|
|
9
|
+
*
|
|
10
|
+
* NOT the customer-facing `openai_compatible` Integration (per-app, console-configured). Models
|
|
11
|
+
* served through these slots are declared in `AI_CHAT_MODEL_REGISTRY` with
|
|
12
|
+
* `providerType: 'openai-compatible'` + `openAiCompatibleSlot`, and resolve only with
|
|
13
|
+
* `keyType: 'system'` (see `AiProviderFactory.getChatProviderForModel`) — never customer-reachable.
|
|
14
|
+
*
|
|
15
|
+
* No slots are defined yet (foundation only). To wire one up:
|
|
16
|
+
* 1. add a slot below, e.g. `'my-model': { baseUrl: 'https://llm.internal.squid/v1' }`;
|
|
17
|
+
* 2. seed its key in `SystemSecrets['openai-compatible']['my-model'].apiKey`;
|
|
18
|
+
* 3. add a model entry in ai-model.registry.ts pointing `openAiCompatibleSlot: 'my-model'`.
|
|
19
|
+
*/
|
|
20
|
+
/** Non-secret configuration of one system OpenAI-compatible backend. */
|
|
21
|
+
export interface SystemOpenAiCompatibleSlotConfig {
|
|
22
|
+
/** Base URL of the OpenAI-compatible API, e.g. a self-hosted 'https://llm.internal.squid/v1'. */
|
|
23
|
+
baseUrl: string;
|
|
24
|
+
/** Extra HTTP headers sent with every request. */
|
|
25
|
+
headers?: Record<string, string>;
|
|
26
|
+
/** Extra JSON body fields merged into every request — reserved wire fields are dropped by the provider. */
|
|
27
|
+
extraBody?: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
/** Name of a system OpenAI-compatible slot (a key of `SYSTEM_OPENAI_COMPATIBLE_SLOTS`). */
|
|
30
|
+
export type SystemOpenAiCompatibleSlotName = string;
|
|
31
|
+
/**
|
|
32
|
+
* Registered system OpenAI-compatible slots, keyed by name. Empty by design — add a self-hosted
|
|
33
|
+
* (or any other) OpenAI-compatible backend here; see the module doc above.
|
|
34
|
+
*/
|
|
35
|
+
export declare const SYSTEM_OPENAI_COMPATIBLE_SLOTS: Record<SystemOpenAiCompatibleSlotName, SystemOpenAiCompatibleSlotConfig>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Names of the Squid metrics.
|
|
3
|
+
*
|
|
4
|
+
* This list and its Kotlin counterpart (MetricName.kt) may diverge:
|
|
5
|
+
* each side declares only the metrics that its own backend emits.
|
|
6
|
+
* However, metrics emitted by both backends MUST use identical names on both sides —
|
|
7
|
+
* otherwise dashboards and metric queries that mix data from both sources will break.
|
|
8
|
+
*
|
|
9
|
+
* See MetricName.kt for documentation on each value.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ALL_SQUID_METRIC_NAMES: readonly ["squid_functionExecution_count", "squid_functionExecution_time", "squid_aiChatbotContext_size", "squid_aiChatbotChatInputTokens_count", "squid_aiChatbotChatOutputTokens_count", "squid_aiChatbotChatReasoningTokens_count", "squid_aiChatbotChatCacheReadInputTokens_count", "squid_aiChatbotChatCacheWriteInputTokens_count", "squid_aiChatbotChatCostUsd_count", "squid_aiChatbotChatOutcome_count", "squid_aiImageGeneration_count", "squid_aiImageGeneration_time", "squid_aiRemoveBackground_count", "squid_aiRemoveBackground_time", "squid_aiAudioTranscribe_count", "squid_aiAudioTranscribe_time", "squid_aiAudioCreateSpeech_count", "squid_aiAudioCreateSpeech_time", "squid_aiIntegrationData_count", "squid_aiIntegrationData_time", "squid_aiIntegrationApi_count", "squid_aiIntegrationApi_time", "squid_apiControllerCall_count", "squid_apiControllerCall_time", "squid_aiContextUpsert_count", "squid_aiContextDelete_count", "squid_codeInitialization_count", "squid_codeInitialization_time", "squid_sourceCodeAnalysis_count", "squid_sourceCodeAnalysis_time", "squid_sourceCodeLeaseWait_time", "squid_sourceCodeWorkspaceBytes_value", "squid_sourceCodeInputTokens_count", "squid_sourceCodeOutputTokens_count", "squid_deleteApiKey_count", "squid_deleteApiKey_time", "squid_deleteSecret_count", "squid_deleteSecret_time", "squid_discoverGraphQLConnectionSchema_count", "squid_discoverGraphQLConnectionSchema_time", "squid_discoverOpenApiSchema_count", "squid_discoverOpenApiSchema_time", "squid_discoverOpenApiSchemaFromFile_count", "squid_discoverOpenApiSchemaFromFile_time", "squid_executeBackendFunction_count", "squid_executeBackendFunction_time", "squid_apiControllerCall_count", "squid_apiControllerCall_time", "squid_getAiChatbotProfiles_count", "squid_getAiChatbotProfiles_time", "squid_getAllApiKeys_count", "squid_getAllApiKeys_time", "squid_getAllSecrets_count", "squid_getAllSecrets_time", "squid_getAppApiKey_count", "squid_getAppApiKey_time", "squid_getSecret_count", "squid_getSecret_time", "squid_graphql_count", "squid_graphql_time", "squid_graphqlQuery_count", "squid_graphqlQuery_time", "squid_integrationCount_value", "squid_mutate_count", "squid_mutate_time", "squid_metricQuery_count", "squid_metricQuery_time", "squid_metricReport_count", "squid_metricReport_time", "squid_nativeQuery_count", "squid_nativeQuery_time", "squid_openapi_count", "squid_openapi_time", "squid_produceTopicMessage_count", "squid_produceTopicMessage_time", "squid_query_count", "squid_query_time", "squid_queueMessageHandler_count", "squid_queueMessageHandler_time", "squid_registerQuery_count", "squid_registerQuery_time", "squid_rerankChunks_count", "squid_rerankChunks_time", "squid_schedulerJob_count", "squid_schedulerJob_time", "squid_eventHandler_count", "squid_eventHandler_time", "squid_schema_size", "squid_secrets_entries", "squid_storageDeleteFiles_count", "squid_storageDeleteFiles_time", "squid_storageGetDownloadUrl_count", "squid_storageGetDownloadUrl_time", "squid_storageGetFileMetadata_count", "squid_storageGetFileMetadata_time", "squid_storageListDirectoryContents_count", "squid_storageListDirectoryContents_time", "squid_storageUploadFile_count", "squid_storageUploadFile_time", "squid_subscribeToTopic_count", "squid_subscribeToTopic_time", "squid_testGraphQLConnection_count", "squid_testGraphQLConnection_time", "squid_testAgentProtocolConnection_count", "squid_testAgentProtocolConnection_time", "squid_trigger_count", "squid_trigger_time", "squid_upsertApiKey_count", "squid_upsertApiKey_time", "squid_upsertSecret_count", "squid_upsertSecret_time", "squid_vectorChunks_count", "squid_vectorChunks_time", "squid_webhook_count", "squid_webhook_time", "squid_acquireLock_count", "squid_acquireLock_time", "squid_releaseLock_count", "squid_releaseLock_time"];
|
|
12
|
+
export type MetricName = (typeof ALL_SQUID_METRIC_NAMES)[number];
|
|
13
|
+
/** Common prefix for all Squid metrics. */
|
|
14
|
+
export declare const SQUID_METRIC_NAME_PREFIX = "squid_";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSONSchema } from 'json-schema-typed';
|
|
2
|
-
import { AiAudioCreateSpeechModelName, AiAudioTranscriptionModelName, AiChatModelName, AiImageModelName, AiProviderType, AiRerankProvider, AnthropicChatModelName, GeminiChatModelName, GrokChatModelName, ModelIdSpec, OpenAiAudioCreateSpeechModelName, OpenAiAudioTranscriptionModelName, OpenAiChatModelName, OpenAiCreateSpeechFormat, OpenAiImageModelName } from './ai-common.public-types';
|
|
2
|
+
import { AiAudioCreateSpeechModelName, AiAudioTranscriptionModelName, AiChatModelName, AiImageModelName, AiProviderType, AiRerankProvider, AnthropicChatModelName, CanonicalReasoningEffort, GeminiChatModelName, GrokChatModelName, ModelIdSpec, OpenAiAudioCreateSpeechModelName, OpenAiAudioTranscriptionModelName, OpenAiChatModelName, OpenAiCreateSpeechFormat, OpenAiImageModelName } from './ai-common.public-types';
|
|
3
3
|
import { AiContextMetadata, AiContextMetadataFilter, AiKnowledgeBaseContextType, AiRagType } from './ai-knowledge-base.public-types';
|
|
4
4
|
import { AiFunctionId, AiFunctionIdWithContext, UserAiChatModelName } from './backend.public-types';
|
|
5
5
|
import { AiAgentId, AiContextId, AiKnowledgeBaseId, AppId, IntegrationId } from './communication.public-types';
|
|
@@ -575,7 +575,7 @@ export interface OpenAiChatOptions extends BaseAiChatOptions {
|
|
|
575
575
|
* not support the exact requested level.
|
|
576
576
|
* @category AI
|
|
577
577
|
*/
|
|
578
|
-
export type CanonicalReasoningEffort
|
|
578
|
+
export type { CanonicalReasoningEffort } from './ai-common.public-types';
|
|
579
579
|
/**
|
|
580
580
|
* AI reasoning effort. Pass one of the canonical levels for portable, autocomplete-friendly usage, or
|
|
581
581
|
* a raw provider-native string when a model exposes a level outside the canonical set.
|
|
@@ -660,6 +660,56 @@ export type AiChatOptions<T extends AiChatModelSelection | undefined = undefined
|
|
|
660
660
|
export type AllAiAgentChatOptions = {
|
|
661
661
|
[K in keyof BaseAiChatOptions | keyof GeminiChatOptions | keyof GrokChatOptions | keyof OpenAiChatOptions | keyof AnthropicChatOptions]?: (K extends keyof BaseAiChatOptions ? BaseAiChatOptions[K] : never) | (K extends keyof GeminiChatOptions ? GeminiChatOptions[K] : never) | (K extends keyof GrokChatOptions ? GrokChatOptions[K] : never) | (K extends keyof OpenAiChatOptions ? OpenAiChatOptions[K] : never) | (K extends keyof AnthropicChatOptions ? AnthropicChatOptions[K] : never);
|
|
662
662
|
};
|
|
663
|
+
/**
|
|
664
|
+
* Configuration for exposing an AI agent as an MCP server at `/mcp/<agentId>`.
|
|
665
|
+
* @category AI
|
|
666
|
+
*/
|
|
667
|
+
export interface AiAgentMcpServerConfig {
|
|
668
|
+
/** Whether the agent is exposed as an MCP server. */
|
|
669
|
+
enabled: boolean;
|
|
670
|
+
/**
|
|
671
|
+
* Description of the MCP server, served as the `instructions` field of the MCP initialize
|
|
672
|
+
* result. Defaults to the agent description when not provided.
|
|
673
|
+
*/
|
|
674
|
+
description?: string;
|
|
675
|
+
/**
|
|
676
|
+
* Description of the MCP `ask` tool, exposed in the tools manifest.
|
|
677
|
+
* Defaults to a generic ask-the-agent description when not provided.
|
|
678
|
+
*/
|
|
679
|
+
toolDescription?: string;
|
|
680
|
+
/**
|
|
681
|
+
* ID of an auth integration used to OAuth-protect the MCP server. When set, MCP requests must
|
|
682
|
+
* include a valid bearer token from this integration. Without this and `requireApiKey`, the
|
|
683
|
+
* MCP endpoint is public.
|
|
684
|
+
*/
|
|
685
|
+
oauthIntegrationId?: IntegrationId;
|
|
686
|
+
/**
|
|
687
|
+
* When true, MCP requests must present the agent's API key as a bearer token
|
|
688
|
+
* (`Authorization: Bearer <agent API key>` or the `x-squid-agent-api-key` header). Can be
|
|
689
|
+
* combined with `oauthIntegrationId`, in which case either credential is accepted.
|
|
690
|
+
*/
|
|
691
|
+
requireApiKey?: boolean;
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Request to AI-generate the MCP server and tool descriptions for an agent based on its
|
|
695
|
+
* instructions and connected resources.
|
|
696
|
+
* @category AI
|
|
697
|
+
*/
|
|
698
|
+
export interface GenerateAgentMcpDescriptionsRequest {
|
|
699
|
+
/** The ID of the agent to generate MCP descriptions for. */
|
|
700
|
+
agentId: AiAgentId;
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* AI-generated MCP descriptions for an agent. Returned without persisting — the caller saves them
|
|
704
|
+
* onto the agent's MCP server configuration.
|
|
705
|
+
* @category AI
|
|
706
|
+
*/
|
|
707
|
+
export interface GenerateAgentMcpDescriptionsResponse {
|
|
708
|
+
/** Generated description of the MCP server. */
|
|
709
|
+
description: string;
|
|
710
|
+
/** Generated description of the MCP `ask` tool. */
|
|
711
|
+
toolDescription: string;
|
|
712
|
+
}
|
|
663
713
|
/**
|
|
664
714
|
* A definition of an AI agent with its properties and default chat options.
|
|
665
715
|
* @category AI
|
|
@@ -677,10 +727,14 @@ export interface AiAgent<T extends AiChatModelSelection | undefined = undefined>
|
|
|
677
727
|
isPublic?: boolean;
|
|
678
728
|
/** Enables audit logging for the agent's activities if true; defaults to false. */
|
|
679
729
|
auditLog?: boolean;
|
|
730
|
+
/** Records the full agent context in the audit log — assembled system instructions on the chat-start entry and retrieved knowledge-base content in KB tool-call updates; requires auditLog; defaults to false. */
|
|
731
|
+
auditLogFullContext?: boolean;
|
|
680
732
|
/** The default chat options for the agent, overridable by the user during use. */
|
|
681
733
|
options: AiChatOptions<T>;
|
|
682
734
|
/** Optional api key used specifically for operations on this agent */
|
|
683
735
|
apiKey?: string;
|
|
736
|
+
/** Optional configuration for exposing the agent as an MCP server. */
|
|
737
|
+
mcpServer?: AiAgentMcpServerConfig;
|
|
684
738
|
}
|
|
685
739
|
/**
|
|
686
740
|
* @category AI
|
|
@@ -722,6 +776,13 @@ export declare const AGENT_STATUS_TITLE_INSPECTING_KB_METADATA = "Inspecting Kno
|
|
|
722
776
|
* @category AI
|
|
723
777
|
*/
|
|
724
778
|
export declare const AGENT_STATUS_TITLE_QUERYING_KB_GRAPH = "Querying Knowledge Base Graph";
|
|
779
|
+
/**
|
|
780
|
+
* Status update title emitted when the agent runs the `grepKnowledgeBase` tool (a literal/regex scan over
|
|
781
|
+
* the knowledge base's raw extracted text). Distinct from {@link AGENT_STATUS_TITLE_ACCESSING_KB} so a
|
|
782
|
+
* caller can tell an exact-match scan apart from ranked retrieval.
|
|
783
|
+
* @category AI
|
|
784
|
+
*/
|
|
785
|
+
export declare const AGENT_STATUS_TITLE_GREPPING_KB = "Searching Knowledge Base Text";
|
|
725
786
|
/**
|
|
726
787
|
* Status update title broadcast when the agent queries a spreadsheet file callable.
|
|
727
788
|
* @category AI
|
|
@@ -945,7 +1006,13 @@ export interface TextContextRequest extends BaseContextRequest {
|
|
|
945
1006
|
export interface FileContextRequest extends BaseContextRequest {
|
|
946
1007
|
/** Specifies the context type as 'file'. */
|
|
947
1008
|
type: 'file';
|
|
948
|
-
/**
|
|
1009
|
+
/**
|
|
1010
|
+
* Whether to extract images from the file, describe them with a vision model, and index those
|
|
1011
|
+
* descriptions alongside the text. Defaults to true — a document's charts, diagrams and scanned pages
|
|
1012
|
+
* carry content the text layer does not. Note that the text context request has no such option:
|
|
1013
|
+
* inline images in a text payload are extracted only for a knowledge-base text context, and default
|
|
1014
|
+
* to OFF there.
|
|
1015
|
+
*/
|
|
949
1016
|
extractImages?: boolean;
|
|
950
1017
|
/** The minimum size for extracted images, if applicable. */
|
|
951
1018
|
imageMinSizePixels?: number;
|
|
@@ -1062,6 +1129,15 @@ export type AiSessionContext = {
|
|
|
1062
1129
|
agentId: string;
|
|
1063
1130
|
/** The ID of the job associated with the session. */
|
|
1064
1131
|
jobId: JobId;
|
|
1132
|
+
/**
|
|
1133
|
+
* The conversation this call belongs to, as the caller named it (`memoryOptions.memoryId`, or the
|
|
1134
|
+
* deprecated `chatId`). Stable across the turns of one chat and different for two chats, including
|
|
1135
|
+
* two chats of the same client, which `clientId` is not: a client id belongs to a connection, and
|
|
1136
|
+
* one connection can carry several conversations. Not the id chat history is keyed by — that one
|
|
1137
|
+
* falls back to `clientId` — so do not read it as one. Absent for callers that named no conversation
|
|
1138
|
+
* (a direct function call, security rules).
|
|
1139
|
+
*/
|
|
1140
|
+
conversationId?: string;
|
|
1065
1141
|
/**
|
|
1066
1142
|
* ID of the status update that triggered this session (e.g. the agent's "Calling AI Function"
|
|
1067
1143
|
* event). Status updates emitted on behalf of this session nest under it in the status feed.
|
|
@@ -15,6 +15,11 @@ export declare const AI_PROVIDER_TYPES: readonly ["anthropic", "bedrock", "claud
|
|
|
15
15
|
* chat/search/transcribe etc...).
|
|
16
16
|
*/
|
|
17
17
|
export type AiProviderType = (typeof AI_PROVIDER_TYPES)[number];
|
|
18
|
+
/**
|
|
19
|
+
* Canonical reasoning-effort levels, ordered from least to most effort.
|
|
20
|
+
* @category AI
|
|
21
|
+
*/
|
|
22
|
+
export type CanonicalReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
|
|
18
23
|
/**
|
|
19
24
|
* Type of AI provider that supports file upload operations.
|
|
20
25
|
* Only a subset of AI providers support file management features.
|
|
@@ -219,6 +224,10 @@ export type AiModelSource = (typeof AI_MODEL_SOURCES)[number];
|
|
|
219
224
|
export interface ModelIdSpec {
|
|
220
225
|
/** The model ID used for API calls. */
|
|
221
226
|
modelId: AiChatModelName;
|
|
227
|
+
/** The provider serving this model when Squid can determine it from the model registry. */
|
|
228
|
+
providerType?: AiProviderType;
|
|
229
|
+
/** Canonical reasoning-effort levels accepted natively by this model. */
|
|
230
|
+
reasoningEfforts?: CanonicalReasoningEffort[];
|
|
222
231
|
/** The integration ID if this model comes from an integration (OpenAI-compatible, Bedrock). Is undefined for Squid-provided models. */
|
|
223
232
|
integrationId?: string;
|
|
224
233
|
/** Human-readable display name for the model (e.g. "GPT-4o"). */
|
|
@@ -3,6 +3,14 @@ import { ServiceFunctionName } from './backend.public-types';
|
|
|
3
3
|
import { IntegrationType } from './integration.public-types';
|
|
4
4
|
/** Represents the possible data types for an AI function parameter. */
|
|
5
5
|
export type AiFunctionParamType = 'string' | 'number' | 'boolean' | 'date' | 'files';
|
|
6
|
+
/**
|
|
7
|
+
* How sticky affinity routing must be for a function that keeps state outside the request.
|
|
8
|
+
* - `pod`: the state is reachable by any worker of the pod (a file on disk, a child process).
|
|
9
|
+
* - `worker`: the state lives in one worker's memory, so the worker itself has to be reused.
|
|
10
|
+
*/
|
|
11
|
+
export declare const FUNCTION_AFFINITY_SCOPES: readonly ["pod", "worker"];
|
|
12
|
+
/** See {@link FUNCTION_AFFINITY_SCOPES}. */
|
|
13
|
+
export type FunctionAffinityScope = (typeof FUNCTION_AFFINITY_SCOPES)[number];
|
|
6
14
|
/** Defines the structure of a parameter for an AI function. */
|
|
7
15
|
export interface AiFunctionParam {
|
|
8
16
|
/** Name of the parameter. */
|
|
@@ -15,6 +23,34 @@ export interface AiFunctionParam {
|
|
|
15
23
|
required: boolean;
|
|
16
24
|
/** List of possible values for the parameter, if applicable. */
|
|
17
25
|
enum?: Array<Omit<AiFunctionParamType, 'date'>>;
|
|
26
|
+
/**
|
|
27
|
+
* Marks this parameter as the affinity key of the function and states how sticky the routing must
|
|
28
|
+
* be: every call carrying the same value is routed to the same tenant pod (and, for `worker`, the
|
|
29
|
+
* same worker) for as long as it is alive. Use it for functions that keep state outside the
|
|
30
|
+
* request. Only one `string` parameter of a function may declare it, and declaring it on a
|
|
31
|
+
* parameter of any other type fails the bundle build.
|
|
32
|
+
*
|
|
33
|
+
* A value of `undefined`, `null` or `''` means no affinity at all — the call is routed normally, to
|
|
34
|
+
* an arbitrary pod. Blank is deliberately not a key: a caller that leaves the parameter empty must
|
|
35
|
+
* get an instance of its own rather than share one with every other caller that also left it empty.
|
|
36
|
+
*
|
|
37
|
+
* The value is a namespace within the application, the function's SERVICE **and the calling job**
|
|
38
|
+
* (falling back to the conversation for callers without one): two agent requests that pick the same
|
|
39
|
+
* value are routed independently, so the value only has to be unique within one request's own
|
|
40
|
+
* calls. That matches where such values come from — a model authoring a session name is told
|
|
41
|
+
* nothing about other requests, and unrelated callers routinely land on the same word. A caller
|
|
42
|
+
* with neither a job nor a conversation gets no affinity at all rather than a namespace shared with
|
|
43
|
+
* every other such caller. Two callers cannot be routed to one instance on purpose by agreeing on a
|
|
44
|
+
* value; a function that needs genuinely shared state needs shared storage, not shared routing.
|
|
45
|
+
*
|
|
46
|
+
* The domain is the service rather than the single function so that companion functions of one
|
|
47
|
+
* service reach each other's state — a release function must land on the worker whose interpreter
|
|
48
|
+
* its key names, or it would no-op against an empty domain of its own and report success.
|
|
49
|
+
*
|
|
50
|
+
* The guarantee is routing, not durability: when the pod or worker goes away, so does whatever it
|
|
51
|
+
* held, and the next call lands on a fresh one. The function has to detect that itself and cope.
|
|
52
|
+
*/
|
|
53
|
+
affinity?: FunctionAffinityScope;
|
|
18
54
|
}
|
|
19
55
|
/** Represents an AI function response that also includes files. */
|
|
20
56
|
export interface AiFunctionResponseWithFiles<ResponseType = unknown> {
|
|
@@ -494,7 +494,10 @@ export interface AiKnowledgeBaseTextContextRequest extends BaseAiKnowledgeBaseCo
|
|
|
494
494
|
*/
|
|
495
495
|
format?: AiKnowledgeBaseTextFormat;
|
|
496
496
|
/**
|
|
497
|
-
* Whether to extract images embedded in markdown/HTML text. Defaults to
|
|
497
|
+
* Whether to extract images embedded in markdown/HTML text. Defaults to FALSE — deliberately the
|
|
498
|
+
* opposite of {@link AiKnowledgeBaseFileContextRequest.extractImages}. A pasted blob's inline images
|
|
499
|
+
* are usually layout chrome, whereas an uploaded document's images are part of its content. Uploading
|
|
500
|
+
* the same markdown as a `.md` file is therefore the file case, and defaults to images ON.
|
|
498
501
|
*
|
|
499
502
|
* When true and the text is detected as (or declared to be) markdown/HTML, image references inside the
|
|
500
503
|
* text (`` or `<img src="...">`) are fetched, stored, and have descriptions generated
|
|
@@ -524,7 +527,15 @@ export interface AiKnowledgeBaseFileContextRequest extends BaseAiKnowledgeBaseCo
|
|
|
524
527
|
contextId?: AiContextId;
|
|
525
528
|
/** Specifies the context type as 'file'. */
|
|
526
529
|
type: 'file';
|
|
527
|
-
/**
|
|
530
|
+
/**
|
|
531
|
+
* Whether to extract images from the file, describe them with a vision model, and index those
|
|
532
|
+
* descriptions alongside the text. Defaults to TRUE — a document's charts, diagrams and scanned pages
|
|
533
|
+
* carry content the text layer does not, so a file context captures them unless asked not to.
|
|
534
|
+
*
|
|
535
|
+
* Note this is the opposite of {@link AiKnowledgeBaseTextContextRequest.extractImages}, which defaults
|
|
536
|
+
* to false: images referenced from a pasted markdown/HTML blob are usually layout chrome, and fetching
|
|
537
|
+
* them means following URLs the caller supplied.
|
|
538
|
+
*/
|
|
528
539
|
extractImages?: boolean;
|
|
529
540
|
/** The minimum size for extracted images, if applicable. */
|
|
530
541
|
imageMinSizePixels?: number;
|
|
@@ -677,6 +688,134 @@ export interface AiKnowledgeBaseSearchRequest {
|
|
|
677
688
|
/** The search options for this search */
|
|
678
689
|
options: AiKnowledgeBaseSearchOptions;
|
|
679
690
|
}
|
|
691
|
+
/** Default number of grep matches returned when the caller does not ask for a specific number. */
|
|
692
|
+
export declare const GREP_KNOWLEDGE_BASE_DEFAULT_MAX_MATCHES = 50;
|
|
693
|
+
/** Hard ceiling on grep matches: a larger `maxMatches` is clamped down to this value. */
|
|
694
|
+
export declare const GREP_KNOWLEDGE_BASE_MAX_MATCHES = 200;
|
|
695
|
+
/**
|
|
696
|
+
* Longest accepted grep pattern. A literal needle is short by nature; the cap exists so an
|
|
697
|
+
* adversarially long pattern cannot be used to inflate matching cost on a shared server.
|
|
698
|
+
*/
|
|
699
|
+
export declare const GREP_KNOWLEDGE_BASE_MAX_PATTERN_CHARS = 500;
|
|
700
|
+
/** Longest `line` / `context` a single match returns; anything longer is clipped with an ellipsis. */
|
|
701
|
+
export declare const GREP_KNOWLEDGE_BASE_MAX_MATCH_LINE_CHARS = 500;
|
|
702
|
+
/**
|
|
703
|
+
* Options for a literal scan over a knowledge base's raw extracted text.
|
|
704
|
+
* @category AI
|
|
705
|
+
*/
|
|
706
|
+
export interface GrepKnowledgeBaseOptions {
|
|
707
|
+
/**
|
|
708
|
+
* Scopes the scan to the contexts whose metadata matches this filter — the same grammar knowledge-base
|
|
709
|
+
* chunk search accepts, including `$and`/`$or` composition and the `$underPath` folder operator. The
|
|
710
|
+
* filter selects the contexts BEFORE any text is matched.
|
|
711
|
+
*/
|
|
712
|
+
metadataFilter?: AiContextMetadataFilter;
|
|
713
|
+
/**
|
|
714
|
+
* The maximum number of matches to return. Defaults to {@link GREP_KNOWLEDGE_BASE_DEFAULT_MAX_MATCHES}
|
|
715
|
+
* and is clamped to {@link GREP_KNOWLEDGE_BASE_MAX_MATCHES}.
|
|
716
|
+
*/
|
|
717
|
+
maxMatches?: number;
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* Request structure for a literal scan over a knowledge base's raw extracted text.
|
|
721
|
+
* @category AI
|
|
722
|
+
*/
|
|
723
|
+
export interface GrepKnowledgeBaseRequest {
|
|
724
|
+
/** The id of the AiKnowledgeBase */
|
|
725
|
+
knowledgeBaseId: AiKnowledgeBaseId;
|
|
726
|
+
/**
|
|
727
|
+
* The literal substring to look for. Every regex metacharacter in it is escaped, so punctuation and
|
|
728
|
+
* symbols mean themselves, and it may span lines. Capped at
|
|
729
|
+
* {@link GREP_KNOWLEDGE_BASE_MAX_PATTERN_CHARS} characters.
|
|
730
|
+
*
|
|
731
|
+
* Matching is case-insensitive for ASCII letters only: `acme` finds `ACME`, but `café` does not find
|
|
732
|
+
* `CAFÉ`. The store and the server run two different regex engines, and their `i` flags disagree on
|
|
733
|
+
* non-ASCII folding — matching ASCII-only is what keeps them in step, so a hit is never reported as an
|
|
734
|
+
* absence. Search the exact casing for non-ASCII text.
|
|
735
|
+
*/
|
|
736
|
+
pattern: string;
|
|
737
|
+
/** Scan options. */
|
|
738
|
+
options?: GrepKnowledgeBaseOptions;
|
|
739
|
+
}
|
|
740
|
+
/**
|
|
741
|
+
* One matching line found by {@link GrepKnowledgeBaseRequest}.
|
|
742
|
+
* @category AI
|
|
743
|
+
*/
|
|
744
|
+
export interface AiKnowledgeBaseGrepMatch {
|
|
745
|
+
/** The id of the context the match was found in. */
|
|
746
|
+
contextId: AiContextId;
|
|
747
|
+
/** The source file name (or context title for text contexts). */
|
|
748
|
+
fileName: string;
|
|
749
|
+
/** The locator within the file: a sheet/section title when the extractor supplied one, else `page N`. */
|
|
750
|
+
part: string;
|
|
751
|
+
/** The 1-based line number the match starts on within its part. */
|
|
752
|
+
lineNumber: number;
|
|
753
|
+
/** The matching line, clipped to {@link GREP_KNOWLEDGE_BASE_MAX_MATCH_LINE_CHARS} with an ellipsis. */
|
|
754
|
+
line: string;
|
|
755
|
+
/**
|
|
756
|
+
* The matching line plus a small window of the lines around it, joined by newlines and clipped to
|
|
757
|
+
* {@link GREP_KNOWLEDGE_BASE_MAX_MATCH_LINE_CHARS}. Wide spreadsheet rows are the normal case here, so
|
|
758
|
+
* the clip is what keeps a full result set from overflowing an agent's context window.
|
|
759
|
+
*/
|
|
760
|
+
context: string;
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* Why a grep result does not cover everything the caller asked for. Absent means the scan was complete
|
|
764
|
+
* over the requested scope, and only then may an empty `matches` be read as the pattern being absent.
|
|
765
|
+
* At most one applies; the server picks the most significant.
|
|
766
|
+
*
|
|
767
|
+
* - `timedOut` — the scan hit its server-side deadline. Routine on large knowledge bases, since the
|
|
768
|
+
* match is unindexed. Says nothing at all about whether the pattern occurs.
|
|
769
|
+
* - `noIndexedText` — nothing in scope has stored text, so nothing was searched. Contexts ingested
|
|
770
|
+
* before literal search existed sit here until they are re-ingested.
|
|
771
|
+
* - `filterMatchedNoContexts` — `metadataFilter`, composed with any visibility filter the application
|
|
772
|
+
* applies, admitted no contexts, so the scan had nothing to read.
|
|
773
|
+
* - `scopeTruncated` — `metadataFilter` admitted more contexts than one scan can cover, so only a prefix
|
|
774
|
+
* of them was searched. Narrow the filter.
|
|
775
|
+
* - `partsCapReached` — the scan filled its per-call budget of matching pages/sheets, so more matching
|
|
776
|
+
* places exist than it read.
|
|
777
|
+
* - `partialCoverage` — some contexts in scope have stored text and some do not; see
|
|
778
|
+
* {@link GrepKnowledgeBaseResponse.unscannedContextCount}.
|
|
779
|
+
* - `truncatedContent` — some in-scope text was cut at ingest, either because one page or sheet exceeded
|
|
780
|
+
* the per-part storage cap or because a document had more pages than the per-document cap, so that
|
|
781
|
+
* content was never searchable.
|
|
782
|
+
* - `coverageUnknown` — the scan itself succeeded, but how much of the scope holds stored text could not
|
|
783
|
+
* be determined, so completeness cannot be asserted either way.
|
|
784
|
+
* @category AI
|
|
785
|
+
*/
|
|
786
|
+
export type GrepScanLimitation = 'timedOut' | 'noIndexedText' | 'filterMatchedNoContexts' | 'scopeTruncated' | 'partsCapReached' | 'partialCoverage' | 'truncatedContent' | 'coverageUnknown';
|
|
787
|
+
/**
|
|
788
|
+
* Response structure for a literal scan over a knowledge base's raw extracted text.
|
|
789
|
+
* @category AI
|
|
790
|
+
*/
|
|
791
|
+
export interface GrepKnowledgeBaseResponse {
|
|
792
|
+
/** The matches found, in context/part/line order. */
|
|
793
|
+
matches: Array<AiKnowledgeBaseGrepMatch>;
|
|
794
|
+
/**
|
|
795
|
+
* True when the returned list stopped at `maxMatches` — more matches exist than were returned. This
|
|
796
|
+
* means ONLY that: every other way a scan can fall short of the request lives in {@link limitation},
|
|
797
|
+
* so a caller branching on this one field never mistakes an incomplete scan for "there are more hits".
|
|
798
|
+
*/
|
|
799
|
+
truncated: boolean;
|
|
800
|
+
/**
|
|
801
|
+
* Why the scan did not cover the full requested scope, if it did not. Absent means it did — which is
|
|
802
|
+
* the only case where an empty `matches` is evidence that the pattern does not occur. The whole point
|
|
803
|
+
* of this API is to make absence claims trustworthy, so callers must branch on this before concluding
|
|
804
|
+
* anything from an empty result.
|
|
805
|
+
*/
|
|
806
|
+
limitation?: GrepScanLimitation;
|
|
807
|
+
/**
|
|
808
|
+
* With `limitation: 'partialCoverage'`, how many contexts in scope have no stored text and were
|
|
809
|
+
* therefore never scanned. The result is silent about those contexts.
|
|
810
|
+
*/
|
|
811
|
+
unscannedContextCount?: number;
|
|
812
|
+
/**
|
|
813
|
+
* With `limitation: 'truncatedContent'`, the file names of documents known to have lost content at
|
|
814
|
+
* ingest. A bounded sample, not a complete list — present it as an example, and do not infer that
|
|
815
|
+
* documents missing from it are intact.
|
|
816
|
+
*/
|
|
817
|
+
truncatedContentFileNames?: Array<string>;
|
|
818
|
+
}
|
|
680
819
|
/**
|
|
681
820
|
* Request structure for searching AI contexts in the AiKnowledgeBase.
|
|
682
821
|
* @category AI
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* 'CONNECTOR_PACKAGES_TO_EXCLUDE_FROM_AUTO_SYNC' in ConnectorsService (console-backend).
|
|
5
5
|
* @category Platform
|
|
6
6
|
*/
|
|
7
|
-
export declare const CONNECTOR_IDS: readonly ["confluence", "cotomi", "essentials", "freshdesk", "github", "google_calendar", "google_drive", "hubspot", "sharepoint", "jira", "jira_jsm", "linear", "mail", "onedrive", "outlook", "salesforce", "servicenow_csm", "slack", "teams", "ticketmind_companion", "zendesk"];
|
|
7
|
+
export declare const CONNECTOR_IDS: readonly ["bitbucket", "confluence", "cotomi", "essentials", "freshdesk", "github", "google_calendar", "google_drive", "hubspot", "sharepoint", "jira", "jira_jsm", "linear", "mail", "onedrive", "outlook", "salesforce", "servicenow_csm", "slack", "teams", "ticketmind_companion", "zendesk"];
|
|
8
8
|
/**
|
|
9
9
|
* Unique connector package name.
|
|
10
10
|
* @category Platform
|
|
@@ -11,11 +11,18 @@ export interface ExtractDataFromDocumentOptions {
|
|
|
11
11
|
*/
|
|
12
12
|
imageMinSizePixels?: number;
|
|
13
13
|
/**
|
|
14
|
-
* Whether to extract embedded images from the document.
|
|
14
|
+
* Whether to extract embedded images from the document. Defaults to true.
|
|
15
15
|
*/
|
|
16
16
|
extractImages?: boolean;
|
|
17
17
|
/**
|
|
18
|
-
* Specific page indexes to extract from the document (0-based). If omitted, all
|
|
18
|
+
* Specific page indexes to extract from the document (0-based whole numbers). If omitted or empty, all
|
|
19
|
+
* pages are extracted. Duplicates are collapsed, order does not matter, and a selection containing no
|
|
20
|
+
* whole page number at all is rejected.
|
|
21
|
+
*
|
|
22
|
+
* An index past the end of the document is ignored, and a selection naming only such indexes is
|
|
23
|
+
* rejected — but only where the document is read here. Extracting a PDF *by URL* through an OCR
|
|
24
|
+
* provider hands it over without reading it, so its length is unknown and what an out-of-range index
|
|
25
|
+
* does is up to that provider. Upload the file instead to have the whole selection checked.
|
|
19
26
|
*/
|
|
20
27
|
pageIndexes?: number[];
|
|
21
28
|
/**
|
|
@@ -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", "bedrock", "azure_blob", "azure_cosmosdb", "azure_postgresql", "azure_sql", "bigquery", "built_in_azure_blob", "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", "azure-entra-external-id", "dynamodb", "elasticsearch", "firebase_auth", "firestore", "gcs", "github", "google_calendar", "google_docs", "google_drive", "graphql", "hubspot", "jira", "jira_jsm", "jwt_hmac", "jwt_rsa", "kafka", "keycloak", "linear", "mariadb", "monday", "mongo", "mssql", "databricks", "mysql", "newrelic", "okta", "onedrive", "outlook", "oracledb", "pinecone", "postgres", "redis", "s3", "salesforce", "sap_hana", "sentry", "snowflake", "spanner", "xata", "zendesk", "servicenow_csm", "freshdesk", "mail", "slack", "mcp", "a2a", "legend", "teams", "openai_compatible", "openai_compatible_embedding", "sharepoint", "vertex"];
|
|
3
|
+
export declare const INTEGRATION_TYPES: readonly ["active_directory", "ai_agents", "ai_chatbot", "algolia", "alloydb", "api", "auth0", "bedrock", "azure_blob", "azure_cosmosdb", "azure_postgresql", "azure_sql", "bigquery", "bitbucket", "built_in_azure_blob", "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", "azure-entra-external-id", "dynamodb", "elasticsearch", "firebase_auth", "firestore", "gcs", "github", "google_calendar", "google_docs", "google_drive", "graphql", "hubspot", "jira", "jira_jsm", "jwt_hmac", "jwt_rsa", "kafka", "keycloak", "linear", "mariadb", "monday", "mongo", "mssql", "databricks", "mysql", "newrelic", "okta", "onedrive", "outlook", "oracledb", "pinecone", "postgres", "redis", "s3", "salesforce", "sap_hana", "sentry", "snowflake", "spanner", "xata", "zendesk", "servicenow_csm", "freshdesk", "mail", "slack", "mcp", "a2a", "legend", "teams", "openai_compatible", "openai_compatible_embedding", "sharepoint", "vertex"];
|
|
4
4
|
/**
|
|
5
5
|
* @category Database
|
|
6
6
|
*/
|
|
@@ -9,6 +9,12 @@ export declare const DATA_INTEGRATION_TYPES: readonly ["bigquery", "built_in_db"
|
|
|
9
9
|
* @category Auth
|
|
10
10
|
*/
|
|
11
11
|
export declare const AUTH_INTEGRATION_TYPES: readonly ["auth0", "jwt_rsa", "jwt_hmac", "cognito", "okta", "keycloak", "descope", "firebase_auth", "azure-entra-external-id"];
|
|
12
|
+
/**
|
|
13
|
+
* Auth integration types that can OAuth-protect an MCP server (see `McpOAuthOptions` and
|
|
14
|
+
* `AiAgentMcpServerConfig.oauthIntegrationId`). Kept in sync with the providers supported by the
|
|
15
|
+
* MCP OAuth validation in core.
|
|
16
|
+
*/
|
|
17
|
+
export declare const MCP_OAUTH_INTEGRATION_TYPES: readonly ["auth0"];
|
|
12
18
|
/** Supported integration types for GraphQL-based services. */
|
|
13
19
|
export declare const GRAPHQL_INTEGRATION_TYPES: readonly ["graphql"];
|
|
14
20
|
/** Supported integration types for HTTP-based services. */
|