@kubb/agent 5.0.0-beta.17 → 5.0.0-beta.19

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 +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.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.1/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.1/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/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.1/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/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.1/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/node_modules/nitropack/dist/runtime/internal/route-rules-utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/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","../../../../../ast/dist/index.js","../../../../../core/dist/PluginDriver-CT33kVoQ.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.1/node_modules/nitropack/dist/runtime/internal/app.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/node_modules/nitropack/dist/runtime/internal/lib/http-graceful-shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/node_modules/nitropack/dist/runtime/internal/shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/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","path","_b","extname","__privateAdd","__privateMethod","__privateGet","__privateSet","__publicField","readFile","writeFile","build","walk","readdir","files","error","version","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,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.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.1/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.1/node_modules/nitropack/dist/runtime/internal/hash.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/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.1/node_modules/nitropack/dist/runtime/internal/utils.env.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/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.1/node_modules/nitropack/dist/runtime/internal/context.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/node_modules/nitropack/dist/runtime/internal/route-rules-utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/node_modules/nitropack/dist/runtime/internal/route-rules.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/node_modules/nitropack/dist/runtime/internal/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/node_modules/nitropack/dist/runtime/internal/error/utils.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/node_modules/nitropack/dist/runtime/internal/error/prod.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/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","../../../../../ast/dist/index.js","../../../../../core/dist/PluginDriver-uNex0SAr.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/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.1/node_modules/nitropack/dist/runtime/internal/app.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/node_modules/nitropack/dist/runtime/internal/lib/http-graceful-shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/node_modules/nitropack/dist/runtime/internal/shutdown.mjs","../../../../../../node_modules/.pnpm/nitropack@2.13.4_rolldown@1.0.1/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","path","_b","extname","__privateAdd","__privateMethod","__privateGet","__privateSet","__publicField","readFile","writeFile","build","walk","readdir","r","e","n","o","files","error","version","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,55,56,57,58]}
@@ -9,11 +9,13 @@ var require = createRequire('/');
9
9
  // However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.
10
10
  // Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint
11
11
  // is better for memory in most engines (I *think*).
12
+ var _a;
12
13
  // Mediocre shim
13
14
  var Worker;
15
+ var isMarkedAsUntransferable;
14
16
  var workerAdd = ";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global";
15
17
  try {
16
- Worker = require('worker_threads').Worker;
18
+ (_a = require('worker_threads'), Worker = _a.Worker, isMarkedAsUntransferable = _a.isMarkedAsUntransferable);
17
19
  }
18
20
  catch (e) {
19
21
  }
@@ -26,6 +28,8 @@ var wk = Worker ? function (c, _, msg, transfer, cb) {
26
28
  if (c && !done)
27
29
  cb(new Error('exited with code ' + c), null);
28
30
  });
31
+ if (isMarkedAsUntransferable)
32
+ transfer = transfer.filter(function (t) { return !isMarkedAsUntransferable(t); });
29
33
  w.postMessage(msg, transfer);
30
34
  w.terminate = function () {
31
35
  done = true;
@@ -206,7 +210,7 @@ var ec = [
206
210
  'invalid distance',
207
211
  'stream finished',
208
212
  'no stream handler',
209
- ,
213
+ , // determined by compression function
210
214
  'no callback',
211
215
  'invalid UTF-8 data',
212
216
  'extra field too long',
@@ -923,12 +927,12 @@ var cbify = function (dat, opts, fns, init, id, cb) {
923
927
  var astrm = function (strm) {
924
928
  strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };
925
929
  return function (ev) {
926
- if (ev.data.length) {
930
+ if (ev.data[0]) {
927
931
  strm.push(ev.data[0], ev.data[1]);
928
932
  postMessage([ev.data[0].length]);
929
933
  }
930
934
  else
931
- strm.flush();
935
+ strm.flush(ev.data[1]);
932
936
  };
933
937
  };
934
938
  // async stream attach
@@ -958,17 +962,19 @@ var astrmify = function (fns, strm, opts, init, id, flush, ext) {
958
962
  if (t)
959
963
  strm.ondata(err(4, 0, 1), null, !!f);
960
964
  strm.queuedSize += d.length;
961
- w.postMessage([d, t = f], [d.buffer]);
965
+ // can fail for cross-realm Uint8Array, but ok - only a small performance penalty
966
+ w.postMessage([d, t = f], d.buffer instanceof ArrayBuffer ? [d.buffer] : []);
962
967
  };
963
968
  strm.terminate = function () { w.terminate(); };
964
969
  if (flush) {
965
- strm.flush = function () { w.postMessage([]); };
970
+ strm.flush = function (sync) { w.postMessage([0, sync]); };
966
971
  }
967
972
  };
968
973
  // read 2 bytes
969
974
  var b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };
970
975
  // read 4 bytes
971
976
  var b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };
977
+ // read 8 bytes
972
978
  var b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };
973
979
  // write bytes
974
980
  var wbytes = function (d, b, v) {
@@ -1089,18 +1095,37 @@ var Deflate = /*#__PURE__*/ (function () {
1089
1095
  this.p(this.b, final || false);
1090
1096
  this.s.w = this.s.i, this.s.i -= 2;
1091
1097
  }
1098
+ if (final) {
1099
+ // cleanup unneeded buffers/state to reduce memory usage
1100
+ this.s = this.o = {};
1101
+ this.b = et;
1102
+ }
1092
1103
  };
1093
1104
  /**
1094
1105
  * Flushes buffered uncompressed data. Useful to immediately retrieve the
1095
1106
  * deflated output for small inputs.
1107
+ * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5
1108
+ * extra bytes, but guarantees all pushed data is immediately
1109
+ * decompressible. A separate DEFLATE stream may be concatenated
1110
+ * with the current output after a sync flush.
1096
1111
  */
1097
- Deflate.prototype.flush = function () {
1112
+ Deflate.prototype.flush = function (sync) {
1098
1113
  if (!this.ondata)
1099
1114
  err(5);
1100
1115
  if (this.s.l)
1101
1116
  err(4);
1102
1117
  this.p(this.b, false);
1103
1118
  this.s.w = this.s.i, this.s.i -= 2;
1119
+ // could technically skip writing the type-0 block for (this.s.r & 7) == 0,
1120
+ // but the deterministic trailer (00 00 FF FF) is useful in some situations
1121
+ if (sync) {
1122
+ var c = new u8(6);
1123
+ c[0] = this.s.r >> 3;
1124
+ // write empty, non-final type-0 block
1125
+ var ep = wfblk(c, this.s.r, et);
1126
+ this.s.r = 0;
1127
+ this.ondata(c.subarray(0, ep >> 3), false);
1128
+ }
1104
1129
  };
1105
1130
  return Deflate;
1106
1131
  }());
@@ -1211,12 +1236,6 @@ export function inflate(data, opts, cb) {
1211
1236
  bInflt
1212
1237
  ], function (ev) { return pbf(inflateSync(ev.data[0], gopt(ev.data[1]))); }, 1, cb);
1213
1238
  }
1214
- /**
1215
- * Expands DEFLATE data with no wrapper
1216
- * @param data The data to decompress
1217
- * @param opts The decompression options
1218
- * @returns The decompressed version of the data
1219
- */
1220
1239
  export function inflateSync(data, opts) {
1221
1240
  return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);
1222
1241
  }
@@ -1252,9 +1271,12 @@ var Gzip = /*#__PURE__*/ (function () {
1252
1271
  /**
1253
1272
  * Flushes buffered uncompressed data. Useful to immediately retrieve the
1254
1273
  * GZIPped output for small inputs.
1274
+ * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5
1275
+ * extra bytes, but guarantees all pushed data is immediately
1276
+ * decompressible.
1255
1277
  */
1256
- Gzip.prototype.flush = function () {
1257
- Deflate.prototype.flush.call(this);
1278
+ Gzip.prototype.flush = function (sync) {
1279
+ Deflate.prototype.flush.call(this, sync);
1258
1280
  };
1259
1281
  return Gzip;
1260
1282
  }());
@@ -1332,14 +1354,17 @@ var Gunzip = /*#__PURE__*/ (function () {
1332
1354
  }
1333
1355
  // necessary to prevent TS from using the closure value
1334
1356
  // This allows for workerization to function correctly
1335
- Inflate.prototype.c.call(this, final);
1357
+ Inflate.prototype.c.call(this, 0);
1336
1358
  // process concatenated GZIP
1337
- if (this.s.f && !this.s.l && !final) {
1359
+ if (this.s.f && !this.s.l) {
1338
1360
  this.v = shft(this.s.p) + 9;
1339
1361
  this.s = { i: 0 };
1340
1362
  this.o = new u8(0);
1341
1363
  this.push(new u8(0), final);
1342
1364
  }
1365
+ else if (final) {
1366
+ Inflate.prototype.c.call(this, final);
1367
+ }
1343
1368
  };
1344
1369
  return Gunzip;
1345
1370
  }());
@@ -1374,12 +1399,6 @@ export function gunzip(data, opts, cb) {
1374
1399
  function () { return [gunzipSync]; }
1375
1400
  ], function (ev) { return pbf(gunzipSync(ev.data[0], ev.data[1])); }, 3, cb);
1376
1401
  }
1377
- /**
1378
- * Expands GZIP data
1379
- * @param data The data to decompress
1380
- * @param opts The decompression options
1381
- * @returns The decompressed version of the data
1382
- */
1383
1402
  export function gunzipSync(data, opts) {
1384
1403
  var st = gzs(data);
1385
1404
  if (st + 8 > data.length)
@@ -1415,9 +1434,12 @@ var Zlib = /*#__PURE__*/ (function () {
1415
1434
  /**
1416
1435
  * Flushes buffered uncompressed data. Useful to immediately retrieve the
1417
1436
  * zlibbed output for small inputs.
1437
+ * @param sync Whether to flush to a byte boundary. A sync flush takes 4-5
1438
+ * extra bytes, but guarantees all pushed data is immediately
1439
+ * decompressible.
1418
1440
  */
1419
- Zlib.prototype.flush = function () {
1420
- Deflate.prototype.flush.call(this);
1441
+ Zlib.prototype.flush = function (sync) {
1442
+ Deflate.prototype.flush.call(this, sync);
1421
1443
  };
1422
1444
  return Zlib;
1423
1445
  }());
@@ -1524,12 +1546,6 @@ export function unzlib(data, opts, cb) {
1524
1546
  function () { return [unzlibSync]; }
1525
1547
  ], function (ev) { return pbf(unzlibSync(ev.data[0], gopt(ev.data[1]))); }, 5, cb);
1526
1548
  }
1527
- /**
1528
- * Expands Zlib data
1529
- * @param data The data to decompress
1530
- * @param opts The decompression options
1531
- * @returns The decompressed version of the data
1532
- */
1533
1549
  export function unzlibSync(data, opts) {
1534
1550
  return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary);
1535
1551
  }
@@ -1650,7 +1666,7 @@ var fltn = function (d, p, t, o) {
1650
1666
  var val = d[k], n = p + k, op = o;
1651
1667
  if (Array.isArray(val))
1652
1668
  op = mrg(o, val[1]), val = val[0];
1653
- if (val instanceof u8)
1669
+ if (ArrayBuffer.isView(val))
1654
1670
  t[n] = [val, op];
1655
1671
  else {
1656
1672
  t[n += '/'] = [new u8(0), op];
@@ -1835,15 +1851,30 @@ var dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };
1835
1851
  var slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };
1836
1852
  // read zip header
1837
1853
  var zh = function (d, b, z) {
1838
- var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);
1839
- var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];
1840
- return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];
1854
+ var fnl = b2(d, b + 28), efl = b2(d, b + 30), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl;
1855
+ var _a = z64hs(d, es, efl, z, b4(d, b + 20), b4(d, b + 24), b4(d, b + 42)), sc = _a[0], su = _a[1], off = _a[2];
1856
+ return [b2(d, b + 10), sc, su, fn, es + efl + b2(d, b + 32), off];
1841
1857
  };
1842
- // read zip64 extra field
1843
- var z64e = function (d, b) {
1844
- for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))
1845
- ;
1846
- return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];
1858
+ // read zip64 header sizes
1859
+ var z64hs = function (d, b, l, z, sc, su, off) {
1860
+ var nsc = sc == 4294967295, nsu = su == 4294967295, noff = off == 4294967295, e = b + l;
1861
+ var nf = nsc + nsu + noff;
1862
+ if (z && nf) {
1863
+ for (; b + 4 < e; b += 4 + b2(d, b + 2)) {
1864
+ if (b2(d, b) == 1) {
1865
+ return [
1866
+ nsc ? b8(d, b + 4 + 8 * nsu) : sc,
1867
+ nsu ? b8(d, b + 4) : su,
1868
+ noff ? b8(d, b + 4 + 8 * (nsu + nsc)) : off,
1869
+ 1
1870
+ ];
1871
+ }
1872
+ }
1873
+ // z == 2 for unknown whether or not zip64
1874
+ if (z < 2)
1875
+ err(13);
1876
+ }
1877
+ return [sc, su, off, 0];
1847
1878
  };
1848
1879
  // extra field length
