tmcp 1.8.0 → 1.8.2

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.
@@ -0,0 +1,61 @@
1
+ {
2
+ "version": 3,
3
+ "file": "index.d.ts",
4
+ "names": [
5
+ "McpServer",
6
+ "ClientCapabilities",
7
+ "Completion",
8
+ "ServerOptions",
9
+ "ServerInfo",
10
+ "SubscriptionsKeys",
11
+ "McpEvents",
12
+ "JSONRPCResponseSchema",
13
+ "ClientCapabilitiesSchema",
14
+ "InitializeRequestParamsSchema",
15
+ "ServerCapabilitiesSchema",
16
+ "ResourceSchema",
17
+ "ReadResourceResultSchema",
18
+ "GetPromptResultSchema",
19
+ "ToolAnnotationsSchema",
20
+ "CallToolResultSchema",
21
+ "LoggingLevelSchema",
22
+ "CreateMessageRequestParamsSchema",
23
+ "CreateMessageResultSchema",
24
+ "CompleteResultSchema",
25
+ "ServerCapabilities",
26
+ "InitializeRequestParams",
27
+ "CallToolResult",
28
+ "ReadResourceResult",
29
+ "GetPromptResult",
30
+ "CompleteResult",
31
+ "CreateMessageRequestParams",
32
+ "CreateMessageResult",
33
+ "Resource",
34
+ "JSONRPCResponse",
35
+ "LoggingLevel",
36
+ "ToolAnnotations",
37
+ "Trim",
38
+ "ExtractVarName",
39
+ "SplitVariables",
40
+ "ExtractFromExpression",
41
+ "ExtractVariablesFromTemplate",
42
+ "ExtractURITemplateVariables",
43
+ "JsonSchemaAdapter"
44
+ ],
45
+ "sources": [
46
+ "../index.js",
47
+ "../validation/index.js",
48
+ "../internal/internal.d.ts",
49
+ "../internal/uri-template.d.ts",
50
+ "../adapter.js"
51
+ ],
52
+ "sourcesContent": [
53
+ null,
54
+ null,
55
+ null,
56
+ null,
57
+ null
58
+ ],
59
+ "mappings": ";;;;;cAmEaA,SAASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aCo4CsCC,kBA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;;;;;;;;;;;MA8H2BC,kBAAkBA;MASbC,uBAAuBA;MAGhCC,cAAcA;MAGVC,kBAAkBA;MAGrBC,eAAeA;MAGhBC,cAAcA;MAGFC,0BAA0BA;MAGjCC,mBAAmBA;MAY9BC,QAAQA;MAMDC,eAAeA;MAGlBC,YAAYA;MAGTC,eAAeA;;ME5/CnEC,IAAIA;;;;;;;MAOJC,cAAcA;;;;;;;MAOdC,cAAcA;;;;;MAKdC,qBAAqBA;;;;;;;;;;;;;;;;;MAiBrBC,4BAA4BA;;;;;;MAMrBC,2BAA2BA;;;;;;;OCjC1BC,iBAAiBA;;;;;;;;;;;;;;;;cAAjBA,iBAAiBA",
60
+ "ignoreList": []
61
+ }
package/src/adapter.d.ts DELETED
@@ -1,16 +0,0 @@
1
- /**
2
- * @import { StandardSchemaV1 } from "@standard-schema/spec";
3
- * @import { JSONSchema7 } from "json-schema";
4
- */
5
- /**
6
- * @template {StandardSchemaV1} TSchema
7
- */
8
- export class JsonSchemaAdapter<TSchema extends StandardSchemaV1> {
9
- /**
10
- * @param {TSchema} schema
11
- * @returns {Promise<JSONSchema7>}
12
- */
13
- toJsonSchema(schema: TSchema): Promise<JSONSchema7>;
14
- }
15
- import type { StandardSchemaV1 } from "@standard-schema/spec";
16
- import type { JSONSchema7 } from "json-schema";
package/src/index.d.ts DELETED
@@ -1,140 +0,0 @@
1
- /**
2
- * @typedef {ClientCapabilitiesType} ClientCapabilities
3
- */
4
- /**
5
- * @template {StandardSchemaV1} StandardSchema
6
- */
7
- export class McpServer<StandardSchema extends StandardSchemaV1> {
8
- /**
9
- * @param {ServerInfo} server_info
10
- * @param {ServerOptions<StandardSchema>} options
11
- */
12
- constructor(server_info: ServerInfo, options: ServerOptions<StandardSchema>);
13
- /**
14
- * @type {Array<{uri: string, name?: string}>}
15
- */
16
- roots: Array<{
17
- uri: string;
18
- name?: string;
19
- }>;
20
- currentClientCapabilities(): {
21
- experimental?: {};
22
- sampling?: {};
23
- elicitation?: {};
24
- roots?: {
25
- listChanged?: boolean;
26
- };
27
- };
28
- /**
29
- * @template {keyof McpEvents} TEvent
30
- * @param {TEvent} event
31
- * @param {McpEvents[TEvent]} callback
32
- * @param {AddEventListenerOptions} [options]
33
- */
34
- on<TEvent extends keyof McpEvents>(event: TEvent, callback: McpEvents[TEvent], options?: AddEventListenerOptions): () => void;
35
- /**
36
- * @template {StandardSchema | undefined} [TSchema=undefined]
37
- * @param {{ name: string; description: string; title?: string; schema?: StandardSchemaV1.InferInput<TSchema extends undefined ? never : TSchema> extends Record<string, unknown> ? TSchema : never; annotations?: ToolAnnotations }} options
38
- * @param {TSchema extends undefined ? (()=>Promise<CallToolResult> | CallToolResult) : ((input: StandardSchemaV1.InferInput<TSchema extends undefined ? never : TSchema>) => Promise<CallToolResult> | CallToolResult)} execute
39
- */
40
- tool<TSchema extends StandardSchema | undefined = undefined>({ name, description, title, schema, annotations }: {
41
- name: string;
42
- description: string;
43
- title?: string;
44
- schema?: StandardSchemaV1.InferInput<TSchema extends undefined ? never : TSchema> extends Record<string, unknown> ? TSchema : never;
45
- annotations?: ToolAnnotations;
46
- }, execute: TSchema extends undefined ? (() => Promise<CallToolResult> | CallToolResult) : ((input: StandardSchemaV1.InferInput<TSchema extends undefined ? never : TSchema>) => Promise<CallToolResult> | CallToolResult)): void;
47
- /**
48
- * @template {StandardSchema | undefined} [TSchema=undefined]
49
- * @param {{ name: string; description: string; title?: string; schema?: StandardSchemaV1.InferInput<TSchema extends undefined ? never : TSchema> extends Record<string, unknown> ? TSchema : never; complete?: NoInfer<TSchema extends undefined ? never : Partial<Record<keyof (StandardSchemaV1.InferInput<TSchema extends undefined ? never : TSchema>), Completion>>> }} options
50
- * @param {TSchema extends undefined ? (()=>Promise<GetPromptResult> | GetPromptResult) : (input: StandardSchemaV1.InferInput<TSchema extends undefined ? never : TSchema>) => Promise<GetPromptResult> | GetPromptResult} execute
51
- */
52
- prompt<TSchema extends StandardSchema | undefined = undefined>({ name, description, title, schema, complete }: {
53
- name: string;
54
- description: string;
55
- title?: string;
56
- schema?: StandardSchemaV1.InferInput<TSchema extends undefined ? never : TSchema> extends Record<string, unknown> ? TSchema : never;
57
- complete?: NoInfer<TSchema extends undefined ? never : Partial<Record<keyof StandardSchemaV1.InferInput<TSchema extends undefined ? never : TSchema>, Completion>>>;
58
- }, execute: TSchema extends undefined ? (() => Promise<GetPromptResult> | GetPromptResult) : (input: StandardSchemaV1.InferInput<TSchema extends undefined ? never : TSchema>) => Promise<GetPromptResult> | GetPromptResult): void;
59
- /**
60
- * @param {{ name: string; description: string; title?: string; uri: string }} options
61
- * @param {(uri: string) => Promise<ReadResourceResult> | ReadResourceResult} execute
62
- */
63
- resource({ name, description, title, uri }: {
64
- name: string;
65
- description: string;
66
- title?: string;
67
- uri: string;
68
- }, execute: (uri: string) => Promise<ReadResourceResult> | ReadResourceResult): void;
69
- /**
70
- * @template {string} TUri
71
- * @template {ExtractURITemplateVariables<TUri>} TVariables
72
- * @param {{ name: string; description: string; title?: string; uri: TUri; complete?: NoInfer<TVariables extends never ? never : Partial<Record<TVariables, Completion>>>; list?: () => Promise<Array<Resource>> | Array<Resource> }} options
73
- * @param {(uri: string, params: Record<TVariables, string | string[]>) => Promise<ReadResourceResult> | ReadResourceResult} execute
74
- */
75
- template<TUri extends string, TVariables extends ExtractURITemplateVariables<TUri>>({ name, description, title, uri, complete, list: list_resources }: {
76
- name: string;
77
- description: string;
78
- title?: string;
79
- uri: TUri;
80
- complete?: NoInfer<TVariables extends never ? never : Partial<Record<TVariables, Completion>>>;
81
- list?: () => Promise<Array<Resource>> | Array<Resource>;
82
- }, execute: (uri: string, params: Record<TVariables, string | string[]>) => Promise<ReadResourceResult> | ReadResourceResult): void;
83
- /**
84
- * @param {JSONRPCResponse | JSONRPCRequest} message
85
- * @param {string} [session_id]
86
- * @returns {ReturnType<JSONRPCServer['receive']> | ReturnType<JSONRPCClient['receive'] | undefined>}
87
- */
88
- receive(message: JSONRPCResponse | JSONRPCRequest, session_id?: string): ReturnType<JSONRPCServer["receive"]> | ReturnType<JSONRPCClient["receive"] | undefined>;
89
- /**
90
- * Send a notification for subscriptions
91
- * @param {SubscriptionsKeys} what
92
- * @param {string} id
93
- */
94
- changed(what: SubscriptionsKeys, id: string): void;
95
- /**
96
- * Refresh roots list from client
97
- */
98
- refreshRoots(): Promise<void>;
99
- /**
100
- * @template {StandardSchema} TSchema
101
- * @param {TSchema} schema
102
- * @returns {Promise<StandardSchemaV1.InferOutput<TSchema>>}
103
- */
104
- elicitation<TSchema extends StandardSchema>(schema: TSchema): Promise<StandardSchemaV1.InferOutput<TSchema>>;
105
- /**
106
- * Request language model sampling from the client
107
- * @param {CreateMessageRequestParams} request
108
- * @returns {Promise<CreateMessageResult>}
109
- */
110
- message(request: CreateMessageRequestParams): Promise<CreateMessageResult>;
111
- /**
112
- * Log a message to the client if logging is enabled and the level is appropriate
113
- * @param {LoggingLevel} level
114
- * @param {unknown} data
115
- * @param {string} [logger]
116
- */
117
- log(level: LoggingLevel, data: unknown, logger?: string): void;
118
- #private;
119
- }
120
- export type ClientCapabilities = ClientCapabilitiesType;
121
- import type { StandardSchemaV1 } from "@standard-schema/spec";
122
- import type { McpEvents } from "./internal/internal.js";
123
- import type { ToolAnnotations } from "./validation/index.js";
124
- import type { CallToolResult } from "./validation/index.js";
125
- import type { Completion } from "./internal/internal.js";
126
- import type { GetPromptResult } from "./validation/index.js";
127
- import type { ReadResourceResult } from "./validation/index.js";
128
- import type { ExtractURITemplateVariables } from "./internal/uri-template.js";
129
- import type { Resource } from "./validation/index.js";
130
- import type { JSONRPCResponse } from "./validation/index.js";
131
- import type { JSONRPCRequest } from "json-rpc-2.0";
132
- import { JSONRPCServer } from 'json-rpc-2.0';
133
- import { JSONRPCClient } from 'json-rpc-2.0';
134
- import type { SubscriptionsKeys } from "./internal/internal.js";
135
- import type { CreateMessageRequestParams } from "./validation/index.js";
136
- import type { CreateMessageResult } from "./validation/index.js";
137
- import type { LoggingLevel } from "./validation/index.js";
138
- import type { ServerInfo } from "./internal/internal.js";
139
- import type { ServerOptions } from "./internal/internal.js";
140
- import type { ClientCapabilities as ClientCapabilitiesType } from "./validation/index.js";