@zuplo/runtime 7.9.11 → 7.9.13

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{E as p,J as c,M as u}from"../chunk-DDUIJEX3.js";import"../chunk-QTXBMT6O.js";import{a as d}from"../chunk-QGAJTUPE.js";import"../chunk-A3QGJZO7.js";import"../chunk-7AHIER5R.js";import{aa as i}from"../chunk-KESHY2P3.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{E as p,J as c,M as u}from"../chunk-2XSPVUOE.js";import"../chunk-VTO3F6DK.js";import{a as d}from"../chunk-QGAJTUPE.js";import"../chunk-A3QGJZO7.js";import"../chunk-YJ2BHVUH.js";import{aa as i}from"../chunk-PBDT4FDO.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-7AHIER5R.js";import"../../chunk-KESHY2P3.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-YJ2BHVUH.js";import"../../chunk-PBDT4FDO.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
@@ -526,59 +526,19 @@ export declare function aiGatewayHandlerV2(
526
526
  ): Promise<Response>;
527
527
 
528
528
  /**
529
- * Accepts only requests that this gateway made itself with
530
- * `context.invokeRoute`, and rejects every request that arrived over the
531
- * network with `403 Forbidden`.
532
- *
533
- * Use it in place of AI Gateway Authentication on an application that is only
534
- * ever called by other routes and policies on the same gateway, such as the
535
- * classifier application behind the Smart Router or Prompt Injection
536
- * Protection policies. Those calls never leave the gateway, so an API key on
537
- * them protects nothing. This policy asserts the one thing that matters: the
538
- * request originated inside the deployment.
539
- *
540
- * The check reads `context.parentContext`, which the runtime sets only on the
541
- * child context that `context.invokeRoute` creates. A client cannot supply it
542
- * through a header, the URL, or the body. The policy has no options, makes no
543
- * network calls, reads no body, and leaves `request.user` unset.
544
- *
545
- * @title Ensure Gateway Internal Invocation Only
546
- * @product ai-gateway
547
- * @requiresAI
529
+ * @deprecated Use InternalOnlyInboundPolicy instead. This name is from before
530
+ * the policy moved out of the AI Gateway.
548
531
  * @public
549
- *
550
- * @param request - The incoming ZuploRequest
551
- * @param context - The ZuploContext
552
- * @param _options - The policy options set in policies.json (this policy has none)
553
- * @param policyName - The name of the policy as set in policies.json
554
- * @returns The request when the gateway made it with `context.invokeRoute`, otherwise a 403 response
555
- *
556
- * @example
557
- * ```json
558
- * // policies.json - Declare the policy so an application chain can select it
559
- * {
560
- * "name": "ai-gateway-internal-only-inbound",
561
- * "policyType": "ai-gateway-internal-only",
562
- * "handler": {
563
- * "export": "AIGatewayInternalOnlyInboundPolicy",
564
- * "module": "$import(@zuplo/runtime)",
565
- * "options": {}
566
- * }
567
- * }
568
- * ```
569
532
  */
570
- export declare function AIGatewayInternalOnlyInboundPolicy(
571
- request: ZuploRequest,
572
- context: ZuploContext,
573
- _options: AIGatewayInternalOnlyInboundPolicyOptions,
574
- policyName: string
575
- ): Promise<ZuploRequest | Response>;
533
+ export declare const AIGatewayInternalOnlyInboundPolicy: typeof InternalOnlyInboundPolicy;
576
534
 
577
535
  /**
578
- * The options for this policy. It has none.
536
+ * @deprecated Use InternalOnlyInboundPolicyOptions instead. This name is from
537
+ * before the policy moved out of the AI Gateway.
579
538
  * @public
580
539
  */
581
- export declare interface AIGatewayInternalOnlyInboundPolicyOptions {}
540
+ export declare type AIGatewayInternalOnlyInboundPolicyOptions =
541
+ InternalOnlyInboundPolicyOptions;
582
542
 
583
543
  /* Excluded from this release type: AIGatewayMeterIncrements */
584
544
 
