@kubb/agent 5.0.0-alpha.72 → 5.0.0-alpha.74

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,12 +1,12 @@
1
1
  {
2
- "date": "2026-04-28T10:47:37.936Z",
2
+ "date": "2026-04-29T14:39:11.172Z",
3
3
  "preset": "node-server",
4
4
  "framework": {
5
5
  "name": "nitro",
6
6
  "version": ""
7
7
  },
8
8
  "versions": {
9
- "nitro": "2.13.3"
9
+ "nitro": "2.13.4"
10
10
  },
11
11
  "commands": {
12
12
  "preview": "node server/index.mjs"
@@ -90,26 +90,26 @@ function destr(value, options = {}) {
90
90
  }
91
91
  }
92
92
 
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;
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;
102
102
  const ENC_SLASH_RE = /%2f/gi;
103
- function encode(text) {
104
- return encodeURI("" + text).replace(ENC_PIPE_RE, "|");
103
+ function encode$1(text) {
104
+ return encodeURI("" + text).replace(ENC_PIPE_RE$1, "|");
105
105
  }
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");
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");
108
108
  }
109
- function encodeQueryKey(text) {
110
- return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
109
+ function encodeQueryKey$1(text) {
110
+ return encodeQueryValue$1(text).replace(EQUAL_RE$1, "%3D");
111
111
  }
112
- function decode(text = "") {
112
+ function decode$1(text = "") {
113
113
  try {
114
114
  return decodeURIComponent("" + text);
115
115
  } catch {
@@ -117,16 +117,16 @@ function decode(text = "") {
117
117
  }
118
118
  }
119
119
  function decodePath(text) {
120
- return decode(text.replace(ENC_SLASH_RE, "%252F"));
120
+ return decode$1(text.replace(ENC_SLASH_RE, "%252F"));
121
121
  }
122
- function decodeQueryKey(text) {
123
- return decode(text.replace(PLUS_RE, " "));
122
+ function decodeQueryKey$1(text) {
123
+ return decode$1(text.replace(PLUS_RE$1, " "));
124
124
  }
125
- function decodeQueryValue(text) {
126
- return decode(text.replace(PLUS_RE, " "));
125
+ function decodeQueryValue$1(text) {
126
+ return decode$1(text.replace(PLUS_RE$1, " "));
127
127
  }
128
128
 
129
- function parseQuery(parametersString = "") {
129
+ function parseQuery$1(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(parametersString = "") {
136
136
  if (s.length < 2) {
137
137
  continue;
138
138
  }
139
- const key = decodeQueryKey(s[1]);
139
+ const key = decodeQueryKey$1(s[1]);
140
140
  if (key === "__proto__" || key === "constructor") {
141
141
  continue;
142
142
  }
143
- const value = decodeQueryValue(s[2] || "");
143
+ const value = decodeQueryValue$1(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(parametersString = "") {
151
151
  }
152
152
  return object;
153
153
  }
154
- function encodeQueryItem(key, value) {
154
+ function encodeQueryItem$1(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(key);
159
+ return encodeQueryKey$1(key);
160
160
  }
161
161
  if (Array.isArray(value)) {
162
162
  return value.map(
163
- (_value) => `${encodeQueryKey(key)}=${encodeQueryValue(_value)}`
163
+ (_value) => `${encodeQueryKey$1(key)}=${encodeQueryValue$1(_value)}`
164
164
  ).join("&");
165
165
  }
166
- return `${encodeQueryKey(key)}=${encodeQueryValue(value)}`;
166
+ return `${encodeQueryKey$1(key)}=${encodeQueryValue$1(value)}`;
167
167
  }
168
- function stringifyQuery(query) {
169
- return Object.keys(query).filter((k) => query[k] !== void 0).map((k) => encodeQueryItem(k, query[k])).filter(Boolean).join("&");
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("&");
170
170
  }
171
171
 
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 = {}) {
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 = {}) {
177
177
  if (typeof opts === "boolean") {
178
178
  opts = { acceptRelative: opts };
179
179
  }
180
180
  if (opts.strict) {
181
- return PROTOCOL_STRICT_REGEX.test(inputString);
181
+ return PROTOCOL_STRICT_REGEX$1.test(inputString);
182
182
  }
183
- return PROTOCOL_REGEX.test(inputString) || (opts.acceptRelative ? PROTOCOL_RELATIVE_REGEX.test(inputString) : false);
183
+ return PROTOCOL_REGEX$1.test(inputString) || (opts.acceptRelative ? PROTOCOL_RELATIVE_REGEX$1.test(inputString) : false);
184
184
  }
185
- function hasTrailingSlash(input = "", respectQueryAndFragment) {
185
+ function hasTrailingSlash$1(input = "", respectQueryAndFragment) {
186
186
  {
187
187
  return input.endsWith("/");
188
188
  }
189
189
  }
190
- function withoutTrailingSlash(input = "", respectQueryAndFragment) {
190
+ function withoutTrailingSlash$1(input = "", respectQueryAndFragment) {
191
191
  {
192
- return (hasTrailingSlash(input) ? input.slice(0, -1) : input) || "/";
192
+ return (hasTrailingSlash$1(input) ? input.slice(0, -1) : input) || "/";
193
193
  }
194
194
  }
195
- function withTrailingSlash(input = "", respectQueryAndFragment) {
195
+ function withTrailingSlash$1(input = "", respectQueryAndFragment) {
196
196
  {
197
197
  return input.endsWith("/") ? input : input + "/";
198
198
  }
@@ -204,54 +204,36 @@ function withLeadingSlash(input = "") {
204
204
  return hasLeadingSlash(input) ? input : "/" + input;
205
205
  }
206
206
  function withBase(input, base) {
207
- if (isEmptyURL(base) || hasProtocol(input)) {
207
+ if (isEmptyURL$1(base) || hasProtocol$1(input)) {
208
208
  return input;
209
209
  }
210
- const _base = withoutTrailingSlash(base);
210
+ const _base = withoutTrailingSlash$1(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(_base, input);
217
+ return joinURL$1(_base, input);
218
218
  }
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);
232
- return trimmed[0] === "/" ? trimmed : "/" + trimmed;
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);
233
224
  }
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) {
225
+ function isEmptyURL$1(url) {
244
226
  return !url || url === "/";
245
227
  }
246
- function isNonEmptyURL(url) {
228
+ function isNonEmptyURL$1(url) {
247
229
  return url && url !== "/";
248
230
  }
249
- function joinURL(base, ...input) {
231
+ function joinURL$1(base, ...input) {
250
232
  let url = base || "";
251
- for (const segment of input.filter((url2) => isNonEmptyURL(url2))) {
233
+ for (const segment of input.filter((url2) => isNonEmptyURL$1(url2))) {
252
234
  if (url) {
253
- const _segment = segment.replace(JOIN_LEADING_SLASH_RE, "");
254
- url = withTrailingSlash(url) + _segment;
235
+ const _segment = segment.replace(JOIN_LEADING_SLASH_RE$1, "");
236
+ url = withTrailingSlash$1(url) + _segment;
255
237
  } else {
256
238
  url = segment;
257
239
  }
@@ -259,8 +241,8 @@ function joinURL(base, ...input) {
259
241
  return url;
260
242
  }
261
243
 
262
- const protocolRelative = Symbol.for("ufo:protocolRelative");
263
- function parseURL(input = "", defaultProto) {
244
+ const protocolRelative$1 = Symbol.for("ufo:protocolRelative");
245
+ function parseURL$1(input = "", defaultProto) {
264
246
  const _specialProtoMatch = input.match(
265
247
  /^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i
266
248
  );
@@ -276,15 +258,15 @@ function parseURL(input = "", defaultProto) {
276
258
  hash: ""
277
259
  };
278
260
  }
279
- if (!hasProtocol(input, { acceptRelative: true })) {
280
- return parsePath(input);
261
+ if (!hasProtocol$1(input, { acceptRelative: true })) {
262
+ return parsePath$1(input);
281
263
  }
282
264
  const [, protocol = "", auth, hostAndPath = ""] = input.replace(/\\/g, "/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/) || [];
283
265
  let [, host = "", path = ""] = hostAndPath.match(/([^#/?]*)(.*)?/) || [];
284
266
  if (protocol === "file:") {
285
267
  path = path.replace(/\/(?=[A-Za-z]:)/, "");
286
268
  }
287
- const { pathname, search, hash } = parsePath(path);
269
+ const { pathname, search, hash } = parsePath$1(path);
288
270
  return {
289
271
  protocol: protocol.toLowerCase(),
290
272
  auth: auth ? auth.slice(0, Math.max(0, auth.length - 1)) : "",
@@ -292,10 +274,10 @@ function parseURL(input = "", defaultProto) {
292
274
  pathname,
293
275
  search,
294
276
  hash,
295
- [protocolRelative]: !protocol
277
+ [protocolRelative$1]: !protocol
296
278
  };
297
279
  }
298
- function parsePath(input = "") {
280
+ function parsePath$1(input = "") {
299
281
  const [pathname = "", search = "", hash = ""] = (input.match(/([^#?]*)(\?[^#]*)?(#.*)?/) || []).splice(1);
300
282
  return {
301
283
  pathname,
@@ -303,13 +285,13 @@ function parsePath(input = "") {
303
285
  hash
304
286
  };
305
287
  }
306
- function stringifyParsedURL(parsed) {
288
+ function stringifyParsedURL$1(parsed) {
307
289
  const pathname = parsed.pathname || "";
308
290
  const search = parsed.search ? (parsed.search.startsWith("?") ? "" : "?") + parsed.search : "";
309
291
  const hash = parsed.hash || "";
310
292
  const auth = parsed.auth ? parsed.auth + "@" : "";
311
293
  const host = parsed.host || "";
312
- const proto = parsed.protocol || parsed[protocolRelative] ? (parsed.protocol || "") + "//" : "";
294
+ const proto = parsed.protocol || parsed[protocolRelative$1] ? (parsed.protocol || "") + "//" : "";
313
295
  return proto + auth + host + pathname + search + hash;
314
296
  }
315
297
 
@@ -1609,7 +1591,7 @@ function createResolver(stack) {
1609
1591
  res = {
1610
1592
  ...res,
1611
1593
  ..._res,
1612
- route: joinURL(res.route || "/", _res.route || "/")
1594
+ route: joinURL$1(res.route || "/", _res.route || "/")
1613
1595
  };
1614
1596
  }
1615
1597
  return res;
@@ -1627,7 +1609,7 @@ function normalizeLayer(input) {
1627
1609
  handler = toEventHandler(handler, void 0, input.route);
1628
1610
  }
1629
1611
  return {
1630
- route: withoutTrailingSlash(input.route),
1612
+ route: withoutTrailingSlash$1(input.route),
1631
1613
  match: input.match,
1632
1614
  handler
1633
1615
  };
@@ -1694,7 +1676,7 @@ function websocketOptions(evResolver, appOptions) {
1694
1676
  ...appOptions.websocket,
1695
1677
  async resolve(info) {
1696
1678
  const url = info.request?.url || info.url || "/";
1697
- const { pathname } = typeof url === "string" ? parseURL(url) : url;
1679
+ const { pathname } = typeof url === "string" ? parseURL$1(url) : url;
1698
1680
  const resolved = await evResolver(pathname);
1699
1681
  return resolved?.handler?.__websocket__ || {};
1700
1682
  }
@@ -2286,7 +2268,7 @@ function createFetch(globalOptions = {}) {
2286
2268
  context.request = withBase(context.request, context.options.baseURL);
2287
2269
  }
2288
2270
  if (context.options.query) {
2289
- context.request = withQuery(context.request, context.options.query);
2271
+ context.request = withQuery$1(context.request, context.options.query);
2290
2272
  delete context.options.query;
2291
2273
  }
2292
2274
  if ("query" in context.options) {
@@ -2431,6 +2413,206 @@ const Headers$1 = globalThis.Headers || s$1;
2431
2413
  const AbortController = globalThis.AbortController || i;
2432
2414
  createFetch({ fetch, Headers: Headers$1, AbortController });
2433
2415
 
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
+
2434
2616
  function wrapToPromise(value) {
2435
2617
  if (!value || typeof value.then !== "function") {
2436
2618
  return Promise.resolve(value);
@@ -4185,6 +4367,17 @@ getContext("nitro-app", {
4185
4367
  AsyncLocalStorage: void 0
4186
4368
  });
4187
4369
 
4370
+ function isPathInScope(pathname, base) {
4371
+ let canonical;
4372
+ try {
4373
+ const pre = pathname.replace(/%2f/gi, "/").replace(/%5c/gi, "\\");
4374
+ canonical = new URL(pre, "http://_").pathname;
4375
+ } catch {
4376
+ return false;
4377
+ }
4378
+ return !base || canonical === base || canonical.startsWith(base + "/");
4379
+ }
4380
+
4188
4381
  const config = useRuntimeConfig();
4189
4382
  const _routeRulesMatcher = toRouteMatcher(
4190
4383
  createRouter$1({ routes: config.nitro.routeRules })
@@ -4201,7 +4394,12 @@ function createRouteRulesHandler(ctx) {
4201
4394
  let targetPath = event.path;
4202
4395
  const strpBase = routeRules.redirect._redirectStripBase;
4203
4396
  if (strpBase) {
4397
+ if (!isPathInScope(event.path.split("?")[0], strpBase)) {
4398
+ throw createError$1({ statusCode: 400 });
4399
+ }
4204
4400
  targetPath = withoutBase(targetPath, strpBase);
4401
+ } else if (targetPath.startsWith("//")) {
4402
+ targetPath = targetPath.replace(/^\/+/, "/");
4205
4403
  }
4206
4404
  target = joinURL(target.slice(0, -3), targetPath);
4207
4405
  } else if (event.path.includes("?")) {
@@ -4216,7 +4414,12 @@ function createRouteRulesHandler(ctx) {
4216
4414
  let targetPath = event.path;
4217
4415
  const strpBase = routeRules.proxy._proxyStripBase;
4218
4416
  if (strpBase) {
4417
+ if (!isPathInScope(event.path.split("?")[0], strpBase)) {
4418
+ throw createError$1({ statusCode: 400 });
4419
+ }
4219
4420
  targetPath = withoutBase(targetPath, strpBase);
4421
+ } else if (targetPath.startsWith("//")) {
4422
+ targetPath = targetPath.replace(/^\/+/, "/");
4220
4423
  }
4221
4424
  target = joinURL(target.slice(0, -3), targetPath);
4222
4425
  } else if (event.path.includes("?")) {
@@ -6358,7 +6561,7 @@ const fsStorage = createStorage(() => ({
6358
6561
  await clean(resolve(base));
6359
6562
  }
6360
6563
  }));
6361
- var version$1 = "5.0.0-alpha.72";
6564
+ var version$1 = "5.0.0-alpha.74";
6362
6565
  function getDiagnosticInfo() {
6363
6566
  return {
6364
6567
  nodeVersion: version$2,
@@ -6414,6 +6617,8 @@ async function setup(userConfig, options = {}) {
6414
6617
  parsers: (_g = userConfig.parsers) != null ? _g : [],
6415
6618
  adapter: userConfig.adapter,
6416
6619
  output: {
6620
+ format: false,
6621
+ lint: false,
6417
6622
  write: true,
6418
6623
  extension: DEFAULT_EXTENSION,
6419
6624
  defaultBanner: DEFAULT_BANNER,
@@ -6775,7 +6980,7 @@ const memoryStorage = createStorage(() => {
6775
6980
  };
6776
6981
  });
6777
6982
 
6778
- var version = "5.0.0-alpha.72";
6983
+ var version = "5.0.0-alpha.74";
6779
6984
 
6780
6985
  function isCommandMessage(msg) {
6781
6986
  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/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.3_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.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_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.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_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.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_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.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/app.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/lib/http-graceful-shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_rolldown@1.0.0-rc.17/node_modules/nitropack/dist/runtime/internal/shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.3_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,56,57,58,59]}
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,75 +1,75 @@
1
1
  import { createRequire as e } from "node:module";
2
2
  import { spawn as t, spawnSync as n } from "node:child_process";
3
- import { delimiter as r, dirname as i, normalize as a, resolve as o } from "node:path";
4
- import { cwd as s } from "node:process";
5
- import { pipeline as c } from "node:stream/promises";
6
- import { PassThrough as l } from "node:stream";
7
- import u from "node:readline";
3
+ import { cwd as r } from "node:process";
4
+ import { delimiter as i, dirname as a, resolve as o } from "node:path";
5
+ import { pipeline as s } from "node:stream/promises";
6
+ import { PassThrough as c } from "node:stream";
7
+ import l from "node:readline";
8
8
  //#region \0rolldown/runtime.js
9
- var d = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports);
10
- var f = /* @__PURE__ */ e(import.meta.url);
9
+ var u = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports);
10
+ var d = /* @__PURE__ */ e(import.meta.url);
11
11
  //#endregion
12
12
  //#region src/env.ts
13
- const p = /^path$/i;
14
- const m = {
13
+ const f = /^path$/i;
14
+ const p = {
15
15
  key: "PATH",
16
16
  value: ""
17
17
  };
18
- function h(e) {
18
+ function m(e) {
19
19
  for (const t in e) {
20
- if (!Object.prototype.hasOwnProperty.call(e, t) || !p.test(t)) continue;
20
+ if (!Object.prototype.hasOwnProperty.call(e, t) || !f.test(t)) continue;
21
21
  const n = e[t];
22
- if (!n) return m;
22
+ if (!n) return p;
23
23
  return {
24
24
  key: t,
25
25
  value: n
26
26
  };
27
27
  }
28
- return m;
28
+ return p;
29
29
  }
30
- function g(e, t) {
31
- const n = t.value.split(r);
32
- const a = [];
30
+ function h(e, t) {
31
+ const n = t.value.split(i);
32
+ const r = [];
33
33
  let s = e;
34
34
  let c;
35
35
  do {
36
- a.push(o(s, "node_modules", ".bin"));
36
+ r.push(o(s, "node_modules", ".bin"));
37
37
  c = s;
38
- s = i(s);
38
+ s = a(s);
39
39
  } while (s !== c);
40
- a.push(i(process.execPath));
41
- const l = a.concat(n).join(r);
40
+ r.push(a(process.execPath));
41
+ const l = r.concat(n).join(i);
42
42
  return {
43
43
  key: t.key,
44
44
  value: l
45
45
  };
46
46
  }
47
- function _(e, t) {
47
+ function g(e, t) {
48
48
  const n = {
49
49
  ...process.env,
50
50
  ...t
51
51
  };
52
- const r = g(e, h(n));
52
+ const r = h(e, m(n));
53
53
  n[r.key] = r.value;
54
54
  return n;
55
55
  }
56
56
  //#endregion
57
57
  //#region src/stream.ts
58
- const v = (e) => {
58
+ const _ = (e) => {
59
59
  let t = e.length;
60
- const n = new l();
60
+ const n = new c();
61
61
  const r = () => {
62
62
  if (--t === 0) n.end();
63
63
  };
64
- for (const t of e) c(t, n, { end: false }).then(r).catch(r);
64
+ for (const t of e) s(t, n, { end: false }).then(r).catch(r);
65
65
  return n;
66
66
  };
67
67
  //#endregion
68
68
  //#region node_modules/isexe/windows.js
69
- var y = /* @__PURE__ */ d(((e, t) => {
69
+ var v = /* @__PURE__ */ u(((e, t) => {
70
70
  t.exports = a;
71
71
  a.sync = o;
72
- var n = f("fs");
72
+ var n = d("fs");
73
73
  function r(e, t) {
74
74
  var n = t.pathExt !== void 0 ? t.pathExt : process.env.PATHEXT;
75
75
  if (!n) return true;
@@ -96,10 +96,10 @@ var y = /* @__PURE__ */ d(((e, t) => {
96
96
  }));
97
97
  //#endregion
98
98
  //#region node_modules/isexe/mode.js
99
- var b = /* @__PURE__ */ d(((e, t) => {
99
+ var y = /* @__PURE__ */ u(((e, t) => {
100
100
  t.exports = r;
101
101
  r.sync = i;
102
- var n = f("fs");
102
+ var n = d("fs");
103
103
  function r(e, t, r) {
104
104
  n.stat(e, function(e, n) {
105
105
  r(e, e ? false : a(n, t));
@@ -126,11 +126,11 @@ var b = /* @__PURE__ */ d(((e, t) => {
126
126
  }));
127
127
  //#endregion
128
128
  //#region node_modules/isexe/index.js
129
- var x = /* @__PURE__ */ d(((e, t) => {
130
- f("fs");
129
+ var b = /* @__PURE__ */ u(((e, t) => {
130
+ d("fs");
131
131
  var n;
132
- if (process.platform === "win32" || global.TESTING_WINDOWS) n = y();
133
- else n = b();
132
+ if (process.platform === "win32" || global.TESTING_WINDOWS) n = v();
133
+ else n = y();
134
134
  t.exports = r;
135
135
  r.sync = i;
136
136
  function r(e, t, i) {
@@ -168,11 +168,11 @@ var x = /* @__PURE__ */ d(((e, t) => {
168
168
  }));
169
169
  //#endregion
170
170
  //#region node_modules/which/which.js
171
- var S = /* @__PURE__ */ d(((e, t) => {
171
+ var x = /* @__PURE__ */ u(((e, t) => {
172
172
  const n = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
173
- const r = f("path");
173
+ const r = d("path");
174
174
  const i = n ? ";" : ":";
175
- const a = x();
175
+ const a = b();
176
176
  const o = (e) => Object.assign(/* @__PURE__ */ new Error(`not found: ${e}`), { code: "ENOENT" });
177
177
  const s = (e, t) => {
178
178
  const r = t.colon || i;
@@ -240,7 +240,7 @@ var S = /* @__PURE__ */ d(((e, t) => {
240
240
  }));
241
241
  //#endregion
242
242
  //#region node_modules/path-key/index.js
243
- var C = /* @__PURE__ */ d(((e, t) => {
243
+ var S = /* @__PURE__ */ u(((e, t) => {
244
244
  const n = (e = {}) => {
245
245
  const t = e.env || process.env;
246
246
  if ((e.platform || process.platform) !== "win32") return "PATH";
@@ -251,10 +251,10 @@ var C = /* @__PURE__ */ d(((e, t) => {
251
251
  }));
252
252
  //#endregion
253
253
  //#region node_modules/cross-spawn/lib/util/resolveCommand.js
254
- var w = /* @__PURE__ */ d(((e, t) => {
255
- const n = f("path");
256
- const r = S();
257
- const i = C();
254
+ var C = /* @__PURE__ */ u(((e, t) => {
255
+ const n = d("path");
256
+ const r = x();
257
+ const i = S();
258
258
  function a(e, t) {
259
259
  const a = e.options.env || process.env;
260
260
  const o = process.cwd();
@@ -282,7 +282,7 @@ var w = /* @__PURE__ */ d(((e, t) => {
282
282
  }));
283
283
  //#endregion
284
284
  //#region node_modules/cross-spawn/lib/util/escape.js
285
- var T = /* @__PURE__ */ d(((e, t) => {
285
+ var w = /* @__PURE__ */ u(((e, t) => {
286
286
  const n = /([()\][%!^"`<>&|;, *?])/g;
287
287
  function r(e) {
288
288
  e = e.replace(n, "^$1");
@@ -302,13 +302,13 @@ var T = /* @__PURE__ */ d(((e, t) => {
302
302
  }));
303
303
  //#endregion
304
304
  //#region node_modules/shebang-regex/index.js
305
- var E = /* @__PURE__ */ d(((e, t) => {
305
+ var T = /* @__PURE__ */ u(((e, t) => {
306
306
  t.exports = /^#!(.*)/;
307
307
  }));
308
308
  //#endregion
309
309
  //#region node_modules/shebang-command/index.js
310
- var D = /* @__PURE__ */ d(((e, t) => {
311
- const n = E();
310
+ var E = /* @__PURE__ */ u(((e, t) => {
311
+ const n = T();
312
312
  t.exports = (e = "") => {
313
313
  const t = e.match(n);
314
314
  if (!t) return null;
@@ -320,9 +320,9 @@ var D = /* @__PURE__ */ d(((e, t) => {
320
320
  }));
321
321
  //#endregion
322
322
  //#region node_modules/cross-spawn/lib/util/readShebang.js
323
- var O = /* @__PURE__ */ d(((e, t) => {
324
- const n = f("fs");
325
- const r = D();
323
+ var D = /* @__PURE__ */ u(((e, t) => {
324
+ const n = d("fs");
325
+ const r = E();
326
326
  function i(e) {
327
327
  const t = 150;
328
328
  const i = Buffer.alloc(t);
@@ -338,11 +338,11 @@ var O = /* @__PURE__ */ d(((e, t) => {
338
338
  }));
339
339
  //#endregion
340
340
  //#region node_modules/cross-spawn/lib/parse.js
341
- var k = /* @__PURE__ */ d(((e, t) => {
342
- const n = f("path");
343
- const r = w();
344
- const i = T();
345
- const a = O();
341
+ var O = /* @__PURE__ */ u(((e, t) => {
342
+ const n = d("path");
343
+ const r = C();
344
+ const i = w();
345
+ const a = D();
346
346
  const o = process.platform === "win32";
347
347
  const s = /\.(?:com|exe)$/i;
348
348
  const c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
@@ -376,7 +376,7 @@ var k = /* @__PURE__ */ d(((e, t) => {
376
376
  }
377
377
  return e;
378
378
  }
379
- function d(e, t, n) {
379
+ function f(e, t, n) {
380
380
  if (t && !Array.isArray(t)) {
381
381
  n = t;
382
382
  t = null;
@@ -395,11 +395,11 @@ var k = /* @__PURE__ */ d(((e, t) => {
395
395
  };
396
396
  return n.shell ? r : u(r);
397
397
  }
398
- t.exports = d;
398
+ t.exports = f;
399
399
  }));
400
400
  //#endregion
401
401
  //#region node_modules/cross-spawn/lib/enoent.js
402
- var A = /* @__PURE__ */ d(((e, t) => {
402
+ var k = /* @__PURE__ */ u(((e, t) => {
403
403
  const n = process.platform === "win32";
404
404
  function r(e, t) {
405
405
  return Object.assign(/* @__PURE__ */ new Error(`${t} ${e.command} ENOENT`), {
@@ -438,10 +438,10 @@ var A = /* @__PURE__ */ d(((e, t) => {
438
438
  }));
439
439
  //#endregion
440
440
  //#region node_modules/cross-spawn/index.js
441
- var j = /* @__PURE__ */ d(((e, t) => {
442
- const n = f("child_process");
443
- const r = k();
444
- const i = A();
441
+ var A = /* @__PURE__ */ u(((e, t) => {
442
+ const n = d("child_process");
443
+ const r = O();
444
+ const i = k();
445
445
  function a(e, t, a) {
446
446
  const o = r(e, t, a);
447
447
  const s = n.spawn(o.command, o.args, o.options);
@@ -462,8 +462,8 @@ var j = /* @__PURE__ */ d(((e, t) => {
462
462
  }));
463
463
  //#endregion
464
464
  //#region src/non-zero-exit-error.ts
465
- var M = j();
466
- var N = class extends Error {
465
+ var j = A();
466
+ var M = class extends Error {
467
467
  get exitCode() {
468
468
  if (this.result.exitCode !== null) return this.result.exitCode;
469
469
  }
@@ -475,20 +475,14 @@ var N = class extends Error {
475
475
  };
476
476
  //#endregion
477
477
  //#region src/main.ts
478
- const P = /\r?\n/;
479
- const F = {
478
+ const N = /\r?\n/;
479
+ const P = {
480
480
  timeout: void 0,
481
481
  persist: false
482
482
  };
483
- const I = { timeout: void 0 };
484
- const L = { windowsHide: true };
485
- function R(e, t) {
486
- return {
487
- command: a(e),
488
- args: t ?? []
489
- };
490
- }
491
- function z(e) {
483
+ const F = { timeout: void 0 };
484
+ const I = { windowsHide: true };
485
+ function L(e) {
492
486
  const t = new AbortController();
493
487
  for (const n of e) {
494
488
  if (n.aborted) {
@@ -502,14 +496,14 @@ function z(e) {
502
496
  }
503
497
  return t.signal;
504
498
  }
505
- async function B(e) {
499
+ async function R(e) {
506
500
  let t = "";
507
501
  try {
508
502
  for await (const n of e) t += n.toString();
509
503
  } catch {}
510
504
  return t;
511
505
  }
512
- var V = class {
506
+ var z = class {
513
507
  _process;
514
508
  _aborted = false;
515
509
  _options;
@@ -529,7 +523,7 @@ var V = class {
529
523
  }
530
524
  constructor(e, t, n) {
531
525
  this._options = {
532
- ...F,
526
+ ...P,
533
527
  ...n
534
528
  };
535
529
  this._command = e;
@@ -548,7 +542,7 @@ var V = class {
548
542
  return this._process?.killed === true;
549
543
  }
550
544
  pipe(e, t, n) {
551
- return W(e, t, {
545
+ return H(e, t, {
552
546
  ...n,
553
547
  stdin: this
554
548
  });
@@ -559,18 +553,18 @@ var V = class {
559
553
  const t = [];
560
554
  if (this._streamErr) t.push(this._streamErr);
561
555
  if (this._streamOut) t.push(this._streamOut);
562
- const n = v(t);
563
- const r = u.createInterface({ input: n });
556
+ const n = _(t);
557
+ const r = l.createInterface({ input: n });
564
558
  for await (const e of r) yield e.toString();
565
559
  await this._processClosed;
566
560
  e.removeAllListeners();
567
561
  if (this._thrownError) throw this._thrownError;
568
- if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new N(this);
562
+ if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new M(this);
569
563
  }
570
564
  async _waitForOutput() {
571
565
  const e = this._process;
572
566
  if (!e) throw new Error("No process was started");
573
- const [t, n] = await Promise.all([this._streamOut ? B(this._streamOut) : "", this._streamErr ? B(this._streamErr) : ""]);
567
+ const [t, n] = await Promise.all([this._streamOut ? R(this._streamOut) : "", this._streamErr ? R(this._streamErr) : ""]);
574
568
  await this._processClosed;
575
569
  const { stdin: r } = this._options;
576
570
  if (r && typeof r !== "string") await r;
@@ -581,7 +575,7 @@ var V = class {
581
575
  stdout: t,
582
576
  exitCode: this.exitCode
583
577
  };
584
- if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new N(this, i);
578
+ if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new M(this, i);
585
579
  return i;
586
580
  }
587
581
  then(e, t) {
@@ -590,31 +584,30 @@ var V = class {
590
584
  _streamOut;
591
585
  _streamErr;
592
586
  spawn() {
593
- const e = s();
587
+ const e = r();
594
588
  const n = this._options;
595
- const r = {
596
- ...L,
589
+ const i = {
590
+ ...I,
597
591
  ...n.nodeOptions
598
592
  };
599
- const i = [];
593
+ const a = [];
600
594
  this._resetState();
601
- if (n.timeout !== void 0) i.push(AbortSignal.timeout(n.timeout));
602
- if (n.signal !== void 0) i.push(n.signal);
603
- if (n.persist === true) r.detached = true;
604
- if (i.length > 0) r.signal = z(i);
605
- r.env = _(e, r.env);
606
- const { command: a, args: o } = R(this._command, this._args);
607
- const c = (0, M._parse)(a, o, r);
608
- const l = t(c.command, c.args, c.options);
609
- if (l.stderr) this._streamErr = l.stderr;
610
- if (l.stdout) this._streamOut = l.stdout;
611
- this._process = l;
612
- l.once("error", this._onError);
613
- l.once("close", this._onClose);
614
- if (l.stdin) {
595
+ if (n.timeout !== void 0) a.push(AbortSignal.timeout(n.timeout));
596
+ if (n.signal !== void 0) a.push(n.signal);
597
+ if (n.persist === true) i.detached = true;
598
+ if (a.length > 0) i.signal = L(a);
599
+ i.env = g(e, i.env);
600
+ const o = (0, j._parse)(this._command, this._args, i);
601
+ const s = t(o.command, o.args, o.options);
602
+ if (s.stderr) this._streamErr = s.stderr;
603
+ if (s.stdout) this._streamOut = s.stdout;
604
+ this._process = s;
605
+ s.once("error", this._onError);
606
+ s.once("close", this._onClose);
607
+ if (s.stdin) {
615
608
  const { stdin: e } = n;
616
- if (typeof e === "string") l.stdin.end(e);
617
- else e?.process?.stdout?.pipe(l.stdin);
609
+ if (typeof e === "string") s.stdin.end(e);
610
+ else e?.process?.stdout?.pipe(s.stdin);
618
611
  }
619
612
  }
620
613
  _resetState() {
@@ -635,56 +628,55 @@ var V = class {
635
628
  if (this._resolveClose) this._resolveClose();
636
629
  };
637
630
  };
638
- function H(e, t, r) {
639
- const i = {
640
- ...I,
641
- ...r
631
+ function B(e, t, i) {
632
+ const a = {
633
+ ...F,
634
+ ...i
642
635
  };
643
- const a = s();
644
- const o = {
636
+ const o = r();
637
+ const s = {
645
638
  windowsHide: true,
646
- ...i.nodeOptions
639
+ ...a.nodeOptions
647
640
  };
648
- if (i.timeout !== void 0) o.timeout = i.timeout;
649
- o.env = _(a, o.env);
650
- const { command: c, args: l } = R(e, t);
651
- const u = (0, M._parse)(c, l, o);
652
- const d = n(u.command, u.args, u.options);
653
- if (d.error) throw d.error;
654
- const f = d.stdout?.toString() ?? "";
655
- const p = d.stderr?.toString() ?? "";
656
- const m = d.status ?? void 0;
657
- const h = d.signal != null;
658
- const g = {
659
- stdout: f,
660
- stderr: p,
641
+ if (a.timeout !== void 0) s.timeout = a.timeout;
642
+ s.env = g(o, s.env);
643
+ const c = (0, j._parse)(e, t ?? [], s);
644
+ const l = n(c.command, c.args, c.options);
645
+ if (l.error) throw l.error;
646
+ const u = l.stdout?.toString() ?? "";
647
+ const d = l.stderr?.toString() ?? "";
648
+ const f = l.status ?? void 0;
649
+ const p = l.signal != null;
650
+ const m = {
651
+ stdout: u,
652
+ stderr: d,
661
653
  get exitCode() {
662
- return m;
654
+ return f;
663
655
  },
664
656
  get pid() {
665
- return d.pid;
657
+ return l.pid;
666
658
  },
667
659
  get killed() {
668
- return h;
660
+ return p;
669
661
  },
670
662
  *[Symbol.iterator]() {
671
- for (const e of [f, p]) {
663
+ for (const e of [u, d]) {
672
664
  if (!e) continue;
673
- const t = e.split(P);
665
+ const t = e.split(N);
674
666
  if (t[t.length - 1] === "") t.pop();
675
667
  yield* t;
676
668
  }
677
669
  }
678
670
  };
679
- if (i.throwOnError && m !== 0 && m !== void 0) throw new N(g, g);
680
- return g;
671
+ if (a.throwOnError && f !== 0 && f !== void 0) throw new M(m, m);
672
+ return m;
681
673
  }
682
- const U = (e, t, n) => {
683
- const r = new V(e, t, n);
674
+ const V = (e, t, n) => {
675
+ const r = new z(e, t, n);
684
676
  r.spawn();
685
677
  return r;
686
678
  };
687
- const W = U;
688
- const G = H;
679
+ const H = V;
680
+ const U = B;
689
681
  //#endregion
690
- export { V as ExecProcess, N as NonZeroExitError, W as exec, G as execSync, U as x, H as xSync };
682
+ export { z as ExecProcess, M as NonZeroExitError, H as exec, U as execSync, V as x, B as xSync };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinyexec",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "type": "module",
5
5
  "description": "A minimal library for executing processes in Node",
6
6
  "main": "./dist/main.mjs",
@@ -40,16 +40,16 @@
40
40
  "devDependencies": {
41
41
  "@eslint/js": "^10.0.1",
42
42
  "@types/cross-spawn": "^6.0.6",
43
- "@types/node": "^25.5.2",
44
- "@vitest/coverage-v8": "^4.1.2",
43
+ "@types/node": "^25.6.0",
44
+ "@vitest/coverage-v8": "^4.1.5",
45
45
  "cross-spawn": "^7.0.6",
46
- "eslint": "^10.2.0",
47
- "prettier": "^3.8.1",
46
+ "eslint": "^10.2.1",
47
+ "prettier": "^3.8.3",
48
48
  "publint": "^0.3.18",
49
- "rollup-plugin-license": "^3.7.0",
50
- "tsdown": "^0.21.7",
51
- "typescript": "^6.0.2",
52
- "typescript-eslint": "^8.58.0",
49
+ "rollup-plugin-license": "^3.7.1",
50
+ "tsdown": "^0.21.10",
51
+ "typescript": "^6.0.3",
52
+ "typescript-eslint": "^8.59.1",
53
53
  "vitest": "^4.0.7"
54
54
  },
55
55
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/agent-prod",
3
- "version": "5.0.0-alpha.72",
3
+ "version": "5.0.0-alpha.74",
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "dependencies": {
@@ -22,7 +22,7 @@
22
22
  "rolldown": "1.0.0-rc.17",
23
23
  "serialize-error": "8.1.0",
24
24
  "stack-trace": "0.0.10",
25
- "tinyexec": "1.1.1",
25
+ "tinyexec": "1.1.2",
26
26
  "unrun": "0.2.37",
27
27
  "ws": "8.20.0"
28
28
  }
package/README.md CHANGED
@@ -83,7 +83,7 @@ services:
83
83
  PORT: 80
84
84
  KUBB_AGENT_ROOT: /kubb/agent/data
85
85
  KUBB_AGENT_CONFIG: ./kubb.config.ts
86
- KUBB_STUDIO_URL: https://studio.kubb.dev
86
+ KUBB_STUDIO_URL: https://kubb.studio
87
87
  volumes:
88
88
  - agent_kv:/kubb/agent/.kubb/data
89
89
  restart: unless-stopped
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/agent",
3
- "version": "5.0.0-alpha.72",
3
+ "version": "5.0.0-alpha.74",
4
4
  "description": "Agent server for Kubb, enabling HTTP-based access to code generation capabilities.",
5
5
  "keywords": [
6
6
  "agent",
@@ -39,21 +39,21 @@
39
39
  "@logtail/node": "^0.5.8",
40
40
  "consola": "^3.4.2",
41
41
  "remeda": "^2.34.0",
42
- "tinyexec": "^1.1.1",
42
+ "tinyexec": "^1.1.2",
43
43
  "unrun": "^0.2.37",
44
44
  "unstorage": "^1.17.5",
45
45
  "ws": "^8.20.0",
46
- "@kubb/core": "5.0.0-alpha.72",
47
- "@kubb/ast": "5.0.0-alpha.72"
46
+ "@kubb/ast": "5.0.0-alpha.74",
47
+ "@kubb/core": "5.0.0-alpha.74"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/ws": "^8.18.1",
51
- "msw": "^2.13.6",
52
- "nitropack": "^2.13.3",
51
+ "msw": "^2.14.0",
52
+ "nitropack": "^2.13.4",
53
53
  "vite": "^8.0.10",
54
54
  "@internals/utils": "0.0.0",
55
- "@kubb/adapter-oas": "5.0.0-alpha.72",
56
- "@kubb/parser-ts": "5.0.0-alpha.72"
55
+ "@kubb/adapter-oas": "5.0.0-alpha.74",
56
+ "@kubb/parser-ts": "5.0.0-alpha.74"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">=22"