@volter/browser-substrate 0.1.107 → 0.1.109

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.
@@ -4322,4 +4322,4 @@ function serveStore(scope3, port, loadEngine) {
4322
4322
  }
4323
4323
 
4324
4324
  // <stdin>
4325
- startExecutionFront(self, () => import("/assets/node-execution-worker-3ddf5efbaa427e9d.js"));
4325
+ startExecutionFront(self, () => import("/assets/node-execution-worker-67ab1cab4177b67d.js"));
@@ -1 +1 @@
1
- {"format":1,"pyodide":"314.0.6","engine":"sha256-OgoA3+qjSKwg+e8JkEIz0y0z9kQzlmLUrzaPiiAQ83o=","preparation":"77987879a2949714bdec4de6bae2d0431adbc3549686414e4e13e051cf23bfae","integrity":"sha256-flNyEiKVmXt3p7X5uf11FlKbTU7dRmtfCf0uisFuG+A=","bytes":6188627}
1
+ {"format":1,"pyodide":"314.0.6","engine":"sha256-OgoA3+qjSKwg+e8JkEIz0y0z9kQzlmLUrzaPiiAQ83o=","preparation":"77987879a2949714bdec4de6bae2d0431adbc3549686414e4e13e051cf23bfae","integrity":"sha256-2TMP9H+UlA+mYQ0jEau/Omluuwv5cnzQJrU+ac+N6Ac=","bytes":6192309}
@@ -21420,14 +21420,20 @@ var TCPConnectWrap = class {
21420
21420
  localPort = void 0;
21421
21421
  addressType = void 0;
21422
21422
  };
21423
- var boundPorts = /* @__PURE__ */ new Map();
21423
+ var v4Ports = /* @__PURE__ */ new Map();
21424
+ var v6Ports = /* @__PURE__ */ new Map();
21424
21425
  var ephemeralPorts = /* @__PURE__ */ new Set();
21426
+ var portTaken = (port) => v4Ports.has(port) || v6Ports.has(port) || ephemeralPorts.has(port);
21427
+ function spacesOf(family, flags) {
21428
+ if (family !== "IPv6") return [v4Ports];
21429
+ return flags & constants.UV_TCP_IPV6ONLY ? [v6Ports] : [v4Ports, v6Ports];
21430
+ }
21425
21431
  var nextEphemeral = 49152;
21426
21432
  function allocatePort() {
21427
21433
  for (let tries = 0; tries < 16384; tries += 1) {
21428
21434
  const port = nextEphemeral;
21429
21435
  nextEphemeral = nextEphemeral >= 65535 ? 49152 : nextEphemeral + 1;
21430
- if (!boundPorts.has(port) && !ephemeralPorts.has(port)) return port;
21436
+ if (!portTaken(port)) return port;
21431
21437
  }
21432
21438
  return 0;
21433
21439
  }
@@ -21439,9 +21445,13 @@ function isThisHost(address) {
21439
21445
  }
21440
21446
  var onListenWatcher = null;
21441
21447
  var onCloseWatcher = null;
