@zuplo/runtime 7.14.3 → 7.14.6

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.
@@ -22,5 +22,5 @@
22
22
  * DEALINGS IN THE SOFTWARE.
23
23
  *--------------------------------------------------------------------------------------------*/
24
24
 
25
- import{G as p,M as c,Q as u}from"../chunk-ADPB2ZMZ.js";import"../chunk-VP5Q3DEN.js";import{a as d}from"../chunk-7RNZS3GX.js";import"../chunk-A3QGJZO7.js";import"../chunk-C32OTSKW.js";import"../chunk-UKQQD2JN.js";import{aa as i}from"../chunk-UFTMOJ7K.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};
25
+ import{G as p,M as c,Q as u}from"../chunk-JORDKCQ5.js";import"../chunk-VP5Q3DEN.js";import{a as d}from"../chunk-AEVCZW3D.js";import"../chunk-A3QGJZO7.js";import"../chunk-G2O2ZIL3.js";import"../chunk-UKQQD2JN.js";import{aa as i}from"../chunk-VIH2ISEH.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{H as a,I as l,J as c,K as o,N as p,O as y,P as m}from"../../chunk-C32OTSKW.js";import"../../chunk-UKQQD2JN.js";import"../../chunk-UFTMOJ7K.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};
25
+ import{H as a,I as l,J as c,K as o,N as p,O as y,P as m}from"../../chunk-G2O2ZIL3.js";import"../../chunk-UKQQD2JN.js";import"../../chunk-VIH2ISEH.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
@@ -4455,7 +4455,8 @@ declare interface CompatibilityFlags {
4455
4455
  */
4456
4456
  treatBlankOptionalStringOptionsAsUnset: boolean;
4457
4457
  /**
4458
- * Whether the MCP Gateway supports MCP protocol revision `2026-07-28`.
4458
+ * Whether the MCP Gateway and `mcpServerHandler` support MCP protocol
4459
+ * revision `2026-07-28`.
4459
4460
  *
4460
4461
  * MCP requests on `2025-11-25` and earlier get the same answers with or
4461
4462
  * without this flag, with one exception: an `initialize` reply the upstream
@@ -4472,11 +4473,24 @@ declare interface CompatibilityFlags {
4472
4473
  * reading it as `2026-07-28`. An upstream that answers only `server/discover`
4473
4474
  * is reported as unavailable, and a caller that hasn't connected the
4474
4475
  * upstream gets the `-32042` URL-elicitation error, which `2026-07-28`
4475
- * clients can't act on.
4476
+ * clients can't act on. `mcpServerHandler` refuses a `2026-07-28`
4477
+ * `MCP-Protocol-Version` header with HTTP 400 and `-32000`.
4476
4478
  *
4477
- * After this flag: The MCP Gateway handles `2026-07-28` requests as that
4478
- * revision requires:
4479
+ * After this flag: The MCP Gateway and `mcpServerHandler` handle
4480
+ * `2026-07-28` requests as that revision requires:
4479
4481
  *
4482
+ * - `mcpServerHandler` serves a `2026-07-28` request: `server/discover`,
4483
+ * the per-request `_meta` envelope and its validation (`-32602`,
4484
+ * `-32020`, `-32022`), including the required `MCP-Protocol-Version`,
4485
+ * `Mcp-Method` and `Mcp-Name` headers,
4486
+ * HTTP `404` with `-32601` for the methods `2026-07-28` removed
4487
+ * (`initialize`, `ping`, `logging/setLevel`, `resources/subscribe`,
4488
+ * `resources/unsubscribe`), and `resultType`, `serverInfo` and
4489
+ * `ttlMs: 0` / `cacheScope: "private"` on its results. An unknown tool,
4490
+ * prompt or resource gets the MCP SDK's not-found error. The era comes
4491
+ * from the body, so a request that names `2026-07-28` only in
4492
+ * `params._meta`, with no header, gets HTTP `400` with `-32020`. The MCP
4493
+ * capability filter answers a hidden target with the same checks first.
4480
4494
  * - Upstream readiness falls back to `server/discover` when `initialize` is
4481
4495
  * refused with a JSON-RPC error.
4482
4496
  * - `server/discover` gets the configured icon fallback, and the gateway
@@ -4488,10 +4502,18 @@ declare interface CompatibilityFlags {
4488
4502
  * other event is relayed unchanged, and the stream is not buffered.
4489
4503
  * - A caller that hasn't connected the upstream gets an `input_required`
4490
4504
  * result with a URL-mode connect elicitation (or `-32021` when the client
4491
- * didn't declare URL elicitation), not `-32042`. Before the gateway
4492
- * answers such a request itself, it refuses one a `2026-07-28` server
4493
- * would refuse (`-32602`, `-32020` or `-32022`, HTTP 400), and it accepts
4494
- * a notification with `202` and no body.
4505
+ * didn't declare URL elicitation), not `-32042`. Any other method, the
4506
+ * list methods included, gets `-32603` with the connect link in
4507
+ * `data.connectRequired`. Before the gateway answers such a request
4508
+ * itself, it refuses one a `2026-07-28` server would refuse (`-32602`,
4509
+ * `-32020` or `-32022`, HTTP 400), a request without a required
4510
+ * `MCP-Protocol-Version`, `Mcp-Method` or `Mcp-Name` header included, and
4511
+ * it accepts a notification with `202` and no body. Its own
4512
+ * `server/discover` answer lists `2026-07-28` and the 2025-era versions
4513
+ * the route relays through `initialize`.
4514
+ * - A retry's `requestState` with the gateway's `zuplo-connect.` prefix
4515
+ * that doesn't verify under this deployment's key (another Zuplo
4516
+ * gateway's, behind this one) is passed to the upstream, not refused.
4495
4517
  * - The capability filter checks the `Mcp-Method` and `Mcp-Name` headers
4496
4518
  * against the body (`-32020`), answers an unknown method spelling with
4497
4519
  * HTTP `404`, marks lists and `resources/read` results on routes with
@@ -4548,6 +4570,97 @@ declare interface CompatibilityFlags {
4548
4570
  * @compatibilityDate 2026-11-06
4549
4571
  */
4550
4572
  rejectInvalidMcpResourceUris: boolean;
4573
+ /**
4574
+ * Whether the MCP Gateway follows the MCP transport, elicitation and
4575
+ * authorization rules for the answers it builds itself on `2025-11-25` and
4576
+ * earlier requests, and in its upstream readiness check.
4577
+ *
4578
+ * Before this flag:
4579
+ *
4580
+ * - A caller that hasn't connected the upstream gets a JSON-RPC error with
4581
+ * HTTP 200 for every message: `-32042` with a URL-mode elicitation when
4582
+ * the gateway has a connect URL, `-32600` when it doesn't. That includes
4583
+ * a notification or a JSON-RPC response (answered with an error that has
4584
+ * no `id`), an `initialize`, a client that never declared URL-mode
4585
+ * elicitation, and a client on a protocol version before `2025-11-25`,
4586
+ * which has no URL mode.
4587
+ * - When the upstream still answers 401 after the gateway refreshed its
4588
+ * credential (or the gateway could not retry), and when it answers 403
4589
+ * with a `WWW-Authenticate` challenge, the client gets the upstream's
4590
+ * response, `WWW-Authenticate` included. The challenge points at the
4591
+ * upstream's authorization server, and the client reads the 401 as its
4592
+ * own gateway token failing.
4593
+ * - The readiness check ends the upstream session it opened with
4594
+ * `MCP-Protocol-Version: 2025-11-25`, whatever version the upstream
4595
+ * negotiated.
4596
+ *
4597
+ * After this flag:
4598
+ *
4599
+ * - A request from a caller that hasn't connected the upstream is first
4600
+ * checked as `mcpServerHandler` checks it: a body that is not JSON (an
4601
+ * empty one included) gets HTTP `400` `-32700`, a message that is not
4602
+ * valid JSON-RPC `400` `-32600`, an `initialize` batched with other
4603
+ * messages `400` `-32600`, and an `MCP-Protocol-Version` the route does
4604
+ * not serve `400` `-32000` (a missing header is allowed; the route
4605
+ * serves its upstream's versions once the gateway has learned them). A
4606
+ * batch on `2025-06-18` or later is refused whole with `400` `-32600`.
4607
+ * - A valid notification or JSON-RPC response is accepted with `202` and
4608
+ * no body, and dropped. `ping` gets an empty result. A `2025-03-26`
4609
+ * batch is answered per member.
4610
+ * - The `-32042` URL-elicitation error is sent only to an `initialize` that
4611
+ * names `2025-11-25` (and not `2026-07-28` or later) and declares
4612
+ * `capabilities.elicitation.url`: the gateway keeps no session, so it
4613
+ * cannot know what a later request's client declared. Every other
4614
+ * connect-required answer is `-32603` with the connect link in
4615
+ * `data.connectRequired`, never `-32600`.
4616
+ * - On a request the token exchange policy sent with the gateway's own
4617
+ * upstream credential, an upstream 401 the refresh did not fix, or an
4618
+ * upstream 403 with a `WWW-Authenticate` challenge, is answered by the
4619
+ * gateway with JSON-RPC `-32603` (`data.upstreamStatus`) and no
4620
+ * `WWW-Authenticate`; a message without a request gets HTTP `502` with
4621
+ * the error and no id. A route without the policy relays the challenge.
4622
+ * - The readiness check ends the session with the version the upstream
4623
+ * negotiated in its `initialize` result.
4624
+ * - The MCP capability filter answers a 2025-era request for a hidden
4625
+ * target as `mcpServerHandler` answers an absent one: its `406`, `415`,
4626
+ * invalid-message and batched-`initialize` `400`s and unsupported-version
4627
+ * `400` first, then a mistyped `arguments` `-32602`, then the not-found.
4628
+ * - On a `2026-07-28` request (with `mcpProtocolVersion20260728`), a method
4629
+ * 2026-07-28 removed (`ping`, `logging/setLevel`, …) gets `404`
4630
+ * `-32601` from the gateway instead of the connect-required error.
4631
+ *
4632
+ * @compatibilityDate 2026-11-06
4633
+ */
4634
+ mcpGatewaySpecCompliance: boolean;
4635
+ /**
4636
+ * Whether the MCP server handler checks the results and requests that MCP
4637
+ * 2025-11-25 constrains and the handler did not check.
4638
+ *
4639
+ * Before this flag:
4640
+ *
4641
+ * - `prompts/get` returns the prompt route's messages as the route sent
4642
+ * them, so a `role` other than `user` or `assistant` (such as
4643
+ * `"system"`) or an invalid content block reaches the client.
4644
+ * - A JSON-RPC batch (allowed on `2025-03-26` and earlier) whose answer has
4645
+ * one response gets that response as a bare object, not an array.
4646
+ * - A tool from the deprecated `options.files` whose `x-zuplo-mcp-tool`
4647
+ * name is blank is registered with the name `""`.
4648
+ *
4649
+ * After this flag:
4650
+ *
4651
+ * - `prompts/get` answers JSON-RPC `-32603` naming the prompt and the first
4652
+ * invalid message when a message's `role` is not `user` or `assistant`,
4653
+ * or its `content` is not a content block the request's protocol version
4654
+ * defines (`audio` from `2025-03-26`, `resource_link` from `2025-06-18`).
4655
+ * A prompt message's `annotations.lastModified` may be any string, as
4656
+ * every revision's schema types it.
4657
+ * - Every answer to a batch is an array.
4658
+ * - A blank tool name falls back to the operationId, as on every other
4659
+ * path.
4660
+ *
4661
+ * @compatibilityDate 2026-11-06
4662
+ */
4663
+ mcpServerSpecCompliance: boolean;
4551
4664
  }
4552
4665
 
4553
4666
  declare interface CompletionsFallbacks {
@@ -326,7 +326,8 @@ declare interface CompatibilityFlags {
326
326
  */
327
327
  treatBlankOptionalStringOptionsAsUnset: boolean;
328
328
  /**
329
- * Whether the MCP Gateway supports MCP protocol revision `2026-07-28`.
329
+ * Whether the MCP Gateway and `mcpServerHandler` support MCP protocol
330
+ * revision `2026-07-28`.
330
331
  *
331
332
  * MCP requests on `2025-11-25` and earlier get the same answers with or
332
333
  * without this flag, with one exception: an `initialize` reply the upstream
@@ -343,11 +344,24 @@ declare interface CompatibilityFlags {
343
344
  * reading it as `2026-07-28`. An upstream that answers only `server/discover`
344
345
  * is reported as unavailable, and a caller that hasn't connected the
345
346
  * upstream gets the `-32042` URL-elicitation error, which `2026-07-28`
346
- * clients can't act on.
347
- *
348
- * After this flag: The MCP Gateway handles `2026-07-28` requests as that
349
- * revision requires:
350
- *
347
+ * clients can't act on. `mcpServerHandler` refuses a `2026-07-28`
348
+ * `MCP-Protocol-Version` header with HTTP 400 and `-32000`.
349
+ *
350
+ * After this flag: The MCP Gateway and `mcpServerHandler` handle
351
+ * `2026-07-28` requests as that revision requires:
352
+ *
353
+ * - `mcpServerHandler` serves a `2026-07-28` request: `server/discover`,
354
+ * the per-request `_meta` envelope and its validation (`-32602`,
355
+ * `-32020`, `-32022`), including the required `MCP-Protocol-Version`,
356
+ * `Mcp-Method` and `Mcp-Name` headers,
357
+ * HTTP `404` with `-32601` for the methods `2026-07-28` removed
358
+ * (`initialize`, `ping`, `logging/setLevel`, `resources/subscribe`,
359
+ * `resources/unsubscribe`), and `resultType`, `serverInfo` and
360
+ * `ttlMs: 0` / `cacheScope: "private"` on its results. An unknown tool,
361
+ * prompt or resource gets the MCP SDK's not-found error. The era comes
362
+ * from the body, so a request that names `2026-07-28` only in
363
+ * `params._meta`, with no header, gets HTTP `400` with `-32020`. The MCP
364
+ * capability filter answers a hidden target with the same checks first.
351
365
  * - Upstream readiness falls back to `server/discover` when `initialize` is
352
366
  * refused with a JSON-RPC error.
353
367
  * - `server/discover` gets the configured icon fallback, and the gateway
@@ -359,10 +373,18 @@ declare interface CompatibilityFlags {
359
373
  * other event is relayed unchanged, and the stream is not buffered.
360
374
  * - A caller that hasn't connected the upstream gets an `input_required`
361
375
  * result with a URL-mode connect elicitation (or `-32021` when the client
362
- * didn't declare URL elicitation), not `-32042`. Before the gateway
363
- * answers such a request itself, it refuses one a `2026-07-28` server
364
- * would refuse (`-32602`, `-32020` or `-32022`, HTTP 400), and it accepts
365
- * a notification with `202` and no body.
376
+ * didn't declare URL elicitation), not `-32042`. Any other method, the
377
+ * list methods included, gets `-32603` with the connect link in
378
+ * `data.connectRequired`. Before the gateway answers such a request
379
+ * itself, it refuses one a `2026-07-28` server would refuse (`-32602`,
380
+ * `-32020` or `-32022`, HTTP 400), a request without a required
381
+ * `MCP-Protocol-Version`, `Mcp-Method` or `Mcp-Name` header included, and
382
+ * it accepts a notification with `202` and no body. Its own
383
+ * `server/discover` answer lists `2026-07-28` and the 2025-era versions
384
+ * the route relays through `initialize`.
385
+ * - A retry's `requestState` with the gateway's `zuplo-connect.` prefix
386
+ * that doesn't verify under this deployment's key (another Zuplo
387
+ * gateway's, behind this one) is passed to the upstream, not refused.
366
388
  * - The capability filter checks the `Mcp-Method` and `Mcp-Name` headers
367
389
  * against the body (`-32020`), answers an unknown method spelling with
368
390
  * HTTP `404`, marks lists and `resources/read` results on routes with
@@ -419,6 +441,97 @@ declare interface CompatibilityFlags {
419
441
  * @compatibilityDate 2026-11-06
420
442
  */
421
443
  rejectInvalidMcpResourceUris: boolean;
444
+ /**
445
+ * Whether the MCP Gateway follows the MCP transport, elicitation and
446
+ * authorization rules for the answers it builds itself on `2025-11-25` and
447
+ * earlier requests, and in its upstream readiness check.
448
+ *
449
+ * Before this flag:
450
+ *
451
+ * - A caller that hasn't connected the upstream gets a JSON-RPC error with
452
+ * HTTP 200 for every message: `-32042` with a URL-mode elicitation when
453
+ * the gateway has a connect URL, `-32600` when it doesn't. That includes
454
+ * a notification or a JSON-RPC response (answered with an error that has
455
+ * no `id`), an `initialize`, a client that never declared URL-mode
456
+ * elicitation, and a client on a protocol version before `2025-11-25`,
457
+ * which has no URL mode.
458
+ * - When the upstream still answers 401 after the gateway refreshed its
459
+ * credential (or the gateway could not retry), and when it answers 403
460
+ * with a `WWW-Authenticate` challenge, the client gets the upstream's
461
+ * response, `WWW-Authenticate` included. The challenge points at the
462
+ * upstream's authorization server, and the client reads the 401 as its
463
+ * own gateway token failing.
464
+ * - The readiness check ends the upstream session it opened with
465
+ * `MCP-Protocol-Version: 2025-11-25`, whatever version the upstream
466
+ * negotiated.
467
+ *
468
+ * After this flag:
469
+ *
470
+ * - A request from a caller that hasn't connected the upstream is first
471
+ * checked as `mcpServerHandler` checks it: a body that is not JSON (an
472
+ * empty one included) gets HTTP `400` `-32700`, a message that is not
473
+ * valid JSON-RPC `400` `-32600`, an `initialize` batched with other
474
+ * messages `400` `-32600`, and an `MCP-Protocol-Version` the route does
475
+ * not serve `400` `-32000` (a missing header is allowed; the route
476
+ * serves its upstream's versions once the gateway has learned them). A
477
+ * batch on `2025-06-18` or later is refused whole with `400` `-32600`.
478
+ * - A valid notification or JSON-RPC response is accepted with `202` and
479
+ * no body, and dropped. `ping` gets an empty result. A `2025-03-26`
480
+ * batch is answered per member.
481
+ * - The `-32042` URL-elicitation error is sent only to an `initialize` that
482
+ * names `2025-11-25` (and not `2026-07-28` or later) and declares
483
+ * `capabilities.elicitation.url`: the gateway keeps no session, so it
484
+ * cannot know what a later request's client declared. Every other
485
+ * connect-required answer is `-32603` with the connect link in
486
+ * `data.connectRequired`, never `-32600`.
487
+ * - On a request the token exchange policy sent with the gateway's own
488
+ * upstream credential, an upstream 401 the refresh did not fix, or an
489
+ * upstream 403 with a `WWW-Authenticate` challenge, is answered by the
490
+ * gateway with JSON-RPC `-32603` (`data.upstreamStatus`) and no
491
+ * `WWW-Authenticate`; a message without a request gets HTTP `502` with
492
+ * the error and no id. A route without the policy relays the challenge.
493
+ * - The readiness check ends the session with the version the upstream
494
+ * negotiated in its `initialize` result.
495
+ * - The MCP capability filter answers a 2025-era request for a hidden
496
+ * target as `mcpServerHandler` answers an absent one: its `406`, `415`,
497
+ * invalid-message and batched-`initialize` `400`s and unsupported-version
498
+ * `400` first, then a mistyped `arguments` `-32602`, then the not-found.
499
+ * - On a `2026-07-28` request (with `mcpProtocolVersion20260728`), a method
500
+ * 2026-07-28 removed (`ping`, `logging/setLevel`, …) gets `404`
501
+ * `-32601` from the gateway instead of the connect-required error.
502
+ *
503
+ * @compatibilityDate 2026-11-06
504
+ */
505
+ mcpGatewaySpecCompliance: boolean;
506
+ /**
507
+ * Whether the MCP server handler checks the results and requests that MCP
508
+ * 2025-11-25 constrains and the handler did not check.
509
+ *
510
+ * Before this flag:
511
+ *
512
+ * - `prompts/get` returns the prompt route's messages as the route sent
513
+ * them, so a `role` other than `user` or `assistant` (such as
514
+ * `"system"`) or an invalid content block reaches the client.
515
+ * - A JSON-RPC batch (allowed on `2025-03-26` and earlier) whose answer has
516
+ * one response gets that response as a bare object, not an array.
517
+ * - A tool from the deprecated `options.files` whose `x-zuplo-mcp-tool`
518
+ * name is blank is registered with the name `""`.
519
+ *
520
+ * After this flag:
521
+ *
522
+ * - `prompts/get` answers JSON-RPC `-32603` naming the prompt and the first
523
+ * invalid message when a message's `role` is not `user` or `assistant`,
524
+ * or its `content` is not a content block the request's protocol version
525
+ * defines (`audio` from `2025-03-26`, `resource_link` from `2025-06-18`).
526
+ * A prompt message's `annotations.lastModified` may be any string, as
527
+ * every revision's schema types it.
528
+ * - Every answer to a batch is an array.
529
+ * - A blank tool name falls back to the operationId, as on every other
530
+ * path.
531
+ *
532
+ * @compatibilityDate 2026-11-06
533
+ */
534
+ mcpServerSpecCompliance: boolean;
422
535
  }
423
536
 
424
537
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "7.14.3",
4
+ "version": "7.14.6",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
@@ -1,26 +0,0 @@
1
-
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Zuplo, Inc. All rights reserved.
4
- *
5
- * This software and associated documentation files (the "Software") is intended to be used
6
- * only by Zuplo customers solely to develop and test applications that will be deployed
7
- * to Zuplo hosted services. You and others in your organization may use these files on your
8
- * Development Devices solely for the above stated purpose.
9
- *
10
- * Outside of uses stated above, no license is granted for any other purpose including
11
- * without limitation the rights to use, copy, modify, merge, publish, distribute,
12
- * sublicense, host, and/or sell copies of the Software.
13
- *
14
- * The software may include third party components with separate legal notices or governed by
15
- * other agreements, as described in licenses either embedded in or accompanying the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18
- * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19
- * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
20
- * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
- * DEALINGS IN THE SOFTWARE.
23
- *--------------------------------------------------------------------------------------------*/
24
-
25
- import{a as g}from"./chunk-A3QGJZO7.js";import{$ as T}from"./chunk-UFTMOJ7K.js";import{a as r}from"./chunk-TYV53J3B.js";var P=class e extends Request{static{r(this,"ZuploRequest")}#t=void 0;#e;#n;constructor(t,n,s){super(t,n);let o=n?.params;this.#n=s,o?this.#e=o:t instanceof e?this.#e=t.#e:this.#e={};let a=n?.user;a?this.user=a:t instanceof e&&(this.user=t.user)}get originalRequest(){return this.#n??null}get query(){if(this.#t===void 0){let t={},n=new URL(this.url).searchParams;for(let[s,o]of n.entries())t[s]=o;this.#t=t}return g(this.#t)}get params(){return g(this.#e)}user};function h(){return T.instance.build.COMPATIBILITY_FLAGS.mcpProtocolVersion20260728===!0}r(h,"isMcp20260728Enabled");var S="2026-07-28",A="io.modelcontextprotocol/protocolVersion",U="io.modelcontextprotocol/clientCapabilities",B="io.modelcontextprotocol/clientInfo",W="io.modelcontextprotocol/serverInfo";var Q=/^\d{4}-\d{2}-\d{2}$/;function I(e){return typeof e=="string"&&Q.test(e)&&e>=S}r(I,"isModernProtocolVersion");function f(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}r(f,"isRecord");function k(e){if(!f(e)||!f(e.params))return;let t=e.params._meta;return f(t)?t:void 0}r(k,"readRequestMeta");function L(e){let t=k(e)?.[A];return typeof t=="string"?t:void 0}r(L,"readEnvelopeProtocolVersion");function Z(e){let t=k(e)?.[U];return f(t)?t:void 0}r(Z,"readEnvelopeClientCapabilities");function x(e,t){if(Array.isArray(t))return!1;let n=e.get("mcp-protocol-version"),s=L(t);return n!==null&&I(n)||s!==void 0&&I(s)}r(x,"isModernMcpRequest");var X="zuplo_upstream_connect";var M="2.0",R=-32600,N=-32602,se=-32603,re=-32001,b=10*1024*1024;function c(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}r(c,"isRecord");function y(e){return typeof e=="string"||typeof e=="number"}r(y,"isRequestId");function p(e){return e===null?"null":Array.isArray(e)?"an array":typeof e=="object"?"an object":typeof e=="string"?JSON.stringify(e.length>40?`${e.slice(0,40)}\u2026`:e):String(e)}r(p,"describeValue");function i(e){if(!(e===void 0||c(e)))return`params must be an object when present (got ${p(e)}).`}r(i,"optionalObjectParams");function u(e,t){return n=>{if(!c(n))return`params must be an object with a string \`${e}\` (got ${p(n)}). Example: ${t}`;if(typeof n[e]!="string")return`params.${e} must be a string (got ${p(n[e])}). Example: ${t}`}}r(u,"requireStringField");var v={initialize:i,ping:i,"tools/list":i,"tools/call":u("name",'{"name":"my_tool","arguments":{}}'),"prompts/list":i,"prompts/get":u("name",'{"name":"my_prompt"}'),"resources/list":i,"resources/templates/list":i,"resources/read":u("uri",'{"uri":"file:///a.txt"}'),"resources/subscribe":u("uri",'{"uri":"file:///a.txt"}'),"resources/unsubscribe":u("uri",'{"uri":"file:///a.txt"}'),"completion/complete":i,"logging/setLevel":u("level",'{"level":"info"}'),"server/discover":i,"subscriptions/listen":i,"tasks/get":u("taskId",'{"taskId":"task-123"}'),"tasks/update":u("taskId",'{"taskId":"task-123"}'),"tasks/cancel":u("taskId",'{"taskId":"task-123"}')},C={"notifications/initialized":i,"notifications/cancelled":i,"notifications/progress":i,"notifications/roots/list_changed":i,"notifications/subscriptions/acknowledged":i},j=new Set(["server/discover","subscriptions/listen","tasks/get","tasks/update","tasks/cancel"]),$=new Set(["notifications/subscriptions/acknowledged"]);function V(e,t){return Object.hasOwn(v,e)&&(t||!j.has(e))}r(V,"isKnownRequestMethod");function w(e,t){return Object.hasOwn(C,e)&&(t||!$.has(e))}r(w,"isKnownNotificationMethod");function l(e){return{type:"invalid",...e.method===void 0?{}:{method:e.method},id:e.id,error:{code:e.code,message:e.message},raw:e.raw}}r(l,"invalidMessage");function m(e){return y(e)?e:null}r(m,"usableId");function K(e,t,n,s){if(V(t,s)){let o=v[t](e.params);if(o!==void 0)return l({raw:e,method:t,id:n,code:N,message:`Invalid params for \`${t}\`: ${o}`});let a=e.params===void 0?{}:e.params;return{type:"request",method:t,id:n,params:a,raw:e}}return{type:"request",method:t,id:n,params:e.params,raw:e}}r(K,"classifyRequest");function Y(e,t,n){if(w(t,n)){let s=C[t](e.params);if(s!==void 0)return l({raw:e,method:t,id:null,code:N,message:`Invalid params for \`${t}\`: ${s}`});let o=e.params===void 0?{}:e.params;return{type:"notification",method:t,params:o,raw:e}}return{type:"notification",method:t,params:e.params,raw:e}}r(Y,"classifyNotification");function _(e,t=!1){if(!c(e)||e.jsonrpc!==M)return l({raw:e,id:m(c(e)?e.id:void 0),code:R,message:`Invalid Request: batch member is not a JSON-RPC 2.0 message (got ${p(e)}). Every member must include \`"jsonrpc":"2.0"\`.`});let n=e.method;if(typeof n=="string"){if(!("id"in e))return Y(e,n,t);let s=e.id;return y(s)?K(e,n,s,t):l({raw:e,method:n,id:null,code:R,message:`Invalid Request: request id must be a string or number (got ${p(s)}). The gateway cannot correlate a reply to this id \u2014 omit \`id\` to send a notification instead.`})}if(n!==void 0)return l({raw:e,id:m(e.id),code:R,message:`Invalid Request: method must be a string (got ${p(n)}).`});if("result"in e&&y(e.id)&&c(e.result))return{type:"result",id:e.id,result:e.result,raw:e};if("error"in e){let s=e.error;if(c(s)&&typeof s.code=="number"&&typeof s.message=="string"){let o={code:s.code,message:s.message,...s.data===void 0?{}:{data:s.data}};return{type:"error",id:m(e.id),error:o,raw:e}}}return l({raw:e,id:m(e.id),code:R,message:"Invalid Request: message has no `method` and is not a valid JSON-RPC result or error."})}r(_,"classifyMember");var D=new WeakMap,q=new WeakMap;function oe(e){return q.get(e)}r(oe,"getEnvelopeText");async function G(e){let t=e.headers.get("content-type");if(t===null||!t.toLowerCase().includes("json"))return null;let n=e.headers.get("content-length");if(n!==null&&Number(n)>b)return null;let s;try{s=await e.clone().text()}catch{return null}if(s.length>b)return null;let o;try{o=JSON.parse(s)}catch{return null}let a=e.headers.get("mcp-protocol-version");if(Array.isArray(o)){if(o.length>0&&!o.some(d=>c(d)&&d.jsonrpc===M))return null;let O={transport:"json",shape:"batch",messages:o.map(d=>_(d)),...a===null?{}:{protocolVersion:a}};return q.set(O,s),O}if(!c(o)||o.jsonrpc!==M)return null;let E={transport:"json",shape:"single",messages:[_(o,h()&&x(e.headers,o))],...a===null?{}:{protocolVersion:a}};return q.set(E,s),E}r(G,"parseEnvelope");function ie(e){let t=D.get(e);return t===void 0&&(t=G(e),D.set(e,t)),t}r(ie,"getRequest");export{P as a,h as b,S as c,A as d,U as e,B as f,W as g,I as h,L as i,Z as j,x as k,X as l,M as m,R as n,se as o,re as p,c as q,y as r,oe as s,ie as t};
26
- //# sourceMappingURL=chunk-7RNZS3GX.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@zuplo/runtime/request.ts","@zuplo/runtime/mcp-gateway/v2/runtime-utils/mcp-modern-protocol.ts","@zuplo/runtime/mcp/messages/parse.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;wHA0JO,IAAMA,EAAN,MAAMC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AEA,IAAME,EAAkBL,EAAQ,QAAQ,IAAI,sBAAsB,EAElE,GAAI,MAAM,QAAQI,CAAI,EAAG,CAIvB,GACEA,EAAK,OAAS,GACd,CAACA,EAAK,KACHE,GAAWxC,EAASwC,CAAM,GAAKA,EAAO,UAAY9C,CACrD,EAEA,OAAO,KAET,IAAMsC,EAAwB,CAC5B,UAAW,OACX,MAAO,QAEP,SAAUM,EAAK,IAAKE,GAAWd,EAAec,CAAM,CAAC,EACrD,GAAID,IAAoB,KAAO,CAAC,EAAI,CAAE,gBAAAA,CAAgB,CACxD,EACA,OAAAT,EAAa,IAAIE,EAAUK,CAAI,EACxBL,CACT,CAEA,GAAI,CAAChC,EAASsC,CAAI,GAAKA,EAAK,UAAY5C,EACtC,OAAO,KAET,IAAMsC,EAAwB,CAC5B,UAAW,OACX,MAAO,SACP,SAAU,CACRN,EACEY,EACAG,EAAqB,GAAKC,EAAmBR,EAAQ,QAASI,CAAI,CACpE,CACF,EACA,GAAIC,IAAoB,KAAO,CAAC,EAAI,CAAE,gBAAAA,CAAgB,CACxD,EACA,OAAAT,EAAa,IAAIE,EAAUK,CAAI,EACxBL,CACT,CApEe9B,EAAA+B,EAAA,iBAkFR,SAASU,GAAWT,EAA+C,CACxE,IAAIU,EAASf,EAAc,IAAIK,CAAO,EACtC,OAAIU,IAAW,SACbA,EAASX,EAAcC,CAAO,EAC9BL,EAAc,IAAIK,EAASU,CAAM,GAE5BA,CACT,CAPgB1C,EAAAyC,GAAA","names":["ZuploRequest","_ZuploRequest","__name","#query","#params","#originalRequest","input","init","originalRequest","params","user","query","searchParams","key","value","deepFreeze","isMcp20260728Enabled","Environment","__name","MCP_MODERN_PROTOCOL_VERSION","MCP_PROTOCOL_VERSION_META_KEY","MCP_CLIENT_CAPABILITIES_META_KEY","MCP_CLIENT_INFO_META_KEY","MCP_SERVER_INFO_META_KEY","PROTOCOL_REVISION_PATTERN","isModernProtocolVersion","version","MCP_MODERN_PROTOCOL_VERSION","__name","isRecord","value","readRequestMeta","message","meta","readEnvelopeProtocolVersion","MCP_PROTOCOL_VERSION_META_KEY","readEnvelopeClientCapabilities","capabilities","MCP_CLIENT_CAPABILITIES_META_KEY","isModernMcpRequest","headers","header","claim","CONNECT_INPUT_REQUEST_KEY","JSONRPC_VERSION","INVALID_REQUEST","INVALID_PARAMS","INTERNAL_ERROR","NOT_PROCESSED","MAX_BODY_CHARS","isRecord","value","__name","isRequestId","describeValue","optionalObjectParams","params","requireStringField","field","example","REQUEST_PARAM_CHECKS","NOTIFICATION_PARAM_CHECKS","MODERN_ONLY_REQUEST_METHODS","MODERN_ONLY_NOTIFICATION_METHODS","isKnownRequestMethod","method","modern","isKnownNotificationMethod","invalidMessage","input","usableId","classifyRequest","raw","id","problem","classifyNotification","classifyMember","error","detail","envelopeCache","envelopeText","getEnvelopeText","envelope","parseEnvelope","request","contentType","contentLength","text","body","protocolVersion","member","isMcp20260728Enabled","isModernMcpRequest","getRequest","cached"]}