@zuplo/cli 7.11.3 → 7.11.4

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-TPYCFLC7.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};
25
+ import{E as p,J as c,M as u}from"../chunk-3RVZUQKN.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
@@ -3297,6 +3297,8 @@ export declare interface BrownoutInboundPolicyOptions {
3297
3297
  };
3298
3298
  }
3299
3299
 
3300
+ /* Excluded from this release type: buildCacheOperationBase */
3301
+
3300
3302
  /* Excluded from this release type: BuildEnvironment */
3301
3303
 
3302
3304
  /**
@@ -3349,6 +3351,62 @@ declare interface BuildRouteConfiguration {
3349
3351
  */
3350
3352
  declare type CacheNamespace = string;
3351
3353
 
3354
+ /**
3355
+ * The shared per-request dimensions every `cache_operation` event from a
3356
+ * policy carries; outcome-specific fields are added at each emission site.
3357
+ */
3358
+ declare type CacheOperationBase = Pick<
3359
+ CacheOperationParams,
3360
+ | "cacheType"
3361
+ | "policyType"
3362
+ | "policyName"
3363
+ | "configId"
3364
+ | "consumerSub"
3365
+ | "routePath"
3366
+ | "method"
3367
+ >;
3368
+
3369
+ /** The kind of cache a `cache_operation` event describes. */
3370
+ declare type CacheOperationCacheType = "semantic" | "http";
3371
+
3372
+ /**
3373
+ * The outcome of a single cache lookup or write attempt:
3374
+ * - `hit` / `miss`: lookup outcomes.
3375
+ * - `store`: a write-back stored the response.
3376
+ * - `not_stored`: a write-back declined to store (see `reason`).
3377
+ * - `skip`: the lookup never ran (uncacheable shape, missing identity, ...).
3378
+ * - `error`: the lookup or store failed (see `reason`).
3379
+ */
3380
+ declare type CacheOperationOutcome =
3381
+ | "hit"
3382
+ | "miss"
3383
+ | "store"
3384
+ | "skip"
3385
+ | "error"
3386
+ | "not_stored";
3387
+
3388
+ /**
3389
+ * Emitter-facing params for a `cache_operation` event. Everything the emitter
3390
+ * doesn't know may be omitted; {@link buildCacheOperationMetadata} normalizes
3391
+ * omissions to explicit `null`s so every event carries the full contract.
3392
+ */
3393
+ declare interface CacheOperationParams {
3394
+ cacheType: CacheOperationCacheType;
3395
+ policyType: string;
3396
+ policyName: string;
3397
+ outcome: CacheOperationOutcome;
3398
+ reason?: string | null;
3399
+ latencyMs?: number | null;
3400
+ similarity?: number | null;
3401
+ configId?: string | null;
3402
+ consumerSub?: string | null;
3403
+ routePath?: string | null;
3404
+ method?: string | null;
3405
+ statusCode?: number | null;
3406
+ savedPromptTokens?: number | null;
3407
+ savedCompletionTokens?: number | null;
3408
+ }
3409
+
3352
3410
  /**
3353
3411
  * Internal
3354
3412
  */
@@ -5418,6 +5476,10 @@ declare type EmbeddingsOverride =
5418
5476
  default: DefaultModel1;
5419
5477
  };
5420
5478
 
5479
+ /* Excluded from this release type: emitCacheOperation */
5480
+
5481
+ /* Excluded from this release type: emitCacheOperationLate */
5482
+
5421
5483
  /**
5422
5484
  * Enable accumulation and validation of streaming responses.
5423
5485
  * @public
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "7.11.3",
4
+ "version": "7.11.4",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "7.11.3",
3
+ "version": "7.11.4",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "type": "module",
@@ -31,10 +31,10 @@
31
31
  "@opentelemetry/api": "1.9.0",
32
32
  "@opentelemetry/api-logs": "0.220.0",
33
33
  "@swc/core": "1.10.18",
34
- "@zuplo/core": "7.11.3",
34
+ "@zuplo/core": "7.11.4",
35
35
  "@zuplo/editor": "1.0.33162667821",
36
- "@zuplo/openapi-tools": "7.11.3",
37
- "@zuplo/runtime": "7.11.3",
36
+ "@zuplo/openapi-tools": "7.11.4",
37
+ "@zuplo/runtime": "7.11.4",
38
38
  "chalk": "5.4.1",
39
39
  "chokidar": "3.5.3",
40
40
  "cookie": "1.0.2",
@@ -65,15 +65,15 @@
65
65
  "workerd": "1.20261002.1",
66
66
  "yargs": "17.7.2",
67
67
  "zod": "4.4.3",
68
- "@zuplo/graphql": "7.11.3",
69
- "@zuplo/otel": "7.11.3"
68
+ "@zuplo/graphql": "7.11.4",
69
+ "@zuplo/otel": "7.11.4"
70
70
  },
71
71
  "optionalDependencies": {
72
- "@zuplo/lint-darwin-arm64": "7.11.3",
73
- "@zuplo/lint-darwin-x64": "7.11.3",
74
- "@zuplo/lint-linux-x64": "7.11.3",
75
- "@zuplo/lint-linux-arm64": "7.11.3",
76
- "@zuplo/lint-win32-x64": "7.11.3"
72
+ "@zuplo/lint-darwin-arm64": "7.11.4",
73
+ "@zuplo/lint-darwin-x64": "7.11.4",
74
+ "@zuplo/lint-linux-x64": "7.11.4",
75
+ "@zuplo/lint-linux-arm64": "7.11.4",
76
+ "@zuplo/lint-win32-x64": "7.11.4"
77
77
  },
78
78
  "bundleDependencies": [
79
79
  "@inquirer/prompts",