@zuplo/cli 7.1.3 → 7.1.7

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.
Files changed (26) hide show
  1. package/node_modules/@zuplo/core/customer.cli.minified.js +1 -1
  2. package/node_modules/@zuplo/core/index.minified.js +1 -1
  3. package/node_modules/@zuplo/core/package.json +1 -1
  4. package/node_modules/@zuplo/graphql/package.json +1 -1
  5. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  6. package/node_modules/@zuplo/otel/package.json +1 -1
  7. package/node_modules/@zuplo/runtime/out/esm/{chunk-CJFLOF27.js → chunk-B3D32RUX.js} +1 -1
  8. package/node_modules/@zuplo/runtime/out/esm/{chunk-CJFLOF27.js.map → chunk-B3D32RUX.js.map} +1 -1
  9. package/node_modules/@zuplo/runtime/out/esm/{chunk-GFACQ5CL.js → chunk-ZNBAIHML.js} +82 -82
  10. package/node_modules/@zuplo/runtime/out/esm/chunk-ZNBAIHML.js.map +1 -0
  11. package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
  12. package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
  13. package/node_modules/@zuplo/runtime/out/esm/internal/index.js +1 -1
  14. package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
  15. package/node_modules/@zuplo/runtime/out/types/index.d.ts +57 -13
  16. package/node_modules/@zuplo/runtime/package.json +1 -1
  17. package/node_modules/hono/dist/cjs/middleware/etag/index.js +4 -1
  18. package/node_modules/hono/dist/cjs/router/trie-router/node.js +1 -1
  19. package/node_modules/hono/dist/cjs/utils/stream.js +5 -2
  20. package/node_modules/hono/dist/middleware/etag/index.js +4 -1
  21. package/node_modules/hono/dist/router/trie-router/node.js +1 -1
  22. package/node_modules/hono/dist/utils/stream.js +5 -2
  23. package/node_modules/hono/package.json +1 -1
  24. package/package.json +6 -6
  25. package/node_modules/@zuplo/runtime/out/esm/chunk-GFACQ5CL.js.map +0 -1
  26. /package/node_modules/@zuplo/runtime/out/esm/{chunk-GFACQ5CL.js.LEGAL.txt → chunk-ZNBAIHML.js.LEGAL.txt} +0 -0
@@ -245,19 +245,21 @@ export declare type AIGatewayCapability =
245
245
  | "audio_transcriptions";
246
246
 
247
247
  /**
248
- * Loads the app configuration for the request (when auth has not already) and
249
- * runs the inbound policy chain from that configuration.
250
- *
251
- * Place this policy on AI Gateway v2 routes after optional authentication.
252
- * When `ai-gateway-auth-v2-inbound` already populated the app-configuration
253
- * channel, this policy reuses it. Otherwise it loads the configuration with
254
- * the route's `app_id` path parameter. Applications select from policies
255
- * pre-declared by the gateway. Applications without a `inboundPolicyChain`,
256
- * or with an empty chain, run no application-selected policies.
257
- * Entry options replace the declaration's options as a complete object; omit
258
- * them to inherit the declaration, including environment-backed credentials.
259
- * Each occurrence receives a private deep copy of its entry options, so a
260
- * policy mutating its options cannot corrupt the cached app configuration.
248
+ * Loads the app configuration for the request (when auth or the configuration
249
+ * loader has not already) and runs the inbound policy chain from that
250
+ * configuration.
251
+ *
252
+ * Place this policy on AI Gateway v2 routes after optional authentication and
253
+ * optional `ai-gateway-configuration-loader-v2-inbound`. When either of those
254
+ * already populated the app-configuration channel, this policy reuses it.
255
+ * Otherwise it loads the configuration with the route's `app_id` path
256
+ * parameter. Applications select from policies pre-declared by the gateway.
257
+ * Applications without a `inboundPolicyChain`, or with an empty chain, run no
258
+ * application-selected policies. Entry options replace the declaration's
259
+ * options as a complete object; omit them to inherit the declaration,
260
+ * including environment-backed credentials. Each occurrence receives a private
261
+ * deep copy of its entry options, so a policy mutating its options cannot
262
+ * corrupt the cached app configuration.
261
263
  *
262
264
  * @title AI Gateway Configuration Executor (v2)
263
265
  * @product ai-gateway
@@ -288,6 +290,48 @@ export declare interface AIGatewayConfigurationExecutorV2InboundPolicyOptions {
288
290
  cacheTtlSeconds?: number;
289
291
  }
290
292
 
293
+ /**
294
+ * Loads the AI Gateway app configuration for the request into the
295
+ * request-scoped channel and does nothing else.
296
+ *
297
+ * Place this policy on AI Gateway v2 routes before
298
+ * `ai-gateway-configuration-executor-v2-inbound` when you want configuration
299
+ * loading separated from chain execution. When `ai-gateway-auth-v2-inbound`
300
+ * already populated the channel, this policy reuses it. Otherwise it loads
301
+ * the configuration with the route's `app_id` path parameter.
302
+ *
303
+ * If this policy is omitted, the configuration executor still loads
304
+ * configuration itself before running the application chain.
305
+ *
306
+ * @title AI Gateway Configuration Loader (v2)
307
+ * @product ai-gateway
308
+ * @hidden
309
+ * @requiresAI
310
+ */
311
+ export declare class AIGatewayConfigurationLoaderV2InboundPolicy extends InboundPolicy<AIGatewayConfigurationLoaderV2InboundPolicyOptions> {
312
+ #private;
313
+ static readonly policyType = "ai-gateway-configuration-loader-v2";
314
+ constructor(
315
+ options: AIGatewayConfigurationLoaderV2InboundPolicyOptions,
316
+ policyName: string
317
+ );
318
+ handler(
319
+ request: ZuploRequest,
320
+ context: ZuploContext
321
+ ): Promise<ZuploRequest | Response>;
322
+ }
323
+
324
+ /**
325
+ * Options for loading each application's AI Gateway configuration into the request-scoped channel.
326
+ * @public
327
+ */
328
+ export declare interface AIGatewayConfigurationLoaderV2InboundPolicyOptions {
329
+ /**
330
+ * The time to cache app configurations loaded by app_id. Higher values decrease latency. Cached results remain valid until the cache expires even if the configuration changes in the portal. When ai-gateway-auth-v2-inbound already loaded the configuration for the request, this cache is not used.
331
+ */
332
+ cacheTtlSeconds?: number;
333
+ }
334
+
291
335
  /**
292
336
  * Adds failure and quota fallbacks to an existing AI Gateway model selection.
293
337
  *
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "7.1.3",
4
+ "version": "7.1.7",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
@@ -54,6 +54,9 @@ const etag = (options) => {
54
54
  return async function etag2(c, next) {
55
55
  const ifNoneMatch = c.req.header("If-None-Match") ?? null;
56
56
  await next();
57
+ if (!(c.req.method === "GET" || c.req.method === "HEAD" || c.req.method === "QUERY") || !c.res.ok) {
58
+ return;
59
+ }
57
60
  const res = c.res;
58
61
  let etag3 = res.headers.get("ETag");
59
62
  if (!etag3) {
@@ -70,7 +73,7 @@ const etag = (options) => {
70
73
  }
71
74
  etag3 = weak ? `W/"${hash}"` : `"${hash}"`;
72
75
  }
73
- const matched = ifNoneMatch === "*" ? (c.req.method === "GET" || c.req.method === "HEAD" || c.req.method === "QUERY") && res.ok : etagMatches(etag3, ifNoneMatch);
76
+ const matched = ifNoneMatch === "*" || etagMatches(etag3, ifNoneMatch);
74
77
  if (matched) {
75
78
  c.res = new Response(null, {
76
79
  status: 304,
@@ -166,7 +166,7 @@ class Node {
166
166
  }
167
167
  if (hasChildren(child.#children)) {
168
168
  child.#params = params;
169
- const componentCount = m[0].match(/\//)?.length ?? 0;
169
+ const componentCount = m[0].match(/\//g)?.length ?? 0;
170
170
  const targetCurNodes = curNodesQueue[componentCount] ||= [];
171
171
  targetCurNodes.push(child);
172
172
  }
@@ -80,8 +80,11 @@ class StreamingApi {
80
80
  }
81
81
  async pipe(body) {
82
82
  this.writer.releaseLock();
83
- await body.pipeTo(this.writable, { preventClose: true });
84
- this.writer = this.writable.getWriter();
83
+ try {
84
+ await body.pipeTo(this.writable, { preventClose: true, preventAbort: true });
85
+ } finally {
86
+ this.writer = this.writable.getWriter();
87
+ }
85
88
  }
86
89
  onAbort(listener) {
87
90
  this.abortSubscribers.push(listener);
@@ -32,6 +32,9 @@ var etag = (options) => {
32
32
  return async function etag2(c, next) {
33
33
  const ifNoneMatch = c.req.header("If-None-Match") ?? null;
34
34
  await next();
35
+ if (!(c.req.method === "GET" || c.req.method === "HEAD" || c.req.method === "QUERY") || !c.res.ok) {
36
+ return;
37
+ }
35
38
  const res = c.res;
36
39
  let etag3 = res.headers.get("ETag");
37
40
  if (!etag3) {
@@ -48,7 +51,7 @@ var etag = (options) => {
48
51
  }
49
52
  etag3 = weak ? `W/"${hash}"` : `"${hash}"`;
50
53
  }
51
- const matched = ifNoneMatch === "*" ? (c.req.method === "GET" || c.req.method === "HEAD" || c.req.method === "QUERY") && res.ok : etagMatches(etag3, ifNoneMatch);
54
+ const matched = ifNoneMatch === "*" || etagMatches(etag3, ifNoneMatch);
52
55
  if (matched) {
53
56
  c.res = new Response(null, {
54
57
  status: 304,
@@ -145,7 +145,7 @@ var Node = class _Node {
145
145
  }
146
146
  if (hasChildren(child.#children)) {
147
147
  child.#params = params;
148
- const componentCount = m[0].match(/\//)?.length ?? 0;
148
+ const componentCount = m[0].match(/\//g)?.length ?? 0;
149
149
  const targetCurNodes = curNodesQueue[componentCount] ||= [];
150
150
  targetCurNodes.push(child);
151
151
  }
@@ -59,8 +59,11 @@ var StreamingApi = class {
59
59
  }
60
60
  async pipe(body) {
61
61
  this.writer.releaseLock();
62
- await body.pipeTo(this.writable, { preventClose: true });
63
- this.writer = this.writable.getWriter();
62
+ try {
63
+ await body.pipeTo(this.writable, { preventClose: true, preventAbort: true });
64
+ } finally {
65
+ this.writer = this.writable.getWriter();
66
+ }
64
67
  }
65
68
  onAbort(listener) {
66
69
  this.abortSubscribers.push(listener);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hono",
3
- "version": "4.13.0",
3
+ "version": "4.13.1",
4
4
  "description": "Web framework built on Web Standards",
5
5
  "main": "dist/cjs/index.js",
6
6
  "type": "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "7.1.3",
3
+ "version": "7.1.7",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "type": "module",
@@ -28,10 +28,10 @@
28
28
  "@opentelemetry/api": "1.9.0",
29
29
  "@opentelemetry/api-logs": "0.220.0",
30
30
  "@swc/core": "1.10.18",
31
- "@zuplo/core": "7.1.3",
31
+ "@zuplo/core": "7.1.7",
32
32
  "@zuplo/editor": "1.0.31094607111",
33
- "@zuplo/openapi-tools": "7.1.3",
34
- "@zuplo/runtime": "7.1.3",
33
+ "@zuplo/openapi-tools": "7.1.7",
34
+ "@zuplo/runtime": "7.1.7",
35
35
  "chalk": "5.4.1",
36
36
  "chokidar": "3.5.3",
37
37
  "cookie": "1.0.2",
@@ -62,8 +62,8 @@
62
62
  "workerd": "1.20241230.0",
63
63
  "yargs": "17.7.2",
64
64
  "zod": "4.4.3",
65
- "@zuplo/graphql": "7.1.3",
66
- "@zuplo/otel": "7.1.3"
65
+ "@zuplo/graphql": "7.1.7",
66
+ "@zuplo/otel": "7.1.7"
67
67
  },
68
68
  "bundleDependencies": [
69
69
  "@inquirer/prompts",