@zuplo/runtime 7.11.0 → 7.11.1

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-6YPRGG62.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};
25
+ import{E as p,J as c,M as u}from"../chunk-RHU3Z7DA.js";import"../chunk-NUVXDVLJ.js";import{a as d}from"../chunk-QGAJTUPE.js";import"../chunk-A3QGJZO7.js";import"../chunk-CDEAY3VY.js";import{aa as i}from"../chunk-LVSZ3WTO.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-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};
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-CDEAY3VY.js";import"../../chunk-LVSZ3WTO.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
@@ -1310,15 +1310,6 @@ export declare interface AIGatewaySmartRouterResult {
1310
1310
  profile: AIGatewaySmartRouterProfile;
1311
1311
  usage: AIGatewaySmartRouterTokenUsage;
1312
1312
  classifierModel: string;
1313
- /**
1314
- * Classifier cost in USD, separate from the routed model's cost. An unpriced
1315
- * zero means unknown, not free. Optional for results written by older code.
1316
- */
1317
- cost?: {
1318
- costUsd: number;
1319
- source: "provider" | "catalog" | "unpriced";
1320
- accuracy: "exact" | "estimated" | "unpriced";
1321
- };
1322
1313
  routing: AIGatewaySmartRouterRoutingDecision;
1323
1314
  durationMs: number;
1324
1315
  promptSource: AIGatewaySmartRouterPromptSource;
@@ -1343,9 +1334,7 @@ export declare interface AIGatewaySmartRouterRoutingDecision {
1343
1334
  }
1344
1335
 
1345
1336
  /**
1346
- * Classifier token usage from gateway accounting for app classifiers. Missing
1347
- * accounting headers produce zero counts, without a provider-body fallback.
1348
- * Deprecated direct classifiers retain the provider-reported counts; for Jev,
1337
+ * Classifier token usage reported in the classifier response body. For Jev,
1349
1338
  * input and output tokens map directly to these fields.
1350
1339
  *
1351
1340
  * @public
@@ -1354,18 +1343,6 @@ export declare interface AIGatewaySmartRouterTokenUsage {
1354
1343
  inputTokens: number;
1355
1344
  outputTokens: number;
1356
1345
  totalTokens: number;
1357
- /** Disjoint accounting categories already included in the totals above. */
1358
- breakdown?: {
1359
- uncachedInputTokens: number;
1360
- cacheReadInputTokens?: number;
1361
- /** Cache writes grouped by TTL when accounting reports that detail. */
1362
- cacheWriteInput?: Array<{
1363
- tokens: number;
1364
- cacheTtl?: "5m" | "1h";
1365
- }>;
1366
- visibleOutputTokens: number;
1367
- reasoningOutputTokens?: number;
1368
- };
1369
1346
  }
1370
1347
 
1371
1348
  /**
@@ -4195,6 +4172,20 @@ declare interface CompatibilityFlags {
4195
4172
  * discover tools with `tools/list`, as the MCP spec defines.
4196
4173
  */
4197
4174
  removeMcpToolsCapabilityExtension: boolean;
4175
+ /**
4176
+ * Whether the MCP server handler reports a `tools/call` whose arguments fail
4177
+ * the tool's `inputSchema` as a tool result with `isError: true`, as
4178
+ * MCP 2025-11-25 specifies for input validation errors.
4179
+ *
4180
+ * Before this flag: Invalid arguments return a JSON-RPC `-32602` error.
4181
+ *
4182
+ * After this flag: When the request's `MCP-Protocol-Version` header is
4183
+ * `2025-11-25` or later, invalid arguments return a result with
4184
+ * `isError: true` and the validation message as text content, and the tool
4185
+ * is not called. Earlier or missing protocol versions still return
4186
+ * `-32602`. Unknown tools and malformed requests return `-32602` either way.
4187
+ */
4188
+ returnMcpToolInputErrorsAsToolResults: boolean;
4198
4189
  /**
4199
4190
  * Whether OpenAPI schema combinators (`allOf`, `oneOf`, `anyOf`, `not`) are
4200
4191
  * applied with JSON Schema semantics when an operation's schemas are turned
@@ -154,6 +154,20 @@ declare interface CompatibilityFlags {
154
154
  * discover tools with `tools/list`, as the MCP spec defines.
155
155
  */
156
156
  removeMcpToolsCapabilityExtension: boolean;
157
+ /**
158
+ * Whether the MCP server handler reports a `tools/call` whose arguments fail
159
+ * the tool's `inputSchema` as a tool result with `isError: true`, as
160
+ * MCP 2025-11-25 specifies for input validation errors.
161
+ *
162
+ * Before this flag: Invalid arguments return a JSON-RPC `-32602` error.
163
+ *
164
+ * After this flag: When the request's `MCP-Protocol-Version` header is
165
+ * `2025-11-25` or later, invalid arguments return a result with
166
+ * `isError: true` and the validation message as text content, and the tool
167
+ * is not called. Earlier or missing protocol versions still return
168
+ * `-32602`. Unknown tools and malformed requests return `-32602` either way.
169
+ */
170
+ returnMcpToolInputErrorsAsToolResults: boolean;
157
171
  /**
158
172
  * Whether OpenAPI schema combinators (`allOf`, `oneOf`, `anyOf`, `not`) are
159
173
  * applied with JSON Schema semantics when an operation's schemas are turned
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "7.11.0",
4
+ "version": "7.11.1",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {