@squidcloud/backend 1.0.382 → 1.0.385
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/backend/src/actions.d.ts +32 -12
- package/dist/backend/src/public-types.d.ts +2 -0
- package/dist/cjs/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/internal-common/src/public-types-backend/bundle-api.public-types.d.ts +11 -0
- package/dist/internal-common/src/public-types-backend/llm.public-types.d.ts +10 -0
- package/dist/internal-common/src/public-types-backend/mcp.public-types.d.ts +31 -0
- package/package.json +2 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { AiFunctionId, ApiEndpointId, CollectionName, IntegrationId, IntegrationType,
|
|
2
|
-
import {
|
|
1
|
+
import { AiFunctionId, ApiEndpointId, CollectionName, IntegrationId, IntegrationType, TopicName } from '@squidcloud/client';
|
|
2
|
+
import { JSONSchema } from 'json-schema-typed';
|
|
3
|
+
import { ActionMethodDecorator, AiFunctionAction, ClientConnectionStateChangeAction, ExecutableAction, LimiterConfig, LimitsAction, LlmAskAction, McpAuthorizerAction, McpToolAction, SchedulerAction, SecureAiAgentAction, SecureApiAction, SecureDatabaseAction, SecureDistributedLockAction, SecureGraphQLAction, SecureMetricAction, SecureNativeQueryAction, SecureStorageAction, SecureTopicAction, TriggerAction, WebhookAction } from '../../internal-common/src/public-types-backend/bundle-api.public-types';
|
|
3
4
|
import { AiFunctionAttributes, AiFunctionParam, DatabaseActionType, MetricActionType, StorageActionType, TopicActionType } from '../../internal-common/src/public-types-backend/bundle-data.public-types';
|
|
4
|
-
import { AiFunctionsConfiguratorRequest, AiFunctionsConfiguratorResponse, CronExpression, CronExpressionString, MutationType, SchedulerId, TriggerId, WebhookId } from './public-types';
|
|
5
|
+
import { AiFunctionsConfiguratorRequest, AiFunctionsConfiguratorResponse, CronExpression, CronExpressionString, LlmServiceOptions, McpServerOptions, MutationType, SchedulerId, TriggerId, WebhookId } from './public-types';
|
|
5
6
|
/**
|
|
6
7
|
* Decorator that marks a function for securing a database.
|
|
7
8
|
* The decorator takes a type of action and an optional integration ID.
|
|
@@ -141,6 +142,18 @@ export interface AiFunctionMetadataOptions {
|
|
|
141
142
|
/** Additional optional attributes for the function. Example: related integrations. */
|
|
142
143
|
attributes?: AiFunctionAttributes;
|
|
143
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Options for the `@mcpTool` annotation.
|
|
147
|
+
* @category AI
|
|
148
|
+
*/
|
|
149
|
+
export interface McpToolMetadataOptions {
|
|
150
|
+
/** Describes the capabilities of the function. This is used by the AI agent to determine when to call it. */
|
|
151
|
+
description: string;
|
|
152
|
+
/** Parameters for the MCP Tool. */
|
|
153
|
+
inputSchema: JSONSchema;
|
|
154
|
+
/** (Optional) The tool output schema. */
|
|
155
|
+
outputSchema?: JSONSchema;
|
|
156
|
+
}
|
|
144
157
|
/**
|
|
145
158
|
* Decorator that marks a function for exposing it to the AI assistant.
|
|
146
159
|
* The function accepts a JSON object as described in the description of the function in the annotation.
|
|
@@ -405,15 +418,6 @@ export declare function secureAiAgent(agentId?: string): ActionMethodDecorator<S
|
|
|
405
418
|
* @category Decorator
|
|
406
419
|
*/
|
|
407
420
|
export declare function limits(options: LimiterConfig): ActionMethodDecorator<LimitsAction>;
|
|
408
|
-
/**
|
|
409
|
-
* Options for the `@llmService` decorator.
|
|
410
|
-
*/
|
|
411
|
-
export interface LlmServiceOptions {
|
|
412
|
-
/**
|
|
413
|
-
* Map of model names to their metadata.
|
|
414
|
-
*/
|
|
415
|
-
models: Record<UserAiChatModelName, LlmModelMetadata>;
|
|
416
|
-
}
|
|
417
421
|
/**
|
|
418
422
|
* Decorator‐factory that takes service options and returns a ClassDecorator.
|
|
419
423
|
* @category Decorator
|
|
@@ -424,6 +428,22 @@ export declare function llmService(opts: LlmServiceOptions): ClassDecorator;
|
|
|
424
428
|
* @category Decorator
|
|
425
429
|
*/
|
|
426
430
|
export declare function llmAsk(): ActionMethodDecorator<LlmAskAction>;
|
|
431
|
+
/**
|
|
432
|
+
* Decorator that marks a class as an MCP server.
|
|
433
|
+
* @category Decorator
|
|
434
|
+
*/
|
|
435
|
+
export declare function mcpServer(opts: McpServerOptions): ClassDecorator;
|
|
436
|
+
/**
|
|
437
|
+
* A decorator to mark a function as a tool that can be used by the MCP .
|
|
438
|
+
* @param options Options for the MCP tool.
|
|
439
|
+
* @category Decorator
|
|
440
|
+
*/
|
|
441
|
+
export declare function mcpTool(options: McpToolMetadataOptions): ActionMethodDecorator<McpToolAction>;
|
|
442
|
+
/**
|
|
443
|
+
* A decorator to mark a function as authorized request handler for the MCP.
|
|
444
|
+
* @category Decorator
|
|
445
|
+
*/
|
|
446
|
+
export declare function mcpAuthorizer(): ActionMethodDecorator<McpAuthorizerAction>;
|
|
427
447
|
/**
|
|
428
448
|
* Decorator that marks a function for handling a client connection state change.
|
|
429
449
|
* @category Platform
|
|
@@ -4,6 +4,8 @@ export * from '../../internal-common/src/public-types-backend/application.public
|
|
|
4
4
|
export * from '../../internal-common/src/public-types-backend/bundle-api.public-types';
|
|
5
5
|
export * from '../../internal-common/src/public-types-backend/distributed-lock.public-context';
|
|
6
6
|
export * from '../../internal-common/src/public-types-backend/graphql.public-context';
|
|
7
|
+
export * from '../../internal-common/src/public-types-backend/llm.public-types';
|
|
8
|
+
export * from '../../internal-common/src/public-types-backend/mcp.public-types';
|
|
7
9
|
export * from '../../internal-common/src/public-types-backend/metric.public-context';
|
|
8
10
|
export * from '../../internal-common/src/public-types-backend/mutation.public-context';
|
|
9
11
|
export * from '../../internal-common/src/public-types-backend/native-query.public-context';
|