SEP-1319: Decouple Request Payloads, Remove passthrough iteration, Typecheck fixes (#1086)
This commit is contained in:
parent
806d7cf9c0
commit
f59996ae66
1 changed files with 2840 additions and 951 deletions
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Source: https://github.com/modelcontextprotocol/modelcontextprotocol
|
||||
* Pulled from: https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/draft/schema.ts
|
||||
* Last updated from commit: 50671e92e71da830b101c7d1162b44fbddcbef30
|
||||
* Last updated from commit: bcdd3363e6472b645f196e7ec6988abe3b9799e2
|
||||
*
|
||||
* DO NOT EDIT THIS FILE MANUALLY. Changes will be overwritten by automated updates.
|
||||
* To update this file, run: npm run fetch:spec-types
|
||||
|
|
@ -35,34 +35,43 @@ export type ProgressToken = string | number;
|
|||
*/
|
||||
export type Cursor = string;
|
||||
|
||||
/** @internal */
|
||||
export interface Request {
|
||||
method: string;
|
||||
params?: {
|
||||
/**
|
||||
* Common params for any request.
|
||||
*/
|
||||
export interface RequestParams {
|
||||
/**
|
||||
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
||||
*/
|
||||
_meta?: {
|
||||
/**
|
||||
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
||||
* If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
|
||||
*/
|
||||
_meta?: {
|
||||
/**
|
||||
* If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
|
||||
*/
|
||||
progressToken?: ProgressToken;
|
||||
[key: string]: unknown;
|
||||
};
|
||||
progressToken?: ProgressToken;
|
||||
[key: string]: unknown;
|
||||
};
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export interface Request {
|
||||
method: string;
|
||||
// Allow unofficial extensions of `Request.params` without impacting `RequestParams`.
|
||||
params?: { [key: string]: any };
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export interface NotificationParams {
|
||||
/**
|
||||
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
||||
*/
|
||||
_meta?: { [key: string]: unknown };
|
||||
}
|
||||
|
||||
|
||||
/** @internal */
|
||||
export interface Notification {
|
||||
method: string;
|
||||
params?: {
|
||||
/**
|
||||
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
||||
*/
|
||||
_meta?: { [key: string]: unknown };
|
||||
[key: string]: unknown;
|
||||
};
|
||||
// Allow unofficial extensions of `Notification.params` without impacting `NotificationParams`.
|
||||
params?: { [key: string]: any };
|
||||
}
|
||||
|
||||
export interface Result {
|
||||
|
|
@ -145,6 +154,25 @@ export interface JSONRPCError {
|
|||
export type EmptyResult = Result;
|
||||
|
||||
/* Cancellation */
|
||||
/**
|
||||
* Parameters for a `notifications/cancelled` notification.
|
||||
*
|
||||
* @category notifications/cancelled
|
||||
*/
|
||||
export interface CancelledNotificationParams extends NotificationParams {
|
||||
/**
|
||||
* The ID of the request to cancel.
|
||||
*
|
||||
* This MUST correspond to the ID of a request previously issued in the same direction.
|
||||
*/
|
||||
requestId: RequestId;
|
||||
|
||||
/**
|
||||
* An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
|
||||
*/
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
|
||||
*
|
||||
|
|
@ -158,22 +186,24 @@ export type EmptyResult = Result;
|
|||
*/
|
||||
export interface CancelledNotification extends JSONRPCNotification {
|
||||
method: "notifications/cancelled";
|
||||
params: {
|
||||
/**
|
||||
* The ID of the request to cancel.
|
||||
*
|
||||
* This MUST correspond to the ID of a request previously issued in the same direction.
|
||||
*/
|
||||
requestId: RequestId;
|
||||
|
||||
/**
|
||||
* An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
|
||||
*/
|
||||
reason?: string;
|
||||
};
|
||||
params: CancelledNotificationParams;
|
||||
}
|
||||
|
||||
/* Initialization */
|
||||
/**
|
||||
* Parameters for an `initialize` request.
|
||||
*
|
||||
* @category initialize
|
||||
*/
|
||||
export interface InitializeRequestParams extends RequestParams {
|
||||
/**
|
||||
* The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
|
||||
*/
|
||||
protocolVersion: string;
|
||||
capabilities: ClientCapabilities;
|
||||
clientInfo: Implementation;
|
||||
}
|
||||
|
||||
/**
|
||||
* This request is sent from the client to the server when it first connects, asking it to begin initialization.
|
||||
*
|
||||
|
|
@ -181,14 +211,7 @@ export interface CancelledNotification extends JSONRPCNotification {
|
|||
*/
|
||||
export interface InitializeRequest extends JSONRPCRequest {
|
||||
method: "initialize";
|
||||
params: {
|
||||
/**
|
||||
* The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
|
||||
*/
|
||||
protocolVersion: string;
|
||||
capabilities: ClientCapabilities;
|
||||
clientInfo: Implementation;
|
||||
};
|
||||
params: InitializeRequestParams;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -219,6 +242,7 @@ export interface InitializeResult extends Result {
|
|||
*/
|
||||
export interface InitializedNotification extends JSONRPCNotification {
|
||||
method: "notifications/initialized";
|
||||
params?: NotificationParams;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -403,9 +427,39 @@ export interface Implementation extends BaseMetadata, Icons {
|
|||
*/
|
||||
export interface PingRequest extends JSONRPCRequest {
|
||||
method: "ping";
|
||||
params?: RequestParams
|
||||
}
|
||||
|
||||
/* Progress notifications */
|
||||
|
||||
/**
|
||||
* Parameters for a `notifications/progress` notification.
|
||||
*
|
||||
* @category notifications/progress
|
||||
*/
|
||||
export interface ProgressNotificationParams extends NotificationParams {
|
||||
/**
|
||||
* The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
|
||||
*/
|
||||
progressToken: ProgressToken;
|
||||
/**
|
||||
* The progress thus far. This should increase every time progress is made, even if the total is unknown.
|
||||
*
|
||||
* @TJS-type number
|
||||
*/
|
||||
progress: number;
|
||||
/**
|
||||
* Total number of items to process (or total progress required), if known.
|
||||
*
|
||||
* @TJS-type number
|
||||
*/
|
||||
total?: number;
|
||||
/**
|
||||
* An optional message describing the current progress.
|
||||
*/
|
||||
message?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* An out-of-band notification used to inform the receiver of a progress update for a long-running request.
|
||||
*
|
||||
|
|
@ -413,40 +467,24 @@ export interface PingRequest extends JSONRPCRequest {
|
|||
*/
|
||||
export interface ProgressNotification extends JSONRPCNotification {
|
||||
method: "notifications/progress";
|
||||
params: {
|
||||
/**
|
||||
* The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
|
||||
*/
|
||||
progressToken: ProgressToken;
|
||||
/**
|
||||
* The progress thus far. This should increase every time progress is made, even if the total is unknown.
|
||||
*
|
||||
* @TJS-type number
|
||||
*/
|
||||
progress: number;
|
||||
/**
|
||||
* Total number of items to process (or total progress required), if known.
|
||||
*
|
||||
* @TJS-type number
|
||||
*/
|
||||
total?: number;
|
||||
/**
|
||||
* An optional message describing the current progress.
|
||||
*/
|
||||
message?: string;
|
||||
};
|
||||
params: ProgressNotificationParams;
|
||||
}
|
||||
|
||||
/* Pagination */
|
||||
/**
|
||||
* Common parameters for paginated requests.
|
||||
*/
|
||||
export interface PaginatedRequestParams extends RequestParams {
|
||||
/**
|
||||
* An opaque token representing the current pagination position.
|
||||
* If provided, the server should return results starting after this cursor.
|
||||
*/
|
||||
cursor?: Cursor;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export interface PaginatedRequest extends JSONRPCRequest {
|
||||
params?: {
|
||||
/**
|
||||
* An opaque token representing the current pagination position.
|
||||
* If provided, the server should return results starting after this cursor.
|
||||
*/
|
||||
cursor?: Cursor;
|
||||
};
|
||||
params?: PaginatedRequestParams;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
|
|
@ -495,6 +533,27 @@ export interface ListResourceTemplatesResult extends PaginatedResult {
|
|||
resourceTemplates: ResourceTemplate[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Common parameters when working with resources.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export interface ResourceRequestParams extends RequestParams {
|
||||
/**
|
||||
* The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it.
|
||||
*
|
||||
* @format uri
|
||||
*/
|
||||
uri: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for a `resources/read` request.
|
||||
*
|
||||
* @category resources/read
|
||||
*/
|
||||
export interface ReadResourceRequestParams extends ResourceRequestParams {}
|
||||
|
||||
/**
|
||||
* Sent from the client to the server, to read a specific resource URI.
|
||||
*
|
||||
|
|
@ -502,14 +561,7 @@ export interface ListResourceTemplatesResult extends PaginatedResult {
|
|||
*/
|
||||
export interface ReadResourceRequest extends JSONRPCRequest {
|
||||
method: "resources/read";
|
||||
params: {
|
||||
/**
|
||||
* The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
|
||||
*
|
||||
* @format uri
|
||||
*/
|
||||
uri: string;
|
||||
};
|
||||
params: ReadResourceRequestParams;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -528,8 +580,16 @@ export interface ReadResourceResult extends Result {
|
|||
*/
|
||||
export interface ResourceListChangedNotification extends JSONRPCNotification {
|
||||
method: "notifications/resources/list_changed";
|
||||
params?: NotificationParams;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for a `resources/subscribe` request.
|
||||
*
|
||||
* @category resources/subscribe
|
||||
*/
|
||||
export interface SubscribeRequestParams extends ResourceRequestParams {}
|
||||
|
||||
/**
|
||||
* Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
|
||||
*
|
||||
|
|
@ -537,16 +597,16 @@ export interface ResourceListChangedNotification extends JSONRPCNotification {
|
|||
*/
|
||||
export interface SubscribeRequest extends JSONRPCRequest {
|
||||
method: "resources/subscribe";
|
||||
params: {
|
||||
/**
|
||||
* The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.
|
||||
*
|
||||
* @format uri
|
||||
*/
|
||||
uri: string;
|
||||
};
|
||||
params: SubscribeRequestParams;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for a `resources/unsubscribe` request.
|
||||
*
|
||||
* @category resources/unsubscribe
|
||||
*/
|
||||
export interface UnsubscribeRequestParams extends ResourceRequestParams {}
|
||||
|
||||
/**
|
||||
* Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
|
||||
*
|
||||
|
|
@ -554,14 +614,21 @@ export interface SubscribeRequest extends JSONRPCRequest {
|
|||
*/
|
||||
export interface UnsubscribeRequest extends JSONRPCRequest {
|
||||
method: "resources/unsubscribe";
|
||||
params: {
|
||||
/**
|
||||
* The URI of the resource to unsubscribe from.
|
||||
*
|
||||
* @format uri
|
||||
*/
|
||||
uri: string;
|
||||
};
|
||||
params: UnsubscribeRequestParams;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for a `notifications/resources/updated` notification.
|
||||
*
|
||||
* @category notifications/resources/updated
|
||||
*/
|
||||
export interface ResourceUpdatedNotificationParams extends NotificationParams {
|
||||
/**
|
||||
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
||||
*
|
||||
* @format uri
|
||||
*/
|
||||
uri: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -571,14 +638,7 @@ export interface UnsubscribeRequest extends JSONRPCRequest {
|
|||
*/
|
||||
export interface ResourceUpdatedNotification extends JSONRPCNotification {
|
||||
method: "notifications/resources/updated";
|
||||
params: {
|
||||
/**
|
||||
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
||||
*
|
||||
* @format uri
|
||||
*/
|
||||
uri: string;
|
||||
};
|
||||
params: ResourceUpdatedNotificationParams;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -712,6 +772,22 @@ export interface ListPromptsResult extends PaginatedResult {
|
|||
prompts: Prompt[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for a `prompts/get` request.
|
||||
*
|
||||
* @category prompts/get
|
||||
*/
|
||||
export interface GetPromptRequestParams extends RequestParams {
|
||||
/**
|
||||
* The name of the prompt or prompt template.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Arguments to use for templating the prompt.
|
||||
*/
|
||||
arguments?: { [key: string]: string };
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by the client to get a prompt provided by the server.
|
||||
*
|
||||
|
|
@ -719,16 +795,7 @@ export interface ListPromptsResult extends PaginatedResult {
|
|||
*/
|
||||
export interface GetPromptRequest extends JSONRPCRequest {
|
||||
method: "prompts/get";
|
||||
params: {
|
||||
/**
|
||||
* The name of the prompt or prompt template.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Arguments to use for templating the prompt.
|
||||
*/
|
||||
arguments?: { [key: string]: string };
|
||||
};
|
||||
params: GetPromptRequestParams;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -830,6 +897,7 @@ export interface EmbeddedResource {
|
|||
*/
|
||||
export interface PromptListChangedNotification extends JSONRPCNotification {
|
||||
method: "notifications/prompts/list_changed";
|
||||
params?: NotificationParams;
|
||||
}
|
||||
|
||||
/* Tools */
|
||||
|
|
@ -884,6 +952,22 @@ export interface CallToolResult extends Result {
|
|||
isError?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for a `tools/call` request.
|
||||
*
|
||||
* @category tools/call
|
||||
*/
|
||||
export interface CallToolRequestParams extends RequestParams {
|
||||
/**
|
||||
* The name of the tool.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Arguments to use for the tool call.
|
||||
*/
|
||||
arguments?: { [key: string]: unknown };
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by the client to invoke a tool provided by the server.
|
||||
*
|
||||
|
|
@ -891,10 +975,7 @@ export interface CallToolResult extends Result {
|
|||
*/
|
||||
export interface CallToolRequest extends JSONRPCRequest {
|
||||
method: "tools/call";
|
||||
params: {
|
||||
name: string;
|
||||
arguments?: { [key: string]: unknown };
|
||||
};
|
||||
params: CallToolRequestParams;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -904,6 +985,7 @@ export interface CallToolRequest extends JSONRPCRequest {
|
|||
*/
|
||||
export interface ToolListChangedNotification extends JSONRPCNotification {
|
||||
method: "notifications/tools/list_changed";
|
||||
params?: NotificationParams;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1004,6 +1086,19 @@ export interface Tool extends BaseMetadata, Icons {
|
|||
}
|
||||
|
||||
/* Logging */
|
||||
|
||||
/**
|
||||
* Parameters for a `logging/setLevel` request.
|
||||
*
|
||||
* @category logging/setLevel
|
||||
*/
|
||||
export interface SetLevelRequestParams extends RequestParams {
|
||||
/**
|
||||
* The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/message.
|
||||
*/
|
||||
level: LoggingLevel;
|
||||
}
|
||||
|
||||
/**
|
||||
* A request from the client to the server, to enable or adjust logging.
|
||||
*
|
||||
|
|
@ -1011,12 +1106,27 @@ export interface Tool extends BaseMetadata, Icons {
|
|||
*/
|
||||
export interface SetLevelRequest extends JSONRPCRequest {
|
||||
method: "logging/setLevel";
|
||||
params: {
|
||||
/**
|
||||
* The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/message.
|
||||
*/
|
||||
level: LoggingLevel;
|
||||
};
|
||||
params: SetLevelRequestParams;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for a `notifications/message` notification.
|
||||
*
|
||||
* @category notifications/message
|
||||
*/
|
||||
export interface LoggingMessageNotificationParams extends NotificationParams {
|
||||
/**
|
||||
* The severity of this log message.
|
||||
*/
|
||||
level: LoggingLevel;
|
||||
/**
|
||||
* An optional name of the logger issuing this message.
|
||||
*/
|
||||
logger?: string;
|
||||
/**
|
||||
* The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
|
||||
*/
|
||||
data: unknown;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1026,20 +1136,7 @@ export interface SetLevelRequest extends JSONRPCRequest {
|
|||
*/
|
||||
export interface LoggingMessageNotification extends JSONRPCNotification {
|
||||
method: "notifications/message";
|
||||
params: {
|
||||
/**
|
||||
* The severity of this log message.
|
||||
*/
|
||||
level: LoggingLevel;
|
||||
/**
|
||||
* An optional name of the logger issuing this message.
|
||||
*/
|
||||
logger?: string;
|
||||
/**
|
||||
* The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
|
||||
*/
|
||||
data: unknown;
|
||||
};
|
||||
params: LoggingMessageNotificationParams;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1059,6 +1156,42 @@ export type LoggingLevel =
|
|||
| "emergency";
|
||||
|
||||
/* Sampling */
|
||||
/**
|
||||
* Parameters for a `sampling/createMessage` request.
|
||||
*
|
||||
* @category sampling/createMessage
|
||||
*/
|
||||
export interface CreateMessageRequestParams extends RequestParams {
|
||||
messages: SamplingMessage[];
|
||||
/**
|
||||
* The server's preferences for which model to select. The client MAY ignore these preferences.
|
||||
*/
|
||||
modelPreferences?: ModelPreferences;
|
||||
/**
|
||||
* An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
|
||||
*/
|
||||
systemPrompt?: string;
|
||||
/**
|
||||
* A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.
|
||||
*/
|
||||
includeContext?: "none" | "thisServer" | "allServers";
|
||||
/**
|
||||
* @TJS-type number
|
||||
*/
|
||||
temperature?: number;
|
||||
/**
|
||||
* The requested maximum number of tokens to sample (to prevent runaway completions).
|
||||
*
|
||||
* The client MAY choose to sample fewer tokens than the requested maximum.
|
||||
*/
|
||||
maxTokens: number;
|
||||
stopSequences?: string[];
|
||||
/**
|
||||
* Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
|
||||
*/
|
||||
metadata?: object;
|
||||
}
|
||||
|
||||
/**
|
||||
* A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.
|
||||
*
|
||||
|
|
@ -1066,36 +1199,7 @@ export type LoggingLevel =
|
|||
*/
|
||||
export interface CreateMessageRequest extends JSONRPCRequest {
|
||||
method: "sampling/createMessage";
|
||||
params: {
|
||||
messages: SamplingMessage[];
|
||||
/**
|
||||
* The server's preferences for which model to select. The client MAY ignore these preferences.
|
||||
*/
|
||||
modelPreferences?: ModelPreferences;
|
||||
/**
|
||||
* An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
|
||||
*/
|
||||
systemPrompt?: string;
|
||||
/**
|
||||
* A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.
|
||||
*/
|
||||
includeContext?: "none" | "thisServer" | "allServers";
|
||||
/**
|
||||
* @TJS-type number
|
||||
*/
|
||||
temperature?: number;
|
||||
/**
|
||||
* The requested maximum number of tokens to sample (to prevent runaway completions).
|
||||
*
|
||||
* The client MAY choose to sample fewer tokens than the requested maximum.
|
||||
*/
|
||||
maxTokens: number;
|
||||
stopSequences?: string[];
|
||||
/**
|
||||
* Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
|
||||
*/
|
||||
metadata?: object;
|
||||
};
|
||||
params: CreateMessageRequestParams;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1325,6 +1429,38 @@ export interface ModelHint {
|
|||
}
|
||||
|
||||
/* Autocomplete */
|
||||
/**
|
||||
* Parameters for a `completion/complete` request.
|
||||
*
|
||||
* @category completion/complete
|
||||
*/
|
||||
export interface CompleteRequestParams extends RequestParams {
|
||||
ref: PromptReference | ResourceTemplateReference;
|
||||
/**
|
||||
* The argument's information
|
||||
*/
|
||||
argument: {
|
||||
/**
|
||||
* The name of the argument
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The value of the argument to use for completion matching.
|
||||
*/
|
||||
value: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Additional, optional context for completions
|
||||
*/
|
||||
context?: {
|
||||
/**
|
||||
* Previously-resolved variables in a URI template or prompt.
|
||||
*/
|
||||
arguments?: { [key: string]: string };
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* A request from the client to the server, to ask for completion options.
|
||||
*
|
||||
|
|
@ -1332,32 +1468,7 @@ export interface ModelHint {
|
|||
*/
|
||||
export interface CompleteRequest extends JSONRPCRequest {
|
||||
method: "completion/complete";
|
||||
params: {
|
||||
ref: PromptReference | ResourceTemplateReference;
|
||||
/**
|
||||
* The argument's information
|
||||
*/
|
||||
argument: {
|
||||
/**
|
||||
* The name of the argument
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The value of the argument to use for completion matching.
|
||||
*/
|
||||
value: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Additional, optional context for completions
|
||||
*/
|
||||
context?: {
|
||||
/**
|
||||
* Previously-resolved variables in a URI template or prompt.
|
||||
*/
|
||||
arguments?: { [key: string]: string };
|
||||
};
|
||||
};
|
||||
params: CompleteRequestParams;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1416,6 +1527,7 @@ export interface PromptReference extends BaseMetadata {
|
|||
*/
|
||||
export interface ListRootsRequest extends JSONRPCRequest {
|
||||
method: "roots/list";
|
||||
params?: RequestParams;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1463,6 +1575,30 @@ export interface Root {
|
|||
*/
|
||||
export interface RootsListChangedNotification extends JSONRPCNotification {
|
||||
method: "notifications/roots/list_changed";
|
||||
params?: NotificationParams;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parameters for an `elicitation/create` request.
|
||||
*
|
||||
* @category elicitation/create
|
||||
*/
|
||||
export interface ElicitRequestParams extends RequestParams {
|
||||
/**
|
||||
* The message to present to the user.
|
||||
*/
|
||||
message: string;
|
||||
/**
|
||||
* A restricted subset of JSON Schema.
|
||||
* Only top-level properties are allowed, without nesting.
|
||||
*/
|
||||
requestedSchema: {
|
||||
type: "object";
|
||||
properties: {
|
||||
[key: string]: PrimitiveSchemaDefinition;
|
||||
};
|
||||
required?: string[];
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1472,23 +1608,7 @@ export interface RootsListChangedNotification extends JSONRPCNotification {
|
|||
*/
|
||||
export interface ElicitRequest extends JSONRPCRequest {
|
||||
method: "elicitation/create";
|
||||
params: {
|
||||
/**
|
||||
* The message to present to the user.
|
||||
*/
|
||||
message: string;
|
||||
/**
|
||||
* A restricted subset of JSON Schema.
|
||||
* Only top-level properties are allowed, without nesting.
|
||||
*/
|
||||
requestedSchema: {
|
||||
type: "object";
|
||||
properties: {
|
||||
[key: string]: PrimitiveSchemaDefinition;
|
||||
};
|
||||
required?: string[];
|
||||
};
|
||||
};
|
||||
params: ElicitRequestParams;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue