@kubb/agent 5.0.0-beta.2 → 5.0.0-beta.3

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "date": "2026-04-30T13:48:19.478Z",
2
+ "date": "2026-04-30T15:28:52.702Z",
3
3
  "preset": "node-server",
4
4
  "framework": {
5
5
  "name": "nitro",
@@ -90,26 +90,26 @@ function destr(value, options = {}) {
90
90
  }
91
91
  }
92
92
 
93
- const HASH_RE$1 = /#/g;
94
- const AMPERSAND_RE$1 = /&/g;
95
- const SLASH_RE$1 = /\//g;
96
- const EQUAL_RE$1 = /=/g;
97
- const PLUS_RE$1 = /\+/g;
98
- const ENC_CARET_RE$1 = /%5e/gi;
99
- const ENC_BACKTICK_RE$1 = /%60/gi;
100
- const ENC_PIPE_RE$1 = /%7c/gi;
101
- const ENC_SPACE_RE$1 = /%20/gi;
93
+ const HASH_RE = /#/g;
94
+ const AMPERSAND_RE = /&/g;
95
+ const SLASH_RE = /\//g;
96
+ const EQUAL_RE = /=/g;
97
+ const PLUS_RE = /\+/g;
98
+ const ENC_CARET_RE = /%5e/gi;
99
+ const ENC_BACKTICK_RE = /%60/gi;
100
+ const ENC_PIPE_RE = /%7c/gi;
101
+ const ENC_SPACE_RE = /%20/gi;
102
102
  const ENC_SLASH_RE = /%2f/gi;
103
- function encode$1(text) {
104
- return encodeURI("" + text).replace(ENC_PIPE_RE$1, "|");
103
+ function encode(text) {
104
+ return encodeURI("" + text).replace(ENC_PIPE_RE, "|");
105
105
  }
106
- function encodeQueryValue$1(input) {
107
- return encode$1(typeof input === "string" ? input : JSON.stringify(input)).replace(PLUS_RE$1, "%2B").replace(ENC_SPACE_RE$1, "+").replace(HASH_RE$1, "%23").replace(AMPERSAND_RE$1, "%26").replace(ENC_BACKTICK_RE$1, "`").replace(ENC_CARET_RE$1, "^").replace(SLASH_RE$1, "%2F");
106
+ function encodeQueryValue(input) {
107
+ return encode(typeof input === "string" ? input : JSON.stringify(input)).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CARET_RE, "^").replace(SLASH_RE, "%2F");
108
108
  }
109
- function encodeQueryKey$1(text) {
110
- return encodeQueryValue$1(text).replace(EQUAL_RE$1, "%3D");
109
+ function encodeQueryKey(text) {
110
+ return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
111
111
  }
112
- function decode$1(text = "") {
112
+ function decode(text = "") {
113
113
  try {
114
114
  return decodeURIComponent("" + text);
115
115
  } catch {
@@ -117,16 +117,16 @@ function decode$1(text = "") {
117
117
  }
118
118
  }
119
119
  function decodePath(text) {
120
- return decode$1(text.replace(ENC_SLASH_RE, "%252F"));
120
+ return decode(text.replace(ENC_SLASH_RE, "%252F"));
121
121
  }
122
- function decodeQueryKey$1(text) {
123
- return decode$1(text.replace(PLUS_RE$1, " "));
122
+ function decodeQueryKey(text) {
123
+ return decode(text.replace(PLUS_RE, " "));
124
124
  }
125
- function decodeQueryValue$1(text) {
126
- return decode$1(text.replace(PLUS_RE$1, " "));
125
+ function decodeQueryValue(text) {
126
+ return decode(text.replace(PLUS_RE, " "));
127
127
  }
128
128
 
129
- function parseQuery$1(parametersString = "") {
129
+ function parseQuery(parametersString = "") {
130
130
  const object = /* @__PURE__ */ Object.create(null);
131
131
  if (parametersString[0] === "?") {
132
132
  parametersString = parametersString.slice(1);
@@ -136,11 +136,11 @@ function parseQuery$1(parametersString = "") {
136
136
  if (s.length < 2) {
137
137
  continue;
138
138
  }
139
- const key = decodeQueryKey$1(s[1]);
139
+ const key = decodeQueryKey(s[1]);
140
140
  if (key === "__proto__" || key === "constructor") {
141
141
  continue;
142
142
  }
143
- const value = decodeQueryValue$1(s[2] || "");
143
+ const value = decodeQueryValue(s[2] || "");
144
144
  if (object[key] === void 0) {
145
145
  object[key] = value;
146
146
  } else if (Array.isArray(object[key])) {
@@ -151,48 +151,48 @@ function parseQuery$1(parametersString = "") {
151
151
  }
152
152
  return object;
153
153
  }
154
- function encodeQueryItem$1(key, value) {
154
+ function encodeQueryItem(key, value) {
155
155
  if (typeof value === "number" || typeof value === "boolean") {
156
156
  value = String(value);
157
157
  }
158
158
  if (!value) {
159
- return encodeQueryKey$1(key);
159
+ return encodeQueryKey(key);
160
160
  }
161
161
  if (Array.isArray(value)) {
162
162
  return value.map(
163
- (_value) => `${encodeQueryKey$1(key)}=${encodeQueryValue$1(_value)}`
163
+ (_value) => `${encodeQueryKey(key)}=${encodeQueryValue(_value)}`
164
164
  ).join("&");
165
165
  }
166
- return `${encodeQueryKey$1(key)}=${encodeQueryValue$1(value)}`;
166
+ return `${encodeQueryKey(key)}=${encodeQueryValue(value)}`;
167
167
  }
168
- function stringifyQuery$1(query) {
169
- return Object.keys(query).filter((k) => query[k] !== void 0).map((k) => encodeQueryItem$1(k, query[k])).filter(Boolean).join("&");
168
+ function stringifyQuery(query) {
169
+ return Object.keys(query).filter((k) => query[k] !== void 0).map((k) => encodeQueryItem(k, query[k])).filter(Boolean).join("&");
170
170
  }
171
171
 
172
- const PROTOCOL_STRICT_REGEX$1 = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/;
173
- const PROTOCOL_REGEX$1 = /^[\s\w\0+.-]{2,}:([/\\]{2})?/;
174
- const PROTOCOL_RELATIVE_REGEX$1 = /^([/\\]\s*){2,}[^/\\]/;
175
- const JOIN_LEADING_SLASH_RE$1 = /^\.?\//;
176
- function hasProtocol$1(inputString, opts = {}) {
172
+ const PROTOCOL_STRICT_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/;
173
+ const PROTOCOL_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{2})?/;
174
+ const PROTOCOL_RELATIVE_REGEX = /^([/\\]\s*){2,}[^/\\]/;
175
+ const JOIN_LEADING_SLASH_RE = /^\.?\//;
176
+ function hasProtocol(inputString, opts = {}) {
177
177
  if (typeof opts === "boolean") {
178
178
  opts = { acceptRelative: opts };
179
179
  }
180
180
  if (opts.strict) {
181
- return PROTOCOL_STRICT_REGEX$1.test(inputString);
181
+ return PROTOCOL_STRICT_REGEX.test(inputString);
182
182
  }
183
- return PROTOCOL_REGEX$1.test(inputString) || (opts.acceptRelative ? PROTOCOL_RELATIVE_REGEX$1.test(inputString) : false);
183
+ return PROTOCOL_REGEX.test(inputString) || (opts.acceptRelative ? PROTOCOL_RELATIVE_REGEX.test(inputString) : false);
184
184
  }
185
- function hasTrailingSlash$1(input = "", respectQueryAndFragment) {
185
+ function hasTrailingSlash(input = "", respectQueryAndFragment) {
186
186
  {
187
187
  return input.endsWith("/");
188
188
  }
189
189
  }
190
- function withoutTrailingSlash$1(input = "", respectQueryAndFragment) {
190
+ function withoutTrailingSlash(input = "", respectQueryAndFragment) {
191
191
  {
192
- return (hasTrailingSlash$1(input) ? input.slice(0, -1) : input) || "/";
192
+ return (hasTrailingSlash(input) ? input.slice(0, -1) : input) || "/";
193
193
  }
194
194
  }
195
- function withTrailingSlash$1(input = "", respectQueryAndFragment) {
195
+ function withTrailingSlash(input = "", respectQueryAndFragment) {
196
196
  {
197
197
  return input.endsWith("/") ? input : input + "/";
198
198
  }
@@ -204,36 +204,54 @@ function withLeadingSlash(input = "") {
204
204
  return hasLeadingSlash(input) ? input : "/" + input;
205
205
  }
206
206
  function withBase(input, base) {
207
- if (isEmptyURL$1(base) || hasProtocol$1(input)) {
207
+ if (isEmptyURL(base) || hasProtocol(input)) {
208
208
  return input;
209
209
  }
210
- const _base = withoutTrailingSlash$1(base);
210
+ const _base = withoutTrailingSlash(base);
211
211
  if (input.startsWith(_base)) {
212
212
  const nextChar = input[_base.length];
213
213
  if (!nextChar || nextChar === "/" || nextChar === "?") {
214
214
  return input;
215
215
  }
216
216
  }
217
- return joinURL$1(_base, input);
217
+ return joinURL(_base, input);
218
218
  }
219
- function withQuery$1(input, query) {
220
- const parsed = parseURL$1(input);
221
- const mergedQuery = { ...parseQuery$1(parsed.search), ...query };
222
- parsed.search = stringifyQuery$1(mergedQuery);
223
- return stringifyParsedURL$1(parsed);
219
+ function withoutBase(input, base) {
220
+ if (isEmptyURL(base)) {
221
+ return input;
222
+ }
223
+ const _base = withoutTrailingSlash(base);
224
+ if (!input.startsWith(_base)) {
225
+ return input;
226
+ }
227
+ const nextChar = input[_base.length];
228
+ if (nextChar && nextChar !== "/" && nextChar !== "?") {
229
+ return input;
230
+ }
231
+ const trimmed = input.slice(_base.length).replace(/^\/+/, "");
232
+ return "/" + trimmed;
224
233
  }
225
- function isEmptyURL$1(url) {
234
+ function withQuery(input, query) {
235
+ const parsed = parseURL(input);
236
+ const mergedQuery = { ...parseQuery(parsed.search), ...query };
237
+ parsed.search = stringifyQuery(mergedQuery);
238
+ return stringifyParsedURL(parsed);
239
+ }
240
+ function getQuery(input) {
241
+ return parseQuery(parseURL(input).search);
242
+ }
243
+ function isEmptyURL(url) {
226
244
  return !url || url === "/";
227
245
  }
228
- function isNonEmptyURL$1(url) {
246
+ function isNonEmptyURL(url) {
229
247
  return url && url !== "/";
230
248
  }
231
- function joinURL$1(base, ...input) {
249
+ function joinURL(base, ...input) {
232
250
  let url = base || "";
233
- for (const segment of input.filter((url2) => isNonEmptyURL$1(url2))) {
251
+ for (const segment of input.filter((url2) => isNonEmptyURL(url2))) {
234
252
  if (url) {
235
- const _segment = segment.replace(JOIN_LEADING_SLASH_RE$1, "");
236
- url = withTrailingSlash$1(url) + _segment;
253
+ const _segment = segment.replace(JOIN_LEADING_SLASH_RE, "");
254
+ url = withTrailingSlash(url) + _segment;
237
255
  } else {
238
256
  url = segment;
239
257
  }
@@ -241,8 +259,8 @@ function joinURL$1(base, ...input) {
241
259
  return url;
242
260
  }
243
261
 
244
- const protocolRelative$1 = Symbol.for("ufo:protocolRelative");
245
- function parseURL$1(input = "", defaultProto) {
262
+ const protocolRelative = Symbol.for("ufo:protocolRelative");
263
+ function parseURL(input = "", defaultProto) {
246
264
  const _specialProtoMatch = input.match(
247
265
  /^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i
248
266
  );
@@ -258,15 +276,15 @@ function parseURL$1(input = "", defaultProto) {
258
276
  hash: ""
259
277
  };
260
278
  }
261
- if (!hasProtocol$1(input, { acceptRelative: true })) {
262
- return parsePath$1(input);
279
+ if (!hasProtocol(input, { acceptRelative: true })) {
280
+ return parsePath(input);
263
281
  }
264
282
  const [, protocol = "", auth, hostAndPath = ""] = input.replace(/\\/g, "/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/) || [];
265
283
  let [, host = "", path = ""] = hostAndPath.match(/([^#/?]*)(.*)?/) || [];
266
284
  if (protocol === "file:") {
267
285
  path = path.replace(/\/(?=[A-Za-z]:)/, "");
268
286
  }
269
- const { pathname, search, hash } = parsePath$1(path);
287
+ const { pathname, search, hash } = parsePath(path);
270
288
  return {
271
289
  protocol: protocol.toLowerCase(),
272
290
  auth: auth ? auth.slice(0, Math.max(0, auth.length - 1)) : "",
@@ -274,10 +292,10 @@ function parseURL$1(input = "", defaultProto) {
274
292
  pathname,
275
293
  search,
276
294
  hash,
277
- [protocolRelative$1]: !protocol
295
+ [protocolRelative]: !protocol
278
296
  };
279
297
  }
280
- function parsePath$1(input = "") {
298
+ function parsePath(input = "") {
281
299
  const [pathname = "", search = "", hash = ""] = (input.match(/([^#?]*)(\?[^#]*)?(#.*)?/) || []).splice(1);
282
300
  return {
283
301
  pathname,
@@ -285,13 +303,13 @@ function parsePath$1(input = "") {
285
303
  hash
286
304
  };
287
305
  }
288
- function stringifyParsedURL$1(parsed) {
306
+ function stringifyParsedURL(parsed) {
289
307
  const pathname = parsed.pathname || "";
290
308
  const search = parsed.search ? (parsed.search.startsWith("?") ? "" : "?") + parsed.search : "";
291
309
  const hash = parsed.hash || "";
292
310
  const auth = parsed.auth ? parsed.auth + "@" : "";
293
311
  const host = parsed.host || "";
294
- const proto = parsed.protocol || parsed[protocolRelative$1] ? (parsed.protocol || "") + "//" : "";
312
+ const proto = parsed.protocol || parsed[protocolRelative] ? (parsed.protocol || "") + "//" : "";
295
313
  return proto + auth + host + pathname + search + hash;
296
314
  }
297
315
 
@@ -1591,7 +1609,7 @@ function createResolver(stack) {
1591
1609
  res = {
1592
1610
  ...res,
1593
1611
  ..._res,
1594
- route: joinURL$1(res.route || "/", _res.route || "/")
1612
+ route: joinURL(res.route || "/", _res.route || "/")
1595
1613
  };
1596
1614
  }
1597
1615
  return res;
@@ -1609,7 +1627,7 @@ function normalizeLayer(input) {
1609
1627
  handler = toEventHandler(handler, void 0, input.route);
1610
1628
  }
1611
1629
  return {
1612
- route: withoutTrailingSlash$1(input.route),
1630
+ route: withoutTrailingSlash(input.route),
1613
1631
  match: input.match,
1614
1632
  handler
1615
1633
  };
@@ -1676,7 +1694,7 @@ function websocketOptions(evResolver, appOptions) {
1676
1694
  ...appOptions.websocket,
1677
1695
  async resolve(info) {
1678
1696
  const url = info.request?.url || info.url || "/";
1679
- const { pathname } = typeof url === "string" ? parseURL$1(url) : url;
1697
+ const { pathname } = typeof url === "string" ? parseURL(url) : url;
1680
1698
  const resolved = await evResolver(pathname);
1681
1699
  return resolved?.handler?.__websocket__ || {};
1682
1700
  }
@@ -2268,7 +2286,7 @@ function createFetch(globalOptions = {}) {
2268
2286
  context.request = withBase(context.request, context.options.baseURL);
2269
2287
  }
2270
2288
  if (context.options.query) {
2271
- context.request = withQuery$1(context.request, context.options.query);
2289
+ context.request = withQuery(context.request, context.options.query);
2272
2290
  delete context.options.query;
2273
2291
  }
2274
2292
  if ("query" in context.options) {
@@ -2413,206 +2431,6 @@ const Headers$1 = globalThis.Headers || s$1;
2413
2431
  const AbortController = globalThis.AbortController || i;
2414
2432
  createFetch({ fetch, Headers: Headers$1, AbortController });
2415
2433
 
2416
- const HASH_RE = /#/g;
2417
- const AMPERSAND_RE = /&/g;
2418
- const SLASH_RE = /\//g;
2419
- const EQUAL_RE = /=/g;
2420
- const PLUS_RE = /\+/g;
2421
- const ENC_CARET_RE = /%5e/gi;
2422
- const ENC_BACKTICK_RE = /%60/gi;
2423
- const ENC_PIPE_RE = /%7c/gi;
2424
- const ENC_SPACE_RE = /%20/gi;
2425
- function encode(text) {
2426
- return encodeURI("" + text).replace(ENC_PIPE_RE, "|");
2427
- }
2428
- function encodeQueryValue(input) {
2429
- return encode(typeof input === "string" ? input : JSON.stringify(input)).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CARET_RE, "^").replace(SLASH_RE, "%2F");
2430
- }
2431
- function encodeQueryKey(text) {
2432
- return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
2433
- }
2434
- function decode(text = "") {
2435
- try {
2436
- return decodeURIComponent("" + text);
2437
- } catch {
2438
- return "" + text;
2439
- }
2440
- }
2441
- function decodeQueryKey(text) {
2442
- return decode(text.replace(PLUS_RE, " "));
2443
- }
2444
- function decodeQueryValue(text) {
2445
- return decode(text.replace(PLUS_RE, " "));
2446
- }
2447
-
2448
- function parseQuery(parametersString = "") {
2449
- const object = /* @__PURE__ */ Object.create(null);
2450
- if (parametersString[0] === "?") {
2451
- parametersString = parametersString.slice(1);
2452
- }
2453
- for (const parameter of parametersString.split("&")) {
2454
- const s = parameter.match(/([^=]+)=?(.*)/) || [];
2455
- if (s.length < 2) {
2456
- continue;
2457
- }
2458
- const key = decodeQueryKey(s[1]);
2459
- if (key === "__proto__" || key === "constructor") {
2460
- continue;
2461
- }
2462
- const value = decodeQueryValue(s[2] || "");
2463
- if (object[key] === void 0) {
2464
- object[key] = value;
2465
- } else if (Array.isArray(object[key])) {
2466
- object[key].push(value);
2467
- } else {
2468
- object[key] = [object[key], value];
2469
- }
2470
- }
2471
- return object;
2472
- }
2473
- function encodeQueryItem(key, value) {
2474
- if (typeof value === "number" || typeof value === "boolean") {
2475
- value = String(value);
2476
- }
2477
- if (!value) {
2478
- return encodeQueryKey(key);
2479
- }
2480
- if (Array.isArray(value)) {
2481
- return value.map(
2482
- (_value) => `${encodeQueryKey(key)}=${encodeQueryValue(_value)}`
2483
- ).join("&");
2484
- }
2485
- return `${encodeQueryKey(key)}=${encodeQueryValue(value)}`;
2486
- }
2487
- function stringifyQuery(query) {
2488
- return Object.keys(query).filter((k) => query[k] !== void 0).map((k) => encodeQueryItem(k, query[k])).filter(Boolean).join("&");
2489
- }
2490
-
2491
- const PROTOCOL_STRICT_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/;
2492
- const PROTOCOL_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{2})?/;
2493
- const PROTOCOL_RELATIVE_REGEX = /^([/\\]\s*){2,}[^/\\]/;
2494
- const JOIN_LEADING_SLASH_RE = /^\.?\//;
2495
- function hasProtocol(inputString, opts = {}) {
2496
- if (typeof opts === "boolean") {
2497
- opts = { acceptRelative: opts };
2498
- }
2499
- if (opts.strict) {
2500
- return PROTOCOL_STRICT_REGEX.test(inputString);
2501
- }
2502
- return PROTOCOL_REGEX.test(inputString) || (opts.acceptRelative ? PROTOCOL_RELATIVE_REGEX.test(inputString) : false);
2503
- }
2504
- function hasTrailingSlash(input = "", respectQueryAndFragment) {
2505
- {
2506
- return input.endsWith("/");
2507
- }
2508
- }
2509
- function withoutTrailingSlash(input = "", respectQueryAndFragment) {
2510
- {
2511
- return (hasTrailingSlash(input) ? input.slice(0, -1) : input) || "/";
2512
- }
2513
- }
2514
- function withTrailingSlash(input = "", respectQueryAndFragment) {
2515
- {
2516
- return input.endsWith("/") ? input : input + "/";
2517
- }
2518
- }
2519
- function withoutBase(input, base) {
2520
- if (isEmptyURL(base)) {
2521
- return input;
2522
- }
2523
- const _base = withoutTrailingSlash(base);
2524
- if (!input.startsWith(_base)) {
2525
- return input;
2526
- }
2527
- const nextChar = input[_base.length];
2528
- if (nextChar && nextChar !== "/" && nextChar !== "?") {
2529
- return input;
2530
- }
2531
- const trimmed = input.slice(_base.length).replace(/^\/+/, "");
2532
- return "/" + trimmed;
2533
- }
2534
- function withQuery(input, query) {
2535
- const parsed = parseURL(input);
2536
- const mergedQuery = { ...parseQuery(parsed.search), ...query };
2537
- parsed.search = stringifyQuery(mergedQuery);
2538
- return stringifyParsedURL(parsed);
2539
- }
2540
- function getQuery(input) {
2541
- return parseQuery(parseURL(input).search);
2542
- }
2543
- function isEmptyURL(url) {
2544
- return !url || url === "/";
2545
- }
2546
- function isNonEmptyURL(url) {
2547
- return url && url !== "/";
2548
- }
2549
- function joinURL(base, ...input) {
2550
- let url = base || "";
2551
- for (const segment of input.filter((url2) => isNonEmptyURL(url2))) {
2552
- if (url) {
2553
- const _segment = segment.replace(JOIN_LEADING_SLASH_RE, "");
2554
- url = withTrailingSlash(url) + _segment;
2555
- } else {
2556
- url = segment;
2557
- }
2558
- }
2559
- return url;
2560
- }
2561
-
2562
- const protocolRelative = Symbol.for("ufo:protocolRelative");
2563
- function parseURL(input = "", defaultProto) {
2564
- const _specialProtoMatch = input.match(
2565
- /^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i
2566
- );
2567
- if (_specialProtoMatch) {
2568
- const [, _proto, _pathname = ""] = _specialProtoMatch;
2569
- return {
2570
- protocol: _proto.toLowerCase(),
2571
- pathname: _pathname,
2572
- href: _proto + _pathname,
2573
- auth: "",
2574
- host: "",
2575
- search: "",
2576
- hash: ""
2577
- };
2578
- }
2579
- if (!hasProtocol(input, { acceptRelative: true })) {
2580
- return defaultProto ? parseURL(defaultProto + input) : parsePath(input);
2581
- }
2582
- const [, protocol = "", auth, hostAndPath = ""] = input.replace(/\\/g, "/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/) || [];
2583
- let [, host = "", path = ""] = hostAndPath.match(/([^#/?]*)(.*)?/) || [];
2584
- if (protocol === "file:") {
2585
- path = path.replace(/\/(?=[A-Za-z]:)/, "");
2586
- }
2587
- const { pathname, search, hash } = parsePath(path);
2588
- return {
2589
- protocol: protocol.toLowerCase(),
2590
- auth: auth ? auth.slice(0, Math.max(0, auth.length - 1)) : "",
2591
- host,
2592
- pathname,
2593
- search,
2594
- hash,
2595
- [protocolRelative]: !protocol
2596
- };
2597
- }
2598
- function parsePath(input = "") {
2599
- const [pathname = "", search = "", hash = ""] = (input.match(/([^#?]*)(\?[^#]*)?(#.*)?/) || []).splice(1);
2600
- return {
2601
- pathname,
2602
- search,
2603
- hash
2604
- };
2605
- }
2606
- function stringifyParsedURL(parsed) {
2607
- const pathname = parsed.pathname || "";
2608
- const search = parsed.search ? (parsed.search.startsWith("?") ? "" : "?") + parsed.search : "";
2609
- const hash = parsed.hash || "";
2610
- const auth = parsed.auth ? parsed.auth + "@" : "";
2611
- const host = parsed.host || "";
2612
- const proto = parsed.protocol || parsed[protocolRelative] ? (parsed.protocol || "") + "//" : "";
2613
- return proto + auth + host + pathname + search + hash;
2614
- }
2615
-
2616
2434
  function wrapToPromise(value) {
2617
2435
  if (!value || typeof value.then !== "function") {
2618
2436
  return Promise.resolve(value);
@@ -5239,6 +5057,14 @@ function combineExports(exports$1) {
5239
5057
  function combineImports(imports, exports$1, source) {
5240
5058
  const exportedNames = new Set(exports$1.flatMap((e) => Array.isArray(e.name) ? e.name : e.name ? [e.name] : []));
5241
5059
  const isUsed = (importName) => !source || source.includes(importName) || exportedNames.has(importName);
5060
+ const importNameMemo = /* @__PURE__ */ new Map();
5061
+ const canonicalizeName = (n) => {
5062
+ var _a;
5063
+ if (typeof n === "string") return n;
5064
+ const key = `${n.propertyName}:${(_a = n.name) != null ? _a : ""}`;
5065
+ if (!importNameMemo.has(key)) importNameMemo.set(key, n);
5066
+ return importNameMemo.get(key);
5067
+ };
5242
5068
  const result = [];
5243
5069
  const namedByPath = /* @__PURE__ */ new Map();
5244
5070
  const seen = /* @__PURE__ */ new Set();
@@ -5252,7 +5078,7 @@ function combineImports(imports, exports$1, source) {
5252
5078
  const { path: path2, isTypeOnly } = curr;
5253
5079
  let { name } = curr;
5254
5080
  if (Array.isArray(name)) {
5255
- name = [...new Set(name)].filter((item) => {
5081
+ name = [...new Set(name.map(canonicalizeName))].filter((item) => {
5256
5082
  var _a;
5257
5083
  return typeof item === "string" ? isUsed(item) : isUsed((_a = item.name) != null ? _a : item.propertyName);
5258
5084
  });
@@ -6638,7 +6464,7 @@ const fsStorage = createStorage(() => ({
6638
6464
  await clean(resolve(base));
6639
6465
  }
6640
6466
  }));
6641
- var version$1 = "5.0.0-beta.2";
6467
+ var version$1 = "5.0.0-beta.3";
6642
6468
  function getDiagnosticInfo() {
6643
6469
  return {
6644
6470
  nodeVersion: version$2,
@@ -7074,7 +6900,7 @@ const memoryStorage = createStorage(() => {
7074
6900
  };
7075
6901
  });
7076
6902
 
7077
- var version = "5.0.0-beta.2";
6903
+ var version = "5.0.0-beta.3";
7078
6904
 
7079
6905
  function isCommandMessage(msg) {
7080
6906
  return msg.type === "command";
@@ -1 +1 @@
1
- {"version":3,"file":"nitro.mjs","sources":["../../../../../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs","../../../../../../node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs","../../../../../../node_modules/.pnpm/radix3@1.1.2/node_modules/radix3/dist/index.mjs","../../../../../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs","../../../../../../node_modules/.pnpm/node-mock-http@1.0.4/node_modules/node-mock-http/dist/index.mjs","../../../../../../node_modules/.pnpm/h3@1.15.11/node_modules/h3/dist/index.mjs","../../../../../../node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs","../../../../../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/native.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs","../../../../../../node_modules/.pnpm/ufo@1.6.4/node_modules/ufo/dist/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/dist/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/utils/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/utils/node-fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/fs-lite.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/storage.mjs","../../../../../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/cache.mjs","../../../../../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/dist/index.mjs","../../../../../../node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/config.mjs","../../../../../../node_modules/.pnpm/unctx@2.5.0/node_modules/unctx/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/route-rules-utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/plugin.mjs","../../../../server/utils/logger.ts","../../../../server/plugins/fetch-logger.ts","../../../../../../internals/utils/dist/index.js","../../../../server/plugins/heartbeat.ts","../../../../server/utils/token.ts","../../../../server/utils/api.ts","../../../../../core/dist/chunk--u3MIqq1.js","../../../../../ast/dist/index.js","../../../../../core/dist/PluginDriver-DV3p2Hky.js","../../../../../core/dist/index.js","../../../../server/types/agent.ts","../../../../server/utils/agentCache.ts","../../../../server/utils/executeHooks.ts","../../../../server/utils/generate.ts","../../../../server/utils/getCosmiConfig.ts","../../../../server/utils/loadConfig.ts","../../../../server/utils/resolvePlugins.ts","../../../../server/utils/mergePlugins.ts","../../../../server/utils/publish.ts","../../../../server/utils/setupHookListener.ts","../../../../server/constants.ts","../../../../server/utils/ws.ts","../../../../server/utils/connectStudio.ts","../../../../server/utils/runtimeConfig.ts","../../../../server/plugins/studio.ts","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/app.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/lib/http-graceful-shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/presets/node/runtime/node-server.mjs"],"names":["HASH_RE","AMPERSAND_RE","SLASH_RE","EQUAL_RE","PLUS_RE","ENC_CARET_RE","ENC_BACKTICK_RE","ENC_PIPE_RE","ENC_SPACE_RE","encode","encodeQueryValue","encodeQueryKey","decode","decodeQueryKey","decodeQueryValue","parseQuery","encodeQueryItem","stringifyQuery","PROTOCOL_STRICT_REGEX","PROTOCOL_REGEX","PROTOCOL_RELATIVE_REGEX","JOIN_LEADING_SLASH_RE","hasProtocol","hasTrailingSlash","withoutTrailingSlash","withTrailingSlash","isEmptyURL","joinURL","withQuery","parseURL","stringifyParsedURL","isNonEmptyURL","protocolRelative","parsePath","createRouter","f","h","i","l","createError","mergeHeaders","s","nodeFetch","Headers","Headers$1","AbortController$1","normalizeKey","defineDriver","DRIVER_NAME","createStorage","fsPromises","PATH_TRAVERSE_RE","fsp","_inlineAppConfig","createRadixRouter","formatMs","resolve","_a","process","__defProp","path","exports","_b","extname","__privateAdd","__privateMethod","__privateGet","__privateSet","__publicField","readFile","writeFile","build","walk","readdir","version","_c","_d","_e","files","error","nitroApp","callNodeRequestHandler","fetchNodeRequestHandler","gracefulShutdown","HttpsServer","HttpServer"],"mappings":"","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,58,59,60,61]}
1
+ {"version":3,"file":"nitro.mjs","sources":["../../../../../../node_modules/.pnpm/destr@2.0.5/node_modules/destr/dist/index.mjs","../../../../../../node_modules/.pnpm/ufo@1.6.4/node_modules/ufo/dist/index.mjs","../../../../../../node_modules/.pnpm/radix3@1.1.2/node_modules/radix3/dist/index.mjs","../../../../../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs","../../../../../../node_modules/.pnpm/node-mock-http@1.0.4/node_modules/node-mock-http/dist/index.mjs","../../../../../../node_modules/.pnpm/h3@1.15.11/node_modules/h3/dist/index.mjs","../../../../../../node_modules/.pnpm/hookable@5.5.3/node_modules/hookable/dist/index.mjs","../../../../../../node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/native.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.CWycOUEr.mjs","../../../../../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/node.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/dist/shared/unstorage.zVDD2mZo.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/dist/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/utils/index.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/utils/node-fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/fs.mjs","../../../../../../node_modules/.pnpm/unstorage@1.17.5_db0@0.3.4_ioredis@5.10.1/node_modules/unstorage/drivers/fs-lite.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/storage.mjs","../../../../../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/cache.mjs","../../../../../../node_modules/.pnpm/klona@2.0.6/node_modules/klona/dist/index.mjs","../../../../../../node_modules/.pnpm/scule@1.3.0/node_modules/scule/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/config.mjs","../../../../../../node_modules/.pnpm/unctx@2.5.0/node_modules/unctx/dist/index.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/route-rules-utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/plugin.mjs","../../../../server/utils/logger.ts","../../../../server/plugins/fetch-logger.ts","../../../../../../internals/utils/dist/index.js","../../../../server/plugins/heartbeat.ts","../../../../server/utils/token.ts","../../../../server/utils/api.ts","../../../../../core/dist/chunk--u3MIqq1.js","../../../../../ast/dist/index.js","../../../../../core/dist/PluginDriver-DV3p2Hky.js","../../../../../core/dist/index.js","../../../../server/types/agent.ts","../../../../server/utils/agentCache.ts","../../../../server/utils/executeHooks.ts","../../../../server/utils/generate.ts","../../../../server/utils/getCosmiConfig.ts","../../../../server/utils/loadConfig.ts","../../../../server/utils/resolvePlugins.ts","../../../../server/utils/mergePlugins.ts","../../../../server/utils/publish.ts","../../../../server/utils/setupHookListener.ts","../../../../server/constants.ts","../../../../server/utils/ws.ts","../../../../server/utils/connectStudio.ts","../../../../server/utils/runtimeConfig.ts","../../../../server/plugins/studio.ts","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/app.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/lib/http-graceful-shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/presets/node/runtime/node-server.mjs"],"names":["createRouter","f","h","i","l","createError","mergeHeaders","s","nodeFetch","Headers","Headers$1","AbortController$1","normalizeKey","defineDriver","DRIVER_NAME","createStorage","fsPromises","PATH_TRAVERSE_RE","fsp","_inlineAppConfig","createRadixRouter","formatMs","resolve","_a","process","__defProp","path","exports","_b","extname","__privateAdd","__privateMethod","__privateGet","__privateSet","__publicField","readFile","writeFile","build","walk","readdir","version","_c","_d","_e","files","error","nitroApp","callNodeRequestHandler","fetchNodeRequestHandler","gracefulShutdown","HttpsServer","HttpServer"],"mappings":"","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,57,58,59,60]}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/agent-prod",
3
- "version": "5.0.0-beta.2",
3
+ "version": "5.0.0-beta.3",
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/agent",
3
- "version": "5.0.0-beta.2",
3
+ "version": "5.0.0-beta.3",
4
4
  "description": "Agent server for Kubb, enabling HTTP-based access to code generation capabilities.",
5
5
  "keywords": [
6
6
  "agent",
@@ -43,8 +43,8 @@
43
43
  "unrun": "^0.2.37",
44
44
  "unstorage": "^1.17.5",
45
45
  "ws": "^8.20.0",
46
- "@kubb/core": "5.0.0-beta.2",
47
- "@kubb/ast": "5.0.0-beta.2"
46
+ "@kubb/ast": "5.0.0-beta.3",
47
+ "@kubb/core": "5.0.0-beta.3"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/ws": "^8.18.1",
@@ -52,8 +52,8 @@
52
52
  "nitropack": "^2.13.4",
53
53
  "vite": "^8.0.10",
54
54
  "@internals/utils": "0.0.0",
55
- "@kubb/parser-ts": "5.0.0-beta.2",
56
- "@kubb/adapter-oas": "5.0.0-beta.2"
55
+ "@kubb/adapter-oas": "5.0.0-beta.3",
56
+ "@kubb/parser-ts": "5.0.0-beta.3"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">=22"