@zuplo/cli 7.14.5 → 7.14.8

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.
Files changed (72) hide show
  1. package/node_modules/@zuplo/core/customer.cli.minified.js +156 -156
  2. package/node_modules/@zuplo/core/index.minified.js +161 -161
  3. package/node_modules/@zuplo/core/package.json +1 -1
  4. package/node_modules/@zuplo/graphql/package.json +1 -1
  5. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  6. package/node_modules/@zuplo/otel/package.json +1 -1
  7. package/node_modules/@zuplo/runtime/out/esm/chunk-2HVCLUM4.js +37 -0
  8. package/node_modules/@zuplo/runtime/out/esm/{chunk-UFTMOJ7K.js.map → chunk-2HVCLUM4.js.map} +1 -1
  9. package/node_modules/@zuplo/runtime/out/esm/{chunk-C32OTSKW.js → chunk-6R2COTV6.js} +2 -2
  10. package/node_modules/@zuplo/runtime/out/esm/chunk-DB6LKZ36.js +429 -0
  11. package/node_modules/@zuplo/runtime/out/esm/chunk-DB6LKZ36.js.map +1 -0
  12. package/node_modules/@zuplo/runtime/out/esm/chunk-PY52EHDX.js +26 -0
  13. package/node_modules/@zuplo/runtime/out/esm/chunk-PY52EHDX.js.map +1 -0
  14. package/node_modules/@zuplo/runtime/out/esm/{chunk-AENEWA54.js → chunk-SNTU476S.js} +2 -2
  15. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  16. package/node_modules/@zuplo/runtime/out/esm/mcp/messages/index.js +1 -1
  17. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +12 -12
  18. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
  19. package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
  20. package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js +1 -1
  21. package/node_modules/@zuplo/runtime/out/types/index.d.ts +135 -13
  22. package/node_modules/@zuplo/runtime/out/types/internal/index.d.ts +137 -15
  23. package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +40 -0
  24. package/node_modules/@zuplo/runtime/package.json +1 -1
  25. package/node_modules/hono/dist/adapter/aws-lambda/handler.js +1 -1
  26. package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +1 -1
  27. package/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +1 -1
  28. package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +1 -1
  29. package/node_modules/hono/dist/cjs/client/fetch-result-please.js +1 -1
  30. package/node_modules/hono/dist/cjs/helper/accepts/accepts.js +2 -1
  31. package/node_modules/hono/dist/cjs/helper/ssg/ssg.js +5 -3
  32. package/node_modules/hono/dist/cjs/jsx/base.js +49 -30
  33. package/node_modules/hono/dist/cjs/jsx/components.js +2 -2
  34. package/node_modules/hono/dist/cjs/jsx/constants.js +2 -0
  35. package/node_modules/hono/dist/cjs/jsx/jsx-runtime.js +13 -17
  36. package/node_modules/hono/dist/cjs/middleware/etag/index.js +3 -1
  37. package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +1 -0
  38. package/node_modules/hono/dist/cjs/middleware/timing/timing.js +4 -3
  39. package/node_modules/hono/dist/cjs/utils/cookie.js +2 -2
  40. package/node_modules/hono/dist/cjs/utils/mime.js +1 -1
  41. package/node_modules/hono/dist/cjs/utils/url.js +1 -1
  42. package/node_modules/hono/dist/client/fetch-result-please.js +1 -1
  43. package/node_modules/hono/dist/helper/accepts/accepts.js +2 -1
  44. package/node_modules/hono/dist/helper/ssg/ssg.js +5 -3
  45. package/node_modules/hono/dist/jsx/base.js +49 -32
  46. package/node_modules/hono/dist/jsx/components.js +2 -2
  47. package/node_modules/hono/dist/jsx/constants.js +2 -1
  48. package/node_modules/hono/dist/jsx/jsx-runtime.js +15 -19
  49. package/node_modules/hono/dist/middleware/etag/index.js +3 -1
  50. package/node_modules/hono/dist/middleware/language/language.js +1 -1
  51. package/node_modules/hono/dist/middleware/pretty-json/index.js +1 -0
  52. package/node_modules/hono/dist/middleware/timing/timing.js +4 -3
  53. package/node_modules/hono/dist/types/helper/factory/index.d.ts +1 -1
  54. package/node_modules/hono/dist/types/helper/ssg/ssg.d.ts +6 -1
  55. package/node_modules/hono/dist/types/jsx/base.d.ts +4 -2
  56. package/node_modules/hono/dist/types/jsx/constants.d.ts +1 -0
  57. package/node_modules/hono/dist/types/jsx/jsx-runtime.d.ts +2 -1
  58. package/node_modules/hono/dist/types/utils/cookie.d.ts +1 -1
  59. package/node_modules/hono/dist/utils/cookie.js +2 -2
  60. package/node_modules/hono/dist/utils/mime.js +1 -1
  61. package/node_modules/hono/dist/utils/url.js +1 -1
  62. package/node_modules/hono/package.json +1 -1
  63. package/package.json +11 -11
  64. package/node_modules/@zuplo/runtime/out/esm/chunk-7RNZS3GX.js +0 -26
  65. package/node_modules/@zuplo/runtime/out/esm/chunk-7RNZS3GX.js.map +0 -1
  66. package/node_modules/@zuplo/runtime/out/esm/chunk-UFTMOJ7K.js +0 -37
  67. package/node_modules/@zuplo/runtime/out/esm/chunk-UGZSO3CK.js +0 -414
  68. package/node_modules/@zuplo/runtime/out/esm/chunk-UGZSO3CK.js.map +0 -1
  69. /package/node_modules/@zuplo/runtime/out/esm/{chunk-UFTMOJ7K.js.LEGAL.txt → chunk-2HVCLUM4.js.LEGAL.txt} +0 -0
  70. /package/node_modules/@zuplo/runtime/out/esm/{chunk-C32OTSKW.js.map → chunk-6R2COTV6.js.map} +0 -0
  71. /package/node_modules/@zuplo/runtime/out/esm/{chunk-UGZSO3CK.js.LEGAL.txt → chunk-DB6LKZ36.js.LEGAL.txt} +0 -0
  72. /package/node_modules/@zuplo/runtime/out/esm/{chunk-AENEWA54.js.map → chunk-SNTU476S.js.map} +0 -0