21442
- function listenerOnPort(port) {
21443
- const bound = boundPorts.get(port);
21444
- return bound && bound.listening ? bound : void 0;
21448
+ function listenerOnPort(port, family) {
21449
+ const order = family === "IPv6" ? [v6Ports, v4Ports] : [v4Ports, v6Ports];
21450
+ for (const space of order) {
21451
+ const bound = space.get(port);
21452
+ if (bound && bound.listening) return bound;
21453
+ }
21454
+ return void 0;
21445
21455
  }
21446
21456
  var TCP = class extends LibuvStreamWrap {
21447
21457
  /** `constants.SOCKET` or `constants.SERVER`. */
@@ -21459,24 +21469,27 @@ var TCP = class extends LibuvStreamWrap {
21459
21469
  bind(address, port, _flags) {
21460
21470
  const native = nativeStreamFor(this);
21461
21471
  if (native) return native.call({ operation: "bind", id: native.descriptor.id, address, port, flags: _flags }).status;
21462
- return this.bindTo(address || "0.0.0.0", port, "IPv4");
21472
+ return this.bindTo(address || "0.0.0.0", port, "IPv4", Number(_flags) || 0);
21463
21473
  }
21464
21474
  bind6(address, port, _flags) {
21465
21475
  const native = nativeStreamFor(this);
21466
21476
  if (native) return native.call({ operation: "bind", id: native.descriptor.id, address, port, flags: _flags, ipv6: true }).status;
21467
- return this.bindTo(address || "::", port, "IPv6");
21477
+ return this.bindTo(address || "::", port, "IPv6", Number(_flags) || 0);
21468
21478
  }
21469
- bindTo(address, port, family) {
21479
+ bindTo(address, port, family, flags = 0) {
21470
21480
  if (!isThisHost(address)) return UV_EADDRINUSE;
21471
21481
  const wanted = Number(port) || 0;
21472
- if (wanted !== 0 && boundPorts.has(wanted)) return UV_EADDRINUSE;
21482
+ const spaces3 = spacesOf(family, flags);
21483
+ if (wanted !== 0 && spaces3.some((space) => space.has(wanted))) return UV_EADDRINUSE;
21473
21484
  if (wanted !== 0 && ephemeralPorts.has(wanted)) return UV_EADDRINUSE;
21474
21485
  const bound = wanted === 0 ? allocatePort() : wanted;
21475
- if (this.local && boundPorts.get(this.local.port) === this) boundPorts.delete(this.local.port);
21486
+ if (this.local) {
21487
+ for (const space of [v4Ports, v6Ports]) if (space.get(this.local.port) === this) space.delete(this.local.port);
21488
+ }
21476
21489
  this.local = { address, family, port: bound };
21477
- boundPorts.set(bound, this);
21490
+ for (const space of spaces3) space.set(bound, this);
21478
21491
  this.onLastReferenceClose(() => {
21479
- if (boundPorts.get(bound) === this) boundPorts.delete(bound);
21492
+ for (const space of spaces3) if (space.get(bound) === this) space.delete(bound);
21480
21493
  });
21481
21494
  return 0;
21482
21495
  }
@@ -21522,7 +21535,7 @@ var TCP = class extends LibuvStreamWrap {
21522
21535
  this.remote = { address, family, port: target };
21523
21536
  queueMicrotask(() => {
21524
21537
  if (this.closed) return;
21525
- const server = reachable ? listenerOnPort(target) : void 0;
21538
+ const server = reachable ? listenerOnPort(target, family) : void 0;
21526
21539
  if (!server) {
21527
21540
  req.oncomplete?.(UV_ECONNREFUSED, this, req, true, true);
21528
21541
  return;
@@ -82237,14 +82250,20 @@ var TCPConnectWrap2 = class {
82237
82250
  __publicField2(this, "addressType");
82238
82251
  }
82239
82252
  };
82240
- var boundPorts2 = /* @__PURE__ */ new Map();
82253
+ var v4Ports2 = /* @__PURE__ */ new Map();
82254
+ var v6Ports2 = /* @__PURE__ */ new Map();
82241
82255
  var ephemeralPorts2 = /* @__PURE__ */ new Set();
82256
+ var portTaken2 = (port) => v4Ports2.has(port) || v6Ports2.has(port) || ephemeralPorts2.has(port);
82257
+ function spacesOf2(family, flags) {
82258
+ if (family !== "IPv6") return [v4Ports2];
82259
+ return flags & constants$5.UV_TCP_IPV6ONLY ? [v6Ports2] : [v4Ports2, v6Ports2];
82260
+ }
82242
82261
  var nextEphemeral2 = 49152;
82243
82262
  function allocatePort2() {
82244
82263
  for (let tries = 0; tries < 16384; tries += 1) {
82245
82264
  const port = nextEphemeral2;
82246
82265
  nextEphemeral2 = nextEphemeral2 >= 65535 ? 49152 : nextEphemeral2 + 1;
82247
- if (!boundPorts2.has(port) && !ephemeralPorts2.has(port)) return port;
82266
+ if (!portTaken2(port)) return port;
82248
82267
  }
82249
82268
  return 0;
82250
82269
  }
@@ -82260,9 +82279,13 @@ function setPortWatchers(onListen, onClose) {
82260
82279
  onListenWatcher2 = onListen;
82261
82280
  onCloseWatcher2 = onClose;
82262
82281
  }
82263
- function listenerOnPort2(port) {
82264
- const bound = boundPorts2.get(port);
82265
- return bound && bound.listening ? bound : void 0;
82282
+ function listenerOnPort2(port, family) {
82283
+ const order = family === "IPv6" ? [v6Ports2, v4Ports2] : [v4Ports2, v6Ports2];
82284
+ for (const space of order) {
82285
+ const bound = space.get(port);
82286
+ if (bound && bound.listening) return bound;
82287
+ }
82288
+ return void 0;
82266
82289
  }
82267
82290
  var TCP2 = class extends LibuvStreamWrap2 {
82268
82291
  constructor(type22 = constants$5.SOCKET) {
@@ -82278,24 +82301,27 @@ var TCP2 = class extends LibuvStreamWrap2 {
82278
82301
  bind(address, port, _flags) {
82279
82302
  const native = nativeStreamFor2(this);
82280
82303
  if (native) return native.call({ operation: "bind", id: native.descriptor.id, address, port, flags: _flags }).status;
82281
- return this.bindTo(address || "0.0.0.0", port, "IPv4");
82304
+ return this.bindTo(address || "0.0.0.0", port, "IPv4", Number(_flags) || 0);
82282
82305
  }
82283
82306
  bind6(address, port, _flags) {
82284
82307
  const native = nativeStreamFor2(this);
82285
82308
  if (native) return native.call({ operation: "bind", id: native.descriptor.id, address, port, flags: _flags, ipv6: true }).status;
82286
- return this.bindTo(address || "::", port, "IPv6");
82309
+ return this.bindTo(address || "::", port, "IPv6", Number(_flags) || 0);
82287
82310
  }
82288
- bindTo(address, port, family) {
82311
+ bindTo(address, port, family, flags = 0) {
82289
82312
  if (!isThisHost2(address)) return UV_EADDRINUSE2;
82290
82313
  const wanted = Number(port) || 0;
82291
- if (wanted !== 0 && boundPorts2.has(wanted)) return UV_EADDRINUSE2;
82314
+ const spaces3 = spacesOf2(family, flags);
82315
+ if (wanted !== 0 && spaces3.some((space) => space.has(wanted))) return UV_EADDRINUSE2;
82292
82316
  if (wanted !== 0 && ephemeralPorts2.has(wanted)) return UV_EADDRINUSE2;
82293
82317
  const bound = wanted === 0 ? allocatePort2() : wanted;
82294
- if (this.local && boundPorts2.get(this.local.port) === this) boundPorts2.delete(this.local.port);
82318
+ if (this.local) {
82319
+ for (const space of [v4Ports2, v6Ports2]) if (space.get(this.local.port) === this) space.delete(this.local.port);
82320
+ }
82295
82321
  this.local = { address, family, port: bound };
82296
- boundPorts2.set(bound, this);
82322
+ for (const space of spaces3) space.set(bound, this);
82297
82323
  this.onLastReferenceClose(() => {
82298
- if (boundPorts2.get(bound) === this) boundPorts2.delete(bound);
82324
+ for (const space of spaces3) if (space.get(bound) === this) space.delete(bound);
82299
82325
  });
82300
82326
  return 0;
82301
82327
  }
@@ -82345,7 +82371,7 @@ var TCP2 = class extends LibuvStreamWrap2 {
82345
82371
  queueMicrotask(() => {
82346
82372
  var _a22, _b22, _c22;
82347
82373
  if (this.closed) return;
82348
- const server = reachable ? listenerOnPort2(target) : void 0;
82374
+ const server = reachable ? listenerOnPort2(target, family) : void 0;
82349
82375
  if (!server) {
82350
82376
  (_a22 = req.oncomplete) == null ? void 0 : _a22.call(req, UV_ECONNREFUSED2, this, req, true, true);
82351
82377
  return;
@@ -116347,7 +116373,7 @@ var WorkerRuntime = class {
116347
116373
  this.worker = new Worker(
116348
116374
  new URL(
116349
116375
  /* @vite-ignore */
116350
- "/assets/runtime-worker-CFd3N-Xm.js",
116376
+ "/assets/runtime-worker-CTPA-1k9.js",
116351
116377
  import.meta.url
116352
116378
  ),
116353
116379
  { type: "module" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/browser-substrate",
3
- "version": "0.1.107",
3
+ "version": "0.1.109",
4
4
  "description": "Run a folder in a browser tab: one command, a Dockerfile as the config, static files out",
5
5
  "license": "MIT",
6
6
  "repository": {