@fuzdev/fuz_app 0.10.0 → 0.10.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action_rpc.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/actions/action_rpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAoB,KAAK,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAgC,KAAK,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAE9F,OAAO,KAAK,EAAC,EAAE,EAAC,MAAM,aAAa,CAAC;AAEpC,OAAO,EAGN,KAAK,gBAAgB,EAGrB,MAAM,oBAAoB,CAAC;AAO5B;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC7B,+DAA+D;IAC/D,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;IAC5B,iDAAiD;IACjD,UAAU,EAAE,gBAAgB,CAAC;IAC7B,8DAA8D;IAC9D,EAAE,EAAE,EAAE,CAAC;IACP,oFAAoF;IACpF,aAAa,EAAE,EAAE,CAAC;IAClB,2EAA2E;IAC3E,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;;;;GAKG;AACH,MAAM,MAAM,aAAa,CAAC,MAAM,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,CACxD,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,aAAa,KACd,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEhC;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,yBAAyB,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Aa,CAAC,MAAM,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,CACxD,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,aAAa,KACd,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEhC;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,yBAAyB,CAAC;IAChC,OAAO,EAAE,aAAa,CAAC;CACvB;AAED,yCAAyC;AACzC,MAAM,WAAW,wBAAwB;IACxC,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1B,2CAA2C;IAC3C,GAAG,EAAE,MAAM,CAAC;CACZ;AAkDD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,wBAAwB,KAAG,KAAK,CAAC,SAAS,CA0OtF,CAAC"}
|
|
@@ -221,6 +221,10 @@ export const create_rpc_endpoint = (options) => {
|
|
|
221
221
|
const error = jsonrpc_error_response(null, jsonrpc_error_messages.invalid_request({ reason: 'missing id query parameter' }));
|
|
222
222
|
return c.json(error, 400);
|
|
223
223
|
}
|
|
224
|
+
// parse integer ids so GET ?id=42 matches POST {id: 42} behavior
|
|
225
|
+
// JSON-RPC spec: "Numbers SHOULD NOT contain fractional parts"
|
|
226
|
+
const id_num = Number(id_raw);
|
|
227
|
+
const id = Number.isInteger(id_num) && String(id_num) === id_raw ? id_num : id_raw;
|
|
224
228
|
// parse params from query string (optional — null input schemas need no params)
|
|
225
229
|
const params_raw = c.req.query('params');
|
|
226
230
|
let params;
|
|
@@ -229,11 +233,11 @@ export const create_rpc_endpoint = (options) => {
|
|
|
229
233
|
params = JSON.parse(params_raw);
|
|
230
234
|
}
|
|
231
235
|
catch {
|
|
232
|
-
const error = jsonrpc_error_response(
|
|
236
|
+
const error = jsonrpc_error_response(id, jsonrpc_error_messages.invalid_params('params query parameter is not valid JSON'));
|
|
233
237
|
return c.json(error, 400);
|
|
234
238
|
}
|
|
235
239
|
}
|
|
236
|
-
return dispatch(c, route, method_name, params,
|
|
240
|
+
return dispatch(c, route, method_name, params, id, true);
|
|
237
241
|
};
|
|
238
242
|
return [
|
|
239
243
|
{
|
package/dist/http/jsonrpc.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* JSON-RPC 2.0 envelope schemas for RPC dispatch and SAES transport.
|
|
3
3
|
*
|
|
4
|
-
* MCP-superset: includes optional `_meta` and `progressToken` fields
|
|
5
|
-
* on params and results. These are `optional()` so consumers that
|
|
6
|
-
* don't use MCP are unaffected.
|
|
7
|
-
*
|
|
8
4
|
* Following MCP, params and result are object-only (no positional arrays).
|
|
5
|
+
* MCP `_meta` types (`JsonrpcMcpMeta`, `JsonrpcRequestParamsMeta`) are
|
|
6
|
+
* exported as building blocks for per-action schemas but are NOT validated
|
|
7
|
+
* at the envelope level — `_meta` content validation belongs in per-action
|
|
8
|
+
* schemas where it produces the correct error code (`invalid_params`, not
|
|
9
|
+
* `invalid_request`).
|
|
9
10
|
*
|
|
10
11
|
* @source https://github.com/modelcontextprotocol/typescript-sdk
|
|
11
12
|
* @see https://www.jsonrpc.org/specification
|
|
@@ -30,67 +31,35 @@ export declare const JsonrpcRequestParamsMeta: z.ZodObject<{
|
|
|
30
31
|
progressToken: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
31
32
|
}, z.core.$loose>;
|
|
32
33
|
export type JsonrpcRequestParamsMeta = z.infer<typeof JsonrpcRequestParamsMeta>;
|
|
33
|
-
/** Request params — loose object
|
|
34
|
-
export declare const JsonrpcRequestParams: z.ZodObject<{
|
|
35
|
-
_meta: z.ZodOptional<z.ZodObject<{
|
|
36
|
-
progressToken: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
37
|
-
}, z.core.$loose>>;
|
|
38
|
-
}, z.core.$loose>;
|
|
34
|
+
/** Request params — loose object. Per-action schemas validate `_meta` content. */
|
|
35
|
+
export declare const JsonrpcRequestParams: z.ZodObject<{}, z.core.$loose>;
|
|
39
36
|
export type JsonrpcRequestParams = z.infer<typeof JsonrpcRequestParams>;
|
|
40
|
-
/** Notification params — loose object
|
|
41
|
-
export declare const JsonrpcNotificationParams: z.ZodObject<{
|
|
42
|
-
/**
|
|
43
|
-
* Reserved by MCP to allow clients and servers to attach
|
|
44
|
-
* additional metadata to their notifications.
|
|
45
|
-
*/
|
|
46
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
47
|
-
}, z.core.$loose>;
|
|
37
|
+
/** Notification params — loose object. Per-action schemas validate `_meta` content. */
|
|
38
|
+
export declare const JsonrpcNotificationParams: z.ZodObject<{}, z.core.$loose>;
|
|
48
39
|
export type JsonrpcNotificationParams = z.infer<typeof JsonrpcNotificationParams>;
|
|
49
|
-
/** Result — loose object
|
|
50
|
-
export declare const JsonrpcResult: z.ZodObject<{
|
|
51
|
-
/**
|
|
52
|
-
* Reserved by the protocol to allow clients and servers
|
|
53
|
-
* to attach additional metadata to their responses.
|
|
54
|
-
*/
|
|
55
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
56
|
-
}, z.core.$loose>;
|
|
40
|
+
/** Result — loose object. Per-action schemas validate `_meta` content. */
|
|
41
|
+
export declare const JsonrpcResult: z.ZodObject<{}, z.core.$loose>;
|
|
57
42
|
export type JsonrpcResult = z.infer<typeof JsonrpcResult>;
|
|
58
43
|
/** A request that expects a response. */
|
|
59
44
|
export declare const JsonrpcRequest: z.ZodObject<{
|
|
60
45
|
jsonrpc: z.ZodLiteral<"2.0">;
|
|
61
46
|
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
62
47
|
method: z.ZodString;
|
|
63
|
-
params: z.ZodOptional<z.ZodObject<{
|
|
64
|
-
_meta: z.ZodOptional<z.ZodObject<{
|
|
65
|
-
progressToken: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
66
|
-
}, z.core.$loose>>;
|
|
67
|
-
}, z.core.$loose>>;
|
|
48
|
+
params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
68
49
|
}, z.core.$loose>;
|
|
69
50
|
export type JsonrpcRequest = z.infer<typeof JsonrpcRequest>;
|
|
70
51
|
/** A notification which does not expect a response. */
|
|
71
52
|
export declare const JsonrpcNotification: z.ZodObject<{
|
|
72
53
|
jsonrpc: z.ZodLiteral<"2.0">;
|
|
73
54
|
method: z.ZodString;
|
|
74
|
-
params: z.ZodOptional<z.ZodObject<{
|
|
75
|
-
/**
|
|
76
|
-
* Reserved by MCP to allow clients and servers to attach
|
|
77
|
-
* additional metadata to their notifications.
|
|
78
|
-
*/
|
|
79
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
80
|
-
}, z.core.$loose>>;
|
|
55
|
+
params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
81
56
|
}, z.core.$loose>;
|
|
82
57
|
export type JsonrpcNotification = z.infer<typeof JsonrpcNotification>;
|
|
83
58
|
/** A successful (non-error) response to a request. */
|
|
84
59
|
export declare const JsonrpcResponse: z.ZodObject<{
|
|
85
60
|
jsonrpc: z.ZodLiteral<"2.0">;
|
|
86
61
|
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
87
|
-
result: z.ZodObject<{
|
|
88
|
-
/**
|
|
89
|
-
* Reserved by the protocol to allow clients and servers
|
|
90
|
-
* to attach additional metadata to their responses.
|
|
91
|
-
*/
|
|
92
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
93
|
-
}, z.core.$loose>;
|
|
62
|
+
result: z.ZodObject<{}, z.core.$loose>;
|
|
94
63
|
}, z.core.$loose>;
|
|
95
64
|
export type JsonrpcResponse = z.infer<typeof JsonrpcResponse>;
|
|
96
65
|
export declare const JSONRPC_PARSE_ERROR = -32700;
|
|
@@ -133,13 +102,7 @@ export type JsonrpcErrorResponse = z.infer<typeof JsonrpcErrorResponse>;
|
|
|
133
102
|
export declare const JsonrpcResponseOrError: z.ZodUnion<readonly [z.ZodObject<{
|
|
134
103
|
jsonrpc: z.ZodLiteral<"2.0">;
|
|
135
104
|
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
136
|
-
result: z.ZodObject<{
|
|
137
|
-
/**
|
|
138
|
-
* Reserved by the protocol to allow clients and servers
|
|
139
|
-
* to attach additional metadata to their responses.
|
|
140
|
-
*/
|
|
141
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
142
|
-
}, z.core.$loose>;
|
|
105
|
+
result: z.ZodObject<{}, z.core.$loose>;
|
|
143
106
|
}, z.core.$loose>, z.ZodObject<{
|
|
144
107
|
jsonrpc: z.ZodLiteral<"2.0">;
|
|
145
108
|
id: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
@@ -155,31 +118,15 @@ export declare const JsonrpcMessage: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
155
118
|
jsonrpc: z.ZodLiteral<"2.0">;
|
|
156
119
|
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
157
120
|
method: z.ZodString;
|
|
158
|
-
params: z.ZodOptional<z.ZodObject<{
|
|
159
|
-
_meta: z.ZodOptional<z.ZodObject<{
|
|
160
|
-
progressToken: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
161
|
-
}, z.core.$loose>>;
|
|
162
|
-
}, z.core.$loose>>;
|
|
121
|
+
params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
163
122
|
}, z.core.$loose>, z.ZodObject<{
|
|
164
123
|
jsonrpc: z.ZodLiteral<"2.0">;
|
|
165
124
|
method: z.ZodString;
|
|
166
|
-
params: z.ZodOptional<z.ZodObject<{
|
|
167
|
-
/**
|
|
168
|
-
* Reserved by MCP to allow clients and servers to attach
|
|
169
|
-
* additional metadata to their notifications.
|
|
170
|
-
*/
|
|
171
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
172
|
-
}, z.core.$loose>>;
|
|
125
|
+
params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
173
126
|
}, z.core.$loose>, z.ZodObject<{
|
|
174
127
|
jsonrpc: z.ZodLiteral<"2.0">;
|
|
175
128
|
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
176
|
-
result: z.ZodObject<{
|
|
177
|
-
/**
|
|
178
|
-
* Reserved by the protocol to allow clients and servers
|
|
179
|
-
* to attach additional metadata to their responses.
|
|
180
|
-
*/
|
|
181
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
182
|
-
}, z.core.$loose>;
|
|
129
|
+
result: z.ZodObject<{}, z.core.$loose>;
|
|
183
130
|
}, z.core.$loose>, z.ZodObject<{
|
|
184
131
|
jsonrpc: z.ZodLiteral<"2.0">;
|
|
185
132
|
id: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
@@ -195,44 +142,22 @@ export declare const JsonrpcMessageFromClientToServer: z.ZodUnion<readonly [z.Zo
|
|
|
195
142
|
jsonrpc: z.ZodLiteral<"2.0">;
|
|
196
143
|
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
197
144
|
method: z.ZodString;
|
|
198
|
-
params: z.ZodOptional<z.ZodObject<{
|
|
199
|
-
_meta: z.ZodOptional<z.ZodObject<{
|
|
200
|
-
progressToken: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
201
|
-
}, z.core.$loose>>;
|
|
202
|
-
}, z.core.$loose>>;
|
|
145
|
+
params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
203
146
|
}, z.core.$loose>, z.ZodObject<{
|
|
204
147
|
jsonrpc: z.ZodLiteral<"2.0">;
|
|
205
148
|
method: z.ZodString;
|
|
206
|
-
params: z.ZodOptional<z.ZodObject<{
|
|
207
|
-
/**
|
|
208
|
-
* Reserved by MCP to allow clients and servers to attach
|
|
209
|
-
* additional metadata to their notifications.
|
|
210
|
-
*/
|
|
211
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
212
|
-
}, z.core.$loose>>;
|
|
149
|
+
params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
213
150
|
}, z.core.$loose>]>;
|
|
214
151
|
export type JsonrpcMessageFromClientToServer = z.infer<typeof JsonrpcMessageFromClientToServer>;
|
|
215
152
|
/** Messages a server can send to a client (notification, response, or error response). */
|
|
216
153
|
export declare const JsonrpcMessageFromServerToClient: z.ZodUnion<readonly [z.ZodObject<{
|
|
217
154
|
jsonrpc: z.ZodLiteral<"2.0">;
|
|
218
155
|
method: z.ZodString;
|
|
219
|
-
params: z.ZodOptional<z.ZodObject<{
|
|
220
|
-
/**
|
|
221
|
-
* Reserved by MCP to allow clients and servers to attach
|
|
222
|
-
* additional metadata to their notifications.
|
|
223
|
-
*/
|
|
224
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
225
|
-
}, z.core.$loose>>;
|
|
156
|
+
params: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
226
157
|
}, z.core.$loose>, z.ZodObject<{
|
|
227
158
|
jsonrpc: z.ZodLiteral<"2.0">;
|
|
228
159
|
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
229
|
-
result: z.ZodObject<{
|
|
230
|
-
/**
|
|
231
|
-
* Reserved by the protocol to allow clients and servers
|
|
232
|
-
* to attach additional metadata to their responses.
|
|
233
|
-
*/
|
|
234
|
-
_meta: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
235
|
-
}, z.core.$loose>;
|
|
160
|
+
result: z.ZodObject<{}, z.core.$loose>;
|
|
236
161
|
}, z.core.$loose>, z.ZodObject<{
|
|
237
162
|
jsonrpc: z.ZodLiteral<"2.0">;
|
|
238
163
|
id: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonrpc.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/jsonrpc.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"jsonrpc.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC,oFAAoF;AACpF,eAAO,MAAM,gBAAgB,iDAAoC,CAAC;AAClE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,8BAA8B;AAC9B,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,4FAA4F;AAC5F,eAAO,MAAM,oBAAoB,iDAAoC,CAAC;AACtE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,gFAAgF;AAChF,eAAO,MAAM,cAAc,gCAAoB,CAAC;AAChD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB;;iBAOnC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEhF,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,gCAAoB,CAAC;AACtD,MAAM,MAAM,oBAAoB,GAA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B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,qDAAqD;AACrD,eAAO,MAAM,kBAAkB;;;;iBAI7B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,mDAAmD;AACnD,eAAO,MAAM,oBAAoB;;;;;;;;iBAI/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,kDAAkD;AAClD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;mBAAmD,CAAC;AACvF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E,uFAAuF;AACvF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;mBAKzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,wEAAwE;AACxE,eAAO,MAAM,gCAAgC;;;;;;;;;mBAAiD,CAAC;AAC/F,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAEhG,0FAA0F;AAC1F,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;mBAI3C,CAAC;AACH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
|
package/dist/http/jsonrpc.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* JSON-RPC 2.0 envelope schemas for RPC dispatch and SAES transport.
|
|
3
3
|
*
|
|
4
|
-
* MCP-superset: includes optional `_meta` and `progressToken` fields
|
|
5
|
-
* on params and results. These are `optional()` so consumers that
|
|
6
|
-
* don't use MCP are unaffected.
|
|
7
|
-
*
|
|
8
4
|
* Following MCP, params and result are object-only (no positional arrays).
|
|
5
|
+
* MCP `_meta` types (`JsonrpcMcpMeta`, `JsonrpcRequestParamsMeta`) are
|
|
6
|
+
* exported as building blocks for per-action schemas but are NOT validated
|
|
7
|
+
* at the envelope level — `_meta` content validation belongs in per-action
|
|
8
|
+
* schemas where it produces the correct error code (`invalid_params`, not
|
|
9
|
+
* `invalid_request`).
|
|
9
10
|
*
|
|
10
11
|
* @source https://github.com/modelcontextprotocol/typescript-sdk
|
|
11
12
|
* @see https://www.jsonrpc.org/specification
|
|
@@ -30,26 +31,12 @@ export const JsonrpcRequestParamsMeta = JsonrpcMcpMeta.extend({
|
|
|
30
31
|
*/
|
|
31
32
|
progressToken: JsonrpcProgressToken.optional(),
|
|
32
33
|
});
|
|
33
|
-
/** Request params — loose object
|
|
34
|
-
export const JsonrpcRequestParams = z.looseObject({
|
|
35
|
-
|
|
36
|
-
});
|
|
37
|
-
/**
|
|
38
|
-
export const
|
|
39
|
-
/**
|
|
40
|
-
* Reserved by MCP to allow clients and servers to attach
|
|
41
|
-
* additional metadata to their notifications.
|
|
42
|
-
*/
|
|
43
|
-
_meta: JsonrpcMcpMeta.optional(),
|
|
44
|
-
});
|
|
45
|
-
/** Result — loose object with optional MCP metadata. */
|
|
46
|
-
export const JsonrpcResult = z.looseObject({
|
|
47
|
-
/**
|
|
48
|
-
* Reserved by the protocol to allow clients and servers
|
|
49
|
-
* to attach additional metadata to their responses.
|
|
50
|
-
*/
|
|
51
|
-
_meta: JsonrpcMcpMeta.optional(),
|
|
52
|
-
});
|
|
34
|
+
/** Request params — loose object. Per-action schemas validate `_meta` content. */
|
|
35
|
+
export const JsonrpcRequestParams = z.looseObject({});
|
|
36
|
+
/** Notification params — loose object. Per-action schemas validate `_meta` content. */
|
|
37
|
+
export const JsonrpcNotificationParams = z.looseObject({});
|
|
38
|
+
/** Result — loose object. Per-action schemas validate `_meta` content. */
|
|
39
|
+
export const JsonrpcResult = z.looseObject({});
|
|
53
40
|
/** A request that expects a response. */
|
|
54
41
|
export const JsonrpcRequest = z.looseObject({
|
|
55
42
|
jsonrpc: z.literal(JSONRPC_VERSION),
|