@squidcloud/client 1.0.484 → 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.
@@ -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 = 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
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
@@ -683,6 +733,8 @@ export interface AiAgent<T extends AiChatModelSelection | undefined = undefined>
683
733
  options: AiChatOptions<T>;
684
734
  /** Optional api key used specifically for operations on this agent */
685
735
  apiKey?: string;
736
+ /** Optional configuration for exposing the agent as an MCP server. */
737
+ mcpServer?: AiAgentMcpServerConfig;
686
738
  }
687
739
  /**
688
740
  * @category AI
@@ -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"). */
@@ -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. */
@@ -1,3 +1,4 @@
1
+ import type { CanonicalReasoningEffort } from './ai-agent.public-types';
1
2
  import type { IntegrationInfo } from './integration.public-types';
2
3
  /** Identifies the source-code analysis AI function. */
3
4
  export declare const SOURCE_CODE_ANALYZE_FUNCTION_ID = "analyzeCode";
@@ -23,6 +24,10 @@ export interface AiAgentSourceCodeIntegrationOptions {
23
24
  codeAnalysisEnabled: boolean;
24
25
  /** Selects the CLI provider used for code analysis. */
25
26
  analyzerModel?: SourceCodeAnalyzerModel;
27
+ /** Selects a concrete model from the analyzer provider's CLI registry. */
28
+ analyzerModelId?: string;
29
+ /** Selects the reasoning effort used by the analyzer CLI. */
30
+ analyzerReasoningEffort?: CanonicalReasoningEffort;
26
31
  /** Provides supplemental code-analysis instructions. */
27
32
  analyzerInstructions?: string;
28
33
  }
@@ -1,4 +1,4 @@
1
- import { AgentContextRequest, AiAgent, AiAgentContext, AiAnnotation, AiAudioCreateSpeechOptions, AiChatMessage, AiChatOptions, AiGenerateImageOptions, AllAiAgentChatOptions, ApplicationAiSettings, BuildAgentOptions } from '../public-types/ai-agent.public-types';
1
+ import { AgentContextRequest, AiAgent, AiAgentContext, AiAgentMcpServerConfig, AiAnnotation, AiAudioCreateSpeechOptions, AiChatMessage, AiChatOptions, AiGenerateImageOptions, AllAiAgentChatOptions, ApplicationAiSettings, BuildAgentOptions } from '../public-types/ai-agent.public-types';
2
2
  import { AiProviderType, ModelIdSpec } from '../public-types/ai-common.public-types';
3
3
  import { AiContextMetadata, AiContextMetadataFilter } from '../public-types/ai-knowledge-base.public-types';
4
4
  import { AiAgentId, AiKnowledgeBaseId, AppId, ClientRequestId } from '../public-types/communication.public-types';
@@ -161,6 +161,10 @@ export interface SetAgentDescriptionRequest {
161
161
  agentId: AiAgentId;
162
162
  description: string;
163
163
  }
164
+ export interface SetAgentMcpServerRequest {
165
+ agentId: AiAgentId;
166
+ mcpServer: AiAgentMcpServerConfig;
167
+ }
164
168
  export interface ListAgentContextsRequest {
165
169
  agentId: AiAgentId;
166
170
  }
@@ -1,5 +1,19 @@
1
1
  import { ClientId } from '../public-types/communication.public-types';
2
+ import { AiStatusMessageToClient, NotificationMessageToClient } from './socket.types';
2
3
  export interface PublishNotificationRequest {
3
4
  clientIds: Array<ClientId>;
4
5
  payload: unknown;
5
6
  }
7
+ /**
8
+ * Body of `/notification/publishSystemNotification`: the payload is a ready-made socket message.
9
+ *
10
+ * Deliberately narrower than the `MessageToClient` union: the endpoint exists to carry an AI status
11
+ * update from the backend SDK, or the same message its sibling `publishNotification` produces, and
12
+ * both are read defensively by their consumers. The protocol variants are not accepted — their
13
+ * handlers do structural work on the payload (the SDK's mutation dispatcher iterates it, for
14
+ * example), so admitting them would let a caller hand its own clients a message that throws.
15
+ */
16
+ export interface PublishSystemNotificationRequest {
17
+ clientIds: Array<ClientId>;
18
+ payload: AiStatusMessageToClient | NotificationMessageToClient;
19
+ }
@@ -1,5 +1,5 @@
1
1
  import { Observable } from 'rxjs';
2
- import { AiAgent, AiChatMessage, AiChatModelSelection, AiConnectedAgentMetadata, AiConnectedIntegrationMetadata, AiConnectedKnowledgeBaseMetadata, AiStatusMessage, AiTranscribeAndAskResponse, AllAiAgentChatOptions, BuildAgentOptions, GuardrailsOptions, ListAgentRevisionsResponse, UpsertAgentRequest } from '../../../internal-common/src/public-types/ai-agent.public-types';
2
+ import { AiAgent, AiAgentMcpServerConfig, AiChatMessage, AiChatModelSelection, AiConnectedAgentMetadata, AiConnectedIntegrationMetadata, AiConnectedKnowledgeBaseMetadata, AiStatusMessage, AiTranscribeAndAskResponse, AllAiAgentChatOptions, BuildAgentOptions, GenerateAgentMcpDescriptionsResponse, GuardrailsOptions, ListAgentRevisionsResponse, UpsertAgentRequest } from '../../../internal-common/src/public-types/ai-agent.public-types';
3
3
  import { JobId } from '../../../internal-common/src/public-types/job.public-types';
4
4
  import { Paths } from '../../../internal-common/src/public-types/typescript.public-types';
5
5
  import { AiAskOptions, AiAskOptionsWithVoice, AiChatOptionsWithoutVoice, AskResponse, AskWithVoiceResponse, TranscribeAndAskWithVoiceResponse, TranscribeAndChatResponse } from './ai-agent-client.types';
@@ -52,6 +52,17 @@ export declare class AiAgentReference {
52
52
  * Updates the agent's guardrails with the provided options.
53
53
  */
54
54
  updateGuardrails(guardrails: GuardrailsOptions): Promise<void>;
55
+ /**
56
+ * Updates the agent's MCP server configuration, controlling whether the agent is exposed as an
57
+ * MCP server at `/mcp/<agentId>`. Requires an API key.
58
+ */
59
+ updateMcpServer(mcpServer: AiAgentMcpServerConfig): Promise<void>;
60
+ /**
61
+ * AI-generates the MCP server and `ask` tool descriptions for the agent based on its
62
+ * instructions and connected resources. Returns the descriptions without persisting them —
63
+ * save them with {@link updateMcpServer}. Requires an API key.
64
+ */
65
+ generateMcpDescriptions(): Promise<GenerateAgentMcpDescriptionsResponse>;
55
66
  /**
56
67
  * Updates the agent's custom guardrails with the provided custom guardrail.
57
68
  */
@@ -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.484";
5
+ export declare const SQUIDCLOUD_CLIENT_PACKAGE_VERSION = "1.0.485";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squidcloud/client",
3
- "version": "1.0.484",
3
+ "version": "1.0.485",
4
4
  "description": "A typescript implementation of the Squid client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -51,12 +51,10 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "@supercharge/promise-pool": "^3.2.0",
54
- "@webpack-cli/generators": "^3.0.7",
55
54
  "copy-webpack-plugin": "^14.0.0",
56
55
  "generate-package-json-webpack-plugin": "^2.6.0",
57
56
  "otrie": "^1.2.2",
58
57
  "tsconfig-paths-webpack-plugin": "^4.1.0",
59
- "tscpaths": "^0.0.9",
60
58
  "typedoc": "^0.28.10",
61
59
  "typedoc-plugin-markdown": "^4.8.1",
62
60
  "webpack": "^5.106.2",