@athrio/loom 0.0.8 → 0.0.10

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.
@@ -0,0 +1,1564 @@
1
+ #!/usr/bin/env node
2
+ import { Af as Prototype, Ah as identity, Bs as gen, C as WatchBackend, Cf as getUnsafe, Cs as effectify, Dt as systemError, E as callback$1, Ec as runFork, Em as BaseProto, Es as fail, Et as badArgument, F as fromChannel$1, Fa as offer, Fu as fail$2, Gp as fromNullishOr, Il as effect, Io as nominal, Ja as make$5, Kp as fromUndefinedOr, La as offerUnsafe, Lc as scoped, Ls as forkScoped, Ms as forEach, Na as failCauseUnsafe, Ns as forever, Os as flatMap, Ou as Done, Pa as make$8, Pu as done, Qa as makeUnsafe, Qs as map, S as Size, St as isSink, Tu as succeed$1, U as isStream, Uc as suspend, Ul as provideMerge, Up as flatMap$1, Vc as succeed, Vl as mergeAll, Vs as ignore, Wc as sync, Wl as succeed$2, X as mkString, Xc as tryPromise, Y as merge, Yc as timeoutOrElse, Yl as addFinalizer, Zc as try_, _ as TypeId$1, _f as Service, _h as isUndefined, _l as catchDone, _s as catch_, _u as makeUnsafe$1, ac as matchEffect, al as void_, ba as mapDone, bc as raceFirst, bt as drain, bu as fail$1, cp as of, ds as callback, dt as unwrap, du as _await, fc as orDie, fh as isNullish, gu as isDone, h as Path$1, is as andThen, j as empty, ja as endUnsafe, jh as pipe, js as fnUntraced, ju as UnknownError, k as decodeText, lh as isNotNull, ls as asVoid, lt as transduce, mt as make$7, nt as run, ot as splitLines, pt as get, pu as doneUnsafe, qp as getOrElse, rm as some, rs as addFinalizer$1, rt as runCollect, ss as as, tl as uninterruptible, tm as none, ts as acquireRelease, uh as isNotUndefined, v as FileDescriptor, w as make$6, wt as BadArgument, x as FileTypeId, xt as fromChannel, y as FileSystem, ya as fromTransform, zc as serviceOption } from "./SqlClient-BHo_uVyk.js";
3
+ import { M as make$9, a as make$11, j as Crypto$1, o as Stdio, r as Terminal, s as make$10 } from "./dist-CKhPOkpR.js";
4
+ import * as NodeChildProcess from "node:child_process";
5
+ import { PassThrough } from "node:stream";
6
+ import * as Crypto from "node:crypto";
7
+ import * as NFS from "node:fs";
8
+ import * as OS from "node:os";
9
+ import * as Path from "node:path";
10
+ import * as NodeUrl from "node:url";
11
+ import * as readline from "node:readline";
12
+ //#region ../../node_modules/effect/dist/unstable/process/ChildProcessSpawner.js
13
+ /**
14
+ * Service boundary for starting and controlling child processes.
15
+ *
16
+ * `ChildProcessSpawner` is the service used by `ChildProcess` commands to start
17
+ * operating-system processes. A spawner turns a command description into a
18
+ * handle that can write to stdin, read stdout and stderr, wait for exit, kill
19
+ * the process, and manage whether the process keeps its parent alive. Platform
20
+ * backends implement this service, while most application code uses the higher
21
+ * level `ChildProcess` module.
22
+ *
23
+ * @since 4.0.0
24
+ */
25
+ /**
26
+ * Constructs branded child process `ExitCode` values.
27
+ *
28
+ * @category constructors
29
+ * @since 4.0.0
30
+ */
31
+ var ExitCode = /*#__PURE__*/ nominal();
32
+ /**
33
+ * Constructs branded child process `ProcessId` values.
34
+ *
35
+ * @category constructors
36
+ * @since 4.0.0
37
+ */
38
+ var ProcessId = /*#__PURE__*/ nominal();
39
+ var HandleTypeId = "~effect/ChildProcessSpawner/ChildProcessHandle";
40
+ var HandleProto = {
41
+ [HandleTypeId]: HandleTypeId,
42
+ ...BaseProto,
43
+ toJSON() {
44
+ return {
45
+ _id: "ChildProcessHandle",
46
+ pid: this.pid
47
+ };
48
+ }
49
+ };
50
+ /**
51
+ * Constructs a new `ChildProcessHandle`.
52
+ *
53
+ * @category constructors
54
+ * @since 4.0.0
55
+ */
56
+ var makeHandle = (params) => Object.assign(Object.create(HandleProto), params);
57
+ /**
58
+ * Creates a `ChildProcessSpawner` service from a `spawn` function, deriving
59
+ * helpers for exit codes and output collection from that implementation.
60
+ *
61
+ * @category models
62
+ * @since 4.0.0
63
+ */
64
+ var make$4 = (spawn) => {
65
+ const streamString = (command, options) => spawn(command).pipe(map((handle) => decodeText(options?.includeStderr === true ? handle.all : handle.stdout)), unwrap);
66
+ const streamLines = (command, options) => splitLines(streamString(command, options));
67
+ return ChildProcessSpawner.of({
68
+ spawn,
69
+ exitCode: (command) => scoped(flatMap(spawn(command), (handle) => handle.exitCode)),
70
+ streamString,
71
+ streamLines,
72
+ lines: (command, options) => runCollect(streamLines(command, options)),
73
+ string: (command, options) => mkString(streamString(command, options))
74
+ });
75
+ };
76
+ /**
77
+ * Service tag for child process spawning.
78
+ *
79
+ * @category services
80
+ * @since 4.0.0
81
+ */
82
+ var ChildProcessSpawner = class extends Service()("effect/process/ChildProcessSpawner") {};
83
+ //#endregion
84
+ //#region ../../node_modules/effect/dist/unstable/process/ChildProcess.js
85
+ /**
86
+ * Describes child processes before they are started.
87
+ *
88
+ * A `Command` stores the executable, arguments, environment, standard streams,
89
+ * working directory, and other process options. Commands can also be piped
90
+ * together. A command is an `Effect`; running it asks the
91
+ * `ChildProcessSpawner` service to start the process and returns a
92
+ * `ChildProcessHandle`.
93
+ *
94
+ * @since 4.0.0
95
+ */
96
+ var TypeId = "~effect/unstable/process/ChildProcess";
97
+ var Proto = {
98
+ .../*#__PURE__*/ Prototype({
99
+ label: "Command",
100
+ evaluate(fiber) {
101
+ return getUnsafe(fiber.context, ChildProcessSpawner).spawn(this);
102
+ }
103
+ }),
104
+ [TypeId]: TypeId
105
+ };
106
+ var makeStandardCommand = (command, args, options) => Object.assign(Object.create(Proto), {
107
+ _tag: "StandardCommand",
108
+ command,
109
+ args,
110
+ options
111
+ });
112
+ /**
113
+ * Create a command from a template literal, options + template, or array form.
114
+ *
115
+ * **Details**
116
+ *
117
+ * This function supports three calling conventions:
118
+ * 1. Template literal: `make\`npm run build\``
119
+ * 2. Options + template literal: `make({ cwd: "/app" })\`npm run build\``
120
+ * 3. Array form: `make("npm", ["run", "build"], options?)`
121
+ *
122
+ * Template literals are not parsed until execution time, allowing parsing
123
+ * errors to flow through Effect's error channel.
124
+ *
125
+ * **Example** (Creating commands)
126
+ *
127
+ * ```ts
128
+ * import { ChildProcess } from "effect/unstable/process"
129
+ *
130
+ * // Template literal form
131
+ * const cmd1 = ChildProcess.make`echo "hello"`
132
+ *
133
+ * // With options
134
+ * const cmd2 = ChildProcess.make({ cwd: "/tmp" })`ls -la`
135
+ *
136
+ * // Array form
137
+ * const cmd3 = ChildProcess.make("git", ["status"])
138
+ * ```
139
+ *
140
+ * @category constructors
141
+ * @since 4.0.0
142
+ */
143
+ var make$3 = function make(...args) {
144
+ if (isTemplateString(args[0])) {
145
+ const [templates, ...expressions] = args;
146
+ const tokens = parseTemplates(templates, expressions);
147
+ return makeStandardCommand(tokens[0] ?? "", tokens.slice(1), {});
148
+ }
149
+ if (typeof args[0] === "object" && !Array.isArray(args[0]) && !isTemplateString(args[0])) {
150
+ const options = args[0];
151
+ return function(templates, ...expressions) {
152
+ const tokens = parseTemplates(templates, expressions);
153
+ return makeStandardCommand(tokens[0] ?? "", tokens.slice(1), options);
154
+ };
155
+ }
156
+ if (typeof args[0] === "string" && !Array.isArray(args[1])) {
157
+ const [command, options = {}] = args;
158
+ return makeStandardCommand(command, [], options);
159
+ }
160
+ const [command, cmdArgs = [], options = {}] = args;
161
+ return makeStandardCommand(command, cmdArgs, options);
162
+ };
163
+ var isTemplateString = (u) => Array.isArray(u) && "raw" in u && Array.isArray(u.raw);
164
+ /**
165
+ * Parses an fd name like "fd3" to its numeric index.
166
+ * Returns undefined if the name is invalid.
167
+ *
168
+ * @category converting
169
+ * @since 4.0.0
170
+ */
171
+ var parseFdName = (name) => {
172
+ const match = /^fd(\d+)$/.exec(name);
173
+ if (match === null) return void 0;
174
+ const fd = parseInt(match[1], 10);
175
+ return fd >= 3 ? fd : void 0;
176
+ };
177
+ /**
178
+ * Create an fd name from its numeric index.
179
+ *
180
+ * @category converting
181
+ * @since 4.0.0
182
+ */
183
+ var fdName = (fd) => `fd${fd}`;
184
+ var parseTemplates = (templates, expressions) => {
185
+ let tokens = [];
186
+ for (const [index, template] of templates.entries()) tokens = parseTemplate(templates, expressions, tokens, template, index);
187
+ return tokens;
188
+ };
189
+ var parseTemplate = (templates, expressions, prevTokens, template, index) => {
190
+ const rawTemplate = templates.raw[index];
191
+ if (rawTemplate === void 0) throw new Error(`Invalid backslash sequence: ${templates.raw[index]}`);
192
+ const { hasLeadingWhitespace, hasTrailingWhitespace, tokens } = splitByWhitespaces(template, rawTemplate);
193
+ const nextTokens = concatTokens(prevTokens, tokens, hasLeadingWhitespace);
194
+ if (index === expressions.length) return nextTokens;
195
+ const expression = expressions[index];
196
+ return concatTokens(nextTokens, Array.isArray(expression) ? expression.map((expression) => parseExpression(expression)) : [parseExpression(expression)], hasTrailingWhitespace);
197
+ };
198
+ /**
199
+ * Convert valid expressions defined in a template string command (i.e. using
200
+ * `${expression}` into strings.
201
+ */
202
+ var parseExpression = (expression) => {
203
+ if (typeof expression === "string") return expression;
204
+ return String(expression);
205
+ };
206
+ var DELIMITERS = /*#__PURE__*/ new Set([
207
+ " ",
208
+ " ",
209
+ "\r",
210
+ "\n"
211
+ ]);
212
+ /**
213
+ * Number of characters in backslash escape sequences: \0 \xXX or \uXXXX
214
+ * \cX is allowed in RegExps but not in strings
215
+ * Octal sequences are not allowed in strict mode
216
+ */
217
+ var ESCAPE_LENGTH = {
218
+ x: 3,
219
+ u: 5
220
+ };
221
+ /**
222
+ * Splits a template string by whitespace while also properly handling escape
223
+ * sequences.
224
+ *
225
+ * As an example, let's review the following valid commands:
226
+ *
227
+ * ```ts
228
+ * ChildProcess.exec`echo foo\n bar`
229
+ * // We should run `["echo", "foo\n", "bar"]`
230
+ *
231
+ * ChildProcess.exec`echo foo
232
+ * bar`
233
+ * // We should run `["echo", "foo", "bar]`
234
+ * ```
235
+ *
236
+ * The problem is that when we evaluate the template string for both of the above
237
+ * commands, we will end up with the same string "echo foo\n bar".
238
+ *
239
+ * What we really want is to include the escaped character in the arguments for
240
+ * the first command, since it was written explicitly by the user.
241
+ *
242
+ * This is why also having access to the raw template string is useful - in a
243
+ * template string, there are two representations of the same string:
244
+ * 1. `template` - The processed string (escape sequences are evaluated).
245
+ * 2. `template.raw` - The raw string (escape sequences are literal).
246
+ */
247
+ var splitByWhitespaces = (template, rawTemplate) => {
248
+ if (rawTemplate.length === 0) return {
249
+ tokens: [],
250
+ hasLeadingWhitespace: false,
251
+ hasTrailingWhitespace: false
252
+ };
253
+ const hasLeadingWhitespace = DELIMITERS.has(rawTemplate[0]);
254
+ const tokens = [];
255
+ let templateCursor = 0;
256
+ for (let templateIndex = 0, rawIndex = 0; templateIndex < template.length; templateIndex += 1, rawIndex += 1) {
257
+ const rawCharacter = rawTemplate[rawIndex];
258
+ if (DELIMITERS.has(rawCharacter)) {
259
+ if (templateCursor !== templateIndex) tokens.push(template.slice(templateCursor, templateIndex));
260
+ templateCursor = templateIndex + 1;
261
+ } else if (rawCharacter === "\\") {
262
+ const nextRawCharacter = rawTemplate[rawIndex + 1];
263
+ if (nextRawCharacter === "\n") {
264
+ templateIndex -= 1;
265
+ rawIndex += 1;
266
+ } else if (nextRawCharacter === "u" && rawTemplate[rawIndex + 2] === "{") rawIndex = rawTemplate.indexOf("}", rawIndex + 3);
267
+ else rawIndex += ESCAPE_LENGTH[nextRawCharacter] ?? 1;
268
+ }
269
+ }
270
+ const hasTrailingWhitespace = templateCursor === template.length;
271
+ if (!hasTrailingWhitespace) tokens.push(template.slice(templateCursor));
272
+ return {
273
+ tokens,
274
+ hasLeadingWhitespace,
275
+ hasTrailingWhitespace
276
+ };
277
+ };
278
+ /**
279
+ * Concatenates two separate sets of string tokens together.
280
+ *
281
+ * If either set is empty or `isSeparated=false`, the last element of `prevTokens`
282
+ * and the first element of `nextTokens` will be joined into a single token.
283
+ */
284
+ var concatTokens = (prevTokens, nextTokens, isSeparated) => isSeparated || prevTokens.length === 0 || nextTokens.length === 0 ? [...prevTokens, ...nextTokens] : [
285
+ ...prevTokens.slice(0, -1),
286
+ `${prevTokens.at(-1)}${nextTokens.at(0)}`,
287
+ ...nextTokens.slice(1)
288
+ ];
289
+ //#endregion
290
+ //#region ../../node_modules/@effect/platform-node-shared/dist/internal/utils.js
291
+ /** @internal */
292
+ var handleErrnoException = (module, method) => (err, [path]) => {
293
+ let reason = "Unknown";
294
+ switch (err.code) {
295
+ case "ENOENT":
296
+ reason = "NotFound";
297
+ break;
298
+ case "EACCES":
299
+ reason = "PermissionDenied";
300
+ break;
301
+ case "EEXIST":
302
+ reason = "AlreadyExists";
303
+ break;
304
+ case "EISDIR":
305
+ reason = "BadResource";
306
+ break;
307
+ case "ENOTDIR":
308
+ reason = "BadResource";
309
+ break;
310
+ case "EBUSY":
311
+ reason = "Busy";
312
+ break;
313
+ case "ELOOP":
314
+ reason = "BadResource";
315
+ break;
316
+ }
317
+ return systemError({
318
+ _tag: reason,
319
+ module,
320
+ method,
321
+ pathOrDescriptor: path,
322
+ syscall: err.syscall,
323
+ cause: err
324
+ });
325
+ };
326
+ //#endregion
327
+ //#region ../../node_modules/@effect/platform-node-shared/dist/NodeSink.js
328
+ /**
329
+ * Creates a `Sink` that writes chunks to a Node writable stream, respecting
330
+ * backpressure, mapping writable errors with `onError`, and ending the stream
331
+ * on completion unless `endOnDone` is `false`.
332
+ *
333
+ * @category constructors
334
+ * @since 4.0.0
335
+ */
336
+ var fromWritable = (options) => fromChannel(mapDone(fromWritableChannel(options), (_) => [_]));
337
+ /**
338
+ * Creates a `Channel` that pulls chunks from upstream and writes them to a
339
+ * Node writable stream, respecting backpressure and optionally ending the
340
+ * writable when upstream is done.
341
+ *
342
+ * @category constructors
343
+ * @since 4.0.0
344
+ */
345
+ var fromWritableChannel = (options) => fromTransform((pull) => {
346
+ const writable = options.evaluate();
347
+ return succeed(pullIntoWritable({
348
+ ...options,
349
+ writable,
350
+ pull
351
+ }));
352
+ });
353
+ /**
354
+ * Writes Effect chunks into a Node writable stream.
355
+ *
356
+ * **When to use**
357
+ *
358
+ * Use to implement custom Node stream adapters that already have an upstream
359
+ * pull and need direct control over a writable stream.
360
+ *
361
+ * **Details**
362
+ *
363
+ * The loop waits for `drain` when needed, fails on writable errors, and ends
364
+ * the writable on upstream completion unless `endOnDone` is `false`.
365
+ *
366
+ * @category converting
367
+ * @since 4.0.0
368
+ */
369
+ var pullIntoWritable = (options) => options.pull.pipe(flatMap((chunk) => {
370
+ let i = 0;
371
+ return callback(function loop(resume) {
372
+ for (; i < chunk.length;) if (!options.writable.write(chunk[i++], options.encoding)) {
373
+ options.writable.once("drain", () => loop(resume));
374
+ return;
375
+ }
376
+ resume(void_);
377
+ });
378
+ }), forever({ disableYield: true }), raceFirst(callback((resume) => {
379
+ const onError = (error) => resume(fail(options.onError(error)));
380
+ options.writable.once("error", onError);
381
+ return sync(() => {
382
+ options.writable.off("error", onError);
383
+ });
384
+ })), options.endOnDone !== false ? catchDone((_) => {
385
+ if ("closed" in options.writable && options.writable.closed) return done(_);
386
+ return callback((resume) => {
387
+ options.writable.once("finish", () => resume(done(_)));
388
+ options.writable.end();
389
+ });
390
+ }) : identity);
391
+ //#endregion
392
+ //#region ../../node_modules/@effect/platform-node-shared/dist/NodeStream.js
393
+ /**
394
+ * Adapters between Node streams and Effect streams, channels, and readables.
395
+ *
396
+ * This module is the stream boundary for Node APIs. It wraps `Readable` and
397
+ * `Duplex` values as Effect `Stream`s and `Channel`s, pipes Effect streams
398
+ * through Node duplex streams, exposes an Effect `Stream` back to Node as a
399
+ * `Readable`, and collects readable payloads into strings, array buffers, or
400
+ * `Uint8Array`s with optional byte limits.
401
+ *
402
+ * @since 4.0.0
403
+ */
404
+ /**
405
+ * Converts a Node readable stream into an Effect `Stream`, reading chunks with
406
+ * an optional chunk size, mapping stream errors with `onError`, and destroying
407
+ * the readable on completion unless `closeOnDone` is `false`.
408
+ *
409
+ * @category constructors
410
+ * @since 4.0.0
411
+ */
412
+ var fromReadable = (options) => fromChannel$1(fromReadableChannel(options));
413
+ /**
414
+ * Creates a `Channel` that pulls chunks from a Node readable stream, mapping
415
+ * errors with `onError` and destroying the readable on completion unless
416
+ * `closeOnDone` is `false`.
417
+ *
418
+ * @category constructors
419
+ * @since 4.0.0
420
+ */
421
+ var fromReadableChannel = (options) => fromTransform((_, scope) => readableToPullUnsafe({
422
+ scope,
423
+ readable: options.evaluate(),
424
+ onError: options.onError ?? defaultOnError,
425
+ chunkSize: options.chunkSize,
426
+ closeOnDone: options.closeOnDone
427
+ }));
428
+ /**
429
+ * Consumes a Node readable stream into a string using the selected encoding,
430
+ * failing through `onError` on stream errors or when `maxBytes` is exceeded
431
+ * and destroying the stream on interruption or failure.
432
+ *
433
+ * @category converting
434
+ * @since 4.0.0
435
+ */
436
+ var toString = (readable, options) => {
437
+ const maxBytesNumber = options?.maxBytes ? Number(options.maxBytes) : void 0;
438
+ const onError = options?.onError ?? defaultOnError;
439
+ const encoding = options?.encoding ?? "utf8";
440
+ return callback((resume) => {
441
+ const stream = readable();
442
+ stream.setEncoding(encoding);
443
+ stream.once("error", (err) => {
444
+ if ("closed" in stream && !stream.closed) stream.destroy();
445
+ resume(fail(onError(err)));
446
+ });
447
+ stream.once("error", (err) => {
448
+ resume(fail(onError(err)));
449
+ });
450
+ let string = "";
451
+ let bytes = 0;
452
+ stream.once("end", () => {
453
+ resume(succeed(string));
454
+ });
455
+ stream.on("data", (chunk) => {
456
+ string += chunk;
457
+ bytes += Buffer.byteLength(chunk);
458
+ if (maxBytesNumber && bytes > maxBytesNumber) resume(fail(onError(/* @__PURE__ */ new Error("maxBytes exceeded"))));
459
+ });
460
+ return sync(() => {
461
+ if ("closed" in stream && !stream.closed) stream.destroy();
462
+ });
463
+ });
464
+ };
465
+ /**
466
+ * Consumes a Node readable stream into an `ArrayBuffer`, failing through
467
+ * `onError` on stream errors or when `maxBytes` is exceeded and destroying the
468
+ * stream on interruption or failure.
469
+ *
470
+ * @category converting
471
+ * @since 4.0.0
472
+ */
473
+ var toArrayBuffer = (readable, options) => {
474
+ const maxBytesNumber = options?.maxBytes ? Number(options.maxBytes) : void 0;
475
+ const onError = options?.onError ?? defaultOnError;
476
+ return callback((resume) => {
477
+ const stream = readable();
478
+ const buffers = [];
479
+ let bytes = 0;
480
+ stream.once("error", (err) => {
481
+ if ("closed" in stream && !stream.closed) stream.destroy();
482
+ resume(fail(onError(err)));
483
+ });
484
+ stream.once("end", () => {
485
+ const buffer = buffers.length === 1 ? buffers[0] : Buffer.concat(buffers);
486
+ if (buffer.byteOffset === 0 && buffer.buffer.byteLength === buffer.byteLength) return resume(succeed(buffer.buffer));
487
+ resume(succeed(buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength)));
488
+ });
489
+ stream.on("data", (chunk) => {
490
+ buffers.push(chunk);
491
+ bytes += chunk.length;
492
+ if (maxBytesNumber && bytes > maxBytesNumber) resume(fail(onError(/* @__PURE__ */ new Error("maxBytes exceeded"))));
493
+ });
494
+ return sync(() => {
495
+ if ("closed" in stream && !stream.closed) stream.destroy();
496
+ });
497
+ });
498
+ };
499
+ /**
500
+ * Consumes a Node readable stream into a `Uint8Array`, using the same error
501
+ * mapping and `maxBytes` handling as `toArrayBuffer`.
502
+ *
503
+ * @category converting
504
+ * @since 4.0.0
505
+ */
506
+ var toUint8Array = (readable, options) => map(toArrayBuffer(readable, options), (buffer) => new Uint8Array(buffer));
507
+ var readableToPullUnsafe = (options) => {
508
+ const readable = options.readable;
509
+ const closeOnDone = options.closeOnDone ?? true;
510
+ const exit = options.exit ?? make$5(void 0);
511
+ const latch = makeUnsafe(false);
512
+ function onReadable() {
513
+ latch.openUnsafe();
514
+ }
515
+ function onError(error) {
516
+ exit.current = fail$1(options.onError(error));
517
+ latch.openUnsafe();
518
+ }
519
+ function onEnd() {
520
+ exit.current = fail$1(Done());
521
+ latch.openUnsafe();
522
+ }
523
+ readable.on("readable", onReadable);
524
+ readable.once("error", onError);
525
+ readable.once("end", onEnd);
526
+ const pull = suspend(function loop() {
527
+ let item = options.readable.read(options.chunkSize);
528
+ if (item === null) {
529
+ if (exit.current) return exit.current;
530
+ if (readable.readableEnded) return fail(Done());
531
+ latch.closeUnsafe();
532
+ return flatMap(latch.await, loop);
533
+ }
534
+ const chunk = of(item);
535
+ while (true) {
536
+ item = options.readable.read(options.chunkSize);
537
+ if (item === null) break;
538
+ chunk.push(item);
539
+ }
540
+ return succeed(chunk);
541
+ });
542
+ return as(addFinalizer(options.scope, sync(() => {
543
+ readable.off("readable", onReadable);
544
+ readable.off("error", onError);
545
+ readable.off("end", onEnd);
546
+ if (closeOnDone && "closed" in options.readable && !options.readable.closed) options.readable.destroy();
547
+ })), pull);
548
+ };
549
+ var defaultOnError = (error) => new UnknownError(error);
550
+ //#endregion
551
+ //#region ../../node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
552
+ var toError = (error) => error instanceof globalThis.Error ? error : new globalThis.Error(String(error));
553
+ var toPlatformError = (method, error, command) => {
554
+ const { commands } = flattenCommand(command);
555
+ const commandStr = commands.reduce((acc, curr) => {
556
+ const cmd = `${curr.command} ${curr.args.join(" ")}`;
557
+ return acc.length === 0 ? cmd : `${acc} | ${cmd}`;
558
+ }, "");
559
+ return handleErrnoException("ChildProcess", method)(error, [commandStr]);
560
+ };
561
+ /**
562
+ * Layer that provides the `NodeChildProcessSpawner` implementation.
563
+ *
564
+ * @category layers
565
+ * @since 4.0.0
566
+ */
567
+ var layer$11 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(function* () {
568
+ const fs = yield* FileSystem;
569
+ const path = yield* Path$1;
570
+ const resolveWorkingDirectory = fnUntraced(function* (options) {
571
+ if (isUndefined(options.cwd)) return void 0;
572
+ yield* fs.access(options.cwd);
573
+ return path.resolve(options.cwd);
574
+ });
575
+ const resolveEnvironment = (options) => {
576
+ return options.extendEnv ? {
577
+ ...globalThis.process.env,
578
+ ...options.env
579
+ } : options.env;
580
+ };
581
+ const inputToStdioOption = (input) => isStream(input) ? "pipe" : input;
582
+ const outputToStdioOption = (input) => isSink(input) ? "pipe" : input;
583
+ const resolveStdinOption = (options) => {
584
+ const defaultConfig = {
585
+ stream: "pipe",
586
+ encoding: "utf-8",
587
+ endOnDone: true
588
+ };
589
+ if (isUndefined(options.stdin)) return defaultConfig;
590
+ if (typeof options.stdin === "string") return {
591
+ ...defaultConfig,
592
+ stream: options.stdin
593
+ };
594
+ if (isStream(options.stdin)) return {
595
+ ...defaultConfig,
596
+ stream: options.stdin
597
+ };
598
+ return {
599
+ stream: options.stdin.stream,
600
+ encoding: options.stdin.encoding ?? defaultConfig.encoding,
601
+ endOnDone: options.stdin.endOnDone ?? defaultConfig.endOnDone
602
+ };
603
+ };
604
+ const resolveOutputOption = (options, streamName) => {
605
+ const option = options[streamName];
606
+ if (isUndefined(option)) return { stream: "pipe" };
607
+ if (typeof option === "string") return { stream: option };
608
+ if (isSink(option)) return { stream: option };
609
+ return { stream: option.stream };
610
+ };
611
+ const resolveAdditionalFds = (options) => {
612
+ if (isUndefined(options.additionalFds)) return [];
613
+ const result = [];
614
+ for (const [name, config] of Object.entries(options.additionalFds)) {
615
+ const fd = parseFdName(name);
616
+ if (isNotUndefined(fd)) result.push({
617
+ fd,
618
+ config
619
+ });
620
+ }
621
+ return result.sort((a, b) => a.fd - b.fd);
622
+ };
623
+ const buildStdioArray = (stdinConfig, stdoutConfig, stderrConfig, additionalFds) => {
624
+ const stdio = [
625
+ inputToStdioOption(stdinConfig.stream),
626
+ outputToStdioOption(stdoutConfig.stream),
627
+ outputToStdioOption(stderrConfig.stream)
628
+ ];
629
+ if (additionalFds.length === 0) return stdio;
630
+ const maxFd = additionalFds.reduce((max, { fd }) => Math.max(max, fd), 2);
631
+ for (let i = 3; i <= maxFd; i++) stdio[i] = "ignore";
632
+ for (const { fd } of additionalFds) stdio[fd] = "pipe";
633
+ return stdio;
634
+ };
635
+ const setupAdditionalFds = fnUntraced(function* (command, childProcess, additionalFds) {
636
+ if (additionalFds.length === 0) return {
637
+ getInputFd: () => drain,
638
+ getOutputFd: () => empty
639
+ };
640
+ const inputSinks = /* @__PURE__ */ new Map();
641
+ const outputStreams = /* @__PURE__ */ new Map();
642
+ for (const { config, fd } of additionalFds) {
643
+ const nodeStream = childProcess.stdio[fd];
644
+ switch (config.type) {
645
+ case "input": {
646
+ let sink = drain;
647
+ if (nodeStream && "write" in nodeStream) sink = fromWritable({
648
+ evaluate: () => nodeStream,
649
+ onError: (error) => toPlatformError(`fromWritable(fd${fd})`, toError(error), command)
650
+ });
651
+ if (config.stream) yield* forkScoped(run(config.stream, sink));
652
+ inputSinks.set(fd, sink);
653
+ break;
654
+ }
655
+ case "output": {
656
+ let stream = empty;
657
+ if (nodeStream && "read" in nodeStream) {
658
+ const passThrough = new PassThrough();
659
+ nodeStream.on("error", (error) => passThrough.destroy(error));
660
+ nodeStream.pipe(passThrough);
661
+ stream = fromReadable({
662
+ evaluate: () => passThrough,
663
+ onError: (error) => toPlatformError(`fromReadable(fd${fd})`, toError(error), command)
664
+ });
665
+ }
666
+ if (config.sink) stream = transduce(stream, config.sink);
667
+ outputStreams.set(fd, stream);
668
+ break;
669
+ }
670
+ }
671
+ }
672
+ return {
673
+ getInputFd: (fd) => inputSinks.get(fd) ?? drain,
674
+ getOutputFd: (fd) => outputStreams.get(fd) ?? empty
675
+ };
676
+ });
677
+ const setupChildStdin = (command, childProcess, config) => suspend(() => {
678
+ let sink = drain;
679
+ if (isNotNull(childProcess.stdin)) sink = fromWritable({
680
+ evaluate: () => childProcess.stdin,
681
+ onError: (error) => toPlatformError("fromWritable(stdin)", toError(error), command),
682
+ endOnDone: config.endOnDone,
683
+ encoding: config.encoding
684
+ });
685
+ if (isStream(config.stream)) return as(forkScoped(run(config.stream, sink)), sink);
686
+ return succeed(sink);
687
+ });
688
+ const setupChildOutputStreams = (command, childProcess, stdoutConfig, stderrConfig) => {
689
+ let stdout = childProcess.stdout ? (() => {
690
+ const passThrough = new PassThrough();
691
+ childProcess.stdout.on("error", (error) => passThrough.destroy(error));
692
+ childProcess.stdout.pipe(passThrough);
693
+ return fromReadable({
694
+ evaluate: () => passThrough,
695
+ onError: (error) => toPlatformError("fromReadable(stdout)", toError(error), command)
696
+ });
697
+ })() : empty;
698
+ let stderr = childProcess.stderr ? (() => {
699
+ const passThrough = new PassThrough();
700
+ childProcess.stderr.on("error", (error) => passThrough.destroy(error));
701
+ childProcess.stderr.pipe(passThrough);
702
+ return fromReadable({
703
+ evaluate: () => passThrough,
704
+ onError: (error) => toPlatformError("fromReadable(stderr)", toError(error), command)
705
+ });
706
+ })() : empty;
707
+ if (isSink(stdoutConfig.stream)) stdout = transduce(stdout, stdoutConfig.stream);
708
+ if (isSink(stderrConfig.stream)) stderr = transduce(stderr, stderrConfig.stream);
709
+ const all = merge(stdout, stderr);
710
+ return {
711
+ stdout,
712
+ stderr,
713
+ all
714
+ };
715
+ };
716
+ const spawn = (command, spawnOptions) => callback((resume) => {
717
+ const deferred = makeUnsafe$1();
718
+ const handle = NodeChildProcess.spawn(command.command, command.args, spawnOptions);
719
+ handle.on("error", (error) => {
720
+ resume(fail(toPlatformError("spawn", error, command)));
721
+ });
722
+ handle.on("exit", (...args) => {
723
+ doneUnsafe(deferred, succeed$1(args));
724
+ });
725
+ handle.on("spawn", () => {
726
+ resume(succeed([handle, deferred]));
727
+ });
728
+ return sync(() => {
729
+ handle.kill("SIGTERM");
730
+ });
731
+ });
732
+ const killProcessGroup = (command, childProcess, signal) => {
733
+ if (globalThis.process.platform === "win32") return callback((resume) => {
734
+ NodeChildProcess.exec(`taskkill /pid ${childProcess.pid} /T /F`, (error) => {
735
+ if (error) resume(fail(toPlatformError("kill", toError(error), command)));
736
+ else resume(void_);
737
+ });
738
+ });
739
+ return try_({
740
+ try: () => {
741
+ globalThis.process.kill(-childProcess.pid, signal);
742
+ },
743
+ catch: (error) => toPlatformError("kill", toError(error), command)
744
+ });
745
+ };
746
+ const killProcessGroupOnExit = (childProcess, signal) => {
747
+ if (globalThis.process.platform === "win32") {
748
+ NodeChildProcess.exec(`taskkill /pid ${childProcess.pid} /T /F`, () => {});
749
+ return;
750
+ }
751
+ try {
752
+ globalThis.process.kill(-childProcess.pid, signal);
753
+ } catch {}
754
+ };
755
+ const killProcess = (command, childProcess, signal) => suspend(() => {
756
+ if (!childProcess.kill(signal)) return fail(toPlatformError("kill", new globalThis.Error("Failed to kill child process"), command));
757
+ return void_;
758
+ });
759
+ const withTimeout = (childProcess, command, options) => (kill) => {
760
+ const killSignal = options?.killSignal ?? "SIGTERM";
761
+ return isUndefined(options?.forceKillAfter) ? kill(command, childProcess, killSignal) : timeoutOrElse(kill(command, childProcess, killSignal), {
762
+ duration: options.forceKillAfter,
763
+ orElse: () => kill(command, childProcess, "SIGKILL")
764
+ });
765
+ };
766
+ /**
767
+ * Get the appropriate source stream from a process handle based on the
768
+ * `from` pipe option.
769
+ */
770
+ const getSourceStream = (handle, from) => {
771
+ const fromOption = from ?? "stdout";
772
+ switch (fromOption) {
773
+ case "stdout": return handle.stdout;
774
+ case "stderr": return handle.stderr;
775
+ case "all": return handle.all;
776
+ default: {
777
+ const fd = parseFdName(fromOption);
778
+ if (isNotUndefined(fd)) return handle.getOutputFd(fd);
779
+ return handle.stdout;
780
+ }
781
+ }
782
+ };
783
+ const spawnCommand = fnUntraced(function* (cmd) {
784
+ switch (cmd._tag) {
785
+ case "StandardCommand": {
786
+ const stdinConfig = resolveStdinOption(cmd.options);
787
+ const stdoutConfig = resolveOutputOption(cmd.options, "stdout");
788
+ const stderrConfig = resolveOutputOption(cmd.options, "stderr");
789
+ const resolvedAdditionalFds = resolveAdditionalFds(cmd.options);
790
+ let isReferenced = true;
791
+ const cwd = yield* resolveWorkingDirectory(cmd.options);
792
+ const env = resolveEnvironment(cmd.options);
793
+ const stdio = buildStdioArray(stdinConfig, stdoutConfig, stderrConfig, resolvedAdditionalFds);
794
+ const [childProcess, exitSignal] = yield* acquireRelease(spawn(cmd, {
795
+ cwd,
796
+ env,
797
+ stdio,
798
+ detached: cmd.options.detached ?? process.platform !== "win32",
799
+ shell: cmd.options.shell
800
+ }), fnUntraced(function* ([childProcess, exitSignal]) {
801
+ const exited = yield* isDone(exitSignal);
802
+ const killWithTimeout = withTimeout(childProcess, cmd, cmd.options);
803
+ if (exited) {
804
+ const [code] = yield* _await(exitSignal);
805
+ if (code !== 0 && isNotNull(code)) return yield* ignore(killWithTimeout(killProcessGroup));
806
+ return yield* void_;
807
+ }
808
+ if (!isReferenced) return yield* void_;
809
+ return yield* killWithTimeout((command, childProcess, signal) => catch_(killProcessGroup(command, childProcess, signal), () => killProcess(command, childProcess, signal))).pipe(andThen(_await(exitSignal)), ignore);
810
+ }));
811
+ const pid = ProcessId(childProcess.pid);
812
+ childProcess.on("exit", (code) => {
813
+ if (code !== 0 && isNotNull(code)) killProcessGroupOnExit(childProcess, cmd.options.killSignal ?? "SIGTERM");
814
+ });
815
+ const reref = sync(() => {
816
+ if (!isReferenced) {
817
+ childProcess.ref();
818
+ isReferenced = true;
819
+ }
820
+ });
821
+ const unref = sync(() => {
822
+ if (isReferenced) {
823
+ childProcess.unref();
824
+ isReferenced = false;
825
+ }
826
+ return reref;
827
+ });
828
+ const stdin = yield* setupChildStdin(cmd, childProcess, stdinConfig);
829
+ const { all, stderr, stdout } = setupChildOutputStreams(cmd, childProcess, stdoutConfig, stderrConfig);
830
+ const { getInputFd, getOutputFd } = yield* setupAdditionalFds(cmd, childProcess, resolvedAdditionalFds);
831
+ const isRunning = map(isDone(exitSignal), (done) => !done);
832
+ const exitCode = flatMap(_await(exitSignal), ([code, signal]) => {
833
+ if (isNotNull(code)) return succeed(ExitCode(code));
834
+ return fail(toPlatformError("exitCode", new globalThis.Error(`Process interrupted due to receipt of signal: '${signal}'`), cmd));
835
+ });
836
+ const kill = (options) => {
837
+ return withTimeout(childProcess, cmd, options)((command, childProcess, signal) => catch_(killProcessGroup(command, childProcess, signal), () => killProcess(command, childProcess, signal))).pipe(andThen(_await(exitSignal)), asVoid);
838
+ };
839
+ return makeHandle({
840
+ pid,
841
+ exitCode,
842
+ isRunning,
843
+ kill,
844
+ stdin,
845
+ stdout,
846
+ stderr,
847
+ all,
848
+ getInputFd,
849
+ getOutputFd,
850
+ unref
851
+ });
852
+ }
853
+ case "PipedCommand": {
854
+ const { commands, pipeOptions } = flattenCommand(cmd);
855
+ const [root, ...pipeline] = commands;
856
+ const handles = [yield* spawnCommand(root)];
857
+ for (let i = 0; i < pipeline.length; i++) {
858
+ const command = pipeline[i];
859
+ const options = pipeOptions[i] ?? {};
860
+ const stdinConfig = resolveStdinOption(command.options);
861
+ const sourceStream = unwrap(succeed(getSourceStream(handles[handles.length - 1], options.from)));
862
+ const toOption = options.to ?? "stdin";
863
+ if (toOption === "stdin") handles.push(yield* spawnCommand(make$3(command.command, command.args, {
864
+ ...command.options,
865
+ stdin: {
866
+ ...stdinConfig,
867
+ stream: sourceStream
868
+ }
869
+ })));
870
+ else {
871
+ const fd = parseFdName(toOption);
872
+ if (isNotUndefined(fd)) {
873
+ const fdName$1 = fdName(fd);
874
+ const existingFds = command.options.additionalFds ?? {};
875
+ handles.push(yield* spawnCommand(make$3(command.command, command.args, {
876
+ ...command.options,
877
+ additionalFds: {
878
+ ...existingFds,
879
+ [fdName$1]: {
880
+ type: "input",
881
+ stream: sourceStream
882
+ }
883
+ }
884
+ })));
885
+ } else handles.push(yield* spawnCommand(make$3(command.command, command.args, {
886
+ ...command.options,
887
+ stdin: {
888
+ ...stdinConfig,
889
+ stream: sourceStream
890
+ }
891
+ })));
892
+ }
893
+ }
894
+ const handle = handles[handles.length - 1];
895
+ const unref = gen(function* () {
896
+ const rerefs = [];
897
+ for (const handle of handles) rerefs.push(yield* handle.unref);
898
+ return forEach([...rerefs].reverse(), (reref) => reref, { discard: true });
899
+ });
900
+ return makeHandle({
901
+ pid: handle.pid,
902
+ exitCode: handle.exitCode,
903
+ isRunning: handle.isRunning,
904
+ kill: handle.kill,
905
+ stdin: handle.stdin,
906
+ stdout: handle.stdout,
907
+ stderr: handle.stderr,
908
+ all: handle.all,
909
+ getInputFd: handle.getInputFd,
910
+ getOutputFd: handle.getOutputFd,
911
+ unref
912
+ });
913
+ }
914
+ }
915
+ });
916
+ return make$4(spawnCommand);
917
+ }));
918
+ /**
919
+ * Flattens a `Command` into an array of `StandardCommand`s along with pipe
920
+ * options for each connection.
921
+ *
922
+ * @category transforming
923
+ * @since 4.0.0
924
+ */
925
+ var flattenCommand = (command) => {
926
+ const commands = [];
927
+ const pipeOptions = [];
928
+ const flatten = (cmd) => {
929
+ switch (cmd._tag) {
930
+ case "StandardCommand":
931
+ commands.push(cmd);
932
+ break;
933
+ case "PipedCommand":
934
+ flatten(cmd.left);
935
+ pipeOptions.push(cmd.options);
936
+ flatten(cmd.right);
937
+ break;
938
+ }
939
+ };
940
+ flatten(command);
941
+ if (commands.length === 0) throw new Error("flattenCommand produced empty commands array");
942
+ const [first, ...rest] = commands;
943
+ return {
944
+ commands: [first, ...rest],
945
+ pipeOptions
946
+ };
947
+ };
948
+ //#endregion
949
+ //#region ../../node_modules/@effect/platform-node-shared/dist/NodeFileSystem.js
950
+ /**
951
+ * Shared Node-compatible implementation of Effect's `FileSystem` service.
952
+ *
953
+ * This module adapts Node's `node:fs`, `node:os`, and `node:path` APIs into a
954
+ * `FileSystem` layer for Effect programs running on Node-compatible runtimes.
955
+ * Platform packages use it to provide file and directory I/O, permissions,
956
+ * links, metadata, temporary files and directories, and file watching through
957
+ * the shared `FileSystem` service.
958
+ *
959
+ * @since 4.0.0
960
+ */
961
+ var handleBadArgument = (method) => (err) => badArgument({
962
+ module: "FileSystem",
963
+ method,
964
+ description: err.message ?? String(err)
965
+ });
966
+ var access = /*#__PURE__*/ (() => {
967
+ const nodeAccess = /*#__PURE__*/ effectify(NFS.access, /*#__PURE__*/ handleErrnoException("FileSystem", "access"), /*#__PURE__*/ handleBadArgument("access"));
968
+ return (path, options) => {
969
+ let mode = NFS.constants.F_OK;
970
+ if (options?.readable) mode |= NFS.constants.R_OK;
971
+ if (options?.writable) mode |= NFS.constants.W_OK;
972
+ return nodeAccess(path, mode);
973
+ };
974
+ })();
975
+ var copy = /*#__PURE__*/ (() => {
976
+ const nodeCp = /*#__PURE__*/ effectify(NFS.cp, /*#__PURE__*/ handleErrnoException("FileSystem", "copy"), /*#__PURE__*/ handleBadArgument("copy"));
977
+ return (fromPath, toPath, options) => nodeCp(fromPath, toPath, {
978
+ force: options?.overwrite ?? false,
979
+ preserveTimestamps: options?.preserveTimestamps ?? false,
980
+ recursive: true
981
+ });
982
+ })();
983
+ var copyFile = /*#__PURE__*/ (() => {
984
+ const nodeCopyFile = /*#__PURE__*/ effectify(NFS.copyFile, /*#__PURE__*/ handleErrnoException("FileSystem", "copyFile"), /*#__PURE__*/ handleBadArgument("copyFile"));
985
+ return (fromPath, toPath) => nodeCopyFile(fromPath, toPath);
986
+ })();
987
+ var chmod = /*#__PURE__*/ (() => {
988
+ const nodeChmod = /*#__PURE__*/ effectify(NFS.chmod, /*#__PURE__*/ handleErrnoException("FileSystem", "chmod"), /*#__PURE__*/ handleBadArgument("chmod"));
989
+ return (path, mode) => nodeChmod(path, mode);
990
+ })();
991
+ var chown = /*#__PURE__*/ (() => {
992
+ const nodeChown = /*#__PURE__*/ effectify(NFS.chown, /*#__PURE__*/ handleErrnoException("FileSystem", "chown"), /*#__PURE__*/ handleBadArgument("chown"));
993
+ return (path, uid, gid) => nodeChown(path, uid, gid);
994
+ })();
995
+ var glob = /*#__PURE__*/ (() => {
996
+ const nodeGlob = /*#__PURE__*/ effectify(NFS.glob, /*#__PURE__*/ handleErrnoException("FileSystem", "glob"), /*#__PURE__*/ handleBadArgument("glob"));
997
+ return (pattern, options) => nodeGlob(pattern, {
998
+ cwd: options?.root,
999
+ exclude: options?.exclude
1000
+ });
1001
+ })();
1002
+ var link = /*#__PURE__*/ (() => {
1003
+ const nodeLink = /*#__PURE__*/ effectify(NFS.link, /*#__PURE__*/ handleErrnoException("FileSystem", "link"), /*#__PURE__*/ handleBadArgument("link"));
1004
+ return (existingPath, newPath) => nodeLink(existingPath, newPath);
1005
+ })();
1006
+ var makeDirectory = /*#__PURE__*/ (() => {
1007
+ const nodeMkdir = /*#__PURE__*/ effectify(NFS.mkdir, /*#__PURE__*/ handleErrnoException("FileSystem", "makeDirectory"), /*#__PURE__*/ handleBadArgument("makeDirectory"));
1008
+ return (path, options) => nodeMkdir(path, {
1009
+ recursive: options?.recursive ?? false,
1010
+ mode: options?.mode
1011
+ });
1012
+ })();
1013
+ var makeTempDirectoryFactory = (method) => {
1014
+ const nodeMkdtemp = effectify(NFS.mkdtemp, handleErrnoException("FileSystem", method), handleBadArgument(method));
1015
+ return (options) => suspend(() => {
1016
+ const prefix = options?.prefix ?? "";
1017
+ const directory = typeof options?.directory === "string" ? Path.join(options.directory, ".") : OS.tmpdir();
1018
+ return nodeMkdtemp(prefix ? Path.join(directory, prefix) : directory + "/");
1019
+ });
1020
+ };
1021
+ var makeTempDirectory = /*#__PURE__*/ makeTempDirectoryFactory("makeTempDirectory");
1022
+ var removeFactory = (method) => {
1023
+ const nodeRm = effectify(NFS.rm, handleErrnoException("FileSystem", method), handleBadArgument(method));
1024
+ return (path, options) => nodeRm(path, {
1025
+ recursive: options?.recursive ?? false,
1026
+ force: options?.force ?? false
1027
+ });
1028
+ };
1029
+ var remove = /*#__PURE__*/ removeFactory("remove");
1030
+ var makeTempDirectoryScoped = /*#__PURE__*/ (() => {
1031
+ const makeDirectory = /*#__PURE__*/ makeTempDirectoryFactory("makeTempDirectoryScoped");
1032
+ const removeDirectory = /*#__PURE__*/ removeFactory("makeTempDirectoryScoped");
1033
+ return (options) => acquireRelease(makeDirectory(options), (directory) => orDie(removeDirectory(directory, { recursive: true })));
1034
+ })();
1035
+ var openFactory = (method) => {
1036
+ const nodeOpen = effectify(NFS.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
1037
+ const nodeClose = effectify(NFS.close, handleErrnoException("FileSystem", method), handleBadArgument(method));
1038
+ return (path, options) => pipe(acquireRelease(nodeOpen(path, options?.flag ?? "r", options?.mode), (fd) => orDie(nodeClose(fd))), map((fd) => makeFile(FileDescriptor(fd), options?.flag?.startsWith("a") ?? false)));
1039
+ };
1040
+ var open = /*#__PURE__*/ openFactory("open");
1041
+ var makeFile = /*#__PURE__*/ (() => {
1042
+ const nodeReadFactory = (method) => effectify(NFS.read, handleErrnoException("FileSystem", method), handleBadArgument(method));
1043
+ const nodeRead = /*#__PURE__*/ nodeReadFactory("read");
1044
+ const nodeReadAlloc = /*#__PURE__*/ nodeReadFactory("readAlloc");
1045
+ const nodeStat = /*#__PURE__*/ effectify(NFS.fstat, /*#__PURE__*/ handleErrnoException("FileSystem", "stat"), /*#__PURE__*/ handleBadArgument("stat"));
1046
+ const nodeTruncate = /*#__PURE__*/ effectify(NFS.ftruncate, /*#__PURE__*/ handleErrnoException("FileSystem", "truncate"), /*#__PURE__*/ handleBadArgument("truncate"));
1047
+ const nodeSync = /*#__PURE__*/ effectify(NFS.fsync, /*#__PURE__*/ handleErrnoException("FileSystem", "sync"), /*#__PURE__*/ handleBadArgument("sync"));
1048
+ const nodeWriteFactory = (method) => effectify(NFS.write, handleErrnoException("FileSystem", method), handleBadArgument(method));
1049
+ const nodeWrite = /*#__PURE__*/ nodeWriteFactory("write");
1050
+ const nodeWriteAll = /*#__PURE__*/ nodeWriteFactory("writeAll");
1051
+ class FileImpl {
1052
+ [FileTypeId];
1053
+ fd;
1054
+ append;
1055
+ position = /*#__PURE__*/ BigInt(0);
1056
+ constructor(fd, append) {
1057
+ this[FileTypeId] = FileTypeId;
1058
+ this.fd = fd;
1059
+ this.append = append;
1060
+ }
1061
+ get stat() {
1062
+ return map(nodeStat(this.fd), makeFileInfo);
1063
+ }
1064
+ get sync() {
1065
+ return nodeSync(this.fd);
1066
+ }
1067
+ seek(offset, from) {
1068
+ const offsetSize = Size(offset);
1069
+ return sync(() => {
1070
+ if (from === "start") this.position = offsetSize;
1071
+ else if (from === "current") this.position = this.position + offsetSize;
1072
+ return this.position;
1073
+ });
1074
+ }
1075
+ read(buffer) {
1076
+ return suspend(() => {
1077
+ const position = this.position;
1078
+ return map(nodeRead(this.fd, {
1079
+ buffer,
1080
+ position
1081
+ }), (bytesRead) => {
1082
+ const sizeRead = Size(bytesRead);
1083
+ this.position = position + sizeRead;
1084
+ return sizeRead;
1085
+ });
1086
+ });
1087
+ }
1088
+ readAlloc(size) {
1089
+ const sizeNumber = Number(size);
1090
+ return suspend(() => {
1091
+ const buffer = Buffer.allocUnsafeSlow(sizeNumber);
1092
+ const position = this.position;
1093
+ return map(nodeReadAlloc(this.fd, {
1094
+ buffer,
1095
+ position
1096
+ }), (bytesRead) => {
1097
+ if (bytesRead === 0) return none();
1098
+ this.position = position + BigInt(bytesRead);
1099
+ if (bytesRead === sizeNumber) return some(buffer);
1100
+ const dst = Buffer.allocUnsafeSlow(bytesRead);
1101
+ buffer.copy(dst, 0, 0, bytesRead);
1102
+ return some(dst);
1103
+ });
1104
+ });
1105
+ }
1106
+ truncate(length) {
1107
+ return map(nodeTruncate(this.fd, length ? Number(length) : void 0), () => {
1108
+ if (!this.append) {
1109
+ const len = BigInt(length ?? 0);
1110
+ if (this.position > len) this.position = len;
1111
+ }
1112
+ });
1113
+ }
1114
+ write(buffer) {
1115
+ return suspend(() => {
1116
+ const position = this.position;
1117
+ return map(nodeWrite(this.fd, buffer, void 0, void 0, this.append ? void 0 : Number(position)), (bytesWritten) => {
1118
+ const sizeWritten = Size(bytesWritten);
1119
+ if (!this.append) this.position = position + sizeWritten;
1120
+ return sizeWritten;
1121
+ });
1122
+ });
1123
+ }
1124
+ writeAllChunk(buffer) {
1125
+ return suspend(() => {
1126
+ const position = this.position;
1127
+ return flatMap(nodeWriteAll(this.fd, buffer, void 0, void 0, this.append ? void 0 : Number(position)), (bytesWritten) => {
1128
+ if (bytesWritten === 0) return fail(systemError({
1129
+ module: "FileSystem",
1130
+ method: "writeAll",
1131
+ _tag: "WriteZero",
1132
+ pathOrDescriptor: this.fd,
1133
+ description: "write returned 0 bytes written"
1134
+ }));
1135
+ if (!this.append) this.position = position + BigInt(bytesWritten);
1136
+ return bytesWritten < buffer.length ? this.writeAllChunk(buffer.subarray(bytesWritten)) : void_;
1137
+ });
1138
+ });
1139
+ }
1140
+ writeAll(buffer) {
1141
+ return this.writeAllChunk(buffer);
1142
+ }
1143
+ }
1144
+ return (fd, append) => new FileImpl(fd, append);
1145
+ })();
1146
+ var makeTempFileFactory = (method) => {
1147
+ const makeDirectory = makeTempDirectoryFactory(method);
1148
+ return fnUntraced(function* (options) {
1149
+ const directory = yield* makeDirectory(options);
1150
+ const random = Crypto.randomBytes(6).toString("hex");
1151
+ const name = Path.join(directory, options?.suffix ? `${random}${options.suffix}` : random);
1152
+ yield* writeFile(name, /* @__PURE__ */ new Uint8Array(0));
1153
+ return name;
1154
+ });
1155
+ };
1156
+ var makeTempFile = /*#__PURE__*/ makeTempFileFactory("makeTempFile");
1157
+ var makeTempFileScoped = /*#__PURE__*/ (() => {
1158
+ const makeFile = /*#__PURE__*/ makeTempFileFactory("makeTempFileScoped");
1159
+ const removeDirectory = /*#__PURE__*/ removeFactory("makeTempFileScoped");
1160
+ return (options) => acquireRelease(makeFile(options), (file) => orDie(removeDirectory(Path.dirname(file), { recursive: true })));
1161
+ })();
1162
+ var readDirectory = (path, options) => tryPromise({
1163
+ try: () => NFS.promises.readdir(path, options),
1164
+ catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [path])
1165
+ });
1166
+ var readFile = (path) => callback((resume, signal) => {
1167
+ try {
1168
+ NFS.readFile(path, { signal }, (err, data) => {
1169
+ if (err) resume(fail(handleErrnoException("FileSystem", "readFile")(err, [path])));
1170
+ else resume(succeed(data));
1171
+ });
1172
+ } catch (err) {
1173
+ resume(fail(handleBadArgument("readFile")(err)));
1174
+ }
1175
+ });
1176
+ var readLink = /*#__PURE__*/ (() => {
1177
+ const nodeReadLink = /*#__PURE__*/ effectify(NFS.readlink, /*#__PURE__*/ handleErrnoException("FileSystem", "readLink"), /*#__PURE__*/ handleBadArgument("readLink"));
1178
+ return (path) => nodeReadLink(path);
1179
+ })();
1180
+ var realPath = /*#__PURE__*/ (() => {
1181
+ const nodeRealPath = /*#__PURE__*/ effectify(NFS.realpath, /*#__PURE__*/ handleErrnoException("FileSystem", "realPath"), /*#__PURE__*/ handleBadArgument("realPath"));
1182
+ return (path) => nodeRealPath(path);
1183
+ })();
1184
+ var rename = /*#__PURE__*/ (() => {
1185
+ const nodeRename = /*#__PURE__*/ effectify(NFS.rename, /*#__PURE__*/ handleErrnoException("FileSystem", "rename"), /*#__PURE__*/ handleBadArgument("rename"));
1186
+ return (oldPath, newPath) => nodeRename(oldPath, newPath);
1187
+ })();
1188
+ var makeFileInfo = (stat) => ({
1189
+ type: stat.isFile() ? "File" : stat.isDirectory() ? "Directory" : stat.isSymbolicLink() ? "SymbolicLink" : stat.isBlockDevice() ? "BlockDevice" : stat.isCharacterDevice() ? "CharacterDevice" : stat.isFIFO() ? "FIFO" : stat.isSocket() ? "Socket" : "Unknown",
1190
+ mtime: fromNullishOr(stat.mtime),
1191
+ atime: fromNullishOr(stat.atime),
1192
+ birthtime: fromNullishOr(stat.birthtime),
1193
+ dev: stat.dev,
1194
+ rdev: fromNullishOr(stat.rdev),
1195
+ ino: fromNullishOr(stat.ino),
1196
+ mode: stat.mode,
1197
+ nlink: fromNullishOr(stat.nlink),
1198
+ uid: fromNullishOr(stat.uid),
1199
+ gid: fromNullishOr(stat.gid),
1200
+ size: Size(stat.size),
1201
+ blksize: stat.blksize !== void 0 ? some(Size(stat.blksize)) : none(),
1202
+ blocks: fromNullishOr(stat.blocks)
1203
+ });
1204
+ var stat = /*#__PURE__*/ (() => {
1205
+ const nodeStat = /*#__PURE__*/ effectify(NFS.stat, /*#__PURE__*/ handleErrnoException("FileSystem", "stat"), /*#__PURE__*/ handleBadArgument("stat"));
1206
+ return (path) => map(nodeStat(path), makeFileInfo);
1207
+ })();
1208
+ var symlink = /*#__PURE__*/ (() => {
1209
+ const nodeSymlink = /*#__PURE__*/ effectify(NFS.symlink, /*#__PURE__*/ handleErrnoException("FileSystem", "symlink"), /*#__PURE__*/ handleBadArgument("symlink"));
1210
+ return (target, path) => nodeSymlink(target, path);
1211
+ })();
1212
+ var truncate = /*#__PURE__*/ (() => {
1213
+ const nodeTruncate = /*#__PURE__*/ effectify(NFS.truncate, /*#__PURE__*/ handleErrnoException("FileSystem", "truncate"), /*#__PURE__*/ handleBadArgument("truncate"));
1214
+ return (path, length) => nodeTruncate(path, length !== void 0 ? Number(length) : void 0);
1215
+ })();
1216
+ var utimes = /*#__PURE__*/ (() => {
1217
+ const nodeUtimes = /*#__PURE__*/ effectify(NFS.utimes, /*#__PURE__*/ handleErrnoException("FileSystem", "utime"), /*#__PURE__*/ handleBadArgument("utime"));
1218
+ return (path, atime, mtime) => nodeUtimes(path, atime, mtime);
1219
+ })();
1220
+ var watchNode = (path) => callback$1((queue) => acquireRelease(sync(() => {
1221
+ const watcher = NFS.watch(path, { recursive: true }, (event, path) => {
1222
+ if (!path) return;
1223
+ switch (event) {
1224
+ case "rename":
1225
+ runFork(matchEffect(stat(path), {
1226
+ onSuccess: (_) => offer(queue, {
1227
+ _tag: "Create",
1228
+ path
1229
+ }),
1230
+ onFailure: (_) => offer(queue, {
1231
+ _tag: "Remove",
1232
+ path
1233
+ })
1234
+ }));
1235
+ return;
1236
+ case "change":
1237
+ offerUnsafe(queue, {
1238
+ _tag: "Update",
1239
+ path
1240
+ });
1241
+ return;
1242
+ }
1243
+ });
1244
+ watcher.on("error", (error) => {
1245
+ failCauseUnsafe(queue, fail$2(systemError({
1246
+ module: "FileSystem",
1247
+ _tag: "Unknown",
1248
+ method: "watch",
1249
+ pathOrDescriptor: path,
1250
+ cause: error
1251
+ })));
1252
+ });
1253
+ watcher.on("close", () => {
1254
+ endUnsafe(queue);
1255
+ });
1256
+ return watcher;
1257
+ }), (watcher) => sync(() => watcher.close())));
1258
+ var watch = (backend, path) => stat(path).pipe(map((stat) => backend.pipe(flatMap$1((_) => _.register(path, stat)), getOrElse(() => watchNode(path)))), unwrap);
1259
+ var writeFile = (path, data, options) => callback((resume, signal) => {
1260
+ try {
1261
+ NFS.writeFile(path, data, {
1262
+ signal,
1263
+ flag: options?.flag,
1264
+ mode: options?.mode
1265
+ }, (err) => {
1266
+ if (err) resume(fail(handleErrnoException("FileSystem", "writeFile")(err, [path])));
1267
+ else resume(void_);
1268
+ });
1269
+ } catch (err) {
1270
+ resume(fail(handleBadArgument("writeFile")(err)));
1271
+ }
1272
+ });
1273
+ var makeFileSystem = /*#__PURE__*/ map(/*#__PURE__*/ serviceOption(WatchBackend), (backend) => make$6({
1274
+ access,
1275
+ chmod,
1276
+ chown,
1277
+ copy,
1278
+ copyFile,
1279
+ glob,
1280
+ link,
1281
+ makeDirectory,
1282
+ makeTempDirectory,
1283
+ makeTempDirectoryScoped,
1284
+ makeTempFile,
1285
+ makeTempFileScoped,
1286
+ open,
1287
+ readDirectory,
1288
+ readFile,
1289
+ readLink,
1290
+ realPath,
1291
+ remove,
1292
+ rename,
1293
+ stat,
1294
+ symlink,
1295
+ truncate,
1296
+ utimes,
1297
+ watch(path) {
1298
+ return watch(backend, path);
1299
+ },
1300
+ writeFile
1301
+ }));
1302
+ //#endregion
1303
+ //#region ../../node_modules/@effect/platform-node/dist/NodeFileSystem.js
1304
+ /**
1305
+ * Node.js `FileSystem` layer for programs that perform real filesystem I/O.
1306
+ *
1307
+ * The exported layer satisfies the platform-independent `FileSystem` service
1308
+ * with Node-backed operations for files, directories, metadata, permissions,
1309
+ * links, temporary paths, and path watching. Effects still call the service from
1310
+ * `effect/FileSystem`; this module only chooses the Node implementation.
1311
+ *
1312
+ * @since 4.0.0
1313
+ */
1314
+ /**
1315
+ * Provides the `FileSystem` service backed by Node filesystem APIs.
1316
+ *
1317
+ * @category layers
1318
+ * @since 4.0.0
1319
+ */
1320
+ var layer$9 = /* @__PURE__ */ effect(FileSystem)(makeFileSystem);
1321
+ //#endregion
1322
+ //#region ../../node_modules/@effect/platform-node-shared/dist/NodeCrypto.js
1323
+ /**
1324
+ * Node-compatible implementation of Effect's `Crypto` service.
1325
+ *
1326
+ * This module builds the service from `node:crypto`, using `randomBytes` for
1327
+ * random data and `createHash` for supported digest algorithms. It exports
1328
+ * `make` as the concrete service value and `layer` for providing it through
1329
+ * Effect context.
1330
+ *
1331
+ * @since 1.0.0
1332
+ */
1333
+ var toHashAlgorithm = (algorithm) => {
1334
+ switch (algorithm) {
1335
+ case "SHA-1": return "sha1";
1336
+ case "SHA-256": return "sha256";
1337
+ case "SHA-384": return "sha384";
1338
+ case "SHA-512": return "sha512";
1339
+ }
1340
+ };
1341
+ var digest = (algorithm, data) => try_({
1342
+ try: () => Uint8Array.from(Crypto.createHash(toHashAlgorithm(algorithm)).update(data).digest()),
1343
+ catch: (cause) => systemError({
1344
+ module: "Crypto",
1345
+ method: "digest",
1346
+ _tag: "Unknown",
1347
+ description: "Could not compute digest",
1348
+ cause
1349
+ })
1350
+ });
1351
+ //#endregion
1352
+ //#region ../../node_modules/@effect/platform-node/dist/NodeCrypto.js
1353
+ /**
1354
+ * The `NodeCrypto` module provides the Node.js `Crypto` service layer for
1355
+ * Effect programs. Provide {@link layer} at the edge of a Node application,
1356
+ * CLI, script, or test to satisfy `effect/Crypto` with Node's `node:crypto`
1357
+ * implementation for secure random bytes, UUID generation, random values, and
1358
+ * SHA digest operations.
1359
+ *
1360
+ * This module is the public Node adapter around the shared Node-compatible
1361
+ * implementation. Digest failures are reported as platform errors, and SHA-1
1362
+ * remains available only for interoperability with existing protocols.
1363
+ *
1364
+ * @since 1.0.0
1365
+ */
1366
+ /**
1367
+ * Layer that provides the Node.js Crypto service implementation.
1368
+ *
1369
+ * @category layers
1370
+ * @since 1.0.0
1371
+ */
1372
+ var layer$7 = /* @__PURE__ */ succeed$2(Crypto$1, /* @__PURE__ */ make$9({
1373
+ randomBytes: Crypto.randomBytes,
1374
+ digest
1375
+ }));
1376
+ //#endregion
1377
+ //#region ../../node_modules/@effect/platform-node-shared/dist/NodePath.js
1378
+ /**
1379
+ * Node-backed provider for Effect's `Path` service.
1380
+ *
1381
+ * This module turns Node's `node:path` and `node:url` APIs into `Path` layers.
1382
+ * `layer` uses the host platform path implementation, while `layerPosix` and
1383
+ * `layerWin32` provide fixed POSIX and Windows variants. All three layers also
1384
+ * include helpers for converting between file paths and file URLs.
1385
+ *
1386
+ * @since 4.0.0
1387
+ */
1388
+ var fromFileUrl = (url) => try_({
1389
+ try: () => NodeUrl.fileURLToPath(url),
1390
+ catch: (cause) => new BadArgument({
1391
+ module: "Path",
1392
+ method: "fromFileUrl",
1393
+ cause
1394
+ })
1395
+ });
1396
+ var toFileUrl = (path) => try_({
1397
+ try: () => NodeUrl.pathToFileURL(path),
1398
+ catch: (cause) => new BadArgument({
1399
+ module: "Path",
1400
+ method: "toFileUrl",
1401
+ cause
1402
+ })
1403
+ });
1404
+ ({ ...Path.posix });
1405
+ ({ ...Path.win32 });
1406
+ //#endregion
1407
+ //#region ../../node_modules/@effect/platform-node/dist/NodePath.js
1408
+ /**
1409
+ * Node.js layers for Effect's `Path` service.
1410
+ *
1411
+ * This module provides the default, POSIX, and Windows variants of the
1412
+ * platform-independent `Path` service by reusing the shared Node path
1413
+ * implementation. The provided path services include Node file URL conversion
1414
+ * behavior.
1415
+ *
1416
+ * @since 4.0.0
1417
+ */
1418
+ /**
1419
+ * Provides the default Node `Path` service using the platform's `node:path`
1420
+ * implementation.
1421
+ *
1422
+ * @category layers
1423
+ * @since 4.0.0
1424
+ */
1425
+ var layer$5 = /* @__PURE__ */ succeed$2(Path$1)({
1426
+ [TypeId$1]: TypeId$1,
1427
+ ...Path,
1428
+ fromFileUrl,
1429
+ toFileUrl
1430
+ });
1431
+ //#endregion
1432
+ //#region ../../node_modules/@effect/platform-node/dist/NodeStdio.js
1433
+ /**
1434
+ * Node.js `Stdio` layer for the current process.
1435
+ *
1436
+ * The exported layer reuses the shared Node stdio implementation. It satisfies
1437
+ * the platform-independent `Stdio` service by reading command-line arguments
1438
+ * from `process.argv`, consuming input from `process.stdin`, and writing output
1439
+ * streams to `process.stdout` and `process.stderr`.
1440
+ *
1441
+ * @since 4.0.0
1442
+ */
1443
+ /**
1444
+ * Provides the `Stdio` service backed by the current process arguments,
1445
+ * stdin, stdout, and stderr streams.
1446
+ *
1447
+ * @category layers
1448
+ * @since 4.0.0
1449
+ */
1450
+ var layer$3 = /* @__PURE__ */ succeed$2(Stdio, /*#__PURE__*/ make$10({
1451
+ args: /*#__PURE__*/ sync(() => process.argv.slice(2)),
1452
+ stdout: (options) => fromWritable({
1453
+ evaluate: () => process.stdout,
1454
+ onError: (cause) => systemError({
1455
+ module: "Stdio",
1456
+ method: "stdout",
1457
+ _tag: "Unknown",
1458
+ cause
1459
+ }),
1460
+ endOnDone: options?.endOnDone ?? false
1461
+ }),
1462
+ stderr: (options) => fromWritable({
1463
+ evaluate: () => process.stderr,
1464
+ onError: (cause) => systemError({
1465
+ module: "Stdio",
1466
+ method: "stderr",
1467
+ _tag: "Unknown",
1468
+ cause
1469
+ }),
1470
+ endOnDone: options?.endOnDone ?? false
1471
+ }),
1472
+ stdin: /*#__PURE__*/ fromReadable({
1473
+ evaluate: () => process.stdin,
1474
+ onError: (cause) => systemError({
1475
+ module: "Stdio",
1476
+ method: "stdin",
1477
+ _tag: "Unknown",
1478
+ cause
1479
+ }),
1480
+ closeOnDone: false
1481
+ })
1482
+ }));
1483
+ /**
1484
+ * Provides the default process-backed `Terminal` service, ending key input on
1485
+ * Ctrl+C or Ctrl+D.
1486
+ *
1487
+ * @category layers
1488
+ * @since 4.0.0
1489
+ */
1490
+ var layer$2 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit) {
1491
+ const stdin = process.stdin;
1492
+ const stdout = process.stdout;
1493
+ const rlRef = yield* make$7({ acquire: acquireRelease(sync(() => {
1494
+ const rl = readline.createInterface({
1495
+ input: stdin,
1496
+ escapeCodeTimeout: 50
1497
+ });
1498
+ readline.emitKeypressEvents(stdin, rl);
1499
+ if (stdin.isTTY) stdin.setRawMode(true);
1500
+ return rl;
1501
+ }), (rl) => sync(() => {
1502
+ if (stdin.isTTY) stdin.setRawMode(false);
1503
+ rl.close();
1504
+ })) });
1505
+ const columns = sync(() => stdout.columns ?? 0);
1506
+ const rows = sync(() => stdout.rows ?? 0);
1507
+ const readInput = gen(function* () {
1508
+ yield* get(rlRef);
1509
+ const queue = yield* make$8();
1510
+ const handleKeypress = (s, k) => {
1511
+ const userInput = {
1512
+ input: fromUndefinedOr(s),
1513
+ key: {
1514
+ name: k.name ?? "",
1515
+ ctrl: !!k.ctrl,
1516
+ meta: !!k.meta,
1517
+ shift: !!k.shift
1518
+ }
1519
+ };
1520
+ offerUnsafe(queue, userInput);
1521
+ if (shouldQuit(userInput)) endUnsafe(queue);
1522
+ };
1523
+ yield* addFinalizer$1(() => sync(() => stdin.off("keypress", handleKeypress)));
1524
+ stdin.on("keypress", handleKeypress);
1525
+ return queue;
1526
+ });
1527
+ const readLine = scoped(flatMap(get(rlRef), (readlineInterface) => callback((resume) => {
1528
+ const onLine = (line) => resume(succeed(line));
1529
+ readlineInterface.once("line", onLine);
1530
+ return sync(() => readlineInterface.off("line", onLine));
1531
+ })));
1532
+ const display = (prompt) => uninterruptible(callback((resume) => {
1533
+ stdout.write(prompt, (err) => isNullish(err) ? resume(void_) : resume(fail(badArgument({
1534
+ module: "Terminal",
1535
+ method: "display",
1536
+ description: "Failed to write prompt to stdout",
1537
+ cause: err
1538
+ }))));
1539
+ }));
1540
+ return make$11({
1541
+ columns,
1542
+ rows,
1543
+ readInput,
1544
+ readLine,
1545
+ display
1546
+ });
1547
+ }))(defaultShouldQuit));
1548
+ function defaultShouldQuit(input) {
1549
+ return input.key.ctrl && (input.key.name === "c" || input.key.name === "d");
1550
+ }
1551
+ //#endregion
1552
+ //#region ../../node_modules/@effect/platform-node/dist/NodeServices.js
1553
+ /**
1554
+ * Provides the default Node implementations for child process spawning,
1555
+ * filesystem, path, stdio, and terminal services.
1556
+ *
1557
+ * @category layers
1558
+ * @since 4.0.0
1559
+ */
1560
+ var layer = /*#__PURE__*/ provideMerge(layer$11, /*#__PURE__*/ mergeAll(layer$9, layer$7, layer$5, layer$3, layer$2));
1561
+ //#endregion
1562
+ export { toString as a, toArrayBuffer as i, layer$9 as n, toUint8Array as o, fromReadable as r, layer as t };
1563
+
1564
+ //# sourceMappingURL=NodeServices-CtEw3D6F.js.map