@zuplo/runtime 7.14.0 → 7.14.2
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-7RNZS3GX.js +26 -0
- package/out/esm/chunk-7RNZS3GX.js.map +1 -0
- package/out/esm/chunk-AENEWA54.js +26 -0
- package/out/esm/chunk-AENEWA54.js.map +1 -0
- package/out/esm/chunk-C32OTSKW.js +91 -0
- package/out/esm/chunk-C32OTSKW.js.map +1 -0
- package/out/esm/chunk-MUDGPSWL.js +414 -0
- package/out/esm/chunk-MUDGPSWL.js.map +1 -0
- package/out/esm/chunk-UFTMOJ7K.js +37 -0
- package/out/esm/chunk-UFTMOJ7K.js.map +1 -0
- package/out/esm/index.js +1 -1
- package/out/esm/index.js.map +1 -1
- package/out/esm/mcp/messages/index.js +1 -1
- package/out/esm/mcp-gateway/index.js +12 -12
- package/out/esm/mcp-gateway/index.js.map +1 -1
- package/out/esm/mocks/index.js +1 -1
- package/out/esm/mocks/index.js.map +1 -1
- package/out/esm/sdks/aws/index.js +1 -1
- package/out/esm/sdks/aws/index.js.map +1 -1
- package/out/types/index.d.ts +120 -0
- package/out/types/internal/index.d.ts +64 -0
- package/out/types/mcp/messages/index.d.ts +78 -0
- package/out/types/mcp-gateway/index.d.ts +3 -2
- package/package.json +1 -1
- package/out/esm/chunk-4SVXBKXH.js +0 -414
- package/out/esm/chunk-4SVXBKXH.js.map +0 -1
- package/out/esm/chunk-7FFIW3HF.js +0 -26
- package/out/esm/chunk-7FFIW3HF.js.map +0 -1
- package/out/esm/chunk-QGAJTUPE.js +0 -26
- package/out/esm/chunk-QGAJTUPE.js.map +0 -1
- package/out/esm/chunk-WUZE2HKB.js +0 -102
- package/out/esm/chunk-WUZE2HKB.js.map +0 -1
- /package/out/esm/{chunk-4SVXBKXH.js.LEGAL.txt → chunk-MUDGPSWL.js.LEGAL.txt} +0 -0
- /package/out/esm/{chunk-WUZE2HKB.js.LEGAL.txt → chunk-UFTMOJ7K.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,
|
|
25
|
+
import{G as p,M as c,Q as u}from"../chunk-MUDGPSWL.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};
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@zuplo/runtime/mocks/context.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["@zuplo/runtime/mocks/context.ts"],"mappings":"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","names":["createMockContext","options","waitUntilPromises","waitUntil","promise","__name","MockZuploContext","DEFAULT_ROUTE_CONFIG","#event","#originalRequest","event","route","parentContext","originalRequest","internals_default","ZuploGatewayAnalyticsContext","policyName","request","response","input","init","hook","handler","ext","ZuploContextExtensions","ZuploRequest","registerPreRequestHandler","entry","type","wrapped","e","err"]}
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
* DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*--------------------------------------------------------------------------------------------*/
|
|
24
24
|
|
|
25
|
-
import{
|
|
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};
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@zuplo/runtime/sdks/aws/sign.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["@zuplo/runtime/sdks/aws/sign.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;kMAiDA,eAAsBA,EACpBC,EACAC,EACkB,CAClB,IAAMC,EACJ,OAAOD,EAAQ,aAAgB,WAC3B,MAAMA,EAAQ,YAAY,EAC1BA,EAAQ,YAERE,EAASH,EAAQ,OAEjBI,EADUD,IAAW,OAASA,IAAW,QAAUH,EAAQ,MAAQ,KAClD,MAAMA,EAAQ,YAAY,EAAI,KAe/CK,EAAS,MAbA,IAAIC,EAAY,CAC7B,OAAAH,EACA,IAAKH,EAAQ,IACb,QAASA,EAAQ,QACjB,KAAAI,EACA,YAAaF,EAAY,YACzB,gBAAiBA,EAAY,gBAC7B,aAAcA,EAAY,aAC1B,QAASD,EAAQ,QACjB,OAAQA,EAAQ,OAChB,UAAWA,EAAQ,SACrB,CAAC,EAE2B,KAAK,EAEjC,OAAO,IAAI,QAAQI,EAAO,IAAI,SAAS,EAAG,CACxC,OAAQA,EAAO,OACf,QAASA,EAAO,QAChB,KAAMA,EAAO,IACf,CAAC,CACH,CAjCsBE,EAAAR,EAAA","names":["signRequest","request","options","credentials","method","body","signed","AwsV4Signer","__name"]}
|
package/out/types/index.d.ts
CHANGED
|
@@ -4454,6 +4454,70 @@ declare interface CompatibilityFlags {
|
|
|
4454
4454
|
* @compatibilityDate 2026-11-06
|
|
4455
4455
|
*/
|
|
4456
4456
|
treatBlankOptionalStringOptionsAsUnset: boolean;
|
|
4457
|
+
/**
|
|
4458
|
+
* Whether the MCP Gateway supports MCP protocol revision `2026-07-28`.
|
|
4459
|
+
*
|
|
4460
|
+
* MCP requests on `2025-11-25` and earlier get the same answers with or
|
|
4461
|
+
* without this flag, with one exception: an `initialize` reply the upstream
|
|
4462
|
+
* sends as an SSE stream gets the configured icon fallback (see below).
|
|
4463
|
+
* Otherwise, per-request behavior changes only for a request that names
|
|
4464
|
+
* `2026-07-28` or a later dated revision (in the `MCP-Protocol-Version`
|
|
4465
|
+
* header or the `params._meta` envelope). Three changes have no
|
|
4466
|
+
* per-request version and apply to the whole project: upstream readiness,
|
|
4467
|
+
* RFC 9207 `iss` on the gateway's authorization server, and the capability
|
|
4468
|
+
* filter's handling of `subscriptions/listen`, a method only `2026-07-28`
|
|
4469
|
+
* defines.
|
|
4470
|
+
*
|
|
4471
|
+
* Before this flag: The MCP Gateway relays `2026-07-28` traffic without
|
|
4472
|
+
* reading it as `2026-07-28`. An upstream that answers only `server/discover`
|
|
4473
|
+
* is reported as unavailable, and a caller that hasn't connected the
|
|
4474
|
+
* upstream gets the `-32042` URL-elicitation error, which `2026-07-28`
|
|
4475
|
+
* clients can't act on.
|
|
4476
|
+
*
|
|
4477
|
+
* After this flag: The MCP Gateway handles `2026-07-28` requests as that
|
|
4478
|
+
* revision requires:
|
|
4479
|
+
*
|
|
4480
|
+
* - Upstream readiness falls back to `server/discover` when `initialize` is
|
|
4481
|
+
* refused with a JSON-RPC error.
|
|
4482
|
+
* - `server/discover` gets the configured icon fallback, and the gateway
|
|
4483
|
+
* answers it itself for a caller that hasn't connected the upstream.
|
|
4484
|
+
* - The configured icon fallback (`serverInfo.icons`) is also added to an
|
|
4485
|
+
* `initialize` or `server/discover` reply the upstream sends as an SSE
|
|
4486
|
+
* stream, not only to a JSON one. Only the JSON-RPC response to that
|
|
4487
|
+
* request changes, and only when its `serverInfo` has no icons; every
|
|
4488
|
+
* other event is relayed unchanged, and the stream is not buffered.
|
|
4489
|
+
* - A caller that hasn't connected the upstream gets an `input_required`
|
|
4490
|
+
* 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.
|
|
4495
|
+
* - The capability filter checks the `Mcp-Method` and `Mcp-Name` headers
|
|
4496
|
+
* against the body (`-32020`), answers an unknown method spelling with
|
|
4497
|
+
* HTTP `404`, marks lists and `resources/read` results on routes with
|
|
4498
|
+
* per-caller access control `cacheScope: "private"`, and answers a hidden
|
|
4499
|
+
* tool, prompt or resource with the MCP SDK's not-found error when the
|
|
4500
|
+
* `MCP-Protocol-Version` header names `2026-07-28`.
|
|
4501
|
+
* - The capability filter removes hidden URIs from every
|
|
4502
|
+
* `subscriptions/listen` and its notifications, and refuses a listen with
|
|
4503
|
+
* a respelled method or ambiguous keys.
|
|
4504
|
+
* - Long-lived streams: on `subscriptions/listen` the request timeout
|
|
4505
|
+
* bounds only the wait for response headers; every other request keeps
|
|
4506
|
+
* the timeout on the whole response. A client disconnect cancels the
|
|
4507
|
+
* upstream request.
|
|
4508
|
+
* - Authorization responses from the gateway's authorization server (the
|
|
4509
|
+
* code redirect, the `access_denied` redirect and error redirects) carry
|
|
4510
|
+
* the RFC 9207 `iss` parameter, and its authorization-server metadata
|
|
4511
|
+
* advertises `authorization_response_iss_parameter_supported: true`. An
|
|
4512
|
+
* MCP SDK client that validates `iss` then rejects a callback without it.
|
|
4513
|
+
* - On Cloudflare Workers (managed edge and `zuplo dev`), the flag also turns
|
|
4514
|
+
* on the Workers `enable_request_signal` compatibility flag. That makes
|
|
4515
|
+
* `request.signal` fire when the client disconnects, for all code in the
|
|
4516
|
+
* project, not only the MCP Gateway.
|
|
4517
|
+
*
|
|
4518
|
+
* @compatibilityDate 2026-11-06
|
|
4519
|
+
*/
|
|
4520
|
+
mcpProtocolVersion20260728: boolean;
|
|
4457
4521
|
/**
|
|
4458
4522
|
* Whether the MCP server handler answers `resources/read` with a JSON-RPC
|
|
4459
4523
|
* error when the resource's route answers an error status.
|
|
@@ -16665,6 +16729,62 @@ export declare class ZuploMcpSdk {
|
|
|
16665
16729
|
* @returns The MCP call tool request object or null if not found
|
|
16666
16730
|
*/
|
|
16667
16731
|
getRawCallToolRequest(): CallToolRequest | null;
|
|
16732
|
+
/**
|
|
16733
|
+
* The MCP session ID of the request being served: the `Mcp-Session-Id`
|
|
16734
|
+
* header the client sent, or undefined when it sent none.
|
|
16735
|
+
*
|
|
16736
|
+
* Works in tool, prompt and resource routes, including routes they invoke
|
|
16737
|
+
* in turn: it looks at this context and every `invokeRoute` ancestor.
|
|
16738
|
+
*
|
|
16739
|
+
* Undefined in a route invoked for a member of a JSON-RPC batch
|
|
16740
|
+
* (2025-03-26): the server reads request details only from a single
|
|
16741
|
+
* message.
|
|
16742
|
+
*
|
|
16743
|
+
* @beta
|
|
16744
|
+
* @returns The session ID, or undefined outside an MCP Server request
|
|
16745
|
+
*/
|
|
16746
|
+
getSessionId(): string | undefined;
|
|
16747
|
+
/**
|
|
16748
|
+
* The MCP protocol version of the request being served: the
|
|
16749
|
+
* `MCP-Protocol-Version` header, the 2026-07-28 `params._meta` version
|
|
16750
|
+
* envelope, the version the client requested on `initialize`, or
|
|
16751
|
+
* `"2025-03-26"` when none is present (the version the MCP specification
|
|
16752
|
+
* tells a server to assume without the header).
|
|
16753
|
+
*
|
|
16754
|
+
* Undefined in a route invoked for a member of a JSON-RPC batch
|
|
16755
|
+
* (2025-03-26): the server reads request details only from a single
|
|
16756
|
+
* message.
|
|
16757
|
+
*
|
|
16758
|
+
* @beta
|
|
16759
|
+
* @returns The protocol version, or undefined outside an MCP Server request
|
|
16760
|
+
*/
|
|
16761
|
+
getProtocolVersion(): string | undefined;
|
|
16762
|
+
/**
|
|
16763
|
+
* The `params._meta` object of the JSON-RPC request being served, for
|
|
16764
|
+
* example a client's progress token or vendor metadata. Trace context keys
|
|
16765
|
+
* (`traceparent`, `tracestate`, `baggage`) appear here as sent; the
|
|
16766
|
+
* gateway does not apply `baggage` to the route's outbound requests.
|
|
16767
|
+
*
|
|
16768
|
+
* Undefined in a route invoked for a member of a JSON-RPC batch
|
|
16769
|
+
* (2025-03-26): the server reads request details only from a single
|
|
16770
|
+
* message.
|
|
16771
|
+
*
|
|
16772
|
+
* @beta
|
|
16773
|
+
* @returns The `_meta` object, or undefined when the request has none
|
|
16774
|
+
*/
|
|
16775
|
+
getRequestMeta(): Record<string, unknown> | undefined;
|
|
16776
|
+
/**
|
|
16777
|
+
* The JSON-RPC `id` of the request being served.
|
|
16778
|
+
*
|
|
16779
|
+
* Undefined in a route invoked for a member of a JSON-RPC batch
|
|
16780
|
+
* (2025-03-26): the server reads request details only from a single
|
|
16781
|
+
* message.
|
|
16782
|
+
*
|
|
16783
|
+
* @beta
|
|
16784
|
+
* @returns The id, or undefined for a notification or outside an MCP
|
|
16785
|
+
* Server request
|
|
16786
|
+
*/
|
|
16787
|
+
getJsonRpcId(): string | number | undefined;
|
|
16668
16788
|
/**
|
|
16669
16789
|
* Overrides fields of the MCP tool result the gateway is about to send.
|
|
16670
16790
|
*
|
|
@@ -325,6 +325,70 @@ declare interface CompatibilityFlags {
|
|
|
325
325
|
* @compatibilityDate 2026-11-06
|
|
326
326
|
*/
|
|
327
327
|
treatBlankOptionalStringOptionsAsUnset: boolean;
|
|
328
|
+
/**
|
|
329
|
+
* Whether the MCP Gateway supports MCP protocol revision `2026-07-28`.
|
|
330
|
+
*
|
|
331
|
+
* MCP requests on `2025-11-25` and earlier get the same answers with or
|
|
332
|
+
* without this flag, with one exception: an `initialize` reply the upstream
|
|
333
|
+
* sends as an SSE stream gets the configured icon fallback (see below).
|
|
334
|
+
* Otherwise, per-request behavior changes only for a request that names
|
|
335
|
+
* `2026-07-28` or a later dated revision (in the `MCP-Protocol-Version`
|
|
336
|
+
* header or the `params._meta` envelope). Three changes have no
|
|
337
|
+
* per-request version and apply to the whole project: upstream readiness,
|
|
338
|
+
* RFC 9207 `iss` on the gateway's authorization server, and the capability
|
|
339
|
+
* filter's handling of `subscriptions/listen`, a method only `2026-07-28`
|
|
340
|
+
* defines.
|
|
341
|
+
*
|
|
342
|
+
* Before this flag: The MCP Gateway relays `2026-07-28` traffic without
|
|
343
|
+
* reading it as `2026-07-28`. An upstream that answers only `server/discover`
|
|
344
|
+
* is reported as unavailable, and a caller that hasn't connected the
|
|
345
|
+
* 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
|
+
*
|
|
351
|
+
* - Upstream readiness falls back to `server/discover` when `initialize` is
|
|
352
|
+
* refused with a JSON-RPC error.
|
|
353
|
+
* - `server/discover` gets the configured icon fallback, and the gateway
|
|
354
|
+
* answers it itself for a caller that hasn't connected the upstream.
|
|
355
|
+
* - The configured icon fallback (`serverInfo.icons`) is also added to an
|
|
356
|
+
* `initialize` or `server/discover` reply the upstream sends as an SSE
|
|
357
|
+
* stream, not only to a JSON one. Only the JSON-RPC response to that
|
|
358
|
+
* request changes, and only when its `serverInfo` has no icons; every
|
|
359
|
+
* other event is relayed unchanged, and the stream is not buffered.
|
|
360
|
+
* - A caller that hasn't connected the upstream gets an `input_required`
|
|
361
|
+
* 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.
|
|
366
|
+
* - The capability filter checks the `Mcp-Method` and `Mcp-Name` headers
|
|
367
|
+
* against the body (`-32020`), answers an unknown method spelling with
|
|
368
|
+
* HTTP `404`, marks lists and `resources/read` results on routes with
|
|
369
|
+
* per-caller access control `cacheScope: "private"`, and answers a hidden
|
|
370
|
+
* tool, prompt or resource with the MCP SDK's not-found error when the
|
|
371
|
+
* `MCP-Protocol-Version` header names `2026-07-28`.
|
|
372
|
+
* - The capability filter removes hidden URIs from every
|
|
373
|
+
* `subscriptions/listen` and its notifications, and refuses a listen with
|
|
374
|
+
* a respelled method or ambiguous keys.
|
|
375
|
+
* - Long-lived streams: on `subscriptions/listen` the request timeout
|
|
376
|
+
* bounds only the wait for response headers; every other request keeps
|
|
377
|
+
* the timeout on the whole response. A client disconnect cancels the
|
|
378
|
+
* upstream request.
|
|
379
|
+
* - Authorization responses from the gateway's authorization server (the
|
|
380
|
+
* code redirect, the `access_denied` redirect and error redirects) carry
|
|
381
|
+
* the RFC 9207 `iss` parameter, and its authorization-server metadata
|
|
382
|
+
* advertises `authorization_response_iss_parameter_supported: true`. An
|
|
383
|
+
* MCP SDK client that validates `iss` then rejects a callback without it.
|
|
384
|
+
* - On Cloudflare Workers (managed edge and `zuplo dev`), the flag also turns
|
|
385
|
+
* on the Workers `enable_request_signal` compatibility flag. That makes
|
|
386
|
+
* `request.signal` fire when the client disconnects, for all code in the
|
|
387
|
+
* project, not only the MCP Gateway.
|
|
388
|
+
*
|
|
389
|
+
* @compatibilityDate 2026-11-06
|
|
390
|
+
*/
|
|
391
|
+
mcpProtocolVersion20260728: boolean;
|
|
328
392
|
/**
|
|
329
393
|
* Whether the MCP server handler answers `resources/read` with a JSON-RPC
|
|
330
394
|
* error when the resource's route answers an error status.
|
|
@@ -1070,6 +1070,15 @@ export declare interface McpCompleteParams extends McpParams {
|
|
|
1070
1070
|
};
|
|
1071
1071
|
}
|
|
1072
1072
|
|
|
1073
|
+
/**
|
|
1074
|
+
* Params for `server/discover` (MCP 2026-07-28). The request carries only the
|
|
1075
|
+
* standard per-request `_meta` envelope (`io.modelcontextprotocol/protocolVersion`
|
|
1076
|
+
* and `io.modelcontextprotocol/clientCapabilities`), so every field is optional.
|
|
1077
|
+
*
|
|
1078
|
+
* @beta
|
|
1079
|
+
*/
|
|
1080
|
+
export declare type McpDiscoverParams = McpParams;
|
|
1081
|
+
|
|
1073
1082
|
/**
|
|
1074
1083
|
* A parsed view of an MCP HTTP request body.
|
|
1075
1084
|
*
|
|
@@ -1268,6 +1277,12 @@ export declare interface McpNotificationParamsMap {
|
|
|
1268
1277
|
readonly "notifications/cancelled": McpCancelledParams;
|
|
1269
1278
|
readonly "notifications/progress": McpProgressParams;
|
|
1270
1279
|
readonly "notifications/roots/list_changed": McpParams;
|
|
1280
|
+
/**
|
|
1281
|
+
* MCP 2026-07-28. Sent by the server as the first event of a
|
|
1282
|
+
* `subscriptions/listen` stream, so it travels server→client and a request
|
|
1283
|
+
* body never carries it; it is listed so response-side tooling can name it.
|
|
1284
|
+
*/
|
|
1285
|
+
readonly "notifications/subscriptions/acknowledged": McpParams;
|
|
1271
1286
|
}
|
|
1272
1287
|
|
|
1273
1288
|
/**
|
|
@@ -1407,6 +1422,11 @@ export declare type McpRequestMethod = keyof McpRequestParamsMap;
|
|
|
1407
1422
|
* their params shapes. Unknown or future methods still surface as requests
|
|
1408
1423
|
* (with `method: string`); they are never dropped.
|
|
1409
1424
|
*
|
|
1425
|
+
* The MCP 2026-07-28 methods (`server/discover`, `subscriptions/listen`,
|
|
1426
|
+
* `tasks/*`) are typed only on a 2026-07-28 request with the
|
|
1427
|
+
* `mcpProtocolVersion20260728` compatibility flag on. On any other request
|
|
1428
|
+
* they surface as unknown methods.
|
|
1429
|
+
*
|
|
1410
1430
|
* @beta
|
|
1411
1431
|
*/
|
|
1412
1432
|
export declare interface McpRequestParamsMap {
|
|
@@ -1423,6 +1443,16 @@ export declare interface McpRequestParamsMap {
|
|
|
1423
1443
|
readonly "resources/unsubscribe": McpResourceParams;
|
|
1424
1444
|
readonly "completion/complete": McpCompleteParams;
|
|
1425
1445
|
readonly "logging/setLevel": McpSetLevelParams;
|
|
1446
|
+
/** MCP 2026-07-28. */
|
|
1447
|
+
readonly "server/discover": McpDiscoverParams;
|
|
1448
|
+
/** MCP 2026-07-28. */
|
|
1449
|
+
readonly "subscriptions/listen": McpSubscriptionsListenParams;
|
|
1450
|
+
/** MCP 2026-07-28, `io.modelcontextprotocol/tasks` extension. */
|
|
1451
|
+
readonly "tasks/get": McpTaskParams;
|
|
1452
|
+
/** MCP 2026-07-28, `io.modelcontextprotocol/tasks` extension. */
|
|
1453
|
+
readonly "tasks/update": McpTaskUpdateParams;
|
|
1454
|
+
/** MCP 2026-07-28, `io.modelcontextprotocol/tasks` extension. */
|
|
1455
|
+
readonly "tasks/cancel": McpTaskParams;
|
|
1426
1456
|
}
|
|
1427
1457
|
|
|
1428
1458
|
/**
|
|
@@ -1451,6 +1481,54 @@ export declare interface McpSetLevelParams extends McpParams {
|
|
|
1451
1481
|
readonly level: string;
|
|
1452
1482
|
}
|
|
1453
1483
|
|
|
1484
|
+
/**
|
|
1485
|
+
* The notification categories a client asks for in `subscriptions/listen`
|
|
1486
|
+
* (MCP 2026-07-28).
|
|
1487
|
+
*
|
|
1488
|
+
* @beta
|
|
1489
|
+
*/
|
|
1490
|
+
export declare interface McpSubscriptionFilter {
|
|
1491
|
+
readonly toolsListChanged?: boolean;
|
|
1492
|
+
readonly promptsListChanged?: boolean;
|
|
1493
|
+
readonly resourcesListChanged?: boolean;
|
|
1494
|
+
/** Resource URIs the client wants `notifications/resources/updated` for. */
|
|
1495
|
+
readonly resourceSubscriptions?: readonly string[];
|
|
1496
|
+
readonly [key: string]: unknown;
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
/**
|
|
1500
|
+
* Params for `subscriptions/listen` (MCP 2026-07-28): the long-lived POST whose
|
|
1501
|
+
* response stream replaces the GET stream and `resources/subscribe`. The
|
|
1502
|
+
* parser does not require `notifications`; the gateway observes traffic rather
|
|
1503
|
+
* than enforcing the schema.
|
|
1504
|
+
*
|
|
1505
|
+
* @beta
|
|
1506
|
+
*/
|
|
1507
|
+
export declare interface McpSubscriptionsListenParams extends McpParams {
|
|
1508
|
+
readonly notifications?: McpSubscriptionFilter;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
/**
|
|
1512
|
+
* Params for the task requests of the `io.modelcontextprotocol/tasks`
|
|
1513
|
+
* extension (`tasks/get`, `tasks/update`, `tasks/cancel`). `taskId` is
|
|
1514
|
+
* guaranteed by the parser; over HTTP it is also the `Mcp-Name` header value.
|
|
1515
|
+
*
|
|
1516
|
+
* @beta
|
|
1517
|
+
*/
|
|
1518
|
+
export declare interface McpTaskParams extends McpParams {
|
|
1519
|
+
readonly taskId: string;
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
/**
|
|
1523
|
+
* Params for `tasks/update`: the client's answers to the task's pending
|
|
1524
|
+
* `inputRequests`.
|
|
1525
|
+
*
|
|
1526
|
+
* @beta
|
|
1527
|
+
*/
|
|
1528
|
+
export declare interface McpTaskUpdateParams extends McpTaskParams {
|
|
1529
|
+
readonly inputResponses?: Record<string, unknown>;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1454
1532
|
/**
|
|
1455
1533
|
* Params for `tools/call`. `name` is guaranteed: a `tools/call` request
|
|
1456
1534
|
* without a string `name` is classified as an invalid member instead of a
|
|
@@ -2916,8 +2916,9 @@ export declare interface McpPingOAuthInboundPolicyOptions {
|
|
|
2916
2916
|
*
|
|
2917
2917
|
* The upstream response streams back to the client as soon as its headers
|
|
2918
2918
|
* arrive. A tap observes the stream on the side; as soon as it sees the
|
|
2919
|
-
* JSON-RPC response (or the stream ends without one), the
|
|
2920
|
-
* capability analytics event is emitted
|
|
2919
|
+
* JSON-RPC response (or the stream ends without one), the MCP SERVER and
|
|
2920
|
+
* CLIENT spans end and the terminal capability analytics event is emitted,
|
|
2921
|
+
* from `context.waitUntil`.
|
|
2921
2922
|
*/
|
|
2922
2923
|
export declare function McpProxyHandler(
|
|
2923
2924
|
request: ZuploRequest,
|