@zuplo/runtime 7.13.10 → 7.14.0
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/out/esm/{chunk-SXGSDVGB.js → chunk-4SVXBKXH.js} +85 -85
- package/out/esm/chunk-4SVXBKXH.js.map +1 -0
- package/out/esm/chunk-VP5Q3DEN.js +26 -0
- package/out/esm/chunk-VP5Q3DEN.js.map +1 -0
- package/out/esm/{chunk-PXS4NOKU.js → chunk-WUZE2HKB.js} +17 -17
- package/out/esm/chunk-WUZE2HKB.js.map +1 -0
- package/out/esm/index.js +1 -1
- package/out/esm/internal/index.js +1 -1
- package/out/esm/mcp-gateway/index.js +1 -1
- package/out/esm/mocks/index.js +1 -1
- package/out/esm/sdks/aws/index.js +1 -1
- package/out/types/index.d.ts +78 -1
- package/out/types/internal/index.d.ts +137 -1
- package/package.json +1 -1
- package/out/esm/chunk-PXS4NOKU.js.map +0 -1
- package/out/esm/chunk-SXGSDVGB.js.map +0 -1
- package/out/esm/chunk-ZCJ5QBVD.js +0 -26
- package/out/esm/chunk-ZCJ5QBVD.js.map +0 -1
- /package/out/esm/{chunk-SXGSDVGB.js.LEGAL.txt → chunk-4SVXBKXH.js.LEGAL.txt} +0 -0
- /package/out/esm/{chunk-PXS4NOKU.js.LEGAL.txt → chunk-WUZE2HKB.js.LEGAL.txt} +0 -0
package/out/esm/mocks/index.js
CHANGED
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
* DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*--------------------------------------------------------------------------------------------*/
|
|
24
24
|
|
|
25
|
-
import{G as p,L as c,O as u}from"../chunk-
|
|
25
|
+
import{G as p,L as c,O as u}from"../chunk-4SVXBKXH.js";import"../chunk-VP5Q3DEN.js";import{a as d}from"../chunk-QGAJTUPE.js";import"../chunk-A3QGJZO7.js";import{aa as i}from"../chunk-WUZE2HKB.js";import"../chunk-UKQQD2JN.js";import{a as o}from"../chunk-TYV53J3B.js";function w(l={request:new Request("https://api.example.com")}){let e=[];function t(s){e.push(Promise.resolve(s))}return o(t,"waitUntil"),{context:new a({event:{waitUntil:t},route:l.route,originalRequest:l.request}),invokeResponse:o(async()=>{await Promise.all(e)},"invokeResponse")}}o(w,"createMockContext");var g={path:"/",methods:["GET"],handler:{module:{},export:"default"},raw:o(()=>({}),"raw")},a=class extends EventTarget{static{o(this,"MockZuploContext")}#e;#t;contextId;requestId;log;route;custom;incomingRequestProperties;parentContext;analyticsContext;constructor({event:e,route:t=g,parentContext:n,originalRequest:r}){super(),this.requestId=crypto.randomUUID(),this.contextId=crypto.randomUUID(),this.log={info:i.console.info,log:i.console.log,debug:i.console.debug,warn:i.console.warn,error:i.console.error,setLogProperties:o(()=>{},"setLogProperties")},this.custom={},this.route=t,this.incomingRequestProperties={ip:"203.0.113.7",asn:1234,asOrganization:"ORGANIZATION",city:"Seattle",region:"Washington",regionCode:"WA",colo:"SEA",continent:"NA",country:"US",postalCode:"98004",metroCode:"SEA",latitude:void 0,longitude:void 0,timezone:void 0,httpProtocol:void 0,clientCert:void 0,clientMtlsVerificationStatus:void 0,clientMtlsVerificationReason:void 0,clientCertFingerprintSha256:void 0,clientCertNotBefore:void 0,clientCertNotAfter:void 0,clientCertIssuerDn:void 0,clientCertSubjectDn:void 0},this.parentContext=n,this.#e=e,this.#t=r,this.analyticsContext=new c(this.requestId)}waitUntil(e){this.#e.waitUntil(e)}invokeInboundPolicy(e,t){throw new Error("Not implemented")}invokeOutboundPolicy(e,t,n){throw new Error("Not implemented")}invokeRoute(e,t){throw new Error("Not implemented")}addResponseSendingHook(e){throw new Error("Not implemented")}addResponseSendingFinalHook(e){throw new Error("Not implemented")}addPreRequestHandler(e,t){let n;try{n=u.getContextExtensions(this)}catch{n=u.initialize(this,new d(this.#t??new Request("https://api.example.com")))}n.preRequestPhase??="active",p(this,n,e,t)}get preRequestHandlers(){let e;try{e=u.getContextExtensions(this)}catch{return[]}return(e.preRequestState?.entries??[]).map(t=>({policyName:t.policyName,name:t.name}))}addEventListener(e,t,n){let r=o(s=>{try{typeof t=="function"?t(s):t.handleEvent(s)}catch(m){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),m}},"wrapped");super.addEventListener(e,r,n)}};export{a as MockZuploContext,w as createMockContext};
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
* DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*--------------------------------------------------------------------------------------------*/
|
|
24
24
|
|
|
25
|
-
import{Ia as a,Ja as l,Ka as c,La as o,Oa as p,Pa as y,Qa as m}from"../../chunk-
|
|
25
|
+
import{Ia as a,Ja as l,Ka as c,La as o,Oa as p,Pa as y,Qa as m}from"../../chunk-WUZE2HKB.js";import"../../chunk-UKQQD2JN.js";import{a as i}from"../../chunk-TYV53J3B.js";async function g(r,e){let t=typeof e.credentials=="function"?await e.credentials():e.credentials,n=r.method,d=n!=="GET"&&n!=="HEAD"&&r.body!=null?await r.arrayBuffer():null,s=await new o({method:n,url:r.url,headers:r.headers,body:d,accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,sessionToken:t.sessionToken,service:e.service,region:e.region,signQuery:e.signQuery}).sign();return new Request(s.url.toString(),{method:s.method,headers:s.headers,body:s.body})}i(g,"signRequest");export{c as AwsClient,o as AwsV4Signer,p as fromTemporaryCredentials,y as fromWebToken,m as fromZuploIdentity,l as getAwsCredentialProvider,a as setAwsCredentialProvider,g as signRequest};
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
package/out/types/index.d.ts
CHANGED
|
@@ -4230,7 +4230,8 @@ declare type CompatibilityDate =
|
|
|
4230
4230
|
| "2024-03-14"
|
|
4231
4231
|
| "2024-09-02"
|
|
4232
4232
|
| "2025-02-06"
|
|
4233
|
-
| "2026-03-01"
|
|
4233
|
+
| "2026-03-01"
|
|
4234
|
+
| "2026-11-06";
|
|
4234
4235
|
|
|
4235
4236
|
declare interface CompatibilityFlags {
|
|
4236
4237
|
/**
|
|
@@ -4277,6 +4278,42 @@ declare interface CompatibilityFlags {
|
|
|
4277
4278
|
* @compatibilityDate 2025-02-06
|
|
4278
4279
|
*/
|
|
4279
4280
|
useForwardRedirectsPropOnUrlForwardHandler: boolean;
|
|
4281
|
+
/**
|
|
4282
|
+
* Whether the build matches an OpenAPI route's path literally, escaping
|
|
4283
|
+
* the URLPattern special characters in it.
|
|
4284
|
+
*
|
|
4285
|
+
* Before this flag: The path is passed to URLPattern as written, after
|
|
4286
|
+
* `{param}` becomes `:param`, so `/foo/{id}/(.*)` mixes URLPattern syntax
|
|
4287
|
+
* into an OpenAPI path. A path that is not a valid URLPattern fails the
|
|
4288
|
+
* build.
|
|
4289
|
+
*
|
|
4290
|
+
* After this flag: `* + ? ( ) [ ] . | ^ $ \ :` in the path are escaped, so
|
|
4291
|
+
* each matches only itself, and `{param}` is the only placeholder.
|
|
4292
|
+
*
|
|
4293
|
+
* The build reads this flag; the runtime does not.
|
|
4294
|
+
*
|
|
4295
|
+
* @compatibilityDate 2025-02-06
|
|
4296
|
+
*/
|
|
4297
|
+
escapeOpenApiPathCharacters: boolean;
|
|
4298
|
+
/**
|
|
4299
|
+
* Whether an OpenAPI path parameter ends at its closing `}`, so a path
|
|
4300
|
+
* such as `/x/{id}abc` binds `id` as written.
|
|
4301
|
+
*
|
|
4302
|
+
* Before this flag: The build writes `{id}` as `:id`. URLPattern reads a
|
|
4303
|
+
* name for as long as the next characters are letters, digits, `_` or `$`,
|
|
4304
|
+
* so `/x/{id}abc` becomes `/x/:idabc`: it matches `/x/<anything>` and sets
|
|
4305
|
+
* `idabc`, never `id`. The build warns about each such path.
|
|
4306
|
+
*
|
|
4307
|
+
* After this flag: When a letter, digit, `_` or `$` follows the `}`, the
|
|
4308
|
+
* build writes `{:id}abc`, so `/x/fooabc` matches with `id` set to `foo`
|
|
4309
|
+
* and `/x/foo` does not match. `mcpServerHandler` writes the parameter's
|
|
4310
|
+
* value in its place. Other paths build exactly as before.
|
|
4311
|
+
*
|
|
4312
|
+
* The build and the MCP server handler read this flag.
|
|
4313
|
+
*
|
|
4314
|
+
* @compatibilityDate 2026-11-06
|
|
4315
|
+
*/
|
|
4316
|
+
delimitOpenApiPathParameters: boolean;
|
|
4280
4317
|
/**
|
|
4281
4318
|
* Whether response sending hooks should chain properly, where each hook
|
|
4282
4319
|
* receives the response from the previous hook instead of the original response.
|
|
@@ -4318,6 +4355,8 @@ declare interface CompatibilityFlags {
|
|
|
4318
4355
|
* and `allOf`. `request-validation-inbound` validates with the same dialect,
|
|
4319
4356
|
* `format` and pattern rules, and keeps its parameter type coercion
|
|
4320
4357
|
* (specs/compat-improved-schema-validation.md).
|
|
4358
|
+
*
|
|
4359
|
+
* @compatibilityDate 2026-11-06
|
|
4321
4360
|
*/
|
|
4322
4361
|
improvedSchemaValidation: boolean;
|
|
4323
4362
|
/**
|
|
@@ -4334,6 +4373,8 @@ declare interface CompatibilityFlags {
|
|
|
4334
4373
|
* Style Examples table says, for example `rgb[R]=100&rgb[G]=200` for a
|
|
4335
4374
|
* `deepObject` and `.blue.black.brown` for a path `label`. Values are
|
|
4336
4375
|
* percent-encoded as UTF-8 and a space is `%20`.
|
|
4376
|
+
*
|
|
4377
|
+
* @compatibilityDate 2026-11-06
|
|
4337
4378
|
*/
|
|
4338
4379
|
serializeMcpParametersByStyle: boolean;
|
|
4339
4380
|
/**
|
|
@@ -4360,6 +4401,8 @@ declare interface CompatibilityFlags {
|
|
|
4360
4401
|
*
|
|
4361
4402
|
* The build warns about every name that breaks the rule or repeats, with or
|
|
4362
4403
|
* without this flag. Set `x-zuplo-route.mcp.name` to keep a name stable.
|
|
4404
|
+
*
|
|
4405
|
+
* @compatibilityDate 2026-11-06
|
|
4363
4406
|
*/
|
|
4364
4407
|
sanitizeMcpToolNames: boolean;
|
|
4365
4408
|
/**
|
|
@@ -4384,6 +4427,8 @@ declare interface CompatibilityFlags {
|
|
|
4384
4427
|
* - Before `2025-03-26`: tools also leave out `annotations`.
|
|
4385
4428
|
*
|
|
4386
4429
|
* `_meta` is sent on every version.
|
|
4430
|
+
*
|
|
4431
|
+
* @compatibilityDate 2026-11-06
|
|
4387
4432
|
*/
|
|
4388
4433
|
omitMcpFieldsNewerThanNegotiatedVersion: boolean;
|
|
4389
4434
|
/**
|
|
@@ -4405,8 +4450,40 @@ declare interface CompatibilityFlags {
|
|
|
4405
4450
|
* secrets, and options whose unset default grants more access keep their
|
|
4406
4451
|
* current behavior. `BLANK_IS_NOT_UNSET` in
|
|
4407
4452
|
* `policies/optional-string-options.spec.ts` lists them with the reason.
|
|
4453
|
+
*
|
|
4454
|
+
* @compatibilityDate 2026-11-06
|
|
4408
4455
|
*/
|
|
4409
4456
|
treatBlankOptionalStringOptionsAsUnset: boolean;
|
|
4457
|
+
/**
|
|
4458
|
+
* Whether the MCP server handler answers `resources/read` with a JSON-RPC
|
|
4459
|
+
* error when the resource's route answers an error status.
|
|
4460
|
+
*
|
|
4461
|
+
* Before this flag: The route's response body is returned as the
|
|
4462
|
+
* resource's contents whatever its status, so a route's 403 problem+json
|
|
4463
|
+
* reaches the client as a successful read.
|
|
4464
|
+
*
|
|
4465
|
+
* After this flag: A status outside 200 to 299, a redirect included,
|
|
4466
|
+
* answers `resources/read` with JSON-RPC error -32603 naming the resource,
|
|
4467
|
+
* its URI and the status, with `data: { uri, status }`. The route's body is
|
|
4468
|
+
* not read or sent.
|
|
4469
|
+
*
|
|
4470
|
+
* @compatibilityDate 2026-11-06
|
|
4471
|
+
*/
|
|
4472
|
+
failMcpResourceReadsOnErrorStatus: boolean;
|
|
4473
|
+
/**
|
|
4474
|
+
* Whether the build fails for an MCP resource URI that is not an absolute
|
|
4475
|
+
* RFC 3986 URI.
|
|
4476
|
+
*
|
|
4477
|
+
* Before this flag: `x-zuplo-route.mcp.uri` (or the deprecated
|
|
4478
|
+
* `x-zuplo-mcp-resource.uri`) is advertised and served as written, for
|
|
4479
|
+
* example `audit doc with spaces`. The build warns.
|
|
4480
|
+
*
|
|
4481
|
+
* After this flag: The build fails, naming the operation, its file and the
|
|
4482
|
+
* URI. The default URI (`mcp://resources/<name>`) is always valid.
|
|
4483
|
+
*
|
|
4484
|
+
* @compatibilityDate 2026-11-06
|
|
4485
|
+
*/
|
|
4486
|
+
rejectInvalidMcpResourceUris: boolean;
|
|
4410
4487
|
}
|
|
4411
4488
|
|
|
4412
4489
|
declare interface CompletionsFallbacks {
|
|
@@ -101,7 +101,8 @@ declare type CompatibilityDate =
|
|
|
101
101
|
| "2024-03-14"
|
|
102
102
|
| "2024-09-02"
|
|
103
103
|
| "2025-02-06"
|
|
104
|
-
| "2026-03-01"
|
|
104
|
+
| "2026-03-01"
|
|
105
|
+
| "2026-11-06";
|
|
105
106
|
|
|
106
107
|
declare interface CompatibilityFlags {
|
|
107
108
|
/**
|
|
@@ -148,6 +149,42 @@ declare interface CompatibilityFlags {
|
|
|
148
149
|
* @compatibilityDate 2025-02-06
|
|
149
150
|
*/
|
|
150
151
|
useForwardRedirectsPropOnUrlForwardHandler: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Whether the build matches an OpenAPI route's path literally, escaping
|
|
154
|
+
* the URLPattern special characters in it.
|
|
155
|
+
*
|
|
156
|
+
* Before this flag: The path is passed to URLPattern as written, after
|
|
157
|
+
* `{param}` becomes `:param`, so `/foo/{id}/(.*)` mixes URLPattern syntax
|
|
158
|
+
* into an OpenAPI path. A path that is not a valid URLPattern fails the
|
|
159
|
+
* build.
|
|
160
|
+
*
|
|
161
|
+
* After this flag: `* + ? ( ) [ ] . | ^ $ \ :` in the path are escaped, so
|
|
162
|
+
* each matches only itself, and `{param}` is the only placeholder.
|
|
163
|
+
*
|
|
164
|
+
* The build reads this flag; the runtime does not.
|
|
165
|
+
*
|
|
166
|
+
* @compatibilityDate 2025-02-06
|
|
167
|
+
*/
|
|
168
|
+
escapeOpenApiPathCharacters: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Whether an OpenAPI path parameter ends at its closing `}`, so a path
|
|
171
|
+
* such as `/x/{id}abc` binds `id` as written.
|
|
172
|
+
*
|
|
173
|
+
* Before this flag: The build writes `{id}` as `:id`. URLPattern reads a
|
|
174
|
+
* name for as long as the next characters are letters, digits, `_` or `$`,
|
|
175
|
+
* so `/x/{id}abc` becomes `/x/:idabc`: it matches `/x/<anything>` and sets
|
|
176
|
+
* `idabc`, never `id`. The build warns about each such path.
|
|
177
|
+
*
|
|
178
|
+
* After this flag: When a letter, digit, `_` or `$` follows the `}`, the
|
|
179
|
+
* build writes `{:id}abc`, so `/x/fooabc` matches with `id` set to `foo`
|
|
180
|
+
* and `/x/foo` does not match. `mcpServerHandler` writes the parameter's
|
|
181
|
+
* value in its place. Other paths build exactly as before.
|
|
182
|
+
*
|
|
183
|
+
* The build and the MCP server handler read this flag.
|
|
184
|
+
*
|
|
185
|
+
* @compatibilityDate 2026-11-06
|
|
186
|
+
*/
|
|
187
|
+
delimitOpenApiPathParameters: boolean;
|
|
151
188
|
/**
|
|
152
189
|
* Whether response sending hooks should chain properly, where each hook
|
|
153
190
|
* receives the response from the previous hook instead of the original response.
|
|
@@ -189,6 +226,8 @@ declare interface CompatibilityFlags {
|
|
|
189
226
|
* and `allOf`. `request-validation-inbound` validates with the same dialect,
|
|
190
227
|
* `format` and pattern rules, and keeps its parameter type coercion
|
|
191
228
|
* (specs/compat-improved-schema-validation.md).
|
|
229
|
+
*
|
|
230
|
+
* @compatibilityDate 2026-11-06
|
|
192
231
|
*/
|
|
193
232
|
improvedSchemaValidation: boolean;
|
|
194
233
|
/**
|
|
@@ -205,6 +244,8 @@ declare interface CompatibilityFlags {
|
|
|
205
244
|
* Style Examples table says, for example `rgb[R]=100&rgb[G]=200` for a
|
|
206
245
|
* `deepObject` and `.blue.black.brown` for a path `label`. Values are
|
|
207
246
|
* percent-encoded as UTF-8 and a space is `%20`.
|
|
247
|
+
*
|
|
248
|
+
* @compatibilityDate 2026-11-06
|
|
208
249
|
*/
|
|
209
250
|
serializeMcpParametersByStyle: boolean;
|
|
210
251
|
/**
|
|
@@ -231,6 +272,8 @@ declare interface CompatibilityFlags {
|
|
|
231
272
|
*
|
|
232
273
|
* The build warns about every name that breaks the rule or repeats, with or
|
|
233
274
|
* without this flag. Set `x-zuplo-route.mcp.name` to keep a name stable.
|
|
275
|
+
*
|
|
276
|
+
* @compatibilityDate 2026-11-06
|
|
234
277
|
*/
|
|
235
278
|
sanitizeMcpToolNames: boolean;
|
|
236
279
|
/**
|
|
@@ -255,6 +298,8 @@ declare interface CompatibilityFlags {
|
|
|
255
298
|
* - Before `2025-03-26`: tools also leave out `annotations`.
|
|
256
299
|
*
|
|
257
300
|
* `_meta` is sent on every version.
|
|
301
|
+
*
|
|
302
|
+
* @compatibilityDate 2026-11-06
|
|
258
303
|
*/
|
|
259
304
|
omitMcpFieldsNewerThanNegotiatedVersion: boolean;
|
|
260
305
|
/**
|
|
@@ -276,8 +321,40 @@ declare interface CompatibilityFlags {
|
|
|
276
321
|
* secrets, and options whose unset default grants more access keep their
|
|
277
322
|
* current behavior. `BLANK_IS_NOT_UNSET` in
|
|
278
323
|
* `policies/optional-string-options.spec.ts` lists them with the reason.
|
|
324
|
+
*
|
|
325
|
+
* @compatibilityDate 2026-11-06
|
|
279
326
|
*/
|
|
280
327
|
treatBlankOptionalStringOptionsAsUnset: boolean;
|
|
328
|
+
/**
|
|
329
|
+
* Whether the MCP server handler answers `resources/read` with a JSON-RPC
|
|
330
|
+
* error when the resource's route answers an error status.
|
|
331
|
+
*
|
|
332
|
+
* Before this flag: The route's response body is returned as the
|
|
333
|
+
* resource's contents whatever its status, so a route's 403 problem+json
|
|
334
|
+
* reaches the client as a successful read.
|
|
335
|
+
*
|
|
336
|
+
* After this flag: A status outside 200 to 299, a redirect included,
|
|
337
|
+
* answers `resources/read` with JSON-RPC error -32603 naming the resource,
|
|
338
|
+
* its URI and the status, with `data: { uri, status }`. The route's body is
|
|
339
|
+
* not read or sent.
|
|
340
|
+
*
|
|
341
|
+
* @compatibilityDate 2026-11-06
|
|
342
|
+
*/
|
|
343
|
+
failMcpResourceReadsOnErrorStatus: boolean;
|
|
344
|
+
/**
|
|
345
|
+
* Whether the build fails for an MCP resource URI that is not an absolute
|
|
346
|
+
* RFC 3986 URI.
|
|
347
|
+
*
|
|
348
|
+
* Before this flag: `x-zuplo-route.mcp.uri` (or the deprecated
|
|
349
|
+
* `x-zuplo-mcp-resource.uri`) is advertised and served as written, for
|
|
350
|
+
* example `audit doc with spaces`. The build warns.
|
|
351
|
+
*
|
|
352
|
+
* After this flag: The build fails, naming the operation, its file and the
|
|
353
|
+
* URI. The default URI (`mcp://resources/<name>`) is always valid.
|
|
354
|
+
*
|
|
355
|
+
* @compatibilityDate 2026-11-06
|
|
356
|
+
*/
|
|
357
|
+
rejectInvalidMcpResourceUris: boolean;
|
|
281
358
|
}
|
|
282
359
|
|
|
283
360
|
/**
|
|
@@ -1231,6 +1308,18 @@ declare type Iso3166Alpha2Code =
|
|
|
1231
1308
|
|
|
1232
1309
|
/* Excluded from this release type: isRestrictedEnvVariableName */
|
|
1233
1310
|
|
|
1311
|
+
/**
|
|
1312
|
+
* Whether `uri` is an absolute RFC 3986 URI (section 3: `scheme ":"
|
|
1313
|
+
* hier-part [ "?" query ] [ "#" fragment ]`), as MCP requires a resource URI
|
|
1314
|
+
* to be (compat-reject-invalid-mcp-resource-uris MCPRESURI-1). The structure
|
|
1315
|
+
* is checked, not just the characters: a bracketed host must be an IP
|
|
1316
|
+
* literal, a port must be digits, and a fragment holds no second `#`. Any
|
|
1317
|
+
* scheme is allowed, so custom schemes such as `docs:` pass.
|
|
1318
|
+
*
|
|
1319
|
+
* @param uri - the resource URI as the handler advertises it (trimmed)
|
|
1320
|
+
*/
|
|
1321
|
+
export declare function isValidMcpResourceUri(uri: string): boolean;
|
|
1322
|
+
|
|
1234
1323
|
/* Excluded from this release type: isZuploReadableEnvVariableName */
|
|
1235
1324
|
|
|
1236
1325
|
declare type JsonArray = JsonValue[] | readonly JsonValue[];
|
|
@@ -1311,6 +1400,36 @@ declare interface Logger extends BaseLogger {
|
|
|
1311
1400
|
): void;
|
|
1312
1401
|
}
|
|
1313
1402
|
|
|
1403
|
+
/** The name and URI `resources/list` advertises for a resource. */
|
|
1404
|
+
export declare interface McpResourceIdentity {
|
|
1405
|
+
/**
|
|
1406
|
+
* The resource's name. Empty only on the `"resources"` path for an
|
|
1407
|
+
* operation with neither a name nor an operationId, which the handler
|
|
1408
|
+
* refuses at startup.
|
|
1409
|
+
*/
|
|
1410
|
+
name: string;
|
|
1411
|
+
/** The advertised URI: the configured one, trimmed, or the default. */
|
|
1412
|
+
uri: string;
|
|
1413
|
+
/** Whether the URI is configured (non-empty after trimming), not the default. */
|
|
1414
|
+
configured: boolean;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
/** The part of a resource extension that names a resource and its URI. */
|
|
1418
|
+
export declare interface McpResourceIdentityConfig {
|
|
1419
|
+
name?: string;
|
|
1420
|
+
uri?: string;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
/**
|
|
1424
|
+
* How `mcpServerHandler` registers a resource, which decides the extension
|
|
1425
|
+
* its name and URI come from:
|
|
1426
|
+
* - `"operations"`: `options.operations`, from `x-zuplo-route.mcp` with
|
|
1427
|
+
* `type: "resource"`.
|
|
1428
|
+
* - `"resources"`: the deprecated `options.resources`, from
|
|
1429
|
+
* `x-zuplo-mcp-resource`.
|
|
1430
|
+
*/
|
|
1431
|
+
export declare type McpResourceRegistration = "operations" | "resources";
|
|
1432
|
+
|
|
1314
1433
|
declare type Modify<T, R> = Omit<T, keyof R> & R;
|
|
1315
1434
|
|
|
1316
1435
|
/**
|
|
@@ -2025,6 +2144,23 @@ declare interface RequestUser<TUserData> {
|
|
|
2025
2144
|
data: TUserData;
|
|
2026
2145
|
}
|
|
2027
2146
|
|
|
2147
|
+
/**
|
|
2148
|
+
* The name and URI `mcpServerHandler` advertises for an operation it registers
|
|
2149
|
+
* as a resource. The handler and the build's resource URI check
|
|
2150
|
+
* (compat-reject-invalid-mcp-resource-uris MCPRESURI-1) both decide it here.
|
|
2151
|
+
* An empty URI gets the default, `mcp://resources/<encoded name>`.
|
|
2152
|
+
*
|
|
2153
|
+
* @param operationId - the operation's operationId
|
|
2154
|
+
* @param config - `x-zuplo-route.mcp` for `"operations"`,
|
|
2155
|
+
* `x-zuplo-mcp-resource` for `"resources"`
|
|
2156
|
+
* @param registration - the handler option that registers the resource
|
|
2157
|
+
*/
|
|
2158
|
+
export declare function resolveMcpResourceIdentity(
|
|
2159
|
+
operationId: string,
|
|
2160
|
+
config: McpResourceIdentityConfig | undefined,
|
|
2161
|
+
registration: McpResourceRegistration
|
|
2162
|
+
): McpResourceIdentity;
|
|
2163
|
+
|
|
2028
2164
|
declare type ResolveRequestParams<
|
|
2029
2165
|
TParams extends RequestParamsDefault | undefined,
|
|
2030
2166
|
> = TParams extends RequestParamsDefault ? TParams : RequestParamsDefault;
|