@@ -1813,7 +1773,7 @@ export declare interface ApiAuthKeyInboundPolicyOptions {
1813
1773
  declare type APIKey = string;
1814
1774
 
1815
1775
  /**
1816
- * Credential used to run the classifier. Without `appId` this is the API key for the OpenAI-compatible service at `baseUrl`, and it is required. With `appId` it is optional: omit it when the classifier app runs the Ensure Gateway Internal Invocation Only policy, which authorizes the in-process invocation itself, and set it only when that app authenticates callers with API keys, in which case it is sent as `Authorization: Bearer`.
1776
+ * Credential used to run the classifier. Without `appId` this is the API key for the OpenAI-compatible service at `baseUrl`, and it is required. With `appId` it is optional: omit it when the classifier app runs the Internal Only policy, which authorizes the in-process invocation itself, and set it only when that app authenticates callers with API keys, in which case it is sent as `Authorization: Bearer`.
1817
1777
  * @public
1818
1778
  */
1819
1779
  declare type APIKey_2 = string;
@@ -3750,7 +3710,8 @@ declare interface ChatCompletionResponse {
3750
3710
  }
3751
3711
 
3752
3712
  /**
3753
- * Classify by calling an OpenAI-compatible Chat Completions API directly, outside the gateway. The model must support structured outputs (`response_format` with a JSON schema).
3713
+ * @deprecated
3714
+ * Deprecated: use classifier.adapter with flat apiKey, model, and baseUrl fields. Classify by calling an OpenAI-compatible Chat Completions API directly, outside the gateway. The model must support structured outputs (`response_format` with a JSON schema).
3754
3715
  * @public
3755
3716
  */
3756
3717
  declare interface ChatCompletionsAPI {
@@ -3796,15 +3757,31 @@ declare type Claim = string;
3796
3757
  declare type ClaimCheck = EqualsRule | InRule | StartsWithRule;
3797
3758
 
3798
3759
  /**
3799
- * Where the user's prompt is classified. Required unless the deprecated `classifierAppID` and `classifierModel` are set. Set exactly one of `app`, `chatCompletions`, or `jev`; setting more than one is a configuration error.
3760
+ * Where the prompt is classified. For a direct API, set adapter, apiKey, model, and optional baseUrl. Alternatively set app. Legacy chatCompletions and jev sections remain supported; do not mix forms.
3800
3761
  * @public
3801
3762
  */
3802
3763
  declare interface Classifier {
3803
3764
  app?: ClassifierApp;
3804
3765
  chatCompletions?: ChatCompletionsAPI;
3805
3766
  jev?: JevTypeSafe;
3767
+ adapter?: ClassifierAdapter;
3768
+ apiKey?: ClassifierAPIKey;
3769
+ model?: ClassifierModel1;
3770
+ baseUrl?: ClassifierBaseURL;
3806
3771
  }
3807
3772
 
3773
+ /**
3774
+ * API contract for direct classification. chatCompletions requires a model supporting JSON-schema structured outputs. systemOne uses the existing Jev typed-question implementation; it does not accept classifierPrompt.
3775
+ * @public
3776
+ */
3777
+ declare type ClassifierAdapter = "chatCompletions" | "systemOne";
3778
+
3779
+ /**
3780
+ * API key for the direct classifier, sent as Authorization: Bearer.
3781
+ * @public
3782
+ */
3783
+ declare type ClassifierAPIKey = string;
3784
+
3808
3785
  /**
3809
3786
  * Classify with another AI Gateway app in this project. The call runs in-process and never leaves the gateway, so the classifier uses that app's providers, routing, and quotas.
3810
3787
  * @public
@@ -3816,7 +3793,7 @@ declare interface ClassifierApp {
3816
3793
  }
3817
3794
 
3818
3795
  /**
3819
- * API key sent as `Authorization: Bearer` when invoking the classifier app. Omit it when the classifier app runs the Ensure Gateway Internal Invocation Only policy: the classifier call never leaves the gateway, so that policy accepts it and rejects everything arriving over the network, and no credential is sent. Set it only when the classifier app authenticates callers with API keys.
3796
+ * API key sent as `Authorization: Bearer` when invoking the classifier app. Omit it when the classifier app runs the Internal Only policy: the classifier call never leaves the gateway, so that policy accepts it and rejects everything arriving over the network, and no credential is sent. Set it only when the classifier app authenticates callers with API keys.
3820
3797
  * @public
3821
3798
  */
3822
3799
  declare type ClassifierAppAPIKey = string;
@@ -3828,7 +3805,7 @@ declare type ClassifierAppAPIKey = string;
3828
3805
  declare type ClassifierAppAPIKeyDeprecated = string;
3829
3806
 
3830
3807
  /**
3831
- * Run the classifier on another AI Gateway app instead of calling an external API directly. The gateway invokes that app in-process — no outbound HTTP hop — so the classifier inherits its provider credentials, model routing, fallbacks and quotas, and provider keys stay on one app. Give that app the Ensure Gateway Internal Invocation Only policy and `apiKey` is not needed at all. When set, `model` must name a routed model as `provider/model` and `baseUrl` must not be set. The target app must not itself run this policy: it would be asked to classify its own classification request, which is rejected as a configuration error rather than silently skipped. Omit to call `baseUrl` directly.
3808
+ * Run the classifier on another AI Gateway app instead of calling an external API directly. The gateway invokes that app in-process — no outbound HTTP hop — so the classifier inherits its provider credentials, model routing, fallbacks and quotas, and provider keys stay on one app. Give that app the Internal Only policy and `apiKey` is not needed at all. When set, `model` must name a routed model as `provider/model` and `baseUrl` must not be set. The target app must not itself run this policy: it would be asked to classify its own classification request, which is rejected as a configuration error rather than silently skipped. Omit to call `baseUrl` directly.
3832
3809
  * @public
3833
3810
  */
3834
3811
  declare type ClassifierAppID = string;
@@ -3845,12 +3822,24 @@ declare type ClassifierAppID_2 = string;
3845
3822
  */
3846
3823
  declare type ClassifierAppIDDeprecated = string;
3847
3824
 
3825
+ /**
3826
+ * HTTP(S) API root. chatCompletions defaults to https://api.openai.com/v1 and appends /chat/completions. systemOne defaults to https://api.typesafe.ai and appends /v1/systemone.
3827
+ * @public
3828
+ */
3829
+ declare type ClassifierBaseURL = string;
3830
+
3848
3831
  /**
3849
3832
  * Tool-calling capable model used to classify prompts. Prefer a small, fast model; the classification runs before every inspected request reaches the upstream model. With `appId` set this must name a model the classifier app routes, written as `provider/model` (for example `openai/gpt-4o-mini`), and has no default.
3850
3833
  * @public
3851
3834
  */
3852
3835
  declare type ClassifierModel = string;
3853
3836
 
3837
+ /**
3838
+ * Model id sent to the direct API. Required for chatCompletions; defaults to jev-latest for systemOne.
3839
+ * @public
3840
+ */
3841
+ declare type ClassifierModel1 = string;
3842
+
3854
3843
  /**
3855
3844
  * The model (`providerName/model`) the classifier app uses to evaluate the user's request. E.g. `openai/gpt-4o-mini`.
3856
3845
  * @public
@@ -3870,7 +3859,7 @@ declare type ClassifierModelDeprecated = string;
3870
3859
  declare type ClassifierPrompt = string | [string, ...string[]];
3871
3860
 
3872
3861
  /**
3873
- * Prompt used to analyze and classify the user message with `classifier.app` or `classifier.chatCompletions`. Omit to use the built-in classifier prompt. Jev takes no prompt, so setting this with `classifier.jev` is a configuration error.
3862
+ * Prompt for classifier.app or the chatCompletions adapter (including its legacy section). Omit to use the built-in prompt. The systemOne adapter and legacy jev section take no prompt; combining them with classifierPrompt is a configuration error.
3874
3863
  * @public
3875
3864
  */
3876
3865
  declare type ClassifierPrompt_2 = string | [string, ...string[]];
@@ -4147,6 +4136,38 @@ declare interface CompatibilityFlags {
4147
4136
  * discover tools with `tools/list`, as the MCP spec defines.
4148
4137
  */
4149
4138
  removeMcpToolsCapabilityExtension: boolean;
4139
+ /**
4140
+ * Whether OpenAPI schema combinators (`allOf`, `oneOf`, `anyOf`, `not`) are
4141
+ * applied with JSON Schema semantics when an operation's schemas are turned
4142
+ * into runtime validators. Today that is the MCP server handler: a tool's
4143
+ * advertised `inputSchema`/`outputSchema` and its argument validation.
4144
+ * `request-validation-inbound` already uses Ajv and is unaffected.
4145
+ *
4146
+ * Before this flag:
4147
+ * - A top-level combinator is used on its own, and every keyword beside it
4148
+ * (`type`, `properties`, `required`, `additionalProperties`, `nullable`,
4149
+ * `description`, ...) is ignored. A body of
4150
+ * `{ type: object, properties, required, oneOf: [...] }` can be advertised
4151
+ * as `{ anyOf: [{}, {}] }` and accept any value.
4152
+ * - `oneOf` behaves like `anyOf`: a value matching several branches is
4153
+ * accepted, and `oneOf` is advertised as `anyOf`.
4154
+ *
4155
+ * After this flag:
4156
+ * - The schema's own keywords and every combinator beside them all apply,
4157
+ * intersected.
4158
+ * - `oneOf` accepts a value only when exactly one branch matches, and is
4159
+ * advertised as `oneOf`.
4160
+ * - Within a combinator schema and its branches: `required`,
4161
+ * `additionalProperties`, `minProperties` or `maxProperties` without a
4162
+ * `type` mark an object schema, an object schema rejects non-objects, a
4163
+ * `required` name that `properties` omits is enforced, a numeric or
4164
+ * boolean `enum` is enforced, and `unevaluatedProperties: false` is
4165
+ * enforced. A schema with no combinator is unchanged.
4166
+ *
4167
+ * The advertised schema changes for every affected tool, and calls the
4168
+ * gateway's request validation would reject are rejected with -32602.
4169
+ */
4170
+ enforceOpenApiCombinatorSemantics: boolean;
4150
4171
  }
4151
4172
 
4152
4173
  declare interface CompletionsFallbacks {
@@ -7831,6 +7852,82 @@ declare type Intents = [
7831
7852
  }[],
7832
7853
  ];
7833
7854
 
7855
+ /**
7856
+ * Accepts only requests that this gateway made itself with
7857
+ * `context.invokeRoute`, and rejects every request that arrived over the
7858
+ * network.
7859
+ *
7860
+ * Use it on a route that only other routes, handlers, and policies on the same
7861
+ * gateway call: a REST endpoint that an MCP server exposes as a tool, or the
7862
+ * classifier application behind the Smart Router or Prompt Injection
7863
+ * Protection policies. Those calls never leave the gateway, so an API key on
7864
+ * them protects nothing. This policy asserts the one thing that matters: the
7865
+ * request originated inside the deployment.
7866
+ *
7867
+ * The check reads `context.parentContext`, which the runtime sets only on the
7868
+ * child context that `context.invokeRoute` creates. A client cannot supply it
7869
+ * through a header, the URL, or the body. The policy makes no network calls,
7870
+ * reads no body, and leaves `request.user` unset.
7871
+ *
7872
+ * A rejected request gets a `403 Forbidden` problem response with no `detail`
7873
+ * by default, so the caller learns nothing about how the gateway works; the
7874
+ * reason goes to the request log. Set `status` to answer with another client
7875
+ * error, such as `404` to hide the route or `401`, `statusText` to change the
7876
+ * status text, and `detail` to add a message.
7877
+ *
7878
+ * @title Internal Only
7879
+ * @product api-gateway
7880
+ * @product ai-gateway
7881
+ * @public
7882
+ *
7883
+ * @param request - The incoming ZuploRequest
7884
+ * @param context - The ZuploContext
7885
+ * @param options - The policy options set in policies.json
7886
+ * @param policyName - The name of the policy as set in policies.json
7887
+ * @returns The request when the gateway made it with `context.invokeRoute`, otherwise the rejection response
7888
+ *
7889
+ * @example
7890
+ * ```json
7891
+ * // policies.json - Hide a REST route that an MCP server calls as a tool
7892
+ * {
7893
+ * "name": "internal-only-inbound",
7894
+ * "policyType": "internal-only-inbound",
7895
+ * "handler": {
7896
+ * "export": "InternalOnlyInboundPolicy",
7897
+ * "module": "$import(@zuplo/runtime)",
7898
+ * "options": {
7899
+ * "status": 404
7900
+ * }
7901
+ * }
7902
+ * }
7903
+ * ```
7904
+ */
7905
+ export declare function InternalOnlyInboundPolicy(
7906
+ request: ZuploRequest,
7907
+ context: ZuploContext,
7908
+ options: InternalOnlyInboundPolicyOptions,
7909
+ policyName: string
7910
+ ): Promise<ZuploRequest | Response>;
7911
+
7912
+ /**
7913
+ * The options for this policy.
7914
+ * @public
7915
+ */
7916
+ export declare interface InternalOnlyInboundPolicyOptions {
7917
+ /**
7918
+ * The HTTP status code returned to a request that did not come from inside the gateway. Any client error status from 400 to 499 is allowed. Use `404` to answer as if the route did not exist, or `401` to answer as an authentication policy does.
7919
+ */
7920
+ status?: number;
7921
+ /**
7922
+ * The status text returned with `status`, such as `Not Found`. When it is omitted, the response uses the standard text for the status. Clients don't always receive it: HTTP/2 and HTTP/3 have no status text, and Managed Dedicated and self-hosted gateways always send the standard text.
7923
+ */
7924
+ statusText?: string;
7925
+ /**
7926
+ * The `detail` of the problem response returned to a rejected request. Every caller outside the gateway receives it, so don't describe how the route is called. When it is omitted, the response has no `detail`, and a `404` matches the response for a route that does not exist.
7927
+ */
7928
+ detail?: string;
7929
+ }
7930
+
7834
7931
  /**
7835
7932
  * Restricts which client IP addresses can call a route using an allow list, a
7836
7933
  * deny list, or both. Entries are individual IP addresses or CIDR ranges, in
@@ -8159,7 +8256,8 @@ declare type JevBaseURL = string;
8159
8256
  declare type JevModel = string;
8160
8257
 
8161
8258
  /**
8162
- * Classify with Jev, TypeSafe's classification model, by calling a System One API directly: TypeSafe's by default, or another host such as OpenRouter through `baseUrl`. Jev answers typed questions instead of generating text, so it takes no `classifierPrompt`.
8259
+ * @deprecated
8260
+ * Deprecated: use classifier.adapter with flat apiKey, model, and baseUrl fields. Classify with Jev, TypeSafe's classification model, by calling a System One API directly: TypeSafe's by default, or another host such as OpenRouter through `baseUrl`. Jev answers typed questions instead of generating text, so it takes no `classifierPrompt`.
8163
8261
  * @public
8164
8262
  */
8165
8263
  declare interface JevTypeSafe {
@@ -154,6 +154,38 @@ declare interface CompatibilityFlags {
154
154
  * discover tools with `tools/list`, as the MCP spec defines.
155
155
  */
156
156
  removeMcpToolsCapabilityExtension: boolean;
157
+ /**
158
+ * Whether OpenAPI schema combinators (`allOf`, `oneOf`, `anyOf`, `not`) are
159
+ * applied with JSON Schema semantics when an operation's schemas are turned
160
+ * into runtime validators. Today that is the MCP server handler: a tool's
161
+ * advertised `inputSchema`/`outputSchema` and its argument validation.
162
+ * `request-validation-inbound` already uses Ajv and is unaffected.
163
+ *
164
+ * Before this flag:
165
+ * - A top-level combinator is used on its own, and every keyword beside it
166
+ * (`type`, `properties`, `required`, `additionalProperties`, `nullable`,
167
+ * `description`, ...) is ignored. A body of
168
+ * `{ type: object, properties, required, oneOf: [...] }` can be advertised
169
+ * as `{ anyOf: [{}, {}] }` and accept any value.
170
+ * - `oneOf` behaves like `anyOf`: a value matching several branches is
171
+ * accepted, and `oneOf` is advertised as `anyOf`.
172
+ *
173
+ * After this flag:
174
+ * - The schema's own keywords and every combinator beside them all apply,
175
+ * intersected.
176
+ * - `oneOf` accepts a value only when exactly one branch matches, and is
177
+ * advertised as `oneOf`.
178
+ * - Within a combinator schema and its branches: `required`,
179
+ * `additionalProperties`, `minProperties` or `maxProperties` without a
180
+ * `type` mark an object schema, an object schema rejects non-objects, a
181
+ * `required` name that `properties` omits is enforced, a numeric or
182
+ * boolean `enum` is enforced, and `unevaluatedProperties: false` is
183
+ * enforced. A schema with no combinator is unchanged.
184
+ *
185
+ * The advertised schema changes for every affected tool, and calls the
186
+ * gateway's request validation would reject are rejected with -32602.
187
+ */
188
+ enforceOpenApiCombinatorSemantics: boolean;
157
189
  }
158
190
 
159
191
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "7.9.11",
4
+ "version": "7.9.13",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {