@ai-ecoverse/slicc-kernel 1.114.0 → 1.116.0

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.
@@ -949,6 +949,7 @@ function parseSyncFsStat(json2) {
949
949
  isDirectory: s.isDirectory,
950
950
  isSymbolicLink: s.isSymbolicLink,
951
951
  ...s.isSocket === true ? { isSocket: true } : {},
952
+ ...s.isFifo === true ? { isFifo: true } : {},
952
953
  size: s.size,
953
954
  ...typeof s.mode === "number" ? { mode: s.mode } : {},
954
955
  ...typeof s.mtimeMs === "number" ? { mtimeMs: s.mtimeMs } : {},
@@ -992,6 +993,7 @@ var init_sync_fs_wire = __esm({
992
993
  "statfs",
993
994
  "hold",
994
995
  "create",
996
+ "mkfifo",
995
997
  "kept",
996
998
  "pread",
997
999
  "pwrite",
@@ -1275,6 +1277,9 @@ function createSyncFsSabBridge(transport, opts = {}) {
1275
1277
  lutimes: (path, atimeMs, mtimeMs, now) => {
1276
1278
  run({ op: "lutimes", path, atimeMs, mtimeMs, ...now ? { now } : {} }, path);
1277
1279
  },
1280
+ mkfifo: (path, mode) => {
1281
+ run({ op: "mkfifo", path, mode }, path);
1282
+ },
1278
1283
  create: (path, mode, opening2) => {
1279
1284
  const flags = { ...mode !== void 0 ? { mode } : {}, ...opening2 ? { opening: opening2 } : {} };
1280
1285
  run({ op: "create", path, ...flags }, path);
@@ -1348,7 +1353,7 @@ function exactIn(node) {
1348
1353
  return node?.mount.opts.bridge.owners === true;
1349
1354
  }
1350
1355
  function modeFromStat(st, exact = false) {
1351
- const type = st.isSymbolicLink ? S_IFLNK : st.isDirectory ? S_IFDIR : st.isSocket ? S_IFSOCK : S_IFREG;
1356
+ const type = st.isSymbolicLink ? S_IFLNK : st.isDirectory ? S_IFDIR : st.isSocket ? S_IFSOCK : st.isFifo ? S_IFIFO : S_IFREG;
1352
1357
  const fallback = st.isDirectory || st.isSymbolicLink ? 511 : 438;
1353
1358
  const perm = (st.mode ?? fallback) & PERM_MASK;
1354
1359
  return type | (exact ? perm : perm || fallback);
@@ -1756,11 +1761,14 @@ function createNodeOps(h) {
1756
1761
  call2(
1757
1762
  () => bridge.create ? bridge.create(path, perm, opening.get(h.Fs) > 0) : bridge.writeFile(path, new Uint8Array(0))
1758
1763
  );
1764
+ } else if ((mode & S_IFMT) === S_IFIFO && bridge.mkfifo) {
1765
+ call2(() => bridge.mkfifo?.(path, mode & PERM_MASK));
1759
1766
  } else {
1760
1767
  throw new Fs.ErrnoError(wasiErrno("EPERM"));
1761
1768
  }
1762
1769
  const node = makeNode(parent, name2, {
1763
1770
  isFile: Fs.isFile(mode),
1771
+ ...(mode & S_IFMT) === S_IFIFO ? { isFifo: true } : {},
1764
1772
  isDirectory: Fs.isDir(mode),
1765
1773
  isSymbolicLink: false,
1766
1774
  size: 0,
@@ -1893,7 +1901,18 @@ function createStreamOps(h) {
1893
1901
  }
1894
1902
  return want;
1895
1903
  };
1904
+ const fifo = (stream) => {
1905
+ const open = h.Fs.sliccOpenFifo;
1906
+ try {
1907
+ if (!open) throw new Fs.ErrnoError(wasiErrno("ENXIO"));
1908
+ open.call(h.Fs, stream, liveNodePath(stream.node));
1909
+ } catch (err) {
1910
+ if (stream.fd !== void 0) Fs.closeStream?.(stream.fd);
1911
+ throw err;
1912
+ }
1913
+ };
1896
1914
  const directory = (stream) => {
1915
+ if ((stream.node.mode & S_IFMT) === S_IFIFO && !(stream.flags & O_PATH)) return fifo(stream);
1897
1916
  if ((stream.node.mode & S_IFMT) === S_IFSOCK && !(stream.flags & O_PATH)) {
1898
1917
  if (stream.fd !== void 0) Fs.closeStream?.(stream.fd);
1899
1918
  throw new Fs.ErrnoError(wasiErrno("ENXIO"));
@@ -2375,7 +2394,7 @@ function readingLinks(Fs) {
2375
2394
  }
2376
2395
  };
2377
2396
  }
2378
- var S_IFDIR, S_IFREG, S_IFLNK, S_IFSOCK, S_IFMT, PERM_MASK, DEFAULT_DIR_PERM, UMASK, SEEK_CUR, SEEK_END, EARLY_WHOLE_FILE, O_APPEND, O_ACCMODE, O_TRUNC, O_PATH, stale, opening;
2397
+ var S_IFDIR, S_IFREG, S_IFLNK, S_IFSOCK, S_IFIFO, S_IFMT, PERM_MASK, DEFAULT_DIR_PERM, UMASK, SEEK_CUR, SEEK_END, EARLY_WHOLE_FILE, O_APPEND, O_ACCMODE, O_TRUNC, O_PATH, stale, opening;
2379
2398
  var init_live_vfs_fs = __esm({
2380
2399
  "src/realm/live-vfs-fs.ts"() {
2381
2400
  "use strict";
@@ -2389,6 +2408,7 @@ var init_live_vfs_fs = __esm({
2389
2408
  S_IFREG = 32768;
2390
2409
  S_IFLNK = 40960;
2391
2410
  S_IFSOCK = 49152;
2411
+ S_IFIFO = 4096;
2392
2412
  S_IFMT = 61440;
2393
2413
  PERM_MASK = 4095;
2394
2414
  DEFAULT_DIR_PERM = 493;
@@ -2522,7 +2542,7 @@ var KERNEL_VERSION, OS_RELEASE;
2522
2542
  var init_version = __esm({
2523
2543
  "src/version.ts"() {
2524
2544
  "use strict";
2525
- KERNEL_VERSION = true ? "1.114.0" : "0.0.0-dev";
2545
+ KERNEL_VERSION = true ? "1.116.0" : "0.0.0-dev";
2526
2546
  OS_RELEASE = "6.0.0-slicc";
2527
2547
  }
2528
2548
  });
@@ -3156,6 +3176,25 @@ function useZeroDevices(Fs) {
3156
3176
  mkdev.call(Fs, path, CHAR_DEVICE, dev);
3157
3177
  }
3158
3178
  }
3179
+ function namesFifo(fs, path) {
3180
+ try {
3181
+ const { node } = fs.lookupPath?.(path, { follow: true }) ?? { node: { mode: 0 } };
3182
+ return (node.mode & S_IFMT_BITS) === S_IFIFO_BITS;
3183
+ } catch {
3184
+ return false;
3185
+ }
3186
+ }
3187
+ function useFifoOpens(Fs, attach) {
3188
+ const fs = Fs;
3189
+ if (attach) fs.sliccOpenFifo = attach;
3190
+ const open = fs.open;
3191
+ if (typeof open !== "function" || typeof fs.lookupPath !== "function") return;
3192
+ fs.open = (path, flags, ...rest2) => {
3193
+ const truncates = typeof path === "string" && typeof flags === "number" && flags & O_TRUNC2;
3194
+ const kept = truncates && namesFifo(fs, path) ? flags & ~O_TRUNC2 : flags;
3195
+ return open.call(Fs, path, kept, ...rest2);
3196
+ };
3197
+ }
3159
3198
  function useDevRemoval(Fs) {
3160
3199
  const fs = Fs;
3161
3200
  for (const name2 of ["unlink", "rmdir"]) {
@@ -3470,7 +3509,7 @@ function linuxDevices(Fs) {
3470
3509
  }
3471
3510
  }
3472
3511
  }
3473
- var O_CLOEXEC, FD_CLOEXEC, F_DUPFD, F_GETFD, F_SETFD, F_GETFL, F_DUPFD_CLOEXEC, tracked, IMPORT_NAMES, EBADF, AT_SYMLINK_NOFOLLOW, EMSCRIPTEN_EPERM, O_PATH2, LITERALS, UTIME_NOW, UTIME_OMIT, PROT_WRITE, MAP_PRIVATE, MAP_TYPE, O_WRONLY2, MAP_ALIGN, DIR_MODE, LINK_MODE, CHAR_DEVICE, O_ACCMODE3, O_CREAT, O_EXCL, field, pinnedRoot, rootKind, NAME, AT_FDCWD, AT_EACCESS, W_ACCESS, X_ACCESS, AT_SYMLINK_FOLLOW, UTS_FIELD, DEVICE_MODES;
3512
+ var O_CLOEXEC, FD_CLOEXEC, F_DUPFD, F_GETFD, F_SETFD, F_GETFL, F_DUPFD_CLOEXEC, tracked, IMPORT_NAMES, EBADF, AT_SYMLINK_NOFOLLOW, EMSCRIPTEN_EPERM, O_PATH2, LITERALS, UTIME_NOW, UTIME_OMIT, PROT_WRITE, MAP_PRIVATE, MAP_TYPE, O_WRONLY2, MAP_ALIGN, DIR_MODE, LINK_MODE, CHAR_DEVICE, O_TRUNC2, S_IFMT_BITS, S_IFIFO_BITS, O_ACCMODE3, O_CREAT, O_EXCL, field, pinnedRoot, rootKind, NAME, AT_FDCWD, AT_EACCESS, W_ACCESS, X_ACCESS, AT_SYMLINK_FOLLOW, UTS_FIELD, DEVICE_MODES;
3474
3513
  var init_process_fds = __esm({
3475
3514
  "src/process/process-fds.ts"() {
3476
3515
  "use strict";
@@ -3528,6 +3567,9 @@ var init_process_fds = __esm({
3528
3567
  DIR_MODE = 16749;
3529
3568
  LINK_MODE = 41408;
3530
3569
  CHAR_DEVICE = 8630;
3570
+ O_TRUNC2 = 512;
3571
+ S_IFMT_BITS = 61440;
3572
+ S_IFIFO_BITS = 4096;
3531
3573
  O_ACCMODE3 = 3;
3532
3574
  O_CREAT = 64;
3533
3575
  O_EXCL = 128;
@@ -3680,7 +3722,7 @@ function datesOf(real) {
3680
3722
  dates[key] = new Date(value2);
3681
3723
  return dates;
3682
3724
  }
3683
- var POLLIN, POLLOUT, POLLERR, POLLHUP, POLLRDNORM, POLLWRNORM, TCSETSF, O_NONBLOCK, SOCKET_MODE, PTY_PATH, TTY_PATH, TTY_NAME, SEALED_PATH, STRERROR, CLIPBOARD_PATH, O_CREAT2, O_EXCL2, O_NOCTTY, O_TRUNC2, O_DIRECTORY, KILLED_BY_SIGPIPE, ProcessExit, SyscallError, KernelStreams;
3725
+ var POLLIN, POLLOUT, POLLERR, POLLHUP, POLLRDNORM, POLLWRNORM, TCSETSF, O_NONBLOCK, SOCKET_MODE, PTY_PATH, TTY_PATH, TTY_NAME, SEALED_PATH, STRERROR, CLIPBOARD_PATH, O_CREAT2, O_EXCL2, O_NOCTTY, O_TRUNC3, O_DIRECTORY, KILLED_BY_SIGPIPE, ProcessExit, SyscallError, KernelStreams;
3684
3726
  var init_kernel_streams = __esm({
3685
3727
  "src/process/kernel-streams.ts"() {
3686
3728
  "use strict";
@@ -3712,7 +3754,7 @@ var init_kernel_streams = __esm({
3712
3754
  O_CREAT2 = 64;
3713
3755
  O_EXCL2 = 128;
3714
3756
  O_NOCTTY = 256;
3715
- O_TRUNC2 = 512;
3757
+ O_TRUNC3 = 512;
3716
3758
  O_DIRECTORY = 65536;
3717
3759
  KILLED_BY_SIGPIPE = 128 + 13;
3718
3760
  ProcessExit = class extends Error {
@@ -3750,6 +3792,13 @@ var init_kernel_streams = __esm({
3750
3792
  if (terminal ?? this.sys.isatty?.(kfd) ?? false) stream.tty = this.ttyOps(kfd);
3751
3793
  else delete stream.tty;
3752
3794
  }
3795
+ attachFifo(stream, path) {
3796
+ const kfd = this.call(
3797
+ () => this.restarting(() => this.sys.openVfs(path, stream.flags, 0, { fifo: true }))
3798
+ );
3799
+ this.attach(stream, kfd, false);
3800
+ stream.sliccKernelFifo = path;
3801
+ }
3753
3802
  attachSocket(stream, kfd) {
3754
3803
  this.attach(stream, kfd, false);
3755
3804
  stream.sliccKernelSocket = true;
@@ -4059,7 +4108,7 @@ var init_kernel_streams = __esm({
4059
4108
  vessel(open, kfd, at, terminal) {
4060
4109
  let stream;
4061
4110
  try {
4062
- stream = open("/dev/null", at.flags & ~(O_CREAT2 | O_EXCL2 | O_TRUNC2), at.mode);
4111
+ stream = open("/dev/null", at.flags & ~(O_CREAT2 | O_EXCL2 | O_TRUNC3), at.mode);
4063
4112
  } catch (e) {
4064
4113
  this.sys.close(kfd);
4065
4114
  throw e;
@@ -4305,7 +4354,8 @@ function kernelEntry(stream, kernel) {
4305
4354
  const device2 = stream.path === void 0 ? void 0 : NAMED_DEVICES[stream.path];
4306
4355
  const kind = stream.sliccKernelFile ? "file" : stream.tty ? "tty" : device2 ?? "stream";
4307
4356
  const access = kind === "tty" ? O_RDWR : (stream.flags ?? O_RDWR) & O_ACCMODE4;
4308
- return { fd: stream.fd, kernel, kind, flags: access, ...cloexec };
4357
+ const fifo = stream.sliccKernelFifo ? { fifo: stream.sliccKernelFifo } : {};
4358
+ return { fd: stream.fd, kernel, kind, flags: access, ...cloexec, ...fifo };
4309
4359
  }
4310
4360
  function describeInherited(Fs, sys, streams2, livePath, actions = []) {
4311
4361
  const table = /* @__PURE__ */ new Map();
@@ -4385,6 +4435,7 @@ function placeKernelStream(Fs, streams2, entry) {
4385
4435
  if (entry.kind === "tty") streams2.nameTerminal(stream);
4386
4436
  if (entry.kind === "stream") {
4387
4437
  asFifo(stream, streams2, entry.desc !== void 0 ? `d${entry.desc}` : `k${entry.kernel}`);
4438
+ if (entry.fifo) stream.path = entry.fifo;
4388
4439
  }
4389
4440
  setCloseOnExec(stream, entry.cloexec === true);
4390
4441
  return stream;
@@ -4398,7 +4449,7 @@ function restoreForkedStreams(Fs, streams2, table) {
4398
4449
  } else {
4399
4450
  const placed = place(
4400
4451
  Fs,
4401
- Fs.open(entry.path, entry.flags & ~(O_CREAT3 | O_EXCL3 | O_TRUNC3)),
4452
+ Fs.open(entry.path, entry.flags & ~(O_CREAT3 | O_EXCL3 | O_TRUNC4)),
4402
4453
  entry.fd
4403
4454
  );
4404
4455
  setCloseOnExec(placed, (entry.flags & O_CLOEXEC) !== 0);
@@ -4407,7 +4458,7 @@ function restoreForkedStreams(Fs, streams2, table) {
4407
4458
  }
4408
4459
  }
4409
4460
  }
4410
- var O_RDWR, O_ACCMODE4, O_CREAT3, O_EXCL3, O_TRUNC3, PLACEHOLDER_DIR, NAMED_DEVICES, ACCESS, DEVICES, FIFO_MODE, nextStreamIno, streamInos;
4461
+ var O_RDWR, O_ACCMODE4, O_CREAT3, O_EXCL3, O_TRUNC4, PLACEHOLDER_DIR, NAMED_DEVICES, ACCESS, DEVICES, FIFO_MODE, nextStreamIno, streamInos;
4411
4462
  var init_process_fork = __esm({
4412
4463
  "src/process/process-fork.ts"() {
4413
4464
  "use strict";
@@ -4416,7 +4467,7 @@ var init_process_fork = __esm({
4416
4467
  O_ACCMODE4 = 3;
4417
4468
  O_CREAT3 = 64;
4418
4469
  O_EXCL3 = 128;
4419
- O_TRUNC3 = 512;
4470
+ O_TRUNC4 = 512;
4420
4471
  PLACEHOLDER_DIR = "/dev/slicc-fd";
4421
4472
  NAMED_DEVICES = {
4422
4473
  "/dev/sealed": "sealed",
@@ -5511,7 +5562,8 @@ function kernelSys(transport) {
5511
5562
  ...opts?.create ? { create: true } : {},
5512
5563
  ...opts?.created ? { created: true } : {},
5513
5564
  ...opts?.pin ? { pin: opts.pin } : {},
5514
- ...opts?.handle !== void 0 ? { handle: opts.handle } : {}
5565
+ ...opts?.handle !== void 0 ? { handle: opts.handle } : {},
5566
+ ...opts?.fifo ? { fifo: true } : {}
5515
5567
  },
5516
5568
  `fd-open-vfs ${path}`
5517
5569
  )
@@ -5915,6 +5967,7 @@ async function runWasmProcess(init, port2, deps = {}) {
5915
5967
  streams2.useKernelFdMetadata();
5916
5968
  useDevFd(running.FS);
5917
5969
  useDevRemoval(running.FS);
5970
+ useFifoOpens(running.FS, (stream, path) => streams2.attachFifo(stream, path));
5918
5971
  useFileMmap(running.FS, {
5919
5972
  sys,
5920
5973
  memory: () => memory,
@@ -7716,6 +7769,7 @@ var init_wasi_fds = __esm({
7716
7769
  return this.regular(path, s, oflags, rights, fdflags, mode);
7717
7770
  }
7718
7771
  regular(path, s, oflags, rights, fdflags, mode) {
7772
+ if (s?.isFifo) return this.kernelFifo(path, s, oflags, rights, fdflags);
7719
7773
  if (this.shared || this.kernelHolds(path, s)) {
7720
7774
  return this.kernelFile(path, s, oflags, rights, fdflags, mode);
7721
7775
  }
@@ -7810,6 +7864,28 @@ var init_wasi_fds = __esm({
7810
7864
  this.bump(fd);
7811
7865
  return fd;
7812
7866
  }
7867
+ kernelFifo(path, existing, oflags, rights, fdflags) {
7868
+ const { readable: readable3, writable: writable2 } = openAccess(existing, oflags, rights);
7869
+ const nonblock = (fdflags & FDFLAGS.NONBLOCK) !== 0;
7870
+ const access = writable2 ? readable3 ? O_RDWR4 : O_WRONLY4 : 0;
7871
+ const fd = this.restarting(
7872
+ () => this.kernel.sys.openVfs(path, access | (nonblock ? O_NONBLOCK2 : 0), 0, { fifo: true })
7873
+ );
7874
+ this.table.set(fd, { type: "kernel", kind: "stream", nonblock, append: false });
7875
+ if (nonblock) this.publishFlags(fd, { nonblock, append: false });
7876
+ this.bump(fd);
7877
+ return fd;
7878
+ }
7879
+ restartable;
7880
+ restarting(call2) {
7881
+ for (; ; ) {
7882
+ try {
7883
+ return call2();
7884
+ } catch (err) {
7885
+ if (err.code !== "EINTR" || !this.restartable?.()) throw err;
7886
+ }
7887
+ }
7888
+ }
7813
7889
  createNew(path, oflags, mode) {
7814
7890
  if (!this.fs.create) {
7815
7891
  this.fs.writeFile(path, new Uint8Array(0));
@@ -8791,7 +8867,7 @@ function wrap(table) {
8791
8867
  }
8792
8868
  return out;
8793
8869
  }
8794
- var WasiExit, IDS, NS_PER_MS4, AT_SYMLINK_NOFOLLOW2, AT_EACCESS2, ROOT_IDS, GONE, S_IFIFO, S_IFLNK2, DEFAULT_UMASK, MONOTONIC_BASE, MAX_READ, SIGINFO_BYTES, FD_ALIAS, STDIO_FDS, SIGPIPE_EXIT, SIG_IGN, SEALED_MODE, WasiHost;
8870
+ var WasiExit, IDS, NS_PER_MS4, AT_SYMLINK_NOFOLLOW2, AT_EACCESS2, ROOT_IDS, GONE, S_IFIFO2, S_IFLNK2, DEFAULT_UMASK, MONOTONIC_BASE, MAX_READ, SIGINFO_BYTES, FD_ALIAS, STDIO_FDS, SIGPIPE_EXIT, SIG_IGN, SEALED_MODE, WasiHost;
8795
8871
  var init_wasi_host = __esm({
8796
8872
  "src/process/wasi/wasi-host.ts"() {
8797
8873
  "use strict";
@@ -8825,7 +8901,7 @@ var init_wasi_host = __esm({
8825
8901
  AT_EACCESS2 = 2;
8826
8902
  ROOT_IDS = Object.freeze({ uid: 0, gid: 0 });
8827
8903
  GONE = /* @__PURE__ */ new Set(["ENOENT", "ENOTDIR"]);
8828
- S_IFIFO = 4096;
8904
+ S_IFIFO2 = 4096;
8829
8905
  S_IFLNK2 = 40960;
8830
8906
  DEFAULT_UMASK = 18;
8831
8907
  MONOTONIC_BASE = BigInt(Math.round(performance.timeOrigin)) * NS_PER_MS4;
@@ -8948,7 +9024,7 @@ var init_wasi_host = __esm({
8948
9024
  const fdMode = (fd) => {
8949
9025
  const e = fds.get(fd);
8950
9026
  const kind = e.type === "kernel" ? fds.kind(fd, e) : void 0;
8951
- if (kind === "stream") return S_IFIFO | 384;
9027
+ if (kind === "stream") return S_IFIFO2 | 384;
8952
9028
  if (kind === "sealed" || kind === "clipboard") return SEALED_MODE;
8953
9029
  return modeOf2(this.o.fs.stat(pathOf(fd)));
8954
9030
  };
@@ -9023,7 +9099,7 @@ var init_wasi_host = __esm({
9023
9099
  if (this.synthetic(path) && deviceOf(path) === void 0)
9024
9100
  return void mem.view().setUint32(out, SEALED_MODE, true);
9025
9101
  const st = flags & AT_SYMLINK_NOFOLLOW2 ? this.o.fs.lstat(path) : this.o.fs.stat(path);
9026
- mem.view().setUint32(out, modeOf2(st), true);
9102
+ mem.view().setUint32(out, (st.isFifo ? S_IFIFO2 : 0) | modeOf2(st), true);
9027
9103
  }
9028
9104
  });
9029
9105
  }
@@ -12614,6 +12690,7 @@ function wireSignals(host, gate) {
12614
12690
  host.interrupted = () => gate.interrupt();
12615
12691
  host.raisedOnEntry = () => gate.raisedOnEntry();
12616
12692
  host.quietly = (fn) => gate.quiet(fn);
12693
+ host.fds.restartable = () => gate.restartable();
12617
12694
  }
12618
12695
  function catchUpFirst(host, sync) {
12619
12696
  return sync && (() => host.quietly(() => sync.current()));
@@ -14955,6 +15032,23 @@ function netOps(kernel, io) {
14955
15032
  }
14956
15033
  };
14957
15034
  };
15035
+ const tlsConnect = async (options, tls) => {
15036
+ const r = await kernel.json({
15037
+ op: "sock-tls",
15038
+ host: options.host ?? "localhost",
15039
+ port: port(options.port),
15040
+ ...tls.servername ? { servername: tls.servername } : {},
15041
+ ...tls.alpn ? { alpn: [...tls.alpn] } : {},
15042
+ ...tls.ca !== void 0 ? { ca: true } : {}
15043
+ });
15044
+ const session = Object.freeze({
15045
+ protocol: "transport",
15046
+ alpnProtocol: r.alpnProtocol,
15047
+ authorized: true,
15048
+ servername: r.servername
15049
+ });
15050
+ return Object.assign(await connection(r.fd), { tls: session });
15051
+ };
14958
15052
  const lookup2 = async (name3, options = {}) => {
14959
15053
  const family = options.family ?? 0;
14960
15054
  if (family !== 0 && family !== 4 && family !== 6) {
@@ -14985,6 +15079,7 @@ function netOps(kernel, io) {
14985
15079
  connect: async (options) => {
14986
15080
  const signal = options.signal ?? NEVER;
14987
15081
  signal.throwIfAborted();
15082
+ if (options.tls) return tlsConnect(options, options.tls);
14988
15083
  const host = options.host ?? "127.0.0.1";
14989
15084
  if (host.includes(":")) throw new JsCallError("EADDRNOTAVAIL", host);
14990
15085
  const addr = {