1849
1880
  var exfl = function (ex) {
@@ -1945,6 +1976,8 @@ var ZipPassThrough = /*#__PURE__*/ (function () {
1945
1976
  this.size += chunk.length;
1946
1977
  if (final)
1947
1978
  this.crc = this.c.d();
1979
+ // we shouldn't really do this cast, but properly handling ArrayBufferLike
1980
+ // makes the API unergonomic with Buffer
1948
1981
  this.process(chunk, final || false);
1949
1982
  };
1950
1983
  return ZipPassThrough;
@@ -2324,8 +2357,9 @@ export function zipSync(data, opts) {
2324
2357
  var UnzipPassThrough = /*#__PURE__*/ (function () {
2325
2358
  function UnzipPassThrough() {
2326
2359
  }
2327
- UnzipPassThrough.prototype.push = function (data, final) {
2328
- this.ondata(null, data, final);
2360
+ UnzipPassThrough.prototype.push = function (chunk, final) {
2361
+ // same as ZipPassThrough: cast to retain Buffer ergonomics
2362
+ this.ondata(null, chunk, final);
2329
2363
  };
2330
2364
  UnzipPassThrough.compression = 0;
2331
2365
  return UnzipPassThrough;
@@ -2345,9 +2379,9 @@ var UnzipInflate = /*#__PURE__*/ (function () {
2345
2379
  _this.ondata(null, dat, final);
2346
2380
  });
2347
2381
  }
2348
- UnzipInflate.prototype.push = function (data, final) {
2382
+ UnzipInflate.prototype.push = function (chunk, final) {
2349
2383
  try {
2350
- this.i.push(data, final);
2384
+ this.i.push(chunk, final);
2351
2385
  }
2352
2386
  catch (e) {
2353
2387
  this.ondata(e, null, final);
@@ -2378,10 +2412,10 @@ var AsyncUnzipInflate = /*#__PURE__*/ (function () {
2378
2412
  this.terminate = this.i.terminate;
2379
2413
  }
2380
2414
  }
2381
- AsyncUnzipInflate.prototype.push = function (data, final) {
2415
+ AsyncUnzipInflate.prototype.push = function (chunk, final) {
2382
2416
  if (this.i.terminate)
2383
- data = slc(data, 0);
2384
- this.i.push(data, final);
2417
+ chunk = slc(chunk, 0);
2418
+ this.i.push(chunk, final);
2385
2419
  };
2386
2420
  AsyncUnzipInflate.compression = 8;
2387
2421
  return AsyncUnzipInflate;
@@ -2438,7 +2472,6 @@ var Unzip = /*#__PURE__*/ (function () {
2438
2472
  }
2439
2473
  var l = buf.length, oc = this.c, add = oc && this.d;
2440
2474
  var _loop_2 = function () {
2441
- var _a;
2442
2475
  var sig = b4(buf, i);
2443
2476
  if (sig == 0x4034B50) {
2444
2477
  f = 1, is = i;
@@ -2449,13 +2482,11 @@ var Unzip = /*#__PURE__*/ (function () {
2449
2482
  var chks_3 = [];
2450
2483
  this_1.k.unshift(chks_3);
2451
2484
  f = 2;
2452
- var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);
2485
+ var lsc = b4(buf, i + 18), lsu = b4(buf, i + 22);
2453
2486
  var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);
2454
- if (sc_1 == 4294967295) {
2455
- _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];
2456
- }
2457
- else if (dd)
2458
- sc_1 = -1;
2487
+ var _a = z64hs(buf, i, es, 2, lsc, lsu, 0), sc_1 = _a[0], su_1 = _a[1], z64 = _a[3];
2488
+ if (dd)
2489
+ sc_1 = -1 - z64;
2459
2490
  i += es;
2460
2491
  this_1.c = sc_1;
2461
2492
  var d_1;
@@ -2568,7 +2599,7 @@ export function unzip(data, opts, cb) {
2568
2599
  if (lft) {
2569
2600
  var c = lft;
2570
2601
  var o = b4(data, e + 16);
2571
- var z = o == 4294967295 || c == 65535;
2602
+ var z = b4(data, e - 20) == 0x7064B50;
2572
2603
  if (z) {
2573
2604
  var ze = b4(data, e - 12);
2574
2605
  z = b4(data, ze) == 0x6064B50;
@@ -2648,7 +2679,7 @@ export function unzipSync(data, opts) {
2648
2679
  if (!c)
2649
2680
  return {};
2650
2681
  var o = b4(data, e + 16);
2651
- var z = o == 4294967295 || c == 65535;
2682
+ var z = b4(data, e - 20) == 0x7064B50;
2652
2683
  if (z) {
2653
2684
  var ze = b4(data, e - 12);
2654
2685
  z = b4(data, ze) == 0x6064B50;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fflate",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "High performance (de)compression in an 8kB package",
5
5
  "main": "./lib/index.cjs",
6
6
  "module": "./esm/browser.js",
@@ -50,7 +50,8 @@
50
50
  "types": "./lib/browser.d.cts",
51
51
  "default": "./lib/browser.cjs"
52
52
  }
53
- }
53
+ },
54
+ "./package.json": "./package.json"
54
55
  },
55
56
  "targets": {
56
57
  "main": false,
@@ -92,30 +93,30 @@
92
93
  "build:umd": "SC=buildUMD npm run script",
93
94
  "build:rewrite": "SC=rewriteBuilds npm run script",
94
95
  "build:demo": "tsc --project tsconfig.demo.json && parcel build demo/index.html --no-cache --public-url \"./\" && SC=cpGHPages npm run script",
95
- "build:docs": "typedoc --plugin typedoc-plugin-markdown --hideBreadcrumbs --readme none --disableSources --excludePrivate --excludeProtected --githubPages false --out docs/ src/index.ts",
96
+ "build:docs": "typedoc --plugin typedoc-plugin-markdown --hideBreadcrumbs --readme none --disableSources --excludePrivate --excludeProtected --expandParameters --githubPages false --out docs/ src/index.ts",
96
97
  "test": "TS_NODE_PROJECT=test/tsconfig.json uvu -b -r ts-node/register test",
97
98
  "prepack": "npm run build && npm run test"
98
99
  },
99
100
  "devDependencies": {
100
101
  "@parcel/service-worker": "^2.9.3",
101
- "@types/node": "^14.11.2",
102
+ "@types/node": "^25.8.0",
102
103
  "@types/pako": "*",
103
104
  "@types/react": "^18.2.21",
104
105
  "@types/react-dom": "^18.2.7",
105
- "jszip": "^3.5.0",
106
+ "jszip": "^3.10.1",
106
107
  "pako": "*",
107
108
  "parcel": "^2.9.3",
108
109
  "preact": "^10.17.1",
109
110
  "react": "^18.2.0",
110
111
  "react-dom": "^18.2.0",
111
112
  "simple-git": "^3.19.1",
112
- "terser": "^5.3.8",
113
+ "terser": "^5.47.1",
113
114
  "tiny-inflate": "*",
114
- "ts-node": "^10.9.1",
115
- "typedoc": "^0.25.0",
116
- "typedoc-plugin-markdown": "^3.16.0",
117
- "typescript": "^5.2.2",
118
- "uvu": "^0.3.3",
115
+ "ts-node": "^10.9.2",
116
+ "typedoc": "^0.28.19",
117
+ "typedoc-plugin-markdown": "^4.11.0",
118
+ "typescript": "^6.0.3",
119
+ "uvu": "^0.5.6",
119
120
  "uzip": "*"
120
121
  },
121
122
  "alias": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/agent-prod",
3
- "version": "5.0.0-beta.17",
3
+ "version": "5.0.0-beta.19",
4
4
  "type": "module",
5
5
  "private": true,
6
6
  "dependencies": {
@@ -12,7 +12,7 @@
12
12
  "anymatch": "3.1.3",
13
13
  "chokidar": "5.0.0",
14
14
  "consola": "3.4.2",
15
- "fflate": "0.8.2",
15
+ "fflate": "0.8.3",
16
16
  "jiti": "2.7.0",
17
17
  "normalize-path": "3.0.0",
18
18
  "picomatch": "2.3.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/agent",
3
- "version": "5.0.0-beta.17",
3
+ "version": "5.0.0-beta.19",
4
4
  "description": "HTTP agent server for Kubb. Exposes code generation via REST API and WebSocket with real-time Kubb Studio integration, machine binding, and Docker support.",
5
5
  "keywords": [
6
6
  "agent",
@@ -43,8 +43,8 @@
43
43
  "tinyexec": "^1.1.2",
44
44
  "unstorage": "^1.17.5",
45
45
  "ws": "^8.20.1",
46
- "@kubb/ast": "5.0.0-beta.17",
47
- "@kubb/core": "5.0.0-beta.17"
46
+ "@kubb/ast": "5.0.0-beta.19",
47
+ "@kubb/core": "5.0.0-beta.19"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/ws": "^8.18.1",
@@ -52,9 +52,9 @@
52
52
  "nitropack": "^2.13.4",
53
53
  "vite": "^8.0.13",
54
54
  "@internals/utils": "0.0.0",
55
- "@kubb/adapter-oas": "5.0.0-beta.17",
56
- "@kubb/parser-ts": "5.0.0-beta.17",
57
- "@kubb/renderer-jsx": "5.0.0-beta.17"
55
+ "@kubb/adapter-oas": "5.0.0-beta.19",
56
+ "@kubb/parser-ts": "5.0.0-beta.19",
57
+ "@kubb/renderer-jsx": "5.0.0-beta.19"
58
58
  },
59
59
  "engines": {
60
60
  "node": ">=22"