@@ -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-UGZSO3CK.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-DB6LKZ36.js";import"../chunk-VP5Q3DEN.js";import{a as d}from"../chunk-PY52EHDX.js";import"../chunk-A3QGJZO7.js";import"../chunk-6R2COTV6.js";import"../chunk-UKQQD2JN.js";import{aa as i}from"../chunk-2HVCLUM4.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-6R2COTV6.js";import"../../chunk-UKQQD2JN.js";import"../../chunk-2HVCLUM4.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
@@ -4352,9 +4352,11 @@ declare interface CompatibilityFlags {
4352
4352
  * precompiled Ajv validators from the OpenAPI document, validated per the
4353
4353
  * dialect and OpenAPI version they declare (specs/mcp-tool-schemas.md), and
4354
4354
  * `prompts/list` also lists the arguments behind a prompt schema's `$ref`
4355
- * and `allOf`. `request-validation-inbound` validates with the same dialect,
4356
- * `format` and pattern rules, and keeps its parameter type coercion
4357
- * (specs/compat-improved-schema-validation.md).
4355
+ * and `allOf`. A tool set to `toolInputStyle: "flat"` whose input can't be
4356
+ * fully flattened fails the build instead of staying nested
4357
+ * (specs/mcp-flat-input.md FLAT-18). `request-validation-inbound` validates
4358
+ * with the same dialect, `format` and pattern rules, and keeps its parameter
4359
+ * type coercion (specs/compat-improved-schema-validation.md).
4358
4360
  *
4359
4361
  * @compatibilityDate 2026-11-06
4360
4362
  */
@@ -4433,10 +4435,11 @@ declare interface CompatibilityFlags {
4433
4435
  omitMcpFieldsNewerThanNegotiatedVersion: boolean;
4434
4436
  /**
4435
4437
  * Whether built-in policies treat an empty or whitespace-only value for an
4436
- * optional string option as if the option were left out.
4438
+ * optional string option as if the option were left out, and reject one for
4439
+ * a required string option.
4437
4440
  *
4438
4441
  * `$env(VAR)` with `VAR` defined but empty reaches a policy as `""`, so this
4439
- * decides what an empty environment variable does to an optional option.
4442
+ * decides what an empty environment variable does to a policy option.
4440
4443
  *
4441
4444
  * Before this flag: Many policies reject `""`. Some fail every request with
4442
4445
  * a `ConfigurationError` (for example `http-deprecation-outbound` `link`,
@@ -4451,11 +4454,18 @@ declare interface CompatibilityFlags {
4451
4454
  * current behavior. `BLANK_IS_NOT_UNSET` in
4452
4455
  * `policies/optional-string-options.spec.ts` lists them with the reason.
4453
4456
  *
4457
+ * A required string option that is empty or whitespace-only fails with a
4458
+ * `ConfigurationError` naming the option when the policy is created, instead
4459
+ * of being sent as a blank credential, host or header. Required options
4460
+ * where an empty value means something (`replace-string-outbound`
4461
+ * `replaceWith`, `set-body-inbound` `body`) are used as given.
4462
+ *
4454
4463
  * @compatibilityDate 2026-11-06
4455
4464
  */
4456
4465
  treatBlankOptionalStringOptionsAsUnset: boolean;
4457
4466
  /**
4458
- * Whether the MCP Gateway supports MCP protocol revision `2026-07-28`.
4467
+ * Whether the MCP Gateway and `mcpServerHandler` support MCP protocol
4468
+ * revision `2026-07-28`.
4459
4469
  *
4460
4470
  * MCP requests on `2025-11-25` and earlier get the same answers with or
4461
4471
  * without this flag, with one exception: an `initialize` reply the upstream
@@ -4472,11 +4482,24 @@ declare interface CompatibilityFlags {
4472
4482
  * reading it as `2026-07-28`. An upstream that answers only `server/discover`
4473
4483
  * is reported as unavailable, and a caller that hasn't connected the
4474
4484
  * upstream gets the `-32042` URL-elicitation error, which `2026-07-28`
4475
- * clients can't act on.
4485
+ * clients can't act on. `mcpServerHandler` refuses a `2026-07-28`
4486
+ * `MCP-Protocol-Version` header with HTTP 400 and `-32000`.
4476
4487
  *
4477
- * After this flag: The MCP Gateway handles `2026-07-28` requests as that
4478
- * revision requires:
4488
+ * After this flag: The MCP Gateway and `mcpServerHandler` handle
4489
+ * `2026-07-28` requests as that revision requires:
4479
4490
  *
4491
+ * - `mcpServerHandler` serves a `2026-07-28` request: `server/discover`,
4492
+ * the per-request `_meta` envelope and its validation (`-32602`,
4493
+ * `-32020`, `-32022`), including the required `MCP-Protocol-Version`,
4494
+ * `Mcp-Method` and `Mcp-Name` headers,
4495
+ * HTTP `404` with `-32601` for the methods `2026-07-28` removed
4496
+ * (`initialize`, `ping`, `logging/setLevel`, `resources/subscribe`,
4497
+ * `resources/unsubscribe`), and `resultType`, `serverInfo` and
4498
+ * `ttlMs: 0` / `cacheScope: "private"` on its results. An unknown tool,
4499
+ * prompt or resource gets the MCP SDK's not-found error. The era comes
4500
+ * from the body, so a request that names `2026-07-28` only in
4501
+ * `params._meta`, with no header, gets HTTP `400` with `-32020`. The MCP
4502
+ * capability filter answers a hidden target with the same checks first.
4480
4503
  * - Upstream readiness falls back to `server/discover` when `initialize` is
4481
4504
  * refused with a JSON-RPC error.
4482
4505
  * - `server/discover` gets the configured icon fallback, and the gateway
@@ -4488,10 +4511,18 @@ declare interface CompatibilityFlags {
4488
4511
  * other event is relayed unchanged, and the stream is not buffered.
4489
4512
  * - A caller that hasn't connected the upstream gets an `input_required`
4490
4513
  * 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.
4514
+ * didn't declare URL elicitation), not `-32042`. Any other method, the
4515
+ * list methods included, gets `-32603` with the connect link in
4516
+ * `data.connectRequired`. Before the gateway answers such a request
4517
+ * itself, it refuses one a `2026-07-28` server would refuse (`-32602`,
4518
+ * `-32020` or `-32022`, HTTP 400), a request without a required
4519
+ * `MCP-Protocol-Version`, `Mcp-Method` or `Mcp-Name` header included, and
4520
+ * it accepts a notification with `202` and no body. Its own
4521
+ * `server/discover` answer lists `2026-07-28` and the 2025-era versions
4522
+ * the route relays through `initialize`.
4523
+ * - A retry's `requestState` with the gateway's `zuplo-connect.` prefix
4524
+ * that doesn't verify under this deployment's key (another Zuplo
4525
+ * gateway's, behind this one) is passed to the upstream, not refused.
4495
4526
  * - The capability filter checks the `Mcp-Method` and `Mcp-Name` headers
4496
4527
  * against the body (`-32020`), answers an unknown method spelling with
4497
4528
  * HTTP `404`, marks lists and `resources/read` results on routes with
@@ -4548,6 +4579,97 @@ declare interface CompatibilityFlags {
4548
4579
  * @compatibilityDate 2026-11-06
4549
4580
  */
4550
4581
  rejectInvalidMcpResourceUris: boolean;
4582
+ /**
4583
+ * Whether the MCP Gateway follows the MCP transport, elicitation and
4584
+ * authorization rules for the answers it builds itself on `2025-11-25` and
4585
+ * earlier requests, and in its upstream readiness check.
4586
+ *
4587
+ * Before this flag:
4588
+ *
4589
+ * - A caller that hasn't connected the upstream gets a JSON-RPC error with
4590
+ * HTTP 200 for every message: `-32042` with a URL-mode elicitation when
4591
+ * the gateway has a connect URL, `-32600` when it doesn't. That includes
4592
+ * a notification or a JSON-RPC response (answered with an error that has
4593
+ * no `id`), an `initialize`, a client that never declared URL-mode
4594
+ * elicitation, and a client on a protocol version before `2025-11-25`,
4595
+ * which has no URL mode.
4596
+ * - When the upstream still answers 401 after the gateway refreshed its
4597
+ * credential (or the gateway could not retry), and when it answers 403
4598
+ * with a `WWW-Authenticate` challenge, the client gets the upstream's
4599
+ * response, `WWW-Authenticate` included. The challenge points at the
4600
+ * upstream's authorization server, and the client reads the 401 as its
4601
+ * own gateway token failing.
4602
+ * - The readiness check ends the upstream session it opened with
4603
+ * `MCP-Protocol-Version: 2025-11-25`, whatever version the upstream
4604
+ * negotiated.
4605
+ *
4606
+ * After this flag:
4607
+ *
4608
+ * - A request from a caller that hasn't connected the upstream is first
4609
+ * checked as `mcpServerHandler` checks it: a body that is not JSON (an
4610
+ * empty one included) gets HTTP `400` `-32700`, a message that is not
4611
+ * valid JSON-RPC `400` `-32600`, an `initialize` batched with other
4612
+ * messages `400` `-32600`, and an `MCP-Protocol-Version` the route does
4613
+ * not serve `400` `-32000` (a missing header is allowed; the route
4614
+ * serves its upstream's versions once the gateway has learned them). A
4615
+ * batch on `2025-06-18` or later is refused whole with `400` `-32600`.
4616
+ * - A valid notification or JSON-RPC response is accepted with `202` and
4617
+ * no body, and dropped. `ping` gets an empty result. A `2025-03-26`
4618
+ * batch is answered per member.
4619
+ * - The `-32042` URL-elicitation error is sent only to an `initialize` that
4620
+ * names `2025-11-25` (and not `2026-07-28` or later) and declares
4621
+ * `capabilities.elicitation.url`: the gateway keeps no session, so it
4622
+ * cannot know what a later request's client declared. Every other
4623
+ * connect-required answer is `-32603` with the connect link in
4624
+ * `data.connectRequired`, never `-32600`.
4625
+ * - On a request the token exchange policy sent with the gateway's own
4626
+ * upstream credential, an upstream 401 the refresh did not fix, or an
4627
+ * upstream 403 with a `WWW-Authenticate` challenge, is answered by the
4628
+ * gateway with JSON-RPC `-32603` (`data.upstreamStatus`) and no
4629
+ * `WWW-Authenticate`; a message without a request gets HTTP `502` with
4630
+ * the error and no id. A route without the policy relays the challenge.
4631
+ * - The readiness check ends the session with the version the upstream
4632
+ * negotiated in its `initialize` result.
4633
+ * - The MCP capability filter answers a 2025-era request for a hidden
4634
+ * target as `mcpServerHandler` answers an absent one: its `406`, `415`,
4635
+ * invalid-message and batched-`initialize` `400`s and unsupported-version
4636
+ * `400` first, then a mistyped `arguments` `-32602`, then the not-found.
4637
+ * - On a `2026-07-28` request (with `mcpProtocolVersion20260728`), a method
4638
+ * 2026-07-28 removed (`ping`, `logging/setLevel`, …) gets `404`
4639
+ * `-32601` from the gateway instead of the connect-required error.
4640
+ *
4641
+ * @compatibilityDate 2026-11-06
4642
+ */
4643
+ mcpGatewaySpecCompliance: boolean;
4644
+ /**
4645
+ * Whether the MCP server handler checks the results and requests that MCP
4646
+ * 2025-11-25 constrains and the handler did not check.
4647
+ *
4648
+ * Before this flag:
4649
+ *
4650
+ * - `prompts/get` returns the prompt route's messages as the route sent
4651
+ * them, so a `role` other than `user` or `assistant` (such as
4652
+ * `"system"`) or an invalid content block reaches the client.
4653
+ * - A JSON-RPC batch (allowed on `2025-03-26` and earlier) whose answer has
4654
+ * one response gets that response as a bare object, not an array.
4655
+ * - A tool from the deprecated `options.files` whose `x-zuplo-mcp-tool`
4656
+ * name is blank is registered with the name `""`.
4657
+ *
4658
+ * After this flag:
4659
+ *
4660
+ * - `prompts/get` answers JSON-RPC `-32603` naming the prompt and the first
4661
+ * invalid message when a message's `role` is not `user` or `assistant`,
4662
+ * or its `content` is not a content block the request's protocol version
4663
+ * defines (`audio` from `2025-03-26`, `resource_link` from `2025-06-18`).
4664
+ * A prompt message's `annotations.lastModified` may be any string, as
4665
+ * every revision's schema types it.
4666
+ * - Every answer to a batch is an array.
4667
+ * - A blank tool name falls back to the operationId, as on every other
4668
+ * path.
4669
+ *
4670
+ * @compatibilityDate 2026-11-06
4671
+ */
4672
+ mcpServerSpecCompliance: boolean;
4551
4673
  }
4552
4674
 
4553
4675
  declare interface CompletionsFallbacks {
@@ -223,9 +223,11 @@ declare interface CompatibilityFlags {
223
223
  * precompiled Ajv validators from the OpenAPI document, validated per the
224
224
  * dialect and OpenAPI version they declare (specs/mcp-tool-schemas.md), and
225
225
  * `prompts/list` also lists the arguments behind a prompt schema's `$ref`
226
- * and `allOf`. `request-validation-inbound` validates with the same dialect,
227
- * `format` and pattern rules, and keeps its parameter type coercion
228
- * (specs/compat-improved-schema-validation.md).
226
+ * and `allOf`. A tool set to `toolInputStyle: "flat"` whose input can't be
227
+ * fully flattened fails the build instead of staying nested
228
+ * (specs/mcp-flat-input.md FLAT-18). `request-validation-inbound` validates
229
+ * with the same dialect, `format` and pattern rules, and keeps its parameter
230
+ * type coercion (specs/compat-improved-schema-validation.md).
229
231
  *
230
232
  * @compatibilityDate 2026-11-06
231
233
  */
@@ -304,10 +306,11 @@ declare interface CompatibilityFlags {
304
306
  omitMcpFieldsNewerThanNegotiatedVersion: boolean;
305
307
  /**
306
308
  * Whether built-in policies treat an empty or whitespace-only value for an
307
- * optional string option as if the option were left out.
309
+ * optional string option as if the option were left out, and reject one for
310
+ * a required string option.
308
311
  *
309
312
  * `$env(VAR)` with `VAR` defined but empty reaches a policy as `""`, so this
310
- * decides what an empty environment variable does to an optional option.
313
+ * decides what an empty environment variable does to a policy option.
311
314
  *
312
315
  * Before this flag: Many policies reject `""`. Some fail every request with
313
316
  * a `ConfigurationError` (for example `http-deprecation-outbound` `link`,
@@ -322,11 +325,18 @@ declare interface CompatibilityFlags {
322
325
  * current behavior. `BLANK_IS_NOT_UNSET` in
323
326
  * `policies/optional-string-options.spec.ts` lists them with the reason.
324
327
  *
328
+ * A required string option that is empty or whitespace-only fails with a
329
+ * `ConfigurationError` naming the option when the policy is created, instead
330
+ * of being sent as a blank credential, host or header. Required options
331
+ * where an empty value means something (`replace-string-outbound`
332
+ * `replaceWith`, `set-body-inbound` `body`) are used as given.
333
+ *
325
334
  * @compatibilityDate 2026-11-06
326
335
  */
327
336
  treatBlankOptionalStringOptionsAsUnset: boolean;
328
337
  /**
329
- * Whether the MCP Gateway supports MCP protocol revision `2026-07-28`.
338
+ * Whether the MCP Gateway and `mcpServerHandler` support MCP protocol
339
+ * revision `2026-07-28`.
330
340
  *
331
341
  * MCP requests on `2025-11-25` and earlier get the same answers with or
332
342
  * without this flag, with one exception: an `initialize` reply the upstream
@@ -343,11 +353,24 @@ declare interface CompatibilityFlags {
343
353
  * reading it as `2026-07-28`. An upstream that answers only `server/discover`
344
354
  * is reported as unavailable, and a caller that hasn't connected the
345
355
  * 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
- *
356
+ * clients can't act on. `mcpServerHandler` refuses a `2026-07-28`
357
+ * `MCP-Protocol-Version` header with HTTP 400 and `-32000`.
358
+ *
359
+ * After this flag: The MCP Gateway and `mcpServerHandler` handle
360
+ * `2026-07-28` requests as that revision requires:
361
+ *
362
+ * - `mcpServerHandler` serves a `2026-07-28` request: `server/discover`,
363
+ * the per-request `_meta` envelope and its validation (`-32602`,
364
+ * `-32020`, `-32022`), including the required `MCP-Protocol-Version`,
365
+ * `Mcp-Method` and `Mcp-Name` headers,
366
+ * HTTP `404` with `-32601` for the methods `2026-07-28` removed
367
+ * (`initialize`, `ping`, `logging/setLevel`, `resources/subscribe`,
368
+ * `resources/unsubscribe`), and `resultType`, `serverInfo` and
369
+ * `ttlMs: 0` / `cacheScope: "private"` on its results. An unknown tool,
370
+ * prompt or resource gets the MCP SDK's not-found error. The era comes
371
+ * from the body, so a request that names `2026-07-28` only in
372
+ * `params._meta`, with no header, gets HTTP `400` with `-32020`. The MCP
373
+ * capability filter answers a hidden target with the same checks first.
351
374
  * - Upstream readiness falls back to `server/discover` when `initialize` is
352
375
  * refused with a JSON-RPC error.
353
376
  * - `server/discover` gets the configured icon fallback, and the gateway
@@ -359,10 +382,18 @@ declare interface CompatibilityFlags {
359
382
  * other event is relayed unchanged, and the stream is not buffered.
360
383
  * - A caller that hasn't connected the upstream gets an `input_required`
361
384
  * 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.
385
+ * didn't declare URL elicitation), not `-32042`. Any other method, the
386
+ * list methods included, gets `-32603` with the connect link in
387
+ * `data.connectRequired`. Before the gateway answers such a request
388
+ * itself, it refuses one a `2026-07-28` server would refuse (`-32602`,
389
+ * `-32020` or `-32022`, HTTP 400), a request without a required
390
+ * `MCP-Protocol-Version`, `Mcp-Method` or `Mcp-Name` header included, and
391
+ * it accepts a notification with `202` and no body. Its own
392
+ * `server/discover` answer lists `2026-07-28` and the 2025-era versions
393
+ * the route relays through `initialize`.
394
+ * - A retry's `requestState` with the gateway's `zuplo-connect.` prefix
395
+ * that doesn't verify under this deployment's key (another Zuplo
396
+ * gateway's, behind this one) is passed to the upstream, not refused.
366
397
  * - The capability filter checks the `Mcp-Method` and `Mcp-Name` headers
367
398
  * against the body (`-32020`), answers an unknown method spelling with
368
399
  * HTTP `404`, marks lists and `resources/read` results on routes with
@@ -419,6 +450,97 @@ declare interface CompatibilityFlags {
419
450
  * @compatibilityDate 2026-11-06
420
451
  */
421
452
  rejectInvalidMcpResourceUris: boolean;
453
+ /**
454
+ * Whether the MCP Gateway follows the MCP transport, elicitation and
455
+ * authorization rules for the answers it builds itself on `2025-11-25` and
456
+ * earlier requests, and in its upstream readiness check.
457
+ *
458
+ * Before this flag:
459
+ *
460
+ * - A caller that hasn't connected the upstream gets a JSON-RPC error with
461
+ * HTTP 200 for every message: `-32042` with a URL-mode elicitation when
462
+ * the gateway has a connect URL, `-32600` when it doesn't. That includes
463
+ * a notification or a JSON-RPC response (answered with an error that has
464
+ * no `id`), an `initialize`, a client that never declared URL-mode
465
+ * elicitation, and a client on a protocol version before `2025-11-25`,
466
+ * which has no URL mode.
467
+ * - When the upstream still answers 401 after the gateway refreshed its
468
+ * credential (or the gateway could not retry), and when it answers 403
469
+ * with a `WWW-Authenticate` challenge, the client gets the upstream's
470
+ * response, `WWW-Authenticate` included. The challenge points at the
471
+ * upstream's authorization server, and the client reads the 401 as its
472
+ * own gateway token failing.
473
+ * - The readiness check ends the upstream session it opened with
474
+ * `MCP-Protocol-Version: 2025-11-25`, whatever version the upstream
475
+ * negotiated.
476
+ *
477
+ * After this flag:
478
+ *
479
+ * - A request from a caller that hasn't connected the upstream is first
480
+ * checked as `mcpServerHandler` checks it: a body that is not JSON (an
481
+ * empty one included) gets HTTP `400` `-32700`, a message that is not
482
+ * valid JSON-RPC `400` `-32600`, an `initialize` batched with other
483
+ * messages `400` `-32600`, and an `MCP-Protocol-Version` the route does
484
+ * not serve `400` `-32000` (a missing header is allowed; the route
485
+ * serves its upstream's versions once the gateway has learned them). A
486
+ * batch on `2025-06-18` or later is refused whole with `400` `-32600`.
487
+ * - A valid notification or JSON-RPC response is accepted with `202` and
488
+ * no body, and dropped. `ping` gets an empty result. A `2025-03-26`
489
+ * batch is answered per member.
490
+ * - The `-32042` URL-elicitation error is sent only to an `initialize` that
491
+ * names `2025-11-25` (and not `2026-07-28` or later) and declares
492
+ * `capabilities.elicitation.url`: the gateway keeps no session, so it
493
+ * cannot know what a later request's client declared. Every other
494
+ * connect-required answer is `-32603` with the connect link in
495
+ * `data.connectRequired`, never `-32600`.
496
+ * - On a request the token exchange policy sent with the gateway's own
497
+ * upstream credential, an upstream 401 the refresh did not fix, or an
498
+ * upstream 403 with a `WWW-Authenticate` challenge, is answered by the
499
+ * gateway with JSON-RPC `-32603` (`data.upstreamStatus`) and no
500
+ * `WWW-Authenticate`; a message without a request gets HTTP `502` with
501
+ * the error and no id. A route without the policy relays the challenge.
502
+ * - The readiness check ends the session with the version the upstream
503
+ * negotiated in its `initialize` result.
504
+ * - The MCP capability filter answers a 2025-era request for a hidden
505
+ * target as `mcpServerHandler` answers an absent one: its `406`, `415`,
506
+ * invalid-message and batched-`initialize` `400`s and unsupported-version
507
+ * `400` first, then a mistyped `arguments` `-32602`, then the not-found.
508
+ * - On a `2026-07-28` request (with `mcpProtocolVersion20260728`), a method
509
+ * 2026-07-28 removed (`ping`, `logging/setLevel`, …) gets `404`
510
+ * `-32601` from the gateway instead of the connect-required error.
511
+ *
512
+ * @compatibilityDate 2026-11-06
513
+ */
514
+ mcpGatewaySpecCompliance: boolean;
515
+ /**
516
+ * Whether the MCP server handler checks the results and requests that MCP
517
+ * 2025-11-25 constrains and the handler did not check.
518
+ *
519
+ * Before this flag:
520
+ *
521
+ * - `prompts/get` returns the prompt route's messages as the route sent
522
+ * them, so a `role` other than `user` or `assistant` (such as
523
+ * `"system"`) or an invalid content block reaches the client.
524
+ * - A JSON-RPC batch (allowed on `2025-03-26` and earlier) whose answer has
525
+ * one response gets that response as a bare object, not an array.
526
+ * - A tool from the deprecated `options.files` whose `x-zuplo-mcp-tool`
527
+ * name is blank is registered with the name `""`.
528
+ *
529
+ * After this flag:
530
+ *
531
+ * - `prompts/get` answers JSON-RPC `-32603` naming the prompt and the first
532
+ * invalid message when a message's `role` is not `user` or `assistant`,
533
+ * or its `content` is not a content block the request's protocol version
534
+ * defines (`audio` from `2025-03-26`, `resource_link` from `2025-06-18`).
535
+ * A prompt message's `annotations.lastModified` may be any string, as
536
+ * every revision's schema types it.
537
+ * - Every answer to a batch is an array.
538
+ * - A blank tool name falls back to the operationId, as on every other
539
+ * path.
540
+ *
541
+ * @compatibilityDate 2026-11-06
542
+ */
543
+ mcpServerSpecCompliance: boolean;
422
544
  }
423
545
 
424
546
  /**
@@ -2925,6 +2925,46 @@ export declare function McpProxyHandler(
2925
2925
  context: ZuploContext
2926
2926
  ): Promise<Response>;
2927
2927
 
2928
+ /**
2929
+ * OpenTelemetry options for the MCP Gateway's `McpProxyHandler`, set under
2930
+ * `telemetry` in the route's handler options. The same options as the MCP
2931
+ * Server handler's `telemetry`.
2932
+ */
2933
+ export declare interface McpProxyHandlerTelemetryOptions {
2934
+ /**
2935
+ * Record tool call content on the MCP SERVER and CLIENT spans of a
2936
+ * forwarded `tools/call`: the arguments the client sent as
2937
+ * `gen_ai.tool.call.arguments` and, when the upstream returns a result
2938
+ * without `isError: true`, that result as `gen_ai.tool.call.result`. Both
2939
+ * are JSON strings capped at 8192 UTF-16 code units.
2940
+ *
2941
+ * Off by default. Tool arguments and results often contain personal or
2942
+ * otherwise sensitive data, and enabling this sends them to your telemetry
2943
+ * backend.
2944
+ *
2945
+ * The gateway records content only for a `tools/call` it forwards upstream.
2946
+ * A call a gateway policy answers itself (for example, by asking the client
2947
+ * to connect the upstream) records neither attribute. A result is recorded
2948
+ * when the JSON response, or the SSE event that carries it, is 1 MiB or
2949
+ * less; a larger result is forwarded to the client but not recorded.
2950
+ *
2951
+ * @example
2952
+ * ```json
2953
+ * {
2954
+ * "handler": {
2955
+ * "export": "McpProxyHandler",
2956
+ * "module": "$import(@zuplo/runtime/mcp-gateway)",
2957
+ * "options": {
2958
+ * "rewritePattern": "https://mcp.example.com/mcp",
2959
+ * "telemetry": { "captureToolCallContent": true }
2960
+ * }
2961
+ * }
2962
+ * }
2963
+ * ```
2964
+ */
2965
+ captureToolCallContent?: boolean;
2966
+ }
2967
+
2928
2968
  /**
2929
2969
  * Resolve a gateway-managed upstream MCP credential and apply it to the
2930
2970
  * request before the normal Zuplo route handler forwards the request.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "7.14.5",
4
+ "version": "7.14.8",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
@@ -199,7 +199,7 @@ var EventV2Processor = class extends EventProcessor {
199
199
  const headers = new Headers();
200
200
  this.getCookies(event, headers);
201
201
  if (event.headers) {
202
- for (const [k, v] of Object.entries(event.headers)) if (v) headers.set(k, v);
202
+ for (const [k, v] of Object.entries(event.headers)) if (v) headers.set(k, sanitizeHeaderValue(v));
203
203
  }
204
204
  return headers;
205
205
  }
@@ -200,7 +200,7 @@ var EventV2Processor = class extends EventProcessor {
200
200
  const headers = new Headers();
201
201
  this.getCookies(event, headers);
202
202
  if (event.headers) {
203
- for (const [k, v] of Object.entries(event.headers)) if (v) headers.set(k, v);
203
+ for (const [k, v] of Object.entries(event.headers)) if (v) headers.set(k, sanitizeHeaderValue(v));
204
204
  }
205
205
  return headers;
206
206
  }
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_middleware_serve_static_index = require("../../middleware/serve-static/index.js");
3
- let node_path = require("node:path");
4
3
  let node_fs_promises = require("node:fs/promises");
4
+ let node_path = require("node:path");
5
5
  //#region src/adapter/bun/serve-static.ts
6
6
  /**
7
7
  * @deprecated `hono/bun` will be removed in v5. Install `@hono/bun` and import from there instead.
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_helper_websocket_index = require("../../helper/websocket/index.js");
3
2
  const require_adapter_bun_server = require("./server.js");
3
+ const require_helper_websocket_index = require("../../helper/websocket/index.js");
4
4
  //#region src/adapter/bun/websocket.ts
5
5
  /**
6
6
  * @internal
@@ -58,7 +58,7 @@ const jsonRegex = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(?:;.+)?$/i;
58
58
  function detectResponseType(response) {
59
59
  const _contentType = response.headers.get("content-type");
60
60
  if (!_contentType) return "text";
61
- const contentType = _contentType.split(";").shift();
61
+ const contentType = _contentType.split(";").shift().trim();
62
62
  if (jsonRegex.test(contentType)) return "json";
63
63
  return "text";
64
64
  }
@@ -20,12 +20,13 @@ const getSpecificity = (type) => {
20
20
  };
21
21
  const defaultMatch = (accepts, config) => {
22
22
  const { supports, default: defaultSupport } = config;
23
+ const exactTypes = new Set(accepts.filter((accept) => getSpecificity(accept.type) === 3).map((accept) => accept.type.toLowerCase()));
23
24
  const sortedAccepts = accepts.filter((accept) => accept.q > 0).sort((a, b) => {
24
25
  if (b.q !== a.q) return b.q - a.q;
25
26
  return getSpecificity(b.type) - getSpecificity(a.type);
26
27
  });
27
28
  for (const accept of sortedAccepts) {
28
- const matched = supports.find((supported) => matchType(accept.type, supported));
29
+ const matched = supports.find((supported) => matchType(accept.type, supported) && (getSpecificity(accept.type) !== 2 || !exactTypes.has(supported.toLowerCase())));
29
30
  if (matched) return matched;
30
31
  }
31
32
  return defaultSupport;
@@ -39,6 +39,8 @@ const defaultExtensionMap = {
39
39
  const determineExtension = (mimeType, userExtensionMap) => {
40
40
  const extensionMap = userExtensionMap || defaultExtensionMap;
41
41
  if (mimeType in extensionMap) return extensionMap[mimeType];
42
+ const lowerCasedMimeType = mimeType.toLowerCase();
43
+ if (lowerCasedMimeType in extensionMap) return extensionMap[lowerCasedMimeType];
42
44
  return require_utils_mime.getExtension(mimeType) || "html";
43
45
  };
44
46
  const combineBeforeRequestHooks = (hooks) => {
@@ -142,8 +144,7 @@ const fetchRoutesContent = function* (app, beforeRequestHook, afterResponseHook,
142
144
  * `saveContentToFile` is an experimental feature.
143
145
  * The API might be changed.
144
146
  */
145
- const createdDirs = /* @__PURE__ */ new Set();
146
- const saveContentToFile = async (data, fsModule, outDir, extensionMap) => {
147
+ const saveContentToFile = async (data, fsModule, outDir, extensionMap, createdDirs = /* @__PURE__ */ new Set()) => {
147
148
  const awaitedData = await data;
148
149
  if (!awaitedData) return;
149
150
  const { routePath, content, mimeType } = awaitedData;
@@ -183,10 +184,11 @@ const toSSG = async (app, fs, options) => {
183
184
  const concurrency = options?.concurrency ?? DEFAULT_CONCURRENCY;
184
185
  const combinedBeforeRequestHook = combineBeforeRequestHooks(beforeRequestHooks.length > 0 ? beforeRequestHooks : [(req) => req]);
185
186
  const combinedAfterResponseHook = combineAfterResponseHooks(afterResponseHooks.length > 0 ? afterResponseHooks : [(req) => req]);
187
+ const createdDirs = /* @__PURE__ */ new Set();
186
188
  const getInfoGen = fetchRoutesContent(app, combinedBeforeRequestHook, combinedAfterResponseHook, concurrency);
187
189
  for (const getInfo of getInfoGen) getInfoPromises.push(getInfo.then((getContentGen) => {
188
190
  if (!getContentGen) return;
189
- for (const content of getContentGen) savePromises.push(saveContentToFile(content, fs, outputDir, options?.extensionMap).catch((e) => e));
191
+ for (const content of getContentGen) savePromises.push(saveContentToFile(content, fs, outputDir, options?.extensionMap, createdDirs).catch((e) => e));
190
192
  }));
191
193
  await Promise.all(getInfoPromises);
192
194
  const files = [];