tmcp 1.15.0 → 1.15.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.
- package/package.json +1 -1
- package/src/index.js +50 -5
- package/src/types/index.d.ts +23 -11
- package/src/types/index.d.ts.map +11 -10
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @import SqidsType from "sqids";
|
|
5
5
|
* @import { JSONRPCRequest, JSONRPCParams } from "json-rpc-2.0";
|
|
6
6
|
* @import { ExtractURITemplateVariables } from "./internal/uri-template.js";
|
|
7
|
-
* @import { CallToolResult, ReadResourceResult, GetPromptResult, ServerInfo, ClientCapabilities as ClientCapabilitiesType, JSONRPCRequest as JSONRPCRequestType, JSONRPCResponse, CreateMessageRequestParams, CreateMessageResult, Resource, LoggingLevel, ToolAnnotations, ClientInfo, ElicitResult, Icons } from "./validation/index.js";
|
|
7
|
+
* @import { CallToolResult as CallToolResultType, ReadResourceResult as ReadResourceResultType, GetPromptResult as GetPromptResultType, ServerInfo as ServerInfoType, ClientCapabilities as ClientCapabilitiesType, JSONRPCRequest as JSONRPCRequestType, JSONRPCResponse, CreateMessageRequestParams as CreateMessageRequestParamsType, CreateMessageResult as CreateMessageResultType, Resource as ResourceType, LoggingLevel as LoggingLevelType, ToolAnnotations, ClientInfo as ClientInfoType, ElicitResult as ElicitResultType, Icons as IconsType } from "./validation/index.js";
|
|
8
8
|
* @import { Tool, Completion, Prompt, StoredResource, ServerOptions, SubscriptionsKeys, ChangedArgs, McpEvents } from "./internal/internal.js";
|
|
9
9
|
*/
|
|
10
10
|
import { JSONRPCClient, JSONRPCServer } from 'json-rpc-2.0';
|
|
@@ -53,6 +53,55 @@ import { should_version_negotiation_fail } from './validation/version.js';
|
|
|
53
53
|
* @property {TCustom} [custom]
|
|
54
54
|
*/
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* @typedef {IconsType} Icons
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @template {Record<string, unknown> | undefined} TStructuredContent
|
|
62
|
+
* @typedef {CallToolResultType<TStructuredContent>} CallToolResult
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @typedef {ReadResourceResultType} ReadResourceResult
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @typedef {GetPromptResultType} GetPromptResult
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @typedef {ClientCapabilitiesType} ClientCapabilities
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @typedef {ServerInfoType} ServerInfo
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @typedef {CreateMessageRequestParamsType} CreateMessageRequestParams
|
|
83
|
+
*/
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @typedef {CreateMessageResultType} CreateMessageResult
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @typedef {ResourceType} Resource
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @typedef {LoggingLevelType} LoggingLevel
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @typedef {ClientInfoType} ClientInfo
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @typedef {ElicitResultType} ElicitResult
|
|
103
|
+
*/
|
|
104
|
+
|
|
56
105
|
/**
|
|
57
106
|
* @type {SqidsType | undefined}
|
|
58
107
|
*/
|
|
@@ -93,10 +142,6 @@ async function safe_enabled(enabled) {
|
|
|
93
142
|
}
|
|
94
143
|
}
|
|
95
144
|
|
|
96
|
-
/**
|
|
97
|
-
* @typedef {ClientCapabilitiesType} ClientCapabilities
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
145
|
/**
|
|
101
146
|
* @template {StandardSchemaV1 | undefined} [StandardSchema=undefined]
|
|
102
147
|
* @template {Record<string, unknown> | undefined} [CustomContext=undefined]
|
package/src/types/index.d.ts
CHANGED
|
@@ -185,7 +185,18 @@ declare module 'tmcp' {
|
|
|
185
185
|
auth?: AuthInfo | undefined;
|
|
186
186
|
custom?: TCustom | undefined;
|
|
187
187
|
};
|
|
188
|
+
export type Icons = Icons_1;
|
|
189
|
+
export type CallToolResult<TStructuredContent extends Record<string, unknown> | undefined> = CallToolResult_1<TStructuredContent>;
|
|
190
|
+
export type ReadResourceResult = ReadResourceResult_1;
|
|
191
|
+
export type GetPromptResult = GetPromptResult_1;
|
|
188
192
|
export type ClientCapabilities = ClientCapabilities_1;
|
|
193
|
+
export type ServerInfo = ServerInfo_1;
|
|
194
|
+
export type CreateMessageRequestParams = CreateMessageRequestParams_1;
|
|
195
|
+
export type CreateMessageResult = CreateMessageResult_1;
|
|
196
|
+
export type Resource = Resource_1;
|
|
197
|
+
export type LoggingLevel = LoggingLevel_1;
|
|
198
|
+
export type ClientInfo = ClientInfo_1;
|
|
199
|
+
export type ElicitResult = ElicitResult_1;
|
|
189
200
|
type Completion = (
|
|
190
201
|
query: string,
|
|
191
202
|
context: { arguments: Record<string, string> },
|
|
@@ -200,7 +211,7 @@ declare module 'tmcp' {
|
|
|
200
211
|
prompts?: { size?: number };
|
|
201
212
|
};
|
|
202
213
|
logging?: {
|
|
203
|
-
default:
|
|
214
|
+
default: LoggingLevel_1;
|
|
204
215
|
}
|
|
205
216
|
};
|
|
206
217
|
|
|
@@ -1171,14 +1182,15 @@ declare module 'tmcp' {
|
|
|
1171
1182
|
*/
|
|
1172
1183
|
readonly _meta: v.OptionalSchema<v.LooseObjectSchema<{}, undefined>, undefined>;
|
|
1173
1184
|
}, undefined>;
|
|
1174
|
-
type
|
|
1185
|
+
type Icons_1 = v.InferInput<typeof IconsSchema>;
|
|
1175
1186
|
type ClientCapabilities_1 = v.InferInput<typeof ClientCapabilitiesSchema>;
|
|
1176
1187
|
type ServerCapabilities = v.InferInput<typeof ServerCapabilitiesSchema>;
|
|
1177
|
-
type
|
|
1188
|
+
type ClientInfo_1 = v.InferInput<typeof ImplementationSchema>;
|
|
1189
|
+
type ServerInfo_1 = v.InferInput<typeof ImplementationSchema> & {
|
|
1178
1190
|
description?: string;
|
|
1179
1191
|
};
|
|
1180
1192
|
type InitializeRequestParams = v.InferInput<typeof InitializeRequestParamsSchema>;
|
|
1181
|
-
type
|
|
1193
|
+
type CallToolResult_1<TStructuredContent extends Record<string, unknown> | undefined> = Omit<v.InferInput<typeof CallToolResultSchema>, "structuredContent" | "isError"> & (undefined extends TStructuredContent ? {
|
|
1182
1194
|
structuredContent?: undefined;
|
|
1183
1195
|
isError?: boolean;
|
|
1184
1196
|
} : ({
|
|
@@ -1188,16 +1200,16 @@ declare module 'tmcp' {
|
|
|
1188
1200
|
isError: true;
|
|
1189
1201
|
structuredContent?: TStructuredContent;
|
|
1190
1202
|
}));
|
|
1191
|
-
type
|
|
1192
|
-
type
|
|
1203
|
+
type ReadResourceResult_1 = v.InferInput<typeof ReadResourceResultSchema>;
|
|
1204
|
+
type GetPromptResult_1 = v.InferInput<typeof GetPromptResultSchema>;
|
|
1193
1205
|
type CompleteResult = v.InferInput<typeof CompleteResultSchema>;
|
|
1194
|
-
type
|
|
1195
|
-
type
|
|
1196
|
-
type
|
|
1206
|
+
type CreateMessageRequestParams_1 = v.InferInput<typeof CreateMessageRequestParamsSchema>;
|
|
1207
|
+
type CreateMessageResult_1 = v.InferInput<typeof CreateMessageResultSchema>;
|
|
1208
|
+
type Resource_1 = v.InferInput<typeof ResourceSchema>;
|
|
1197
1209
|
type JSONRPCResponse = v.InferInput<typeof JSONRPCResponseSchema>;
|
|
1198
|
-
type
|
|
1210
|
+
type LoggingLevel_1 = v.InferInput<typeof LoggingLevelSchema>;
|
|
1199
1211
|
type ToolAnnotations = v.InferInput<typeof ToolAnnotationsSchema>;
|
|
1200
|
-
type
|
|
1212
|
+
type ElicitResult_1 = v.InferInput<typeof ElicitResultSchema>;
|
|
1201
1213
|
// Helper type to remove whitespace
|
|
1202
1214
|
type Trim<S extends string> = S extends ` ${infer R}`
|
|
1203
1215
|
? Trim<R>
|
package/src/types/index.d.ts.map
CHANGED
|
@@ -3,7 +3,17 @@
|
|
|
3
3
|
"file": "index.d.ts",
|
|
4
4
|
"names": [
|
|
5
5
|
"McpServer",
|
|
6
|
+
"Icons",
|
|
7
|
+
"ReadResourceResult",
|
|
8
|
+
"GetPromptResult",
|
|
6
9
|
"ClientCapabilities",
|
|
10
|
+
"ServerInfo",
|
|
11
|
+
"CreateMessageRequestParams",
|
|
12
|
+
"CreateMessageResult",
|
|
13
|
+
"Resource",
|
|
14
|
+
"LoggingLevel",
|
|
15
|
+
"ClientInfo",
|
|
16
|
+
"ElicitResult",
|
|
7
17
|
"Completion",
|
|
8
18
|
"ServerOptions",
|
|
9
19
|
"ChangedArgs",
|
|
@@ -24,20 +34,11 @@
|
|
|
24
34
|
"CreateMessageResultSchema",
|
|
25
35
|
"ElicitResultSchema",
|
|
26
36
|
"CompleteResultSchema",
|
|
27
|
-
"Icons",
|
|
28
37
|
"ServerCapabilities",
|
|
29
|
-
"ServerInfo",
|
|
30
38
|
"InitializeRequestParams",
|
|
31
|
-
"ReadResourceResult",
|
|
32
|
-
"GetPromptResult",
|
|
33
39
|
"CompleteResult",
|
|
34
|
-
"CreateMessageRequestParams",
|
|
35
|
-
"CreateMessageResult",
|
|
36
|
-
"Resource",
|
|
37
40
|
"JSONRPCResponse",
|
|
38
|
-
"LoggingLevel",
|
|
39
41
|
"ToolAnnotations",
|
|
40
|
-
"ElicitResult",
|
|
41
42
|
"Trim",
|
|
42
43
|
"ExtractVarName",
|
|
43
44
|
"SplitVariables",
|
|
@@ -60,6 +61,6 @@
|
|
|
60
61
|
null,
|
|
61
62
|
null
|
|
62
63
|
],
|
|
63
|
-
"mappings": ";;;;;
|
|
64
|
+
"mappings": ";;;;;cAoJaA,SAAS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