Merge pull request #13 from modelcontextprotocol/justin/uris
Treat URIs as `URL` type
This commit is contained in:
commit
73c66f4a7c
5 changed files with 133 additions and 116 deletions
136
dist/types.d.ts
generated
vendored
136
dist/types.d.ts
generated
vendored
|
|
@ -1813,13 +1813,13 @@ export declare const ResourceContentsSchema: z.ZodObject<{
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* The MIME type of this resource, if known.
|
||||
*/
|
||||
mimeType: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
mimeType?: string | undefined;
|
||||
}, {
|
||||
uri: string;
|
||||
|
|
@ -1829,7 +1829,7 @@ export declare const TextResourceContentsSchema: z.ZodObject<z.objectUtil.extend
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* The MIME type of this resource, if known.
|
||||
*/
|
||||
|
|
@ -1841,7 +1841,7 @@ export declare const TextResourceContentsSchema: z.ZodObject<z.objectUtil.extend
|
|||
text: z.ZodString;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
text: string;
|
||||
uri: string;
|
||||
uri: URL;
|
||||
mimeType?: string | undefined;
|
||||
}, {
|
||||
text: string;
|
||||
|
|
@ -1852,7 +1852,7 @@ export declare const BlobResourceContentsSchema: z.ZodObject<z.objectUtil.extend
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* The MIME type of this resource, if known.
|
||||
*/
|
||||
|
|
@ -1863,7 +1863,7 @@ export declare const BlobResourceContentsSchema: z.ZodObject<z.objectUtil.extend
|
|||
*/
|
||||
blob: z.ZodString;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
blob: string;
|
||||
mimeType?: string | undefined;
|
||||
}, {
|
||||
|
|
@ -1878,7 +1878,7 @@ export declare const ResourceSchema: z.ZodObject<{
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* A human-readable name for this resource.
|
||||
*
|
||||
|
|
@ -1897,7 +1897,7 @@ export declare const ResourceSchema: z.ZodObject<{
|
|||
mimeType: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name: string;
|
||||
uri: string;
|
||||
uri: URL;
|
||||
mimeType?: string | undefined;
|
||||
description?: string | undefined;
|
||||
}, {
|
||||
|
|
@ -2042,7 +2042,7 @@ export declare const ListResourcesResultSchema: z.ZodObject<z.objectUtil.extendS
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* A human-readable name for this resource.
|
||||
*
|
||||
|
|
@ -2061,7 +2061,7 @@ export declare const ListResourcesResultSchema: z.ZodObject<z.objectUtil.extendS
|
|||
mimeType: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name: string;
|
||||
uri: string;
|
||||
uri: URL;
|
||||
mimeType?: string | undefined;
|
||||
description?: string | undefined;
|
||||
}, {
|
||||
|
|
@ -2086,7 +2086,7 @@ export declare const ListResourcesResultSchema: z.ZodObject<z.objectUtil.extendS
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* A human-readable name for this resource.
|
||||
*
|
||||
|
|
@ -2105,7 +2105,7 @@ export declare const ListResourcesResultSchema: z.ZodObject<z.objectUtil.extendS
|
|||
mimeType: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name: string;
|
||||
uri: string;
|
||||
uri: URL;
|
||||
mimeType?: string | undefined;
|
||||
description?: string | undefined;
|
||||
}, {
|
||||
|
|
@ -2130,7 +2130,7 @@ export declare const ListResourcesResultSchema: z.ZodObject<z.objectUtil.extendS
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* A human-readable name for this resource.
|
||||
*
|
||||
|
|
@ -2149,7 +2149,7 @@ export declare const ListResourcesResultSchema: z.ZodObject<z.objectUtil.extendS
|
|||
mimeType: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name: string;
|
||||
uri: string;
|
||||
uri: URL;
|
||||
mimeType?: string | undefined;
|
||||
description?: string | undefined;
|
||||
}, {
|
||||
|
|
@ -2440,15 +2440,15 @@ export declare const ReadResourceRequestSchema: z.ZodObject<z.objectUtil.extendS
|
|||
/**
|
||||
* The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
}, {
|
||||
uri: string;
|
||||
}>;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
params: {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
};
|
||||
method: "resources/read";
|
||||
}, {
|
||||
|
|
@ -2470,7 +2470,7 @@ export declare const ReadResourceResultSchema: z.ZodObject<z.objectUtil.extendSh
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* The MIME type of this resource, if known.
|
||||
*/
|
||||
|
|
@ -2482,7 +2482,7 @@ export declare const ReadResourceResultSchema: z.ZodObject<z.objectUtil.extendSh
|
|||
text: z.ZodString;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
text: string;
|
||||
uri: string;
|
||||
uri: URL;
|
||||
mimeType?: string | undefined;
|
||||
}, {
|
||||
text: string;
|
||||
|
|
@ -2492,7 +2492,7 @@ export declare const ReadResourceResultSchema: z.ZodObject<z.objectUtil.extendSh
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* The MIME type of this resource, if known.
|
||||
*/
|
||||
|
|
@ -2503,7 +2503,7 @@ export declare const ReadResourceResultSchema: z.ZodObject<z.objectUtil.extendSh
|
|||
*/
|
||||
blob: z.ZodString;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
blob: string;
|
||||
mimeType?: string | undefined;
|
||||
}, {
|
||||
|
|
@ -2521,7 +2521,7 @@ export declare const ReadResourceResultSchema: z.ZodObject<z.objectUtil.extendSh
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* The MIME type of this resource, if known.
|
||||
*/
|
||||
|
|
@ -2533,7 +2533,7 @@ export declare const ReadResourceResultSchema: z.ZodObject<z.objectUtil.extendSh
|
|||
text: z.ZodString;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
text: string;
|
||||
uri: string;
|
||||
uri: URL;
|
||||
mimeType?: string | undefined;
|
||||
}, {
|
||||
text: string;
|
||||
|
|
@ -2543,7 +2543,7 @@ export declare const ReadResourceResultSchema: z.ZodObject<z.objectUtil.extendSh
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* The MIME type of this resource, if known.
|
||||
*/
|
||||
|
|
@ -2554,7 +2554,7 @@ export declare const ReadResourceResultSchema: z.ZodObject<z.objectUtil.extendSh
|
|||
*/
|
||||
blob: z.ZodString;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
blob: string;
|
||||
mimeType?: string | undefined;
|
||||
}, {
|
||||
|
|
@ -2572,7 +2572,7 @@ export declare const ReadResourceResultSchema: z.ZodObject<z.objectUtil.extendSh
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* The MIME type of this resource, if known.
|
||||
*/
|
||||
|
|
@ -2584,7 +2584,7 @@ export declare const ReadResourceResultSchema: z.ZodObject<z.objectUtil.extendSh
|
|||
text: z.ZodString;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
text: string;
|
||||
uri: string;
|
||||
uri: URL;
|
||||
mimeType?: string | undefined;
|
||||
}, {
|
||||
text: string;
|
||||
|
|
@ -2594,7 +2594,7 @@ export declare const ReadResourceResultSchema: z.ZodObject<z.objectUtil.extendSh
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* The MIME type of this resource, if known.
|
||||
*/
|
||||
|
|
@ -2605,7 +2605,7 @@ export declare const ReadResourceResultSchema: z.ZodObject<z.objectUtil.extendSh
|
|||
*/
|
||||
blob: z.ZodString;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
blob: string;
|
||||
mimeType?: string | undefined;
|
||||
}, {
|
||||
|
|
@ -2717,15 +2717,15 @@ export declare const SubscribeRequestSchema: z.ZodObject<z.objectUtil.extendShap
|
|||
/**
|
||||
* The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
}, {
|
||||
uri: string;
|
||||
}>;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
params: {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
};
|
||||
method: "resources/subscribe";
|
||||
}, {
|
||||
|
|
@ -2797,15 +2797,15 @@ export declare const UnsubscribeRequestSchema: z.ZodObject<z.objectUtil.extendSh
|
|||
/**
|
||||
* The URI of the resource to unsubscribe from.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
}, {
|
||||
uri: string;
|
||||
}>;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
params: {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
};
|
||||
method: "resources/unsubscribe";
|
||||
}, {
|
||||
|
|
@ -2841,15 +2841,15 @@ export declare const ResourceUpdatedNotificationSchema: z.ZodObject<z.objectUtil
|
|||
/**
|
||||
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
}, {
|
||||
uri: string;
|
||||
}>;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
params: {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
};
|
||||
method: "notifications/resources/updated";
|
||||
}, {
|
||||
|
|
@ -5496,15 +5496,15 @@ export declare const ClientRequestSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.e
|
|||
/**
|
||||
* The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
}, {
|
||||
uri: string;
|
||||
}>;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
params: {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
};
|
||||
method: "resources/read";
|
||||
}, {
|
||||
|
|
@ -5572,15 +5572,15 @@ export declare const ClientRequestSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.e
|
|||
/**
|
||||
* The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
}, {
|
||||
uri: string;
|
||||
}>;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
params: {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
};
|
||||
method: "resources/subscribe";
|
||||
}, {
|
||||
|
|
@ -5648,15 +5648,15 @@ export declare const ClientRequestSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.e
|
|||
/**
|
||||
* The URI of the resource to unsubscribe from.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
}, {
|
||||
uri: string;
|
||||
}>;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
params: {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
};
|
||||
method: "resources/unsubscribe";
|
||||
}, {
|
||||
|
|
@ -6505,15 +6505,15 @@ export declare const ServerNotificationSchema: z.ZodUnion<[z.ZodObject<z.objectU
|
|||
/**
|
||||
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
}, {
|
||||
uri: string;
|
||||
}>;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
params: {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
};
|
||||
method: "notifications/resources/updated";
|
||||
}, {
|
||||
|
|
@ -7567,7 +7567,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* A human-readable name for this resource.
|
||||
*
|
||||
|
|
@ -7586,7 +7586,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
mimeType: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name: string;
|
||||
uri: string;
|
||||
uri: URL;
|
||||
mimeType?: string | undefined;
|
||||
description?: string | undefined;
|
||||
}, {
|
||||
|
|
@ -7611,7 +7611,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* A human-readable name for this resource.
|
||||
*
|
||||
|
|
@ -7630,7 +7630,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
mimeType: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name: string;
|
||||
uri: string;
|
||||
uri: URL;
|
||||
mimeType?: string | undefined;
|
||||
description?: string | undefined;
|
||||
}, {
|
||||
|
|
@ -7655,7 +7655,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* A human-readable name for this resource.
|
||||
*
|
||||
|
|
@ -7674,7 +7674,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
mimeType: z.ZodOptional<z.ZodString>;
|
||||
}, "strip", z.ZodTypeAny, {
|
||||
name: string;
|
||||
uri: string;
|
||||
uri: URL;
|
||||
mimeType?: string | undefined;
|
||||
description?: string | undefined;
|
||||
}, {
|
||||
|
|
@ -7693,7 +7693,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* The MIME type of this resource, if known.
|
||||
*/
|
||||
|
|
@ -7705,7 +7705,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
text: z.ZodString;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
text: string;
|
||||
uri: string;
|
||||
uri: URL;
|
||||
mimeType?: string | undefined;
|
||||
}, {
|
||||
text: string;
|
||||
|
|
@ -7715,7 +7715,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* The MIME type of this resource, if known.
|
||||
*/
|
||||
|
|
@ -7726,7 +7726,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
*/
|
||||
blob: z.ZodString;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
blob: string;
|
||||
mimeType?: string | undefined;
|
||||
}, {
|
||||
|
|
@ -7744,7 +7744,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* The MIME type of this resource, if known.
|
||||
*/
|
||||
|
|
@ -7756,7 +7756,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
text: z.ZodString;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
text: string;
|
||||
uri: string;
|
||||
uri: URL;
|
||||
mimeType?: string | undefined;
|
||||
}, {
|
||||
text: string;
|
||||
|
|
@ -7766,7 +7766,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* The MIME type of this resource, if known.
|
||||
*/
|
||||
|
|
@ -7777,7 +7777,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
*/
|
||||
blob: z.ZodString;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
blob: string;
|
||||
mimeType?: string | undefined;
|
||||
}, {
|
||||
|
|
@ -7795,7 +7795,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* The MIME type of this resource, if known.
|
||||
*/
|
||||
|
|
@ -7807,7 +7807,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
text: z.ZodString;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
text: string;
|
||||
uri: string;
|
||||
uri: URL;
|
||||
mimeType?: string | undefined;
|
||||
}, {
|
||||
text: string;
|
||||
|
|
@ -7817,7 +7817,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.ZodString;
|
||||
uri: z.ZodEffects<z.ZodString, URL, string>;
|
||||
/**
|
||||
* The MIME type of this resource, if known.
|
||||
*/
|
||||
|
|
@ -7828,7 +7828,7 @@ export declare const ServerResultSchema: z.ZodUnion<[z.ZodObject<{
|
|||
*/
|
||||
blob: z.ZodString;
|
||||
}>, "strip", z.ZodTypeAny, {
|
||||
uri: string;
|
||||
uri: URL;
|
||||
blob: string;
|
||||
mimeType?: string | undefined;
|
||||
}, {
|
||||
|
|
|
|||
2
dist/types.d.ts.map
generated
vendored
2
dist/types.d.ts.map
generated
vendored
File diff suppressed because one or more lines are too long
30
dist/types.js
generated
vendored
30
dist/types.js
generated
vendored
|
|
@ -206,16 +206,19 @@ export const ServerCapabilitiesSchema = z.object({
|
|||
/**
|
||||
* Present if the server offers any prompt templates.
|
||||
*/
|
||||
prompts: z.optional(z.object({
|
||||
prompts: z.optional(z
|
||||
.object({
|
||||
/**
|
||||
* Whether this server supports notifications for changes to the prompt list.
|
||||
*/
|
||||
listChanged: z.optional(z.boolean()),
|
||||
}).passthrough()),
|
||||
})
|
||||
.passthrough()),
|
||||
/**
|
||||
* Present if the server offers any resources to read.
|
||||
*/
|
||||
resources: z.optional(z.object({
|
||||
resources: z.optional(z
|
||||
.object({
|
||||
/**
|
||||
* Whether this server supports subscribing to resource updates.
|
||||
*/
|
||||
|
|
@ -224,16 +227,19 @@ export const ServerCapabilitiesSchema = z.object({
|
|||
* Whether this server supports notifications for changes to the resource list.
|
||||
*/
|
||||
listChanged: z.optional(z.boolean()),
|
||||
}).passthrough()),
|
||||
})
|
||||
.passthrough()),
|
||||
/**
|
||||
* Present if the server offers any tools to call.
|
||||
*/
|
||||
tools: z.optional(z.object({
|
||||
tools: z.optional(z
|
||||
.object({
|
||||
/**
|
||||
* Whether this server supports notifications for changes to the tool list.
|
||||
*/
|
||||
listChanged: z.optional(z.boolean()),
|
||||
}).passthrough()),
|
||||
})
|
||||
.passthrough()),
|
||||
});
|
||||
/**
|
||||
* After receiving an initialize request from the client, the server sends this response.
|
||||
|
|
@ -307,7 +313,7 @@ export const ResourceContentsSchema = z.object({
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.string().url(),
|
||||
uri: z.string().transform((s) => new URL(s)),
|
||||
/**
|
||||
* The MIME type of this resource, if known.
|
||||
*/
|
||||
|
|
@ -332,7 +338,7 @@ export const ResourceSchema = z.object({
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.string().url(),
|
||||
uri: z.string().transform((s) => new URL(s)),
|
||||
/**
|
||||
* A human-readable name for this resource.
|
||||
*
|
||||
|
|
@ -408,7 +414,7 @@ export const ReadResourceRequestSchema = RequestSchema.extend({
|
|||
/**
|
||||
* The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
|
||||
*/
|
||||
uri: z.string().url(),
|
||||
uri: z.string().transform((s) => new URL(s)),
|
||||
}),
|
||||
});
|
||||
/**
|
||||
|
|
@ -432,7 +438,7 @@ export const SubscribeRequestSchema = RequestSchema.extend({
|
|||
/**
|
||||
* The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.
|
||||
*/
|
||||
uri: z.string().url(),
|
||||
uri: z.string().transform((s) => new URL(s)),
|
||||
}),
|
||||
});
|
||||
/**
|
||||
|
|
@ -444,7 +450,7 @@ export const UnsubscribeRequestSchema = RequestSchema.extend({
|
|||
/**
|
||||
* The URI of the resource to unsubscribe from.
|
||||
*/
|
||||
uri: z.string().url(),
|
||||
uri: z.string().transform((s) => new URL(s)),
|
||||
}),
|
||||
});
|
||||
/**
|
||||
|
|
@ -456,7 +462,7 @@ export const ResourceUpdatedNotificationSchema = NotificationSchema.extend({
|
|||
/**
|
||||
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
||||
*/
|
||||
uri: z.string().url(),
|
||||
uri: z.string().transform((s) => new URL(s)),
|
||||
}),
|
||||
});
|
||||
/* Prompts */
|
||||
|
|
|
|||
2
dist/types.js.map
generated
vendored
2
dist/types.js.map
generated
vendored
File diff suppressed because one or more lines are too long
79
src/types.ts
79
src/types.ts
|
|
@ -2,7 +2,6 @@ import { z } from "zod";
|
|||
|
||||
export const PROTOCOL_VERSION = "2024-10-07";
|
||||
|
||||
|
||||
/* JSON-RPC types */
|
||||
export const JSONRPC_VERSION = "2.0";
|
||||
|
||||
|
|
@ -236,38 +235,44 @@ export const ServerCapabilitiesSchema = z.object({
|
|||
* Present if the server offers any prompt templates.
|
||||
*/
|
||||
prompts: z.optional(
|
||||
z.object({
|
||||
/**
|
||||
* Whether this server supports notifications for changes to the prompt list.
|
||||
*/
|
||||
listChanged: z.optional(z.boolean()),
|
||||
}).passthrough(),
|
||||
z
|
||||
.object({
|
||||
/**
|
||||
* Whether this server supports notifications for changes to the prompt list.
|
||||
*/
|
||||
listChanged: z.optional(z.boolean()),
|
||||
})
|
||||
.passthrough(),
|
||||
),
|
||||
/**
|
||||
* Present if the server offers any resources to read.
|
||||
*/
|
||||
resources: z.optional(
|
||||
z.object({
|
||||
/**
|
||||
* Whether this server supports subscribing to resource updates.
|
||||
*/
|
||||
subscribe: z.optional(z.boolean()),
|
||||
/**
|
||||
* Whether this server supports notifications for changes to the resource list.
|
||||
*/
|
||||
listChanged: z.optional(z.boolean()),
|
||||
}).passthrough(),
|
||||
z
|
||||
.object({
|
||||
/**
|
||||
* Whether this server supports subscribing to resource updates.
|
||||
*/
|
||||
subscribe: z.optional(z.boolean()),
|
||||
/**
|
||||
* Whether this server supports notifications for changes to the resource list.
|
||||
*/
|
||||
listChanged: z.optional(z.boolean()),
|
||||
})
|
||||
.passthrough(),
|
||||
),
|
||||
/**
|
||||
* Present if the server offers any tools to call.
|
||||
*/
|
||||
tools: z.optional(
|
||||
z.object({
|
||||
/**
|
||||
* Whether this server supports notifications for changes to the tool list.
|
||||
*/
|
||||
listChanged: z.optional(z.boolean()),
|
||||
}).passthrough(),
|
||||
z
|
||||
.object({
|
||||
/**
|
||||
* Whether this server supports notifications for changes to the tool list.
|
||||
*/
|
||||
listChanged: z.optional(z.boolean()),
|
||||
})
|
||||
.passthrough(),
|
||||
),
|
||||
});
|
||||
|
||||
|
|
@ -352,7 +357,7 @@ export const ResourceContentsSchema = z.object({
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.string().url(),
|
||||
uri: z.string().transform((s) => new URL(s)),
|
||||
/**
|
||||
* The MIME type of this resource, if known.
|
||||
*/
|
||||
|
|
@ -380,7 +385,7 @@ export const ResourceSchema = z.object({
|
|||
/**
|
||||
* The URI of this resource.
|
||||
*/
|
||||
uri: z.string().url(),
|
||||
uri: z.string().transform((s) => new URL(s)),
|
||||
|
||||
/**
|
||||
* A human-readable name for this resource.
|
||||
|
|
@ -448,9 +453,11 @@ export const ListResourcesResultSchema = PaginatedResultSchema.extend({
|
|||
/**
|
||||
* Sent from the client to request a list of resource templates the server has.
|
||||
*/
|
||||
export const ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
|
||||
method: z.literal("resources/templates/list"),
|
||||
});
|
||||
export const ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend(
|
||||
{
|
||||
method: z.literal("resources/templates/list"),
|
||||
},
|
||||
);
|
||||
|
||||
/**
|
||||
* The server's response to a resources/templates/list request from the client.
|
||||
|
|
@ -468,7 +475,7 @@ export const ReadResourceRequestSchema = RequestSchema.extend({
|
|||
/**
|
||||
* The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
|
||||
*/
|
||||
uri: z.string().url(),
|
||||
uri: z.string().transform((s) => new URL(s)),
|
||||
}),
|
||||
});
|
||||
|
||||
|
|
@ -497,7 +504,7 @@ export const SubscribeRequestSchema = RequestSchema.extend({
|
|||
/**
|
||||
* The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.
|
||||
*/
|
||||
uri: z.string().url(),
|
||||
uri: z.string().transform((s) => new URL(s)),
|
||||
}),
|
||||
});
|
||||
|
||||
|
|
@ -510,7 +517,7 @@ export const UnsubscribeRequestSchema = RequestSchema.extend({
|
|||
/**
|
||||
* The URI of the resource to unsubscribe from.
|
||||
*/
|
||||
uri: z.string().url(),
|
||||
uri: z.string().transform((s) => new URL(s)),
|
||||
}),
|
||||
});
|
||||
|
||||
|
|
@ -523,7 +530,7 @@ export const ResourceUpdatedNotificationSchema = NotificationSchema.extend({
|
|||
/**
|
||||
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
||||
*/
|
||||
uri: z.string().url(),
|
||||
uri: z.string().transform((s) => new URL(s)),
|
||||
}),
|
||||
});
|
||||
|
||||
|
|
@ -938,8 +945,12 @@ export type Resource = z.infer<typeof ResourceSchema>;
|
|||
export type ResourceTemplate = z.infer<typeof ResourceTemplateSchema>;
|
||||
export type ListResourcesRequest = z.infer<typeof ListResourcesRequestSchema>;
|
||||
export type ListResourcesResult = z.infer<typeof ListResourcesResultSchema>;
|
||||
export type ListResourceTemplatesRequest = z.infer<typeof ListResourceTemplatesRequestSchema>;
|
||||
export type ListResourceTemplatesResult = z.infer<typeof ListResourceTemplatesResultSchema>;
|
||||
export type ListResourceTemplatesRequest = z.infer<
|
||||
typeof ListResourceTemplatesRequestSchema
|
||||
>;
|
||||
export type ListResourceTemplatesResult = z.infer<
|
||||
typeof ListResourceTemplatesResultSchema
|
||||
>;
|
||||
export type ReadResourceRequest = z.infer<typeof ReadResourceRequestSchema>;
|
||||
export type ReadResourceResult = z.infer<typeof ReadResourceResultSchema>;
|
||||
export type ResourceListChangedNotification = z.infer<
|
||||
|
|
|
|||
Loading…
Reference in a new issue