mcp-use 1.7.0-canary.1 → 1.7.0-canary.3
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/.tsbuildinfo +1 -1
- package/dist/{chunk-PE7UMCVO.js → chunk-3R5PDYIN.js} +27 -1
- package/dist/{chunk-XN2PU4PS.js → chunk-BBEY6HHN.js} +59 -7
- package/dist/{chunk-YURRUCIM.js → chunk-CPG2WZUL.js} +9 -11
- package/dist/{chunk-R5DJJ4IV.js → chunk-F4UHAA5L.js} +3 -91
- package/dist/chunk-MTHLLDCX.js +97 -0
- package/dist/{chunk-QSLJXXMG.js → chunk-PSO6HYXH.js} +4 -4
- package/dist/{chunk-GVVPUU5K.js → chunk-S6K5QZBJ.js} +739 -29
- package/dist/{display-YIYC6WJE.js → display-A5IEINAP.js} +79 -17
- package/dist/index.cjs +952 -107
- package/dist/index.js +6 -5
- package/dist/{langfuse-C4HKZ3NL.js → langfuse-N5Y5BSXK.js} +1 -1
- package/dist/{oauth-CNGBFOZW.js → oauth-U4NNKN4B.js} +2 -1
- package/dist/src/agents/display.d.ts.map +1 -1
- package/dist/src/agents/index.cjs +854 -78
- package/dist/src/agents/index.js +3 -2
- package/dist/src/auth/index.cjs +30 -5
- package/dist/src/auth/index.js +1 -1
- package/dist/src/browser.cjs +888 -90
- package/dist/src/browser.js +5 -4
- package/dist/src/connectors/base.d.ts +53 -391
- package/dist/src/connectors/base.d.ts.map +1 -1
- package/dist/src/managers/server_manager.d.ts.map +1 -1
- package/dist/src/managers/tools/acquire_active_mcp_server.d.ts +2 -2
- package/dist/src/managers/tools/acquire_active_mcp_server.d.ts.map +1 -1
- package/dist/src/managers/tools/add_server_from_config.d.ts +1 -7
- package/dist/src/managers/tools/add_server_from_config.d.ts.map +1 -1
- package/dist/src/managers/tools/connect_mcp_server.d.ts +2 -10
- package/dist/src/managers/tools/connect_mcp_server.d.ts.map +1 -1
- package/dist/src/managers/tools/list_mcp_servers.d.ts +2 -2
- package/dist/src/managers/tools/list_mcp_servers.d.ts.map +1 -1
- package/dist/src/managers/tools/release_mcp_server_connection.d.ts +2 -2
- package/dist/src/managers/tools/release_mcp_server_connection.d.ts.map +1 -1
- package/dist/src/observability/langfuse.d.ts +4 -0
- package/dist/src/observability/langfuse.d.ts.map +1 -1
- package/dist/src/react/McpUseProvider.d.ts.map +1 -1
- package/dist/src/react/index.cjs +86 -12
- package/dist/src/react/index.js +4 -3
- package/dist/src/server/connect-adapter.d.ts.map +1 -1
- package/dist/src/server/index.cjs +28 -17
- package/dist/src/server/index.js +38 -25
- package/dist/src/server/mcp-server.d.ts.map +1 -1
- package/dist/src/utils/json-schema-to-zod/JSONSchemaToZod.d.ts +270 -0
- package/dist/src/utils/json-schema-to-zod/JSONSchemaToZod.d.ts.map +1 -0
- package/dist/src/utils/json-schema-to-zod/Type.d.ts +24 -0
- package/dist/src/utils/json-schema-to-zod/Type.d.ts.map +1 -0
- package/dist/src/utils/json-schema-to-zod/index.d.ts +3 -0
- package/dist/src/utils/json-schema-to-zod/index.d.ts.map +1 -0
- package/dist/src/utils/url-sanitize.d.ts +17 -0
- package/dist/src/utils/url-sanitize.d.ts.map +1 -0
- package/dist/tsup.config.d.ts.map +1 -1
- package/package.json +20 -37
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import type { ZodSchema } from "zod";
|
|
2
|
+
import type { JSONSchema } from "./Type.js";
|
|
3
|
+
export declare class JSONSchemaToZod {
|
|
4
|
+
/**
|
|
5
|
+
* Converts a JSON schema to a Zod schema.
|
|
6
|
+
*
|
|
7
|
+
* @param {JSONSchema} schema - The JSON schema.
|
|
8
|
+
* @returns {ZodSchema} - The Zod schema.
|
|
9
|
+
*/
|
|
10
|
+
static convert(schema: JSONSchema): ZodSchema;
|
|
11
|
+
/**
|
|
12
|
+
* Checks if data matches a condition schema.
|
|
13
|
+
*
|
|
14
|
+
* @param {JSONValue} data - The data to check.
|
|
15
|
+
* @param {JSONSchema} condition - The condition schema.
|
|
16
|
+
* @returns {boolean} - Whether the data matches the condition.
|
|
17
|
+
*/
|
|
18
|
+
private static matchesCondition;
|
|
19
|
+
/**
|
|
20
|
+
* Validates data against a conditional schema and adds issues to context if validation fails.
|
|
21
|
+
*
|
|
22
|
+
* @param {JSONValue} data - The data to validate.
|
|
23
|
+
* @param {JSONSchema} schema - The conditional schema.
|
|
24
|
+
* @param {z.RefinementCtx} ctx - The Zod refinement context.
|
|
25
|
+
*/
|
|
26
|
+
private static validateConditionalSchema;
|
|
27
|
+
/**
|
|
28
|
+
* Validates that all required properties are present in the data.
|
|
29
|
+
*
|
|
30
|
+
* @param {JSONValue} data - The data to validate.
|
|
31
|
+
* @param {JSONSchema} schema - The schema containing required properties.
|
|
32
|
+
* @param {z.RefinementCtx} ctx - The Zod refinement context.
|
|
33
|
+
*/
|
|
34
|
+
private static validateRequiredProperties;
|
|
35
|
+
/**
|
|
36
|
+
* Validates property patterns for string properties.
|
|
37
|
+
*
|
|
38
|
+
* @param {JSONValue} data - The data to validate.
|
|
39
|
+
* @param {JSONSchema} schema - The schema containing property patterns.
|
|
40
|
+
* @param {z.RefinementCtx} ctx - The Zod refinement context.
|
|
41
|
+
*/
|
|
42
|
+
private static validatePropertyPatterns;
|
|
43
|
+
/**
|
|
44
|
+
* Validates nested if-then-else conditions.
|
|
45
|
+
*
|
|
46
|
+
* @param {JSONValue} data - The data to validate.
|
|
47
|
+
* @param {JSONSchema} schema - The schema containing if-then-else conditions.
|
|
48
|
+
* @param {z.RefinementCtx} ctx - The Zod refinement context.
|
|
49
|
+
*/
|
|
50
|
+
private static validateNestedConditions;
|
|
51
|
+
/**
|
|
52
|
+
* Parses a JSON schema and returns the corresponding Zod schema.
|
|
53
|
+
* This is the main entry point for schema conversion.
|
|
54
|
+
*
|
|
55
|
+
* @param {JSONSchema} schema - The JSON schema.
|
|
56
|
+
* @returns {ZodTypeAny} - The ZodTypeAny schema.
|
|
57
|
+
*/
|
|
58
|
+
private static parseSchema;
|
|
59
|
+
/**
|
|
60
|
+
* Handles schemas with an array of types.
|
|
61
|
+
*
|
|
62
|
+
* @param {JSONSchema} schema - The JSON schema with type array.
|
|
63
|
+
* @returns {ZodTypeAny} - The ZodTypeAny schema.
|
|
64
|
+
*/
|
|
65
|
+
private static handleTypeArray;
|
|
66
|
+
/**
|
|
67
|
+
* Handles nullable types by creating a nullable schema.
|
|
68
|
+
*
|
|
69
|
+
* @param {JSONSchema} schema - The JSON schema with nullable type.
|
|
70
|
+
* @returns {ZodTypeAny} - The nullable Zod schema.
|
|
71
|
+
*/
|
|
72
|
+
private static handleNullableType;
|
|
73
|
+
/**
|
|
74
|
+
* Creates a union type from an array of types.
|
|
75
|
+
*
|
|
76
|
+
* @param {string[]} types - Array of type strings.
|
|
77
|
+
* @param {JSONSchema} baseSchema - The base schema to apply to each type.
|
|
78
|
+
* @returns {ZodTypeAny} - The union Zod schema.
|
|
79
|
+
*/
|
|
80
|
+
private static createUnionFromTypes;
|
|
81
|
+
/**
|
|
82
|
+
* Handles schemas with a single type.
|
|
83
|
+
*
|
|
84
|
+
* @param {JSONSchema} schema - The JSON schema with single type.
|
|
85
|
+
* @returns {ZodTypeAny} - The ZodTypeAny schema.
|
|
86
|
+
*/
|
|
87
|
+
private static handleSingleType;
|
|
88
|
+
/**
|
|
89
|
+
* Parses a number schema.
|
|
90
|
+
*
|
|
91
|
+
* @param {JSONSchema} schema - The JSON schema for a number.
|
|
92
|
+
* @returns {ZodTypeAny} - The ZodTypeAny schema.
|
|
93
|
+
*/
|
|
94
|
+
private static parseNumberSchema;
|
|
95
|
+
/**
|
|
96
|
+
* Applies bounds validation to a number schema.
|
|
97
|
+
*
|
|
98
|
+
* @param {z.ZodNumber} numberSchema - The base number schema.
|
|
99
|
+
* @param {JSONSchema} schema - The JSON schema with bounds.
|
|
100
|
+
* @returns {z.ZodNumber} - The updated schema with bounds validation.
|
|
101
|
+
*/
|
|
102
|
+
private static applyNumberBounds;
|
|
103
|
+
/**
|
|
104
|
+
* Applies multipleOf validation to a number schema.
|
|
105
|
+
*
|
|
106
|
+
* @param {z.ZodNumber} numberSchema - The base number schema.
|
|
107
|
+
* @param {JSONSchema} schema - The JSON schema with multipleOf.
|
|
108
|
+
* @returns {z.ZodNumber} - The updated schema with multipleOf validation.
|
|
109
|
+
*/
|
|
110
|
+
private static applyNumberMultipleOf;
|
|
111
|
+
/**
|
|
112
|
+
* Applies enum validation to a number schema.
|
|
113
|
+
*
|
|
114
|
+
* @param {z.ZodNumber} numberSchema - The base number schema.
|
|
115
|
+
* @param {JSONSchema} schema - The JSON schema with enum.
|
|
116
|
+
* @returns {z.ZodNumber} - The updated schema with enum validation.
|
|
117
|
+
*/
|
|
118
|
+
private static applyNumberEnum;
|
|
119
|
+
/**
|
|
120
|
+
* Applies integer constraint to a number schema if needed.
|
|
121
|
+
*
|
|
122
|
+
* @param {z.ZodNumber} numberSchema - The base number schema.
|
|
123
|
+
* @param {JSONSchema} schema - The JSON schema.
|
|
124
|
+
* @returns {z.ZodNumber} - The updated schema with integer validation if needed.
|
|
125
|
+
*/
|
|
126
|
+
private static applyIntegerConstraint;
|
|
127
|
+
/**
|
|
128
|
+
* Parses a string schema.
|
|
129
|
+
*
|
|
130
|
+
* @param {JSONSchema} schema - The JSON schema for a string.
|
|
131
|
+
* @returns {ZodTypeAny} - The ZodTypeAny schema.
|
|
132
|
+
*/
|
|
133
|
+
private static parseString;
|
|
134
|
+
/**
|
|
135
|
+
* Applies format validation to a string schema.
|
|
136
|
+
*
|
|
137
|
+
* @param {z.ZodString} stringSchema - The base string schema.
|
|
138
|
+
* @param {JSONSchema} schema - The JSON schema with format.
|
|
139
|
+
* @returns {ZodTypeAny} - The updated schema with format validation.
|
|
140
|
+
*/
|
|
141
|
+
private static applyStringFormat;
|
|
142
|
+
/**
|
|
143
|
+
* Applies pattern validation to a string schema.
|
|
144
|
+
*
|
|
145
|
+
* @param {z.ZodString} stringSchema - The base string schema.
|
|
146
|
+
* @param {JSONSchema} schema - The JSON schema with pattern.
|
|
147
|
+
* @returns {z.ZodString} - The updated schema with pattern validation.
|
|
148
|
+
*/
|
|
149
|
+
private static applyStringPattern;
|
|
150
|
+
/**
|
|
151
|
+
* Applies length constraints to a string schema.
|
|
152
|
+
*
|
|
153
|
+
* @param {z.ZodString} stringSchema - The base string schema.
|
|
154
|
+
* @param {JSONSchema} schema - The JSON schema with length constraints.
|
|
155
|
+
* @returns {z.ZodString} - The updated schema with length validation.
|
|
156
|
+
*/
|
|
157
|
+
private static applyStringLength;
|
|
158
|
+
/**
|
|
159
|
+
* Applies enum validation to a string schema.
|
|
160
|
+
*
|
|
161
|
+
* @param {z.ZodString} stringSchema - The base string schema.
|
|
162
|
+
* @param {JSONSchema} schema - The JSON schema with enum.
|
|
163
|
+
* @returns {ZodTypeAny} - The updated schema with enum validation.
|
|
164
|
+
*/
|
|
165
|
+
private static applyStringEnum;
|
|
166
|
+
/**
|
|
167
|
+
* Parses a JSON schema of type array and returns the corresponding Zod schema.
|
|
168
|
+
*
|
|
169
|
+
* @param {JSONSchema} schema - The JSON schema.
|
|
170
|
+
* @returns {ZodTypeAny} - The ZodTypeAny schema.
|
|
171
|
+
*/
|
|
172
|
+
private static parseArray;
|
|
173
|
+
/**
|
|
174
|
+
* Applies constraints to an array schema.
|
|
175
|
+
*
|
|
176
|
+
* @param {z.ZodArray<any>} arraySchema - The base array schema.
|
|
177
|
+
* @param {JSONSchema} schema - The JSON schema with array constraints.
|
|
178
|
+
* @returns {z.ZodTypeAny} - The updated array schema with constraints.
|
|
179
|
+
*/
|
|
180
|
+
private static applyArrayConstraints;
|
|
181
|
+
/**
|
|
182
|
+
* Parses an object schema.
|
|
183
|
+
*
|
|
184
|
+
* @param {JSONSchema} schema - The JSON schema for an object.
|
|
185
|
+
* @returns {ZodTypeAny} - The ZodTypeAny schema.
|
|
186
|
+
*/
|
|
187
|
+
private static parseObject;
|
|
188
|
+
/**
|
|
189
|
+
* Processes object properties and builds the shape object.
|
|
190
|
+
*
|
|
191
|
+
* @param {JSONSchema} schema - The JSON schema for an object.
|
|
192
|
+
* @param {Record<string, ZodTypeAny>} shape - The shape object to populate.
|
|
193
|
+
*/
|
|
194
|
+
private static processObjectProperties;
|
|
195
|
+
/**
|
|
196
|
+
* Processes additionalProperties configuration.
|
|
197
|
+
*
|
|
198
|
+
* @param {JSONSchema} schema - The JSON schema for an object.
|
|
199
|
+
* @param {z.ZodObject<any, any>} objectSchema - The Zod object schema.
|
|
200
|
+
* @returns {z.ZodObject<any, any>} - The updated Zod object schema.
|
|
201
|
+
*/
|
|
202
|
+
private static processAdditionalProperties;
|
|
203
|
+
/**
|
|
204
|
+
* Parses a conditional schema with if-then-else.
|
|
205
|
+
*
|
|
206
|
+
* @param {JSONSchema} schema - The JSON schema with conditional validation.
|
|
207
|
+
* @returns {ZodTypeAny} - The conditional Zod schema.
|
|
208
|
+
*/
|
|
209
|
+
private static parseConditional;
|
|
210
|
+
/**
|
|
211
|
+
* Creates a base object schema from the given JSON schema.
|
|
212
|
+
*
|
|
213
|
+
* @param {JSONSchema} schema - The JSON schema.
|
|
214
|
+
* @returns {z.ZodObject<any, any>} - The base Zod object schema.
|
|
215
|
+
*/
|
|
216
|
+
private static createBaseObjectSchema;
|
|
217
|
+
/**
|
|
218
|
+
* Applies default values from schema properties to data object.
|
|
219
|
+
*
|
|
220
|
+
* @param {JSONValue} data - The original data object.
|
|
221
|
+
* @param {JSONSchema} schema - The schema with default values.
|
|
222
|
+
* @returns {JSONValue} - The data object with defaults applied.
|
|
223
|
+
*/
|
|
224
|
+
private static applyDefaultValues;
|
|
225
|
+
/**
|
|
226
|
+
* Parses a schema with combinators (oneOf, anyOf, allOf).
|
|
227
|
+
* Delegates to the appropriate combinator parser based on which combinator is present.
|
|
228
|
+
*
|
|
229
|
+
* @param {JSONSchema} schema - The JSON schema with combinators.
|
|
230
|
+
* @returns {ZodTypeAny} - The ZodTypeAny schema.
|
|
231
|
+
*/
|
|
232
|
+
private static parseCombinator;
|
|
233
|
+
/**
|
|
234
|
+
* Parses a oneOf combinator schema.
|
|
235
|
+
*
|
|
236
|
+
* @param {JSONSchema[]} schemas - Array of JSON schemas in the oneOf.
|
|
237
|
+
* @returns {ZodTypeAny} - The ZodTypeAny schema.
|
|
238
|
+
*/
|
|
239
|
+
private static parseOneOf;
|
|
240
|
+
/**
|
|
241
|
+
* Parses an anyOf combinator schema.
|
|
242
|
+
*
|
|
243
|
+
* @param {JSONSchema[]} schemas - Array of JSON schemas in the anyOf.
|
|
244
|
+
* @returns {ZodTypeAny} - The ZodTypeAny schema.
|
|
245
|
+
*/
|
|
246
|
+
private static parseAnyOf;
|
|
247
|
+
/**
|
|
248
|
+
* Creates a union from an array of schemas, handling special cases.
|
|
249
|
+
*
|
|
250
|
+
* @param {JSONSchema[]} schemas - Array of JSON schemas to create a union from.
|
|
251
|
+
* @returns {ZodTypeAny} - The union Zod schema.
|
|
252
|
+
*/
|
|
253
|
+
private static createUnionFromSchemas;
|
|
254
|
+
/**
|
|
255
|
+
* Parses an allOf combinator schema by merging all schemas.
|
|
256
|
+
*
|
|
257
|
+
* @param {JSONSchema[]} schemas - Array of JSON schemas in the allOf.
|
|
258
|
+
* @returns {ZodTypeAny} - The ZodTypeAny schema.
|
|
259
|
+
*/
|
|
260
|
+
private static parseAllOf;
|
|
261
|
+
/**
|
|
262
|
+
* Merges two JSON schemas together.
|
|
263
|
+
*
|
|
264
|
+
* @param {JSONSchema} baseSchema - The base JSON schema.
|
|
265
|
+
* @param {JSONSchema} addSchema - The JSON schema to add.
|
|
266
|
+
* @returns {JSONSchema} - The merged JSON schema
|
|
267
|
+
*/
|
|
268
|
+
private static mergeSchemas;
|
|
269
|
+
}
|
|
270
|
+
//# sourceMappingURL=JSONSchemaToZod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JSONSchemaToZod.d.ts","sourceRoot":"","sources":["../../../../src/utils/json-schema-to-zod/JSONSchemaToZod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC,OAAO,KAAK,EAAE,UAAU,EAAyB,MAAM,WAAW,CAAC;AAEnE,qBAAa,eAAe;IAC1B;;;;;OAKG;WACW,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS;IAIpD;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IA2D/B;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAUxC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,0BAA0B;IAiCzC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,wBAAwB;IA6CvC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,wBAAwB;IAiBvC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAyB1B;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAc9B;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAuBjC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAYnC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAmC/B;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAahC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAqBhC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAapC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAsB9B;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAarC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAmB1B;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAwBhC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAcjC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAiBhC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAc9B;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAkBzB;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAyBpC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAgB1B;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAgBtC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,2BAA2B;IAoB1C;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IA0B/B;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAerC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;IA+BjC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAiB9B;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAIzB;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAIzB;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAkCrC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAmBzB;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;CAoB5B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents any valid JSON value.
|
|
3
|
+
*/
|
|
4
|
+
export type JSONValue = string | number | boolean | null | JSONObject | JSONValue[];
|
|
5
|
+
/**
|
|
6
|
+
* Represents a JSON object.
|
|
7
|
+
*/
|
|
8
|
+
export type JSONObject = {
|
|
9
|
+
[key: string]: JSONValue;
|
|
10
|
+
};
|
|
11
|
+
export type JSONSchema = {
|
|
12
|
+
type?: string | string[];
|
|
13
|
+
properties?: Record<string, JSONSchema>;
|
|
14
|
+
items?: JSONSchema | JSONSchema[];
|
|
15
|
+
required?: string[];
|
|
16
|
+
enum?: (string | number)[];
|
|
17
|
+
format?: string;
|
|
18
|
+
oneOf?: JSONSchema[];
|
|
19
|
+
allOf?: JSONSchema[];
|
|
20
|
+
anyOf?: JSONSchema[];
|
|
21
|
+
additionalProperties?: boolean | JSONSchema;
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=Type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Type.d.ts","sourceRoot":"","sources":["../../../../src/utils/json-schema-to-zod/Type.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,UAAU,GACV,SAAS,EAAE,CAAC;AAEhB;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC5C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/json-schema-to-zod/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL sanitization utility
|
|
3
|
+
*
|
|
4
|
+
* Sanitizes URLs to prevent security issues by:
|
|
5
|
+
* - Restricting to http/https protocols only
|
|
6
|
+
* - Encoding URL components properly
|
|
7
|
+
* - Validating hostnames
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Sanitizes a URL string by encoding all components and validating the protocol.
|
|
11
|
+
*
|
|
12
|
+
* @param raw - The raw URL string to sanitize
|
|
13
|
+
* @returns The sanitized URL as a string
|
|
14
|
+
* @throws Error if the URL is invalid or uses an unsupported protocol
|
|
15
|
+
*/
|
|
16
|
+
export declare function sanitizeUrl(raw: string): string;
|
|
17
|
+
//# sourceMappingURL=url-sanitize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-sanitize.d.ts","sourceRoot":"","sources":["../../../src/utils/url-sanitize.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA+B/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsup.config.d.ts","sourceRoot":"","sources":["../tsup.config.ts"],"names":[],"mappings":";AAEA,
|
|
1
|
+
{"version":3,"file":"tsup.config.d.ts","sourceRoot":"","sources":["../tsup.config.ts"],"names":[],"mappings":";AAEA,wBA2CG"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-use",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.7.0-canary.
|
|
5
|
-
"description": "Opinionated MCP Framework for TypeScript (@modelcontextprotocol/sdk compatible) - Build MCP Agents
|
|
4
|
+
"version": "1.7.0-canary.3",
|
|
5
|
+
"description": "Opinionated MCP Framework for TypeScript (@modelcontextprotocol/sdk compatible) - Build MCP Agents, Clients and Servers with support for ChatGPT Apps, Code Mode, OAuth, Notifications, Sampling, Observability and more.",
|
|
6
6
|
"author": "mcp-use, Inc.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/mcp-use/mcp-use#readme",
|
|
@@ -15,12 +15,17 @@
|
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"MCP",
|
|
18
|
+
"mcp-use",
|
|
18
19
|
"Model Context Protocol",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
20
|
+
"ChatGPT Apps",
|
|
21
|
+
"Code Mode",
|
|
22
|
+
"OAuth",
|
|
23
|
+
"Notifications",
|
|
24
|
+
"Sampling",
|
|
21
25
|
"SDK",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
26
|
+
"mcp-ui",
|
|
27
|
+
"mcp-inspector",
|
|
28
|
+
"ai",
|
|
24
29
|
"utility",
|
|
25
30
|
"typescript"
|
|
26
31
|
],
|
|
@@ -93,61 +98,39 @@
|
|
|
93
98
|
}
|
|
94
99
|
},
|
|
95
100
|
"dependencies": {
|
|
96
|
-
"@dmitryrechkin/json-schema-to-zod": "^1.0.1",
|
|
97
101
|
"@hono/node-server": "^1.13.0",
|
|
98
102
|
"@langchain/core": "^1.0.1",
|
|
99
103
|
"@mcp-ui/server": "^5.12.0",
|
|
100
|
-
"@modelcontextprotocol/sdk": "1.
|
|
101
|
-
"@scarf/scarf": "^1.4.0",
|
|
104
|
+
"@modelcontextprotocol/sdk": "1.23.0",
|
|
102
105
|
"ai": "^4.3.19",
|
|
103
|
-
"chalk": "^5.6.2",
|
|
104
|
-
"cli-highlight": "^2.1.11",
|
|
105
|
-
"commander": "^14.0.1",
|
|
106
|
-
"dotenv": "^16.5.0",
|
|
107
|
-
"esbuild": ">=0.25.0",
|
|
108
106
|
"hono": "^4.6.0",
|
|
109
107
|
"jose": "^6.1.2",
|
|
110
108
|
"langchain": "^1.0.1",
|
|
111
|
-
"lodash-es": "^4.17.21",
|
|
112
109
|
"posthog-node": "^5.1.1",
|
|
113
|
-
"strict-url-sanitise": "^0.0.1",
|
|
114
|
-
"strip-ansi": "^7.1.0",
|
|
115
|
-
"ts-node": "^10.9.2",
|
|
116
|
-
"tsx": "^4.20.6",
|
|
117
|
-
"uuid": "^11.1.0",
|
|
118
|
-
"winston": "^3.17.0",
|
|
119
|
-
"winston-transport-browserconsole": "^1.0.5",
|
|
120
110
|
"ws": "^8.18.2",
|
|
121
|
-
"zod": "^
|
|
122
|
-
"
|
|
123
|
-
"@mcp-use/
|
|
124
|
-
"@mcp-use/inspector": "0.9.0-canary.1"
|
|
111
|
+
"zod": "^4.1.13",
|
|
112
|
+
"@mcp-use/cli": "2.4.3-canary.3",
|
|
113
|
+
"@mcp-use/inspector": "0.9.0-canary.3"
|
|
125
114
|
},
|
|
126
115
|
"optionalDependencies": {
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
"node-mocks-http": "^1.16.2",
|
|
131
|
-
"vite": ">=5.4.21"
|
|
116
|
+
"chalk": "^5.6.2",
|
|
117
|
+
"cli-highlight": "^2.1.11",
|
|
118
|
+
"winston": "^3.17.0"
|
|
132
119
|
},
|
|
133
120
|
"devDependencies": {
|
|
134
121
|
"@antfu/eslint-config": "^4.13.2",
|
|
135
122
|
"@langchain/anthropic": "^1.0.0",
|
|
136
123
|
"@langchain/openai": "^1.0.0",
|
|
137
|
-
"@types/cors": "^2.8.17",
|
|
138
|
-
"@types/express": "^4.17.21",
|
|
139
|
-
"@types/lodash-es": "^4.17.12",
|
|
140
124
|
"@types/node": "^20.19.8",
|
|
141
125
|
"@types/react": "^19.2.2",
|
|
142
126
|
"@types/ws": "^8.18.1",
|
|
143
|
-
"
|
|
127
|
+
"esbuild": ">=0.25.0",
|
|
144
128
|
"eslint": "^9.28.0",
|
|
145
129
|
"eslint-plugin-format": "^1.0.1",
|
|
146
|
-
"express": "^4.18.2",
|
|
147
130
|
"husky": "^9.1.7",
|
|
148
131
|
"lint-staged": "^15.2.11",
|
|
149
132
|
"react": "^19.2.0",
|
|
150
|
-
"
|
|
133
|
+
"tsx": "^4.20.6",
|
|
151
134
|
"typescript": "^5.8.3",
|
|
152
135
|
"vitest": "^3.2.4"
|
|
153
136
|
},
|