@zuplo/cli 6.73.13 → 6.73.15
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/dist/cmds/dev.d.ts.map +1 -1
- package/dist/cmds/dev.js +6 -0
- package/dist/cmds/dev.js.map +1 -1
- package/dist/dev/handler.d.ts +1 -0
- package/dist/dev/handler.d.ts.map +1 -1
- package/dist/dev/handler.js +5 -0
- package/dist/dev/handler.js.map +1 -1
- package/dist/dev/zuplo-local-gitignore.d.ts +4 -0
- package/dist/dev/zuplo-local-gitignore.d.ts.map +1 -0
- package/dist/dev/zuplo-local-gitignore.js +29 -0
- package/dist/dev/zuplo-local-gitignore.js.map +1 -0
- package/dist/dev/zuplo-local-gitignore.test.d.ts +2 -0
- package/dist/dev/zuplo-local-gitignore.test.d.ts.map +1 -0
- package/dist/dev/zuplo-local-gitignore.test.js +58 -0
- package/dist/dev/zuplo-local-gitignore.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@zuplo/core/customer.cli.minified.js +238 -238
- package/node_modules/@zuplo/core/index.minified.js +250 -250
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/{chunk-7Z5GGYF5.js → chunk-OAVAM6CR.js} +122 -122
- package/node_modules/@zuplo/runtime/out/esm/chunk-OAVAM6CR.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +282 -128
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/hono/dist/cjs/helper/streaming/sse.js +1 -1
- package/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +10 -4
- package/node_modules/hono/dist/cjs/request.js +1 -1
- package/node_modules/hono/dist/cjs/utils/accept.js +1 -1
- package/node_modules/hono/dist/cjs/utils/url.js +1 -1
- package/node_modules/hono/dist/helper/streaming/sse.js +1 -1
- package/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +10 -4
- package/node_modules/hono/dist/request.js +1 -1
- package/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +9 -0
- package/node_modules/hono/dist/utils/accept.js +1 -1
- package/node_modules/hono/dist/utils/url.js +1 -1
- package/node_modules/hono/package.json +1 -1
- package/package.json +6 -6
- package/node_modules/@zuplo/runtime/out/esm/chunk-7Z5GGYF5.js.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-7Z5GGYF5.js.LEGAL.txt → chunk-OAVAM6CR.js.LEGAL.txt} +0 -0
|
@@ -142,6 +142,85 @@ export declare interface AIGatewayAuthInboundPolicyOptions {
|
|
|
142
142
|
authScheme?: string;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
/**
|
|
146
|
+
* Authenticates requests to an AI Gateway v2 endpoint with application API
|
|
147
|
+
* keys.
|
|
148
|
+
*
|
|
149
|
+
* Place this policy first in the inbound chain so the policies that follow can
|
|
150
|
+
* use the authenticated app's configuration. Use `authHeader` and `authScheme`
|
|
151
|
+
* when clients send their app key somewhere other than the default
|
|
152
|
+
* `Authorization: Bearer` header.
|
|
153
|
+
*
|
|
154
|
+
* @title AI Gateway Authentication (v2)
|
|
155
|
+
* @product ai-gateway
|
|
156
|
+
* @hidden
|
|
157
|
+
* @requiresAI
|
|
158
|
+
* @public
|
|
159
|
+
*
|
|
160
|
+
* @param request - The incoming ZuploRequest
|
|
161
|
+
* @param context - The ZuploContext
|
|
162
|
+
* @param unparsedOptions - The policy configuration options
|
|
163
|
+
* @param policyName - The name of the policy instance
|
|
164
|
+
* @returns The authenticated request with user info, or a 401 response if unauthorized
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```json
|
|
168
|
+
* // policies.json - Authenticate an AI Gateway v2 route
|
|
169
|
+
* {
|
|
170
|
+
* "name": "ai-gateway-auth",
|
|
171
|
+
* "policyType": "ai-gateway-auth-v2",
|
|
172
|
+
* "handler": {
|
|
173
|
+
* "export": "AIGatewayAuthV2InboundPolicy",
|
|
174
|
+
* "module": "$import(@zuplo/runtime)",
|
|
175
|
+
* "options": {
|
|
176
|
+
* "cacheTtlSeconds": 300
|
|
177
|
+
* }
|
|
178
|
+
* }
|
|
179
|
+
* }
|
|
180
|
+
* ```
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```json
|
|
184
|
+
* // Accept an app key from a custom header
|
|
185
|
+
* {
|
|
186
|
+
* "handler": {
|
|
187
|
+
* "export": "AIGatewayAuthV2InboundPolicy",
|
|
188
|
+
* "module": "$import(@zuplo/runtime)",
|
|
189
|
+
* "options": {
|
|
190
|
+
* "authHeader": "x-api-key",
|
|
191
|
+
* "authScheme": ""
|
|
192
|
+
* }
|
|
193
|
+
* }
|
|
194
|
+
* }
|
|
195
|
+
* ```
|
|
196
|
+
*
|
|
197
|
+
*/
|
|
198
|
+
export declare function AIGatewayAuthV2InboundPolicy(
|
|
199
|
+
request: ZuploRequest,
|
|
200
|
+
context: ZuploContext,
|
|
201
|
+
unparsedOptions: AIGatewayAuthV2InboundPolicyOptions,
|
|
202
|
+
policyName: string
|
|
203
|
+
): Promise<Response | ZuploRequest<RequestGeneric_2>>;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* The options for this policy.
|
|
207
|
+
* @public
|
|
208
|
+
*/
|
|
209
|
+
export declare interface AIGatewayAuthV2InboundPolicyOptions {
|
|
210
|
+
/**
|
|
211
|
+
* The time to cache authentication results for a particular key. Higher values will decrease latency. Cached results will be valid until the cache expires even in the event the key is deleted, etc.
|
|
212
|
+
*/
|
|
213
|
+
cacheTtlSeconds?: number;
|
|
214
|
+
/**
|
|
215
|
+
* The name of the header with the key.
|
|
216
|
+
*/
|
|
217
|
+
authHeader?: string;
|
|
218
|
+
/**
|
|
219
|
+
* The scheme used on the header.
|
|
220
|
+
*/
|
|
221
|
+
authScheme?: string;
|
|
222
|
+
}
|
|
223
|
+
|
|
145
224
|
/**
|
|
146
225
|
* An AI Gateway capability that can have a resolved model selection.
|
|
147
226
|
*
|
|
@@ -160,6 +239,88 @@ export declare type AIGatewayCapability =
|
|
|
160
239
|
| "audio_speech"
|
|
161
240
|
| "audio_transcriptions";
|
|
162
241
|
|
|
242
|
+
/**
|
|
243
|
+
* Runs the inbound policy chain selected for an authenticated AI Gateway app.
|
|
244
|
+
*
|
|
245
|
+
* Use this policy after AI Gateway Authentication (v2) when apps need
|
|
246
|
+
* different combinations or ordering of AI Gateway policies. Applications
|
|
247
|
+
* select from policies pre-declared by the gateway. Applications without a
|
|
248
|
+
* `inboundPolicyChain`, or with an empty chain, run no application-selected
|
|
249
|
+
* policies.
|
|
250
|
+
* Entry options replace the declaration's options as a complete object; omit
|
|
251
|
+
* them to inherit the declaration, including environment-backed credentials.
|
|
252
|
+
*
|
|
253
|
+
* @title AI Gateway Configuration Executor (v2)
|
|
254
|
+
* @product ai-gateway
|
|
255
|
+
* @hidden
|
|
256
|
+
* @requiresAI
|
|
257
|
+
*/
|
|
258
|
+
export declare class AIGatewayConfigurationExecutorV2InboundPolicy extends InboundPolicy<AIGatewayConfigurationExecutorV2InboundPolicyOptions> {
|
|
259
|
+
#private;
|
|
260
|
+
static readonly policyType = "ai-gateway-configuration-executor-v2";
|
|
261
|
+
constructor(
|
|
262
|
+
options: AIGatewayConfigurationExecutorV2InboundPolicyOptions,
|
|
263
|
+
policyName: string
|
|
264
|
+
);
|
|
265
|
+
handler(
|
|
266
|
+
request: ZuploRequest,
|
|
267
|
+
context: ZuploContext
|
|
268
|
+
): Promise<ZuploRequest | Response>;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* The application policy chain is supplied through the authenticated request configuration.
|
|
273
|
+
* @public
|
|
274
|
+
*/
|
|
275
|
+
export declare interface AIGatewayConfigurationExecutorV2InboundPolicyOptions {}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Adds failure and quota fallbacks to an existing AI Gateway model selection.
|
|
279
|
+
*
|
|
280
|
+
* Place this policy after AI Gateway Model Filtering (v2). It never creates a
|
|
281
|
+
* model selection, so a misplaced policy cannot bypass filtering.
|
|
282
|
+
*
|
|
283
|
+
* @title AI Gateway Fallback Model (v2)
|
|
284
|
+
* @beta
|
|
285
|
+
* @product ai-gateway
|
|
286
|
+
* @requiresAI
|
|
287
|
+
* @param request - The ZuploRequest
|
|
288
|
+
* @param context - The ZuploContext
|
|
289
|
+
* @param options - The policy options set in policies.json
|
|
290
|
+
* @param policyName - The name of the policy as set in policies.json
|
|
291
|
+
* @returns The unchanged request after enriching an existing model selection
|
|
292
|
+
* @example
|
|
293
|
+
* ```json
|
|
294
|
+
* {
|
|
295
|
+
* "models": {
|
|
296
|
+
* "completions": {
|
|
297
|
+
* "fallback": "anthropic/claude-haiku-4-5",
|
|
298
|
+
* "quotaFallback": "openai/gpt-4o-mini"
|
|
299
|
+
* }
|
|
300
|
+
* },
|
|
301
|
+
* "fallbackTimeoutSeconds": 60
|
|
302
|
+
* }
|
|
303
|
+
* ```
|
|
304
|
+
*/
|
|
305
|
+
export declare class AIGatewayFallbackModelV2InboundPolicy extends InboundPolicy<AIGatewayFallbackModelV2InboundPolicyOptions> {
|
|
306
|
+
#private;
|
|
307
|
+
static readonly policyType = "ai-gateway-fallback-model-v2";
|
|
308
|
+
constructor(
|
|
309
|
+
options: AIGatewayFallbackModelV2InboundPolicyOptions,
|
|
310
|
+
policyName: string
|
|
311
|
+
);
|
|
312
|
+
handler(request: ZuploRequest, context: ZuploContext): Promise<ZuploRequest>;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Options for adding failure and quota fallbacks to an existing AI Gateway model selection.
|
|
317
|
+
* @public
|
|
318
|
+
*/
|
|
319
|
+
export declare interface AIGatewayFallbackModelV2InboundPolicyOptions {
|
|
320
|
+
models: FallbackModels;
|
|
321
|
+
fallbackTimeoutSeconds?: FallbackTimeoutSeconds;
|
|
322
|
+
}
|
|
323
|
+
|
|
163
324
|
/**
|
|
164
325
|
* Handler that routes AI/LLM requests through Zuplo's LLM Translation Layer.
|
|
165
326
|
* This handler forwards requests to the translation layer that handles provider-specific
|
|
@@ -188,7 +349,7 @@ export declare function aiGatewayHandler(
|
|
|
188
349
|
|
|
189
350
|
/**
|
|
190
351
|
* Routes AI requests using the model selection stored in the request context.
|
|
191
|
-
* Attach the `ai-gateway-model-
|
|
352
|
+
* Attach the `ai-gateway-model-filtering-v2-inbound` policy before this handler
|
|
192
353
|
* runs, or call `AIGatewayModelRouting.set(context, routing)` from a custom
|
|
193
354
|
* inbound policy.
|
|
194
355
|
*
|
|
@@ -206,7 +367,7 @@ export declare function aiGatewayHandler(
|
|
|
206
367
|
* "module": "$import(@zuplo/runtime)"
|
|
207
368
|
* },
|
|
208
369
|
* "policies": {
|
|
209
|
-
* "inbound": ["ai-gateway-model-
|
|
370
|
+
* "inbound": ["ai-gateway-model-filtering-v2-inbound"]
|
|
210
371
|
* }
|
|
211
372
|
* }
|
|
212
373
|
* ```
|
|
@@ -275,12 +436,11 @@ export declare class AIGatewayMeteringInboundPolicy extends InboundPolicy<AIGate
|
|
|
275
436
|
private requestCapability;
|
|
276
437
|
/**
|
|
277
438
|
* Validate and return the configured quota fallback when it applies to *this*
|
|
278
|
-
* request's capability, or `undefined` otherwise
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
* we validate it through Zod before acting on it.
|
|
439
|
+
* request's capability, or `undefined` otherwise. A resolved selection is
|
|
440
|
+
* already validated and returns a presence-only marker; legacy configuration
|
|
441
|
+
* is customer-authored and validated through Zod before use. Returning
|
|
442
|
+
* `undefined` blocks the request with a 429, so a fallback is counted only
|
|
443
|
+
* when the handler can serve the request with it.
|
|
284
444
|
*/
|
|
285
445
|
private resolveQuotaFallback;
|
|
286
446
|
private checkHierarchicalQuotaLimits;
|
|
@@ -314,6 +474,54 @@ export declare interface AIGatewayMeteringInboundPolicyOptions {
|
|
|
314
474
|
throwOnFailure?: boolean;
|
|
315
475
|
}
|
|
316
476
|
|
|
477
|
+
/**
|
|
478
|
+
* Matches AI Gateway requests against curated allow lists or open block lists,
|
|
479
|
+
* then stores the winning model reference for the route handler.
|
|
480
|
+
*
|
|
481
|
+
* @title AI Gateway Model Filtering (v2)
|
|
482
|
+
* @beta
|
|
483
|
+
* @product ai-gateway
|
|
484
|
+
* @requiresAI
|
|
485
|
+
* @param request - The ZuploRequest
|
|
486
|
+
* @param context - The ZuploContext
|
|
487
|
+
* @param options - The policy options set in policies.json
|
|
488
|
+
* @param policyName - The name of the policy as set in policies.json
|
|
489
|
+
* @returns The request with model routing stored in context, or a 4xx response
|
|
490
|
+
* @example
|
|
491
|
+
* ```json
|
|
492
|
+
* {
|
|
493
|
+
* "models": {
|
|
494
|
+
* "completions": {
|
|
495
|
+
* "allowList": [
|
|
496
|
+
* "openai/gpt-5",
|
|
497
|
+
* "anthropic/claude-sonnet-4-6"
|
|
498
|
+
* ]
|
|
499
|
+
* }
|
|
500
|
+
* }
|
|
501
|
+
* }
|
|
502
|
+
* ```
|
|
503
|
+
*/
|
|
504
|
+
export declare class AIGatewayModelFilteringV2InboundPolicy extends InboundPolicy<AIGatewayModelFilteringV2InboundPolicyOptions> {
|
|
505
|
+
#private;
|
|
506
|
+
static readonly policyType = "ai-gateway-model-filtering-v2";
|
|
507
|
+
constructor(
|
|
508
|
+
options: AIGatewayModelFilteringV2InboundPolicyOptions,
|
|
509
|
+
policyName: string
|
|
510
|
+
);
|
|
511
|
+
handler(
|
|
512
|
+
request: ZuploRequest,
|
|
513
|
+
context: ZuploContext
|
|
514
|
+
): Promise<ZuploRequest | Response>;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Options for allowing or blocking providerName/model references for each AI Gateway capability.
|
|
519
|
+
* @public
|
|
520
|
+
*/
|
|
521
|
+
export declare interface AIGatewayModelFilteringV2InboundPolicyOptions {
|
|
522
|
+
models: Models;
|
|
523
|
+
}
|
|
524
|
+
|
|
317
525
|
/**
|
|
318
526
|
* Catalog information about an AI Gateway model.
|
|
319
527
|
*
|
|
@@ -369,57 +577,6 @@ export declare const AIGatewayModelRouting: {
|
|
|
369
577
|
get(context: ZuploContext): AIGatewayRouting | undefined;
|
|
370
578
|
};
|
|
371
579
|
|
|
372
|
-
/**
|
|
373
|
-
* Matches AI Gateway requests against curated allow lists or open block lists,
|
|
374
|
-
* then stores the winning {@link AIGatewayRouteTarget} for the route handler.
|
|
375
|
-
*
|
|
376
|
-
* @title AI Gateway Model Routing (v2)
|
|
377
|
-
* @beta
|
|
378
|
-
* @product ai-gateway
|
|
379
|
-
* @requiresAI
|
|
380
|
-
* @param request - The ZuploRequest
|
|
381
|
-
* @param context - The ZuploContext
|
|
382
|
-
* @param options - The policy options set in policies.json
|
|
383
|
-
* @param policyName - The name of the policy as set in policies.json
|
|
384
|
-
* @returns The request with model routing stored in context, or a 4xx response
|
|
385
|
-
* @example
|
|
386
|
-
* ```json
|
|
387
|
-
* {
|
|
388
|
-
* "models": {
|
|
389
|
-
* "completions": {
|
|
390
|
-
* "allowList": [
|
|
391
|
-
* "openai/gpt-5",
|
|
392
|
-
* {
|
|
393
|
-
* "main": "anthropic/claude-sonnet-4-6",
|
|
394
|
-
* "backup": "openai/gpt-5-mini"
|
|
395
|
-
* }
|
|
396
|
-
* ]
|
|
397
|
-
* }
|
|
398
|
-
* }
|
|
399
|
-
* }
|
|
400
|
-
* ```
|
|
401
|
-
*/
|
|
402
|
-
export declare class AIGatewayModelRoutingV2InboundPolicy extends InboundPolicy<AIGatewayModelRoutingV2InboundPolicyOptions> {
|
|
403
|
-
#private;
|
|
404
|
-
static readonly policyType = "ai-gateway-model-routing-v2";
|
|
405
|
-
constructor(
|
|
406
|
-
options: AIGatewayModelRoutingV2InboundPolicyOptions,
|
|
407
|
-
policyName: string
|
|
408
|
-
);
|
|
409
|
-
handler(
|
|
410
|
-
request: ZuploRequest,
|
|
411
|
-
context: ZuploContext
|
|
412
|
-
): Promise<ZuploRequest | Response>;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
* Options for allowing or blocking providerName/model routes for each AI Gateway capability.
|
|
417
|
-
* @public
|
|
418
|
-
*/
|
|
419
|
-
export declare interface AIGatewayModelRoutingV2InboundPolicyOptions {
|
|
420
|
-
models: Models;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
580
|
/**
|
|
424
581
|
* Accesses the live AI Gateway provider and model catalog.
|
|
425
582
|
*
|
|
@@ -612,8 +769,9 @@ export declare interface AIGatewaySemanticCacheOutboundPolicyOptions {}
|
|
|
612
769
|
* Caching parameters (semanticTolerance, expirationSecondsTtl, namespace) come
|
|
613
770
|
* from the policy options — the policy reads nothing from
|
|
614
771
|
* `request.user.configuration` to decide whether to cache, and presence in the
|
|
615
|
-
* route's chain is what enables it.
|
|
616
|
-
*
|
|
772
|
+
* route's chain is what enables it. An authenticated AI Gateway configuration
|
|
773
|
+
* id always provides the cache namespace so application-supplied options cannot
|
|
774
|
+
* cross tenant partitions.
|
|
617
775
|
*
|
|
618
776
|
* Cache outcomes are reported on the response via the RFC 9211 `Cache-Status`
|
|
619
777
|
* header under the cache name `zp-aigw-sem-cache` (hit:
|
|
@@ -1062,12 +1220,18 @@ export declare interface AkamaiFirewallForAiOutboundPolicyOptions {
|
|
|
1062
1220
|
}
|
|
1063
1221
|
|
|
1064
1222
|
/**
|
|
1065
|
-
*
|
|
1223
|
+
* Models clients may select; the first entry is the default when model is omitted.
|
|
1066
1224
|
*
|
|
1067
1225
|
* @minItems 1
|
|
1068
1226
|
* @public
|
|
1069
1227
|
*/
|
|
1070
|
-
declare type AllowedModels = [
|
|
1228
|
+
declare type AllowedModels = [ProviderAndModel, ...ProviderAndModel[]];
|
|
1229
|
+
|
|
1230
|
+
/**
|
|
1231
|
+
* @minItems 1
|
|
1232
|
+
* @public
|
|
1233
|
+
*/
|
|
1234
|
+
declare type AllowedModels1 = [ProviderAndModel, ...ProviderAndModel[]];
|
|
1071
1235
|
|
|
1072
1236
|
/**
|
|
1073
1237
|
* Amberflo is a usage metering and billing service. This policy allows
|
|
@@ -2574,13 +2738,19 @@ declare interface BatchDispatcherOptions {
|
|
|
2574
2738
|
/* Excluded from this release type: BatchDispatchOptions */
|
|
2575
2739
|
|
|
2576
2740
|
/**
|
|
2577
|
-
*
|
|
2741
|
+
* Models rejected in open-but-filtered mode.
|
|
2578
2742
|
*
|
|
2579
2743
|
* @minItems 1
|
|
2580
2744
|
* @public
|
|
2581
2745
|
*/
|
|
2582
2746
|
declare type BlockedModels = [ProviderAndModel, ...ProviderAndModel[]];
|
|
2583
2747
|
|
|
2748
|
+
/**
|
|
2749
|
+
* @minItems 1
|
|
2750
|
+
* @public
|
|
2751
|
+
*/
|
|
2752
|
+
declare type BlockedModels1 = [ProviderAndModel, ...ProviderAndModel[]];
|
|
2753
|
+
|
|
2584
2754
|
/**
|
|
2585
2755
|
* The brownout policy allows performing scheduled downtime on your API
|
|
2586
2756
|
*
|
|
@@ -2683,7 +2853,7 @@ declare interface BuildRouteConfiguration {
|
|
|
2683
2853
|
}
|
|
2684
2854
|
|
|
2685
2855
|
/**
|
|
2686
|
-
* Partitions the cache
|
|
2856
|
+
* Partitions the cache when no authenticated AI Gateway configuration id is available. Authenticated AI Gateway applications always use their configuration id so cache entries remain isolated per tenant.
|
|
2687
2857
|
* @public
|
|
2688
2858
|
*/
|
|
2689
2859
|
declare type CacheNamespace = string;
|
|
@@ -2751,14 +2921,6 @@ export declare interface CachingInboundPolicyOptions {
|
|
|
2751
2921
|
dangerouslyIgnoreAuthorizationHeader?: boolean;
|
|
2752
2922
|
}
|
|
2753
2923
|
|
|
2754
|
-
/**
|
|
2755
|
-
* Choose curated allow-list mode or open-but-filtered block-list mode.
|
|
2756
|
-
* @public
|
|
2757
|
-
*/
|
|
2758
|
-
declare type CapabilityModelRules =
|
|
2759
|
-
| CuratedModelRules
|
|
2760
|
-
| OpenButFilteredModelRules;
|
|
2761
|
-
|
|
2762
2924
|
/**
|
|
2763
2925
|
* Controls which parts of the incoming request are sent to Akamai for inspection. Akamai's detect endpoint receives the captured fields concatenated into a single labeled text payload as `llmInput`.
|
|
2764
2926
|
* @public
|
|
@@ -3317,11 +3479,22 @@ declare interface CompatibilityFlags {
|
|
|
3317
3479
|
return501ForUnsupportedHttpMethods: boolean;
|
|
3318
3480
|
}
|
|
3319
3481
|
|
|
3482
|
+
declare interface CompletionsFallbacks {
|
|
3483
|
+
fallback?: FallbackModel;
|
|
3484
|
+
quotaFallback?: QuotaFallbackModel;
|
|
3485
|
+
}
|
|
3486
|
+
|
|
3320
3487
|
/**
|
|
3321
3488
|
* Rules for chat completions, Responses, and Anthropic Messages requests.
|
|
3322
3489
|
* @public
|
|
3323
3490
|
*/
|
|
3324
|
-
declare type CompletionsModels =
|
|
3491
|
+
declare type CompletionsModels =
|
|
3492
|
+
| {
|
|
3493
|
+
allowList: AllowedModels;
|
|
3494
|
+
}
|
|
3495
|
+
| {
|
|
3496
|
+
blockList: BlockedModels;
|
|
3497
|
+
};
|
|
3325
3498
|
|
|
3326
3499
|
/**
|
|
3327
3500
|
* @public
|
|
@@ -3746,14 +3919,6 @@ export declare class CryptoBeta extends BaseCryptoBeta {
|
|
|
3746
3919
|
digest(algorithm: string, data: string): Promise<string>;
|
|
3747
3920
|
}
|
|
3748
3921
|
|
|
3749
|
-
/**
|
|
3750
|
-
* Allow only listed targets and use entry zero as the default.
|
|
3751
|
-
* @public
|
|
3752
|
-
*/
|
|
3753
|
-
declare interface CuratedModelRules {
|
|
3754
|
-
allowList: AllowedModels;
|
|
3755
|
-
}
|
|
3756
|
-
|
|
3757
3922
|
/**
|
|
3758
3923
|
* Authenticate users using the Curity Phantom Token Pattern.
|
|
3759
3924
|
*
|
|
@@ -4266,11 +4431,22 @@ export declare class DynatraceMetricsPlugin extends MetricsPlugin {
|
|
|
4266
4431
|
static setContext(context: ZuploContext, data: DynatraceMetricsContext): void;
|
|
4267
4432
|
}
|
|
4268
4433
|
|
|
4434
|
+
declare interface EmbeddingsFallbacks {
|
|
4435
|
+
fallback?: FallbackModel;
|
|
4436
|
+
quotaFallback?: QuotaFallbackModel;
|
|
4437
|
+
}
|
|
4438
|
+
|
|
4269
4439
|
/**
|
|
4270
4440
|
* Rules for embedding requests.
|
|
4271
4441
|
* @public
|
|
4272
4442
|
*/
|
|
4273
|
-
declare type EmbeddingsModels =
|
|
4443
|
+
declare type EmbeddingsModels =
|
|
4444
|
+
| {
|
|
4445
|
+
allowList: AllowedModels1;
|
|
4446
|
+
}
|
|
4447
|
+
| {
|
|
4448
|
+
blockList: BlockedModels1;
|
|
4449
|
+
};
|
|
4274
4450
|
|
|
4275
4451
|
/**
|
|
4276
4452
|
* Enable accumulation and validation of streaming responses.
|
|
@@ -4399,7 +4575,22 @@ export declare function extractStreamTextDelta(
|
|
|
4399
4575
|
): string | undefined;
|
|
4400
4576
|
|
|
4401
4577
|
/**
|
|
4402
|
-
*
|
|
4578
|
+
* The model attempted after a retryable error or timeout.
|
|
4579
|
+
* @public
|
|
4580
|
+
*/
|
|
4581
|
+
declare type FallbackModel = string;
|
|
4582
|
+
|
|
4583
|
+
/**
|
|
4584
|
+
* Fallbacks grouped by AI Gateway capability.
|
|
4585
|
+
* @public
|
|
4586
|
+
*/
|
|
4587
|
+
declare interface FallbackModels {
|
|
4588
|
+
completions?: CompletionsFallbacks;
|
|
4589
|
+
embeddings?: EmbeddingsFallbacks;
|
|
4590
|
+
}
|
|
4591
|
+
|
|
4592
|
+
/**
|
|
4593
|
+
* How long a primary model may take before the failure fallback is attempted.
|
|
4403
4594
|
* @public
|
|
4404
4595
|
*/
|
|
4405
4596
|
declare type FallbackTimeoutSeconds = number;
|
|
@@ -9954,18 +10145,7 @@ declare interface ModelConfiguration {
|
|
|
9954
10145
|
}
|
|
9955
10146
|
|
|
9956
10147
|
/**
|
|
9957
|
-
*
|
|
9958
|
-
* @public
|
|
9959
|
-
*/
|
|
9960
|
-
declare interface ModelRouteTarget {
|
|
9961
|
-
main: ProviderAndModel1;
|
|
9962
|
-
backup?: ProviderAndModel2;
|
|
9963
|
-
fallbackTimeoutSeconds?: FallbackTimeoutSeconds;
|
|
9964
|
-
quotaFallback?: ProviderAndModel3;
|
|
9965
|
-
}
|
|
9966
|
-
|
|
9967
|
-
/**
|
|
9968
|
-
* Declarative model-routing rules, grouped by AI Gateway capability.
|
|
10148
|
+
* Model filtering rules grouped by AI Gateway capability.
|
|
9969
10149
|
* @public
|
|
9970
10150
|
*/
|
|
9971
10151
|
declare interface Models {
|
|
@@ -11121,14 +11301,6 @@ declare namespace OpenAPIV3_1 {
|
|
|
11121
11301
|
}
|
|
11122
11302
|
}
|
|
11123
11303
|
|
|
11124
|
-
/**
|
|
11125
|
-
* Allow any requested target except those explicitly blocked.
|
|
11126
|
-
* @public
|
|
11127
|
-
*/
|
|
11128
|
-
declare interface OpenButFilteredModelRules {
|
|
11129
|
-
blockList: BlockedModels;
|
|
11130
|
-
}
|
|
11131
|
-
|
|
11132
11304
|
/**
|
|
11133
11305
|
* Authorize requests using OpenFGA.
|
|
11134
11306
|
*
|
|
@@ -11852,24 +12024,6 @@ export declare interface PropelAuthJwtInboundPolicyOptions {
|
|
|
11852
12024
|
*/
|
|
11853
12025
|
declare type ProviderAndModel = string;
|
|
11854
12026
|
|
|
11855
|
-
/**
|
|
11856
|
-
* A model reference in providerName/model form, split on the first slash.
|
|
11857
|
-
* @public
|
|
11858
|
-
*/
|
|
11859
|
-
declare type ProviderAndModel1 = string;
|
|
11860
|
-
|
|
11861
|
-
/**
|
|
11862
|
-
* A model reference in providerName/model form, split on the first slash.
|
|
11863
|
-
* @public
|
|
11864
|
-
*/
|
|
11865
|
-
declare type ProviderAndModel2 = string;
|
|
11866
|
-
|
|
11867
|
-
/**
|
|
11868
|
-
* A model reference in providerName/model form, split on the first slash.
|
|
11869
|
-
* @public
|
|
11870
|
-
*/
|
|
11871
|
-
declare type ProviderAndModel3 = string;
|
|
11872
|
-
|
|
11873
12027
|
/**
|
|
11874
12028
|
* Extracts a query parameter and sets it as a header in the request.
|
|
11875
12029
|
*
|
|
@@ -11914,6 +12068,12 @@ export declare interface QuotaDetail {
|
|
|
11914
12068
|
};
|
|
11915
12069
|
}
|
|
11916
12070
|
|
|
12071
|
+
/**
|
|
12072
|
+
* The model selected after a usage-limit-exceeded signal.
|
|
12073
|
+
* @public
|
|
12074
|
+
*/
|
|
12075
|
+
declare type QuotaFallbackModel = string;
|
|
12076
|
+
|
|
11917
12077
|
/**
|
|
11918
12078
|
* Global quota fallback models, keyed by capability. Applied whenever any
|
|
11919
12079
|
* configured quota limit (any meter/period) is exceeded.
|
|
@@ -13687,12 +13847,6 @@ export declare interface RouteHandler<T = unknown> {
|
|
|
13687
13847
|
|
|
13688
13848
|
/* Excluded from this release type: Router */
|
|
13689
13849
|
|
|
13690
|
-
/**
|
|
13691
|
-
* A providerName/model string shorthand or a full model route target.
|
|
13692
|
-
* @public
|
|
13693
|
-
*/
|
|
13694
|
-
declare type RouteTarget = ProviderAndModel | ModelRouteTarget;
|
|
13695
|
-
|
|
13696
13850
|
/**
|
|
13697
13851
|
* The authorization rule evaluated against the authenticated user's claims (request.user.data, populated by the authentication policy that runs before this one — a JWT policy, API key auth, mTLS, etc.). A rule is either a single claim check (eq, in, or startsWith) or an and/or combination of nested rules. Combinators may nest up to three levels deep. Requests that fail the rule receive a 403 Forbidden response.
|
|
13698
13852
|
* @public
|
|
@@ -42,7 +42,7 @@ class SSEStreamingApi extends import_stream.StreamingApi {
|
|
|
42
42
|
const sseData = [
|
|
43
43
|
message.event && `event: ${message.event}`,
|
|
44
44
|
dataLines,
|
|
45
|
-
message.id && `id: ${message.id}`,
|
|
45
|
+
message.id !== void 0 && `id: ${message.id}`,
|
|
46
46
|
message.retry !== void 0 && `retry: ${message.retry}`
|
|
47
47
|
].filter(Boolean).join("\n") + "\n\n";
|
|
48
48
|
await this.write(sseData);
|
|
@@ -71,14 +71,20 @@ const secureHeaders = (customOptions) => {
|
|
|
71
71
|
const headersToSet = getFilteredHeaders(options);
|
|
72
72
|
const callbacks = [];
|
|
73
73
|
if (options.contentSecurityPolicy) {
|
|
74
|
-
const [callback, value] = getCSPDirectives(
|
|
74
|
+
const [callback, value] = getCSPDirectives(
|
|
75
|
+
options.contentSecurityPolicy,
|
|
76
|
+
"Content-Security-Policy"
|
|
77
|
+
);
|
|
75
78
|
if (callback) {
|
|
76
79
|
callbacks.push(callback);
|
|
77
80
|
}
|
|
78
81
|
headersToSet.push(["Content-Security-Policy", value]);
|
|
79
82
|
}
|
|
80
83
|
if (options.contentSecurityPolicyReportOnly) {
|
|
81
|
-
const [callback, value] = getCSPDirectives(
|
|
84
|
+
const [callback, value] = getCSPDirectives(
|
|
85
|
+
options.contentSecurityPolicyReportOnly,
|
|
86
|
+
"Content-Security-Policy-Report-Only"
|
|
87
|
+
);
|
|
82
88
|
if (callback) {
|
|
83
89
|
callbacks.push(callback);
|
|
84
90
|
}
|
|
@@ -111,7 +117,7 @@ function getFilteredHeaders(options) {
|
|
|
111
117
|
return typeof overrideValue === "string" ? [defaultValue[0], overrideValue] : defaultValue;
|
|
112
118
|
});
|
|
113
119
|
}
|
|
114
|
-
function getCSPDirectives(contentSecurityPolicy) {
|
|
120
|
+
function getCSPDirectives(contentSecurityPolicy, headerName) {
|
|
115
121
|
const callbacks = [];
|
|
116
122
|
const resultValues = [];
|
|
117
123
|
for (const [directive, value] of Object.entries(contentSecurityPolicy)) {
|
|
@@ -136,7 +142,7 @@ function getCSPDirectives(contentSecurityPolicy) {
|
|
|
136
142
|
resultValues.pop();
|
|
137
143
|
return callbacks.length === 0 ? [void 0, resultValues.join("")] : [
|
|
138
144
|
(ctx, headersToSet) => headersToSet.map((values) => {
|
|
139
|
-
if (values[0] ===
|
|
145
|
+
if (values[0] === headerName) {
|
|
140
146
|
const clone = values[1].slice();
|
|
141
147
|
callbacks.forEach((cb) => {
|
|
142
148
|
cb(ctx, clone);
|
|
@@ -98,7 +98,7 @@ class HonoRequest {
|
|
|
98
98
|
if (name) {
|
|
99
99
|
return this.raw.headers.get(name) ?? void 0;
|
|
100
100
|
}
|
|
101
|
-
const headerData =
|
|
101
|
+
const headerData = /* @__PURE__ */ Object.create(null);
|
|
102
102
|
this.raw.headers.forEach((value, key) => {
|
|
103
103
|
headerData[key] = value;
|
|
104
104
|
});
|
|
@@ -146,7 +146,7 @@ const getNextParam = (acceptHeader, startIndex) => {
|
|
|
146
146
|
const getNextAcceptValue = (acceptHeader, startIndex) => {
|
|
147
147
|
const accept = {
|
|
148
148
|
type: "",
|
|
149
|
-
params:
|
|
149
|
+
params: /* @__PURE__ */ Object.create(null),
|
|
150
150
|
q: 1
|
|
151
151
|
};
|
|
152
152
|
startIndex = consumeWhitespace(acceptHeader, startIndex);
|
|
@@ -192,7 +192,7 @@ const _getQueryParam = (url, key, multiple) => {
|
|
|
192
192
|
return void 0;
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
const results =
|
|
195
|
+
const results = /* @__PURE__ */ Object.create(null);
|
|
196
196
|
encoded ??= /[%+]/.test(url);
|
|
197
197
|
let keyIndex = url.indexOf("?", 8);
|
|
198
198
|
while (keyIndex !== -1) {
|
|
@@ -20,7 +20,7 @@ var SSEStreamingApi = class extends StreamingApi {
|
|
|
20
20
|
const sseData = [
|
|
21
21
|
message.event && `event: ${message.event}`,
|
|
22
22
|
dataLines,
|
|
23
|
-
message.id && `id: ${message.id}`,
|
|
23
|
+
message.id !== void 0 && `id: ${message.id}`,
|
|
24
24
|
message.retry !== void 0 && `retry: ${message.retry}`
|
|
25
25
|
].filter(Boolean).join("\n") + "\n\n";
|
|
26
26
|
await this.write(sseData);
|