@zuplo/cli 6.73.13 → 6.73.14

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.
@@ -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,41 @@ 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
+
163
277
  /**
164
278
  * Handler that routes AI/LLM requests through Zuplo's LLM Translation Layer.
165
279
  * This handler forwards requests to the translation layer that handles provider-specific
@@ -612,8 +726,9 @@ export declare interface AIGatewaySemanticCacheOutboundPolicyOptions {}
612
726
  * Caching parameters (semanticTolerance, expirationSecondsTtl, namespace) come
613
727
  * from the policy options — the policy reads nothing from
614
728
  * `request.user.configuration` to decide whether to cache, and presence in the
615
- * route's chain is what enables it. `namespace` defaults to the AI Gateway
616
- * configuration id when omitted so caching stays scoped per tenant.
729
+ * route's chain is what enables it. An authenticated AI Gateway configuration
730
+ * id always provides the cache namespace so application-supplied options cannot
731
+ * cross tenant partitions.
617
732
  *
618
733
  * Cache outcomes are reported on the response via the RFC 9211 `Cache-Status`
619
734
  * header under the cache name `zp-aigw-sem-cache` (hit:
@@ -2683,7 +2798,7 @@ declare interface BuildRouteConfiguration {
2683
2798
  }
2684
2799
 
2685
2800
  /**
2686
- * Partitions the cache. Omit to default to the AI Gateway configuration id, which keeps caching scoped per tenant.
2801
+ * 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
2802
  * @public
2688
2803
  */
2689
2804
  declare type CacheNamespace = string;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "6.73.13",
4
+ "version": "6.73.14",
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": "6.73.13",
3
+ "version": "6.73.14",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "type": "module",
@@ -27,10 +27,10 @@
27
27
  "@opentelemetry/api": "1.9.0",
28
28
  "@opentelemetry/api-logs": "0.201.1",
29
29
  "@swc/core": "1.10.18",
30
- "@zuplo/core": "6.73.13",
30
+ "@zuplo/core": "6.73.14",
31
31
  "@zuplo/editor": "1.0.29844086763",
32
- "@zuplo/openapi-tools": "6.73.13",
33
- "@zuplo/runtime": "6.73.13",
32
+ "@zuplo/openapi-tools": "6.73.14",
33
+ "@zuplo/runtime": "6.73.14",
34
34
  "chalk": "5.4.1",
35
35
  "chokidar": "3.5.3",
36
36
  "cookie": "1.0.2",
@@ -61,8 +61,8 @@
61
61
  "workerd": "1.20241230.0",
62
62
  "yargs": "17.7.2",
63
63
  "zod": "3.25.76",
64
- "@zuplo/graphql": "6.73.13",
65
- "@zuplo/otel": "6.73.13"
64
+ "@zuplo/graphql": "6.73.14",
65
+ "@zuplo/otel": "6.73.14"
66
66
  },
67
67
  "bundleDependencies": [
68
68
  "@inquirer/prompts",