@smithery/sdk 0.0.19 → 0.0.20

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/config.d.ts CHANGED
@@ -1,193 +1 @@
1
- import { z } from "zod";
2
- export declare const BaseRequestSchema: z.ZodObject<{
3
- _meta: z.ZodOptional<z.ZodObject<{
4
- /**
5
- * 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.
6
- */
7
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
8
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
9
- /**
10
- * 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.
11
- */
12
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
13
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
14
- /**
15
- * 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.
16
- */
17
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
18
- }, z.ZodTypeAny, "passthrough">>>;
19
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
20
- _meta: z.ZodOptional<z.ZodObject<{
21
- /**
22
- * 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.
23
- */
24
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
25
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
26
- /**
27
- * 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.
28
- */
29
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
30
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
31
- /**
32
- * 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.
33
- */
34
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
35
- }, z.ZodTypeAny, "passthrough">>>;
36
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
37
- _meta: z.ZodOptional<z.ZodObject<{
38
- /**
39
- * 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.
40
- */
41
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
42
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
43
- /**
44
- * 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.
45
- */
46
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
47
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
48
- /**
49
- * 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.
50
- */
51
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
52
- }, z.ZodTypeAny, "passthrough">>>;
53
- }, z.ZodTypeAny, "passthrough">>;
54
- /**
55
- * A custom method to set the configuration of the server deployed on Smithery.
56
- * This must be called after initialization and before using the SSE server.
57
- */
58
- export declare const ConfigRequestSchema: z.ZodObject<z.objectUtil.extendShape<{
59
- method: z.ZodString;
60
- params: z.ZodOptional<z.ZodObject<{
61
- _meta: z.ZodOptional<z.ZodObject<{
62
- progressToken: z.ZodOptional<z.
63
- /**
64
- * A custom response schema to expected when creating a config request.
65
- */
66
- ZodUnion<[z.ZodString, z.ZodNumber]>>;
67
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
68
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
69
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
70
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
71
- }, z.ZodTypeAny, "passthrough">>>;
72
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
73
- _meta: z.ZodOptional<z.ZodObject<{
74
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
75
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
76
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
77
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
78
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
79
- }, z.ZodTypeAny, "passthrough">>>;
80
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
81
- _meta: z.ZodOptional<z.ZodObject<{
82
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
83
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
84
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
85
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
86
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
87
- }, z.ZodTypeAny, "passthrough">>>;
88
- }, z.ZodTypeAny, "passthrough">>>;
89
- }, {
90
- method: z.ZodLiteral<"config">;
91
- params: z.ZodObject<z.objectUtil.extendShape<{
92
- _meta: z.ZodOptional<z.ZodObject<{
93
- /**
94
- * 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.
95
- */
96
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
97
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
98
- /**
99
- * 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.
100
- */
101
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
102
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
103
- /**
104
- * 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.
105
- */
106
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
107
- }, z.ZodTypeAny, "passthrough">>>;
108
- }, {
109
- config: z.ZodAny;
110
- }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
111
- _meta: z.ZodOptional<z.ZodObject<{
112
- /**
113
- * 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.
114
- */
115
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
116
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
117
- /**
118
- * 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.
119
- */
120
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
121
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
122
- /**
123
- * 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.
124
- */
125
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
126
- }, z.ZodTypeAny, "passthrough">>>;
127
- }, {
128
- config: z.ZodAny;
129
- }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
130
- _meta: z.ZodOptional<z.ZodObject<{
131
- /**
132
- * 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.
133
- */
134
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
135
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
136
- /**
137
- * 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.
138
- */
139
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
140
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
141
- /**
142
- * 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.
143
- */
144
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
145
- }, z.ZodTypeAny, "passthrough">>>;
146
- }, {
147
- config: z.ZodAny;
148
- }>, z.ZodTypeAny, "passthrough">>;
149
- }>, "strip", z.ZodTypeAny, {
150
- params: {
151
- _meta?: z.objectOutputType<{
152
- /**
153
- * 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.
154
- */
155
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
156
- }, z.ZodTypeAny, "passthrough"> | undefined;
157
- config?: any;
158
- } & {
159
- [k: string]: unknown;
160
- };
161
- method: "config";
162
- }, {
163
- params: {
164
- _meta?: z.objectInputType<{
165
- /**
166
- * 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.
167
- */
168
- progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
169
- }, z.ZodTypeAny, "passthrough"> | undefined;
170
- config?: any;
171
- } & {
172
- [k: string]: unknown;
173
- };
174
- method: "config";
175
- }>;
176
- export type ConfigRequest = z.infer<typeof ConfigRequestSchema>;
177
- /**
178
- * A custom response schema to expected when creating a config request.
179
- */
180
- export declare const ConfigResultSchema: z.ZodObject<z.objectUtil.extendShape<{
181
- _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
182
- }, {
183
- error: z.ZodOptional<z.ZodAny>;
184
- }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
185
- _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
186
- }, {
187
- error: z.ZodOptional<z.ZodAny>;
188
- }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
189
- _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
190
- }, {
191
- error: z.ZodOptional<z.ZodAny>;
192
- }>, z.ZodTypeAny, "passthrough">>;
193
- export type ConfigResult = z.infer<typeof ConfigResultSchema>;
1
+ export declare function createSmitheryUrl(baseUrl: string, config: object): URL;
package/dist/config.js CHANGED
@@ -1,34 +1,8 @@
1
- import { ProgressTokenSchema, RequestSchema, ResultSchema, } from "@modelcontextprotocol/sdk/types.js";
2
- import { z } from "zod";
3
- // Copied from MCP
4
- export const BaseRequestSchema = z
5
- .object({
6
- _meta: z.optional(z
7
- .object({
8
- /**
9
- * 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.
10
- */
11
- progressToken: z.optional(ProgressTokenSchema),
12
- })
13
- .passthrough()),
14
- })
15
- .passthrough();
16
- /**
17
- * A custom method to set the configuration of the server deployed on Smithery.
18
- * This must be called after initialization and before using the SSE server.
19
- */
20
- export const ConfigRequestSchema = RequestSchema.extend({
21
- method: z.literal("config"),
22
- params: BaseRequestSchema.extend({
23
- config: z.any(),
24
- }),
25
- });
26
- /**
27
- * A custom response schema to expected when creating a config request.
28
- */
29
- export const ConfigResultSchema = ResultSchema.extend({
30
- error: z
31
- .any()
32
- .optional()
33
- .describe("An object containing the error. If no error is present, it meanas the config succeeded."),
34
- }).describe("The result of a config request.");
1
+ export function createSmitheryUrl(baseUrl, config) {
2
+ const url = new URL(baseUrl);
3
+ const param = typeof window !== "undefined"
4
+ ? btoa(JSON.stringify(config))
5
+ : Buffer.from(JSON.stringify(config)).toString("base64");
6
+ url.searchParams.set("config", param);
7
+ return url;
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithery/sdk",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "description": "Connect language models to Model Context Protocols",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",