@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.
- package/dist/Cache-Dv3Qogvb.js +1048 -0
- package/dist/Cache-Dv3Qogvb.js.map +1 -0
- package/dist/{LoomServer-CxdKR04b.js → LoomServer-JbCtLtxV.js} +4 -2
- package/dist/{LoomServer-CxdKR04b.js.map → LoomServer-JbCtLtxV.js.map} +1 -1
- package/dist/LoomStore-BGlpRj6W.js +8857 -0
- package/dist/LoomStore-BGlpRj6W.js.map +1 -0
- package/dist/NodeServices-CtEw3D6F.js +1564 -0
- package/dist/NodeServices-CtEw3D6F.js.map +1 -0
- package/dist/{LoomStore-C2tWuEsJ.js → SqlClient-BHo_uVyk.js} +10062 -46572
- package/dist/SqlClient-BHo_uVyk.js.map +1 -0
- package/dist/SqlError-BwVJTsti.js +408 -0
- package/dist/SqlError-BwVJTsti.js.map +1 -0
- package/dist/design-S_129JVC.js +18524 -0
- package/dist/design-S_129JVC.js.map +1 -0
- package/dist/dist-3ptbWhlX.js +202 -0
- package/dist/dist-3ptbWhlX.js.map +1 -0
- package/dist/dist-CKhPOkpR.js +27469 -0
- package/dist/dist-CKhPOkpR.js.map +1 -0
- package/dist/dist-kscTHM4c.js +151 -0
- package/dist/dist-kscTHM4c.js.map +1 -0
- package/dist/identity-DvFsrt2d.js +95 -0
- package/dist/identity-DvFsrt2d.js.map +1 -0
- package/dist/main.js +260 -1535
- package/dist/main.js.map +1 -1
- package/dist/overlay.js +80 -0
- package/dist/store-CtvrwAS8.js +3 -0
- package/dist/store-DgMmJ7v9.js +229 -0
- package/dist/store-DgMmJ7v9.js.map +1 -0
- package/dist/ui.html +103 -0
- package/dist/ui.js +79 -0
- package/package.json +3 -1
- package/dist/LoomStore-C2tWuEsJ.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeServices-CtEw3D6F.js","names":["Inspectable.BaseProto","make","Effect.map","Stream.decodeText","Stream.unwrap","Stream.splitLines","Effect.scoped","Effect.flatMap","Stream.runCollect","Stream.mkString","Context.Service","Context.getUnsafe","make","PlatformError.systemError","Sink.fromChannel","Channel.mapDone","Channel.fromTransform","Effect.succeed","Effect.flatMap","Effect.callback","Effect.void","Effect.forever","Effect.raceFirst","Effect.fail","Effect.sync","Pull.catchDone","Cause.done","Stream.fromChannel","Channel.fromTransform","Effect.callback","Effect.fail","Effect.succeed","Effect.sync","Effect.map","MutableRef.make","Latch.makeUnsafe","Exit.fail","Cause.Done","Effect.suspend","Effect.flatMap","Arr.of","Effect.as","Scope.addFinalizer","Cause.UnknownError","make","FileSystem.FileSystem","Path.Path","Effect.fnUntraced","Predicate.isUndefined","Stream.isStream","Sink.isSink","ChildProcess.parseFdName","Predicate.isNotUndefined","Sink.drain","Stream.empty","NodeSink.fromWritable","Effect.forkScoped","Stream.run","NodeStream.fromReadable","Stream.transduce","Effect.suspend","Predicate.isNotNull","Effect.as","Effect.succeed","Stream.merge","Effect.callback","Deferred.makeUnsafe","Effect.fail","Exit.succeed","Effect.sync","Effect.void","Effect.try","Effect.timeoutOrElse","Effect.acquireRelease","Deferred.isDone","Deferred.await","Effect.ignore","Effect.catch","Effect.andThen","Effect.map","Effect.flatMap","Effect.asVoid","Stream.unwrap","ChildProcess.make","fdName","ChildProcess.fdName","Effect.gen","Effect.forEach","makeSpawner","layer","Error.badArgument","Effect.suspend","Effect.acquireRelease","Effect.orDie","Effect.map","FileSystem.FileDescriptor","FileSystem.FileTypeId","FileSystem.Size","Effect.sync","Option.none","Option.some","Effect.flatMap","Effect.fail","Error.systemError","Effect.void","Effect.fnUntraced","Effect.tryPromise","Effect.callback","Effect.succeed","Option.fromNullishOr","Stream.callback","Effect.matchEffect","Queue.offer","Cause.fail","Option.flatMap","Option.getOrElse","Stream.unwrap","FileSystem.WatchBackend","FileSystem.make","layer","FileSystem.FileSystem","layer","NodeFileSystem.layer","Effect.try","NodeCrypto","PlatformError.systemError","make","layer","EffectCrypto.Crypto","layer","NodeCrypto.layer","Effect.try","Path","TypeId","NodePath","layer","layer","NodePath.layer","layer","Stdio.Stdio","layer","NodeStdio.layer","RcRef.make","Effect.acquireRelease","Effect.sync","Effect.gen","RcRef.get","Queue.make","Option.fromUndefinedOr","Effect.addFinalizer","Effect.scoped","Effect.flatMap","Effect.callback","Effect.succeed","Effect.uninterruptible","Predicate.isNullish","Effect.void","Effect.fail","Terminal.make","layer","Terminal.Terminal","layer","NodeTerminal.layer","NodeChildProcessSpawner.layer","NodeFileSystem.layer","NodeCrypto.layer","NodePath.layer","NodeStdio.layer","NodeTerminal.layer"],"sources":["../../../node_modules/effect/dist/unstable/process/ChildProcessSpawner.js","../../../node_modules/effect/dist/unstable/process/ChildProcess.js","../../../node_modules/@effect/platform-node-shared/dist/internal/utils.js","../../../node_modules/@effect/platform-node-shared/dist/NodeSink.js","../../../node_modules/@effect/platform-node-shared/dist/NodeStream.js","../../../node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js","../../../node_modules/@effect/platform-node-shared/dist/NodeFileSystem.js","../../../node_modules/@effect/platform-node/dist/NodeFileSystem.js","../../../node_modules/@effect/platform-node-shared/dist/NodeCrypto.js","../../../node_modules/@effect/platform-node/dist/NodeCrypto.js","../../../node_modules/@effect/platform-node-shared/dist/NodePath.js","../../../node_modules/@effect/platform-node/dist/NodePath.js","../../../node_modules/@effect/platform-node-shared/dist/NodeStdio.js","../../../node_modules/@effect/platform-node/dist/NodeStdio.js","../../../node_modules/@effect/platform-node-shared/dist/NodeTerminal.js","../../../node_modules/@effect/platform-node/dist/NodeTerminal.js","../../../node_modules/@effect/platform-node/dist/NodeServices.js"],"sourcesContent":["/**\n * Service boundary for starting and controlling child processes.\n *\n * `ChildProcessSpawner` is the service used by `ChildProcess` commands to start\n * operating-system processes. A spawner turns a command description into a\n * handle that can write to stdin, read stdout and stderr, wait for exit, kill\n * the process, and manage whether the process keeps its parent alive. Platform\n * backends implement this service, while most application code uses the higher\n * level `ChildProcess` module.\n *\n * @since 4.0.0\n */\nimport * as Brand from \"../../Brand.js\";\nimport * as Context from \"../../Context.js\";\nimport * as Effect from \"../../Effect.js\";\nimport * as Inspectable from \"../../Inspectable.js\";\nimport * as Stream from \"../../Stream.js\";\n/**\n * Constructs branded child process `ExitCode` values.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const ExitCode = /*#__PURE__*/Brand.nominal();\n/**\n * Constructs branded child process `ProcessId` values.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const ProcessId = /*#__PURE__*/Brand.nominal();\nconst HandleTypeId = \"~effect/ChildProcessSpawner/ChildProcessHandle\";\nconst HandleProto = {\n [HandleTypeId]: HandleTypeId,\n ...Inspectable.BaseProto,\n toJSON() {\n return {\n _id: \"ChildProcessHandle\",\n pid: this.pid\n };\n }\n};\n/**\n * Constructs a new `ChildProcessHandle`.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const makeHandle = params => Object.assign(Object.create(HandleProto), params);\n/**\n * Creates a `ChildProcessSpawner` service from a `spawn` function, deriving\n * helpers for exit codes and output collection from that implementation.\n *\n * @category models\n * @since 4.0.0\n */\nexport const make = spawn => {\n const streamString = (command, options) => spawn(command).pipe(Effect.map(handle => Stream.decodeText(options?.includeStderr === true ? handle.all : handle.stdout)), Stream.unwrap);\n const streamLines = (command, options) => Stream.splitLines(streamString(command, options));\n return ChildProcessSpawner.of({\n spawn,\n exitCode: command => Effect.scoped(Effect.flatMap(spawn(command), handle => handle.exitCode)),\n streamString,\n streamLines,\n lines: (command, options) => Stream.runCollect(streamLines(command, options)),\n string: (command, options) => Stream.mkString(streamString(command, options))\n });\n};\n/**\n * Service tag for child process spawning.\n *\n * @category services\n * @since 4.0.0\n */\nexport class ChildProcessSpawner extends /*#__PURE__*/Context.Service()(\"effect/process/ChildProcessSpawner\") {}\n//# sourceMappingURL=ChildProcessSpawner.js.map","/**\n * Describes child processes before they are started.\n *\n * A `Command` stores the executable, arguments, environment, standard streams,\n * working directory, and other process options. Commands can also be piped\n * together. A command is an `Effect`; running it asks the\n * `ChildProcessSpawner` service to start the process and returns a\n * `ChildProcessHandle`.\n *\n * @since 4.0.0\n */\nimport * as Context from \"../../Context.js\";\nimport * as Effectable from \"../../Effectable.js\";\nimport { dual } from \"../../Function.js\";\nimport * as Predicate from \"../../Predicate.js\";\nimport { ChildProcessSpawner } from \"./ChildProcessSpawner.js\";\nconst TypeId = \"~effect/unstable/process/ChildProcess\";\n// =============================================================================\n// Constructors\n// =============================================================================\nconst Proto = {\n ... /*#__PURE__*/Effectable.Prototype({\n label: \"Command\",\n evaluate(fiber) {\n return Context.getUnsafe(fiber.context, ChildProcessSpawner).spawn(this);\n }\n }),\n [TypeId]: TypeId\n};\n/**\n * Checks whether a value is a `Command`.\n *\n * @category guards\n * @since 4.0.0\n */\nexport const isCommand = u => Predicate.hasProperty(u, TypeId);\n/**\n * Checks whether a command is a `StandardCommand`.\n *\n * @category guards\n * @since 4.0.0\n */\nexport const isStandardCommand = command => command._tag === \"StandardCommand\";\n/**\n * Checks whether a command is a `PipedCommand`.\n *\n * @category guards\n * @since 4.0.0\n */\nexport const isPipedCommand = command => command._tag === \"PipedCommand\";\nconst makeStandardCommand = (command, args, options) => Object.assign(Object.create(Proto), {\n _tag: \"StandardCommand\",\n command,\n args,\n options\n});\nconst makePipedCommand = (left, right, options = {}) => Object.assign(Object.create(Proto), {\n _tag: \"PipedCommand\",\n left,\n right,\n options\n});\n/**\n * Create a command from a template literal, options + template, or array form.\n *\n * **Details**\n *\n * This function supports three calling conventions:\n * 1. Template literal: `make\\`npm run build\\``\n * 2. Options + template literal: `make({ cwd: \"/app\" })\\`npm run build\\``\n * 3. Array form: `make(\"npm\", [\"run\", \"build\"], options?)`\n *\n * Template literals are not parsed until execution time, allowing parsing\n * errors to flow through Effect's error channel.\n *\n * **Example** (Creating commands)\n *\n * ```ts\n * import { ChildProcess } from \"effect/unstable/process\"\n *\n * // Template literal form\n * const cmd1 = ChildProcess.make`echo \"hello\"`\n *\n * // With options\n * const cmd2 = ChildProcess.make({ cwd: \"/tmp\" })`ls -la`\n *\n * // Array form\n * const cmd3 = ChildProcess.make(\"git\", [\"status\"])\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const make = function make(...args) {\n // Template literal form: make`command`\n if (isTemplateString(args[0])) {\n const [templates, ...expressions] = args;\n const tokens = parseTemplates(templates, expressions);\n return makeStandardCommand(tokens[0] ?? \"\", tokens.slice(1), {});\n }\n // Options form: make({ cwd: \"/tmp\" })`command`\n if (typeof args[0] === \"object\" && !Array.isArray(args[0]) && !isTemplateString(args[0])) {\n const options = args[0];\n return function (templates, ...expressions) {\n const tokens = parseTemplates(templates, expressions);\n return makeStandardCommand(tokens[0] ?? \"\", tokens.slice(1), options);\n };\n }\n // Standard form without arguments: make(\"command\", options?)\n if (typeof args[0] === \"string\" && !Array.isArray(args[1])) {\n const [command, options = {}] = args;\n return makeStandardCommand(command, [], options);\n }\n // Standard form with arguments: make(\"command\", [\"arg1\", \"arg2\"], options?)\n const [command, cmdArgs = [], options = {}] = args;\n return makeStandardCommand(command, cmdArgs, options);\n};\n/**\n * Pipes the output of one command to the input of another.\n *\n * **Details**\n *\n * By default, pipes `stdout` from the source to `stdin` of the destination.\n * Use the `options` parameter to customize which streams are connected.\n *\n * **Example** (Piping command output)\n *\n * ```ts\n * import { ChildProcess } from \"effect/unstable/process\"\n *\n * // Pipe stdout (default)\n * const pipeline1 = ChildProcess.make`cat file.txt`.pipe(\n * ChildProcess.pipeTo(ChildProcess.make`grep pattern`)\n * )\n *\n * // Pipe stderr instead of stdout\n * const pipeline2 = ChildProcess.make`my-program`.pipe(\n * ChildProcess.pipeTo(ChildProcess.make`grep error`, { from: \"stderr\" })\n * )\n *\n * // Pipe combined stdout and stderr\n * const pipeline3 = ChildProcess.make`my-program`.pipe(\n * ChildProcess.pipeTo(ChildProcess.make`tee output.log`, { from: \"all\" })\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const pipeTo = /*#__PURE__*/dual(args => isCommand(args[0]) && isCommand(args[1]), (self, that, options) => makePipedCommand(self, that, options ?? {}));\n/**\n * Prepends another command to a command.\n *\n * **Details**\n *\n * For pipelines, only the leftmost command is prefixed.\n *\n * **Example** (Prefixing commands)\n *\n * ```ts\n * import { ChildProcess } from \"effect/unstable/process\"\n *\n * const command = ChildProcess.make`echo \"foo\"`\n *\n * const prefixed = command.pipe(\n * ChildProcess.prefix`time`\n * )\n *\n * // now prefixed will execute `time echo \"foo\"`\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const prefix = function prefix(...args) {\n if (isCommand(args[0]) && args.length > 1) {\n const [self, ...rest] = args;\n const prefixSpec = parsePrefixArgs(rest);\n return applyPrefix(self, prefixSpec);\n }\n const prefixSpec = parsePrefixArgs(args);\n return self => applyPrefix(self, prefixSpec);\n};\nconst parsePrefixArgs = args => {\n if (isTemplateString(args[0])) {\n const [templates, ...expressions] = args;\n const tokens = parseTemplates(templates, expressions);\n return {\n command: tokens[0] ?? \"\",\n args: tokens.slice(1)\n };\n }\n const [command, cmdArgs = []] = args;\n return {\n command,\n args: cmdArgs\n };\n};\nconst applyPrefix = (self, prefixSpec) => {\n switch (self._tag) {\n case \"StandardCommand\":\n {\n return makeStandardCommand(prefixSpec.command, [...prefixSpec.args, self.command, ...self.args], self.options);\n }\n case \"PipedCommand\":\n {\n return makePipedCommand(applyPrefix(self.left, prefixSpec), self.right, self.options);\n }\n }\n};\n/**\n * Sets the current working directory for a command.\n *\n * **Details**\n *\n * For pipelines, applies to each command in the pipeline.\n *\n * **Example** (Setting command working directories)\n *\n * ```ts\n * import { ChildProcess } from \"effect/unstable/process\"\n *\n * const cmd = ChildProcess.make`ls -la`.pipe(\n * ChildProcess.setCwd(\"/tmp\")\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const setCwd = /*#__PURE__*/dual(2, (self, cwd) => {\n switch (self._tag) {\n case \"StandardCommand\":\n {\n return makeStandardCommand(self.command, self.args, {\n ...self.options,\n cwd\n });\n }\n case \"PipedCommand\":\n {\n return makePipedCommand(setCwd(self.left, cwd), setCwd(self.right, cwd), self.options);\n }\n }\n});\n/**\n * Adds environment variables to a command, merging them with any existing\n * command environment and overriding duplicate keys.\n *\n * **Details**\n *\n * For pipelines, applies to each command in the pipeline.\n *\n * **Example** (Setting command environment variables)\n *\n * ```ts\n * import { ChildProcess } from \"effect/unstable/process\"\n *\n * const cmd = ChildProcess.make`node script.js`.pipe(\n * ChildProcess.setEnv({ NODE_ENV: \"test\" })\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const setEnv = /*#__PURE__*/dual(2, (self, env) => {\n switch (self._tag) {\n case \"StandardCommand\":\n {\n const nextEnv = self.options.env === undefined ? env : {\n ...self.options.env,\n ...env\n };\n return makeStandardCommand(self.command, self.args, {\n ...self.options,\n env: nextEnv\n });\n }\n case \"PipedCommand\":\n {\n return makePipedCommand(setEnv(self.left, env), setEnv(self.right, env), self.options);\n }\n }\n});\nconst isTemplateString = u => Array.isArray(u) && \"raw\" in u && Array.isArray(u.raw);\n// =============================================================================\n// Utilities\n// =============================================================================\n/**\n * Parses an fd name like \"fd3\" to its numeric index.\n * Returns undefined if the name is invalid.\n *\n * @category converting\n * @since 4.0.0\n */\nexport const parseFdName = name => {\n const match = /^fd(\\d+)$/.exec(name);\n if (match === null) return undefined;\n const fd = parseInt(match[1], 10);\n return fd >= 3 ? fd : undefined;\n};\n/**\n * Create an fd name from its numeric index.\n *\n * @category converting\n * @since 4.0.0\n */\nexport const fdName = fd => `fd${fd}`;\n// =============================================================================\n// Template Parsing\n// =============================================================================\nconst parseTemplates = (templates, expressions) => {\n let tokens = [];\n for (const [index, template] of templates.entries()) {\n tokens = parseTemplate(templates, expressions, tokens, template, index);\n }\n return tokens;\n};\nconst parseTemplate = (templates, expressions, prevTokens, template, index) => {\n const rawTemplate = templates.raw[index];\n if (rawTemplate === undefined) {\n throw new Error(`Invalid backslash sequence: ${templates.raw[index]}`);\n }\n const {\n hasLeadingWhitespace,\n hasTrailingWhitespace,\n tokens\n } = splitByWhitespaces(template, rawTemplate);\n const nextTokens = concatTokens(prevTokens, tokens, hasLeadingWhitespace);\n if (index === expressions.length) {\n return nextTokens;\n }\n const expression = expressions[index];\n const expressionTokens = Array.isArray(expression) ? expression.map(expression => parseExpression(expression)) : [parseExpression(expression)];\n return concatTokens(nextTokens, expressionTokens, hasTrailingWhitespace);\n};\n/**\n * Convert valid expressions defined in a template string command (i.e. using\n * `${expression}` into strings.\n */\nconst parseExpression = expression => {\n const type = typeof expression;\n if (type === \"string\") {\n return expression; // Return strings directly\n }\n return String(expression); // Convert numbers to strings\n};\nconst DELIMITERS = /*#__PURE__*/new Set([\" \", \"\\t\", \"\\r\", \"\\n\"]);\n/**\n * Number of characters in backslash escape sequences: \\0 \\xXX or \\uXXXX\n * \\cX is allowed in RegExps but not in strings\n * Octal sequences are not allowed in strict mode\n */\nconst ESCAPE_LENGTH = {\n x: 3,\n u: 5\n};\n/**\n * Splits a template string by whitespace while also properly handling escape\n * sequences.\n *\n * As an example, let's review the following valid commands:\n *\n * ```ts\n * ChildProcess.exec`echo foo\\n bar`\n * // We should run `[\"echo\", \"foo\\n\", \"bar\"]`\n *\n * ChildProcess.exec`echo foo\n * bar`\n * // We should run `[\"echo\", \"foo\", \"bar]`\n * ```\n *\n * The problem is that when we evaluate the template string for both of the above\n * commands, we will end up with the same string \"echo foo\\n bar\".\n *\n * What we really want is to include the escaped character in the arguments for\n * the first command, since it was written explicitly by the user.\n *\n * This is why also having access to the raw template string is useful - in a\n * template string, there are two representations of the same string:\n * 1. `template` - The processed string (escape sequences are evaluated).\n * 2. `template.raw` - The raw string (escape sequences are literal).\n */\nconst splitByWhitespaces = (template, rawTemplate) => {\n if (rawTemplate.length === 0) {\n return {\n tokens: [],\n hasLeadingWhitespace: false,\n hasTrailingWhitespace: false\n };\n }\n const hasLeadingWhitespace = DELIMITERS.has(rawTemplate[0]);\n const tokens = [];\n // Given that escape sequences will have different lengths in the template\n // versus the raw template, we must maintain two indices:\n // - One for the index into the template string\n // - One for the index into the raw template string\n // We also maintain the current cursor position for where we are in the template\n let templateCursor = 0;\n for (let templateIndex = 0, rawIndex = 0; templateIndex < template.length; templateIndex += 1, rawIndex += 1) {\n // Use the raw template character to check for actual whitespace\n const rawCharacter = rawTemplate[rawIndex];\n if (DELIMITERS.has(rawCharacter)) {\n // Whitespace found, extract token from template if necessary\n if (templateCursor !== templateIndex) {\n tokens.push(template.slice(templateCursor, templateIndex));\n }\n // Advance the template start index to the current position\n templateCursor = templateIndex + 1;\n } else if (rawCharacter === \"\\\\\") {\n // Escape sequence detected, check the next raw character\n const nextRawCharacter = rawTemplate[rawIndex + 1];\n if (nextRawCharacter === \"\\n\") {\n // Handle `\\` character followed by a newline (i.e. a line continuation) by:\n // - Reversing the template index (backslash-newline is erased in template)\n // - Advancing the raw template index past the line continuation\n templateIndex -= 1;\n rawIndex += 1;\n } else if (nextRawCharacter === \"u\" && rawTemplate[rawIndex + 2] === \"{\") {\n // Handle variable-length unicode escape sequences (i.e. `\\u{1F600}`) by:\n // - Advancing the raw template index past the unicode escape sequence\n rawIndex = rawTemplate.indexOf(\"}\", rawIndex + 3);\n } else {\n // Advance raw template index past fixed-length escape sequences:\n // - \\n → 2 chars (backslash + n)\n // - \\t → 2 chars (backslash + t)\n // - \\xHH → 4 chars (backslash + x + H + H)\n // - \\uHHHH → 6 chars (backslash + u + H + H + H + H)\n rawIndex += ESCAPE_LENGTH[nextRawCharacter] ?? 1;\n }\n }\n }\n // Trailing whitespace only exists if the template cursor is equivalent to the\n // length of the template\n const hasTrailingWhitespace = templateCursor === template.length;\n // If we did not end with trailing whitespace, ensure the final token is added\n if (!hasTrailingWhitespace) {\n tokens.push(template.slice(templateCursor));\n }\n return {\n tokens,\n hasLeadingWhitespace,\n hasTrailingWhitespace\n };\n};\n/**\n * Concatenates two separate sets of string tokens together.\n *\n * If either set is empty or `isSeparated=false`, the last element of `prevTokens`\n * and the first element of `nextTokens` will be joined into a single token.\n */\nconst concatTokens = (prevTokens, nextTokens, isSeparated) => isSeparated || prevTokens.length === 0 || nextTokens.length === 0\n// Keep the previous and next tokens separate from one another\n? [...prevTokens, ...nextTokens]\n// Join the last token from the previous set and the first token from the next set\n: [...prevTokens.slice(0, -1), `${prevTokens.at(-1)}${nextTokens.at(0)}`, ...nextTokens.slice(1)];\n//# sourceMappingURL=ChildProcess.js.map","import * as PlatformError from \"effect/PlatformError\";\n/** @internal */\nexport const handleErrnoException = (module, method) => (err, [path]) => {\n let reason = \"Unknown\";\n switch (err.code) {\n case \"ENOENT\":\n reason = \"NotFound\";\n break;\n case \"EACCES\":\n reason = \"PermissionDenied\";\n break;\n case \"EEXIST\":\n reason = \"AlreadyExists\";\n break;\n case \"EISDIR\":\n reason = \"BadResource\";\n break;\n case \"ENOTDIR\":\n reason = \"BadResource\";\n break;\n case \"EBUSY\":\n reason = \"Busy\";\n break;\n case \"ELOOP\":\n reason = \"BadResource\";\n break;\n }\n return PlatformError.systemError({\n _tag: reason,\n module,\n method,\n pathOrDescriptor: path,\n syscall: err.syscall,\n cause: err\n });\n};\n//# sourceMappingURL=utils.js.map","import * as Cause from \"effect/Cause\";\nimport * as Channel from \"effect/Channel\";\nimport * as Effect from \"effect/Effect\";\nimport { identity } from \"effect/Function\";\nimport * as Pull from \"effect/Pull\";\nimport * as Sink from \"effect/Sink\";\n/**\n * Creates a `Sink` that writes chunks to a Node writable stream, respecting\n * backpressure, mapping writable errors with `onError`, and ending the stream\n * on completion unless `endOnDone` is `false`.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fromWritable = options => Sink.fromChannel(Channel.mapDone(fromWritableChannel(options), _ => [_]));\n/**\n * Creates a `Channel` that pulls chunks from upstream and writes them to a\n * Node writable stream, respecting backpressure and optionally ending the\n * writable when upstream is done.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fromWritableChannel = options => Channel.fromTransform(pull => {\n const writable = options.evaluate();\n return Effect.succeed(pullIntoWritable({\n ...options,\n writable,\n pull\n }));\n});\n/**\n * Writes Effect chunks into a Node writable stream.\n *\n * **When to use**\n *\n * Use to implement custom Node stream adapters that already have an upstream\n * pull and need direct control over a writable stream.\n *\n * **Details**\n *\n * The loop waits for `drain` when needed, fails on writable errors, and ends\n * the writable on upstream completion unless `endOnDone` is `false`.\n *\n * @category converting\n * @since 4.0.0\n */\nexport const pullIntoWritable = options => options.pull.pipe(Effect.flatMap(chunk => {\n let i = 0;\n return Effect.callback(function loop(resume) {\n for (; i < chunk.length;) {\n const success = options.writable.write(chunk[i++], options.encoding);\n if (!success) {\n options.writable.once(\"drain\", () => loop(resume));\n return;\n }\n }\n resume(Effect.void);\n });\n}), Effect.forever({\n disableYield: true\n}), Effect.raceFirst(Effect.callback(resume => {\n const onError = error => resume(Effect.fail(options.onError(error)));\n options.writable.once(\"error\", onError);\n return Effect.sync(() => {\n options.writable.off(\"error\", onError);\n });\n})), options.endOnDone !== false ? Pull.catchDone(_ => {\n if (\"closed\" in options.writable && options.writable.closed) {\n return Cause.done(_);\n }\n return Effect.callback(resume => {\n options.writable.once(\"finish\", () => resume(Cause.done(_)));\n options.writable.end();\n });\n}) : identity);\n//# sourceMappingURL=NodeSink.js.map","/**\n * Adapters between Node streams and Effect streams, channels, and readables.\n *\n * This module is the stream boundary for Node APIs. It wraps `Readable` and\n * `Duplex` values as Effect `Stream`s and `Channel`s, pipes Effect streams\n * through Node duplex streams, exposes an Effect `Stream` back to Node as a\n * `Readable`, and collects readable payloads into strings, array buffers, or\n * `Uint8Array`s with optional byte limits.\n *\n * @since 4.0.0\n */\nimport * as Arr from \"effect/Array\";\nimport * as Cause from \"effect/Cause\";\nimport * as Channel from \"effect/Channel\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Fiber from \"effect/Fiber\";\nimport { dual } from \"effect/Function\";\nimport * as Latch from \"effect/Latch\";\nimport * as MutableRef from \"effect/MutableRef\";\nimport * as Pull from \"effect/Pull\";\nimport * as Scope from \"effect/Scope\";\nimport * as Stream from \"effect/Stream\";\nimport { Readable } from \"node:stream\";\nimport { pullIntoWritable } from \"./NodeSink.js\";\n/**\n * Converts a Node readable stream into an Effect `Stream`, reading chunks with\n * an optional chunk size, mapping stream errors with `onError`, and destroying\n * the readable on completion unless `closeOnDone` is `false`.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fromReadable = options => Stream.fromChannel(fromReadableChannel(options));\n/**\n * Creates a `Channel` that pulls chunks from a Node readable stream, mapping\n * errors with `onError` and destroying the readable on completion unless\n * `closeOnDone` is `false`.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fromReadableChannel = options => Channel.fromTransform((_, scope) => readableToPullUnsafe({\n scope,\n readable: options.evaluate(),\n onError: options.onError ?? defaultOnError,\n chunkSize: options.chunkSize,\n closeOnDone: options.closeOnDone\n}));\n/**\n * Creates a `Channel` over a Node `Duplex`, writing upstream chunks with\n * backpressure while emitting chunks read from the duplex and optionally ending\n * the writable side when upstream completes.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fromDuplex = options => Channel.fromTransform((upstream, scope) => {\n const duplex = options.evaluate();\n const exit = MutableRef.make(undefined);\n return pullIntoWritable({\n pull: upstream,\n writable: duplex,\n onError: options.onError ?? defaultOnError,\n endOnDone: options.endOnDone,\n encoding: options.encoding\n }).pipe(Effect.catchCause(cause => {\n if (Pull.isDoneCause(cause)) return Effect.void;\n exit.current = Exit.failCause(cause);\n return Effect.void;\n }), Effect.forkIn(scope), Effect.flatMap(() => readableToPullUnsafe({\n scope,\n exit,\n readable: duplex,\n onError: options.onError ?? defaultOnError,\n chunkSize: options.chunkSize\n })));\n});\n/**\n * Pipes an Effect `Stream` through a Node `Duplex`, writing the stream's\n * chunks to the duplex and emitting chunks read back from it.\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const pipeThroughDuplex = /*#__PURE__*/dual(2, (self, options) => Stream.pipeThroughChannelOrFail(self, fromDuplex(options)));\n/**\n * Pipes a stream of strings or bytes through a Node `Duplex` using default\n * options and `Cause.UnknownError` for stream failures.\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const pipeThroughSimple = /*#__PURE__*/dual(2, (self, duplex) => pipeThroughDuplex(self, {\n evaluate: duplex\n}));\n/**\n * Converts an Effect `Stream` into a Node `Readable`, using the caller's\n * Effect context to run the stream and destroying the readable if the stream\n * fails.\n *\n * @category converting\n * @since 4.0.0\n */\nexport const toReadable = stream => Effect.map(Effect.context(), context => new StreamAdapter(context, stream));\n/**\n * Converts a service-free Effect `Stream` into a Node `Readable` using an\n * empty Effect context.\n *\n * @category converting\n * @since 4.0.0\n */\nexport const toReadableNever = stream => new StreamAdapter(Context.empty(), stream);\n/**\n * Consumes a Node readable stream into a string using the selected encoding,\n * failing through `onError` on stream errors or when `maxBytes` is exceeded\n * and destroying the stream on interruption or failure.\n *\n * @category converting\n * @since 4.0.0\n */\nexport const toString = (readable, options) => {\n const maxBytesNumber = options?.maxBytes ? Number(options.maxBytes) : undefined;\n const onError = options?.onError ?? defaultOnError;\n const encoding = options?.encoding ?? \"utf8\";\n return Effect.callback(resume => {\n const stream = readable();\n stream.setEncoding(encoding);\n stream.once(\"error\", err => {\n if (\"closed\" in stream && !stream.closed) {\n stream.destroy();\n }\n resume(Effect.fail(onError(err)));\n });\n stream.once(\"error\", err => {\n resume(Effect.fail(onError(err)));\n });\n let string = \"\";\n let bytes = 0;\n stream.once(\"end\", () => {\n resume(Effect.succeed(string));\n });\n stream.on(\"data\", chunk => {\n string += chunk;\n bytes += Buffer.byteLength(chunk);\n if (maxBytesNumber && bytes > maxBytesNumber) {\n resume(Effect.fail(onError(new Error(\"maxBytes exceeded\"))));\n }\n });\n return Effect.sync(() => {\n if (\"closed\" in stream && !stream.closed) {\n stream.destroy();\n }\n });\n });\n};\n/**\n * Consumes a Node readable stream into an `ArrayBuffer`, failing through\n * `onError` on stream errors or when `maxBytes` is exceeded and destroying the\n * stream on interruption or failure.\n *\n * @category converting\n * @since 4.0.0\n */\nexport const toArrayBuffer = (readable, options) => {\n const maxBytesNumber = options?.maxBytes ? Number(options.maxBytes) : undefined;\n const onError = options?.onError ?? defaultOnError;\n return Effect.callback(resume => {\n const stream = readable();\n const buffers = [];\n let bytes = 0;\n stream.once(\"error\", err => {\n if (\"closed\" in stream && !stream.closed) {\n stream.destroy();\n }\n resume(Effect.fail(onError(err)));\n });\n stream.once(\"end\", () => {\n const buffer = buffers.length === 1 ? buffers[0] : Buffer.concat(buffers);\n if (buffer.byteOffset === 0 && buffer.buffer.byteLength === buffer.byteLength) {\n return resume(Effect.succeed(buffer.buffer));\n }\n resume(Effect.succeed(buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength)));\n });\n stream.on(\"data\", chunk => {\n buffers.push(chunk);\n bytes += chunk.length;\n if (maxBytesNumber && bytes > maxBytesNumber) {\n resume(Effect.fail(onError(new Error(\"maxBytes exceeded\"))));\n }\n });\n return Effect.sync(() => {\n if (\"closed\" in stream && !stream.closed) {\n stream.destroy();\n }\n });\n });\n};\n/**\n * Consumes a Node readable stream into a `Uint8Array`, using the same error\n * mapping and `maxBytes` handling as `toArrayBuffer`.\n *\n * @category converting\n * @since 4.0.0\n */\nexport const toUint8Array = (readable, options) => Effect.map(toArrayBuffer(readable, options), buffer => new Uint8Array(buffer));\n// ----------------------------------------------------------------------------\n// internal\n// ----------------------------------------------------------------------------\nconst readableToPullUnsafe = options => {\n const readable = options.readable;\n const closeOnDone = options.closeOnDone ?? true;\n const exit = options.exit ?? MutableRef.make(undefined);\n const latch = Latch.makeUnsafe(false);\n function onReadable() {\n latch.openUnsafe();\n }\n function onError(error) {\n exit.current = Exit.fail(options.onError(error));\n latch.openUnsafe();\n }\n function onEnd() {\n exit.current = Exit.fail(Cause.Done());\n latch.openUnsafe();\n }\n readable.on(\"readable\", onReadable);\n readable.once(\"error\", onError);\n readable.once(\"end\", onEnd);\n const pull = Effect.suspend(function loop() {\n let item = options.readable.read(options.chunkSize);\n if (item === null) {\n if (exit.current) {\n return exit.current;\n }\n if (readable.readableEnded) {\n return Effect.fail(Cause.Done());\n }\n latch.closeUnsafe();\n return Effect.flatMap(latch.await, loop);\n }\n const chunk = Arr.of(item);\n while (true) {\n item = options.readable.read(options.chunkSize);\n if (item === null) break;\n chunk.push(item);\n }\n return Effect.succeed(chunk);\n });\n return Effect.as(Scope.addFinalizer(options.scope, Effect.sync(() => {\n readable.off(\"readable\", onReadable);\n readable.off(\"error\", onError);\n readable.off(\"end\", onEnd);\n if (closeOnDone && \"closed\" in options.readable && !options.readable.closed) {\n options.readable.destroy();\n }\n })), pull);\n};\nclass StreamAdapter extends Readable {\n readLatch;\n fiber = undefined;\n constructor(context, stream) {\n super({});\n this.readLatch = Latch.makeUnsafe(false);\n this.fiber = Stream.runForEachArray(stream, chunk => this.readLatch.whenOpen(Effect.sync(() => {\n this.readLatch.closeUnsafe();\n for (let i = 0; i < chunk.length; i++) {\n const item = chunk[i];\n if (typeof item === \"string\") {\n this.push(item, \"utf8\");\n } else {\n this.push(item);\n }\n }\n }))).pipe(this.readLatch.whenOpen, Effect.provideContext(context), Effect.runFork);\n this.fiber.addObserver(exit => {\n this.fiber = undefined;\n if (Exit.isSuccess(exit)) {\n this.push(null);\n } else {\n this.destroy(Cause.squash(exit.cause));\n }\n });\n }\n _read(_size) {\n this.readLatch.openUnsafe();\n }\n _destroy(error, callback) {\n if (!this.fiber) {\n return callback(error);\n }\n Effect.runFork(Fiber.interrupt(this.fiber)).addObserver(exit => {\n callback(exit._tag === \"Failure\" ? Cause.squash(exit.cause) : error);\n });\n }\n}\nconst defaultOnError = error => new Cause.UnknownError(error);\n//# sourceMappingURL=NodeStream.js.map","import * as Deferred from \"effect/Deferred\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Layer from \"effect/Layer\";\nimport * as Path from \"effect/Path\";\nimport * as Predicate from \"effect/Predicate\";\nimport * as Sink from \"effect/Sink\";\nimport * as Stream from \"effect/Stream\";\nimport * as ChildProcess from \"effect/unstable/process/ChildProcess\";\nimport { ChildProcessSpawner, ExitCode, make as makeSpawner, makeHandle, ProcessId } from \"effect/unstable/process/ChildProcessSpawner\";\nimport * as NodeChildProcess from \"node:child_process\";\nimport { PassThrough } from \"node:stream\";\nimport { handleErrnoException } from \"./internal/utils.js\";\nimport * as NodeSink from \"./NodeSink.js\";\nimport * as NodeStream from \"./NodeStream.js\";\nconst toError = error => error instanceof globalThis.Error ? error : new globalThis.Error(String(error));\nconst toPlatformError = (method, error, command) => {\n const {\n commands\n } = flattenCommand(command);\n const commandStr = commands.reduce((acc, curr) => {\n const cmd = `${curr.command} ${curr.args.join(\" \")}`;\n return acc.length === 0 ? cmd : `${acc} | ${cmd}`;\n }, \"\");\n return handleErrnoException(\"ChildProcess\", method)(error, [commandStr]);\n};\nconst make = /*#__PURE__*/Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const resolveWorkingDirectory = Effect.fnUntraced(function* (options) {\n if (Predicate.isUndefined(options.cwd)) return undefined;\n // Validate that the specified directory is accessible\n yield* fs.access(options.cwd);\n return path.resolve(options.cwd);\n });\n const resolveEnvironment = options => {\n return options.extendEnv ? {\n ...globalThis.process.env,\n ...options.env\n } : options.env;\n };\n const inputToStdioOption = input => Stream.isStream(input) ? \"pipe\" : input;\n const outputToStdioOption = input => Sink.isSink(input) ? \"pipe\" : input;\n const resolveStdinOption = options => {\n const defaultConfig = {\n stream: \"pipe\",\n encoding: \"utf-8\",\n endOnDone: true\n };\n if (Predicate.isUndefined(options.stdin)) {\n return defaultConfig;\n }\n if (typeof options.stdin === \"string\") {\n return {\n ...defaultConfig,\n stream: options.stdin\n };\n }\n if (Stream.isStream(options.stdin)) {\n return {\n ...defaultConfig,\n stream: options.stdin\n };\n }\n return {\n stream: options.stdin.stream,\n encoding: options.stdin.encoding ?? defaultConfig.encoding,\n endOnDone: options.stdin.endOnDone ?? defaultConfig.endOnDone\n };\n };\n const resolveOutputOption = (options, streamName) => {\n const option = options[streamName];\n if (Predicate.isUndefined(option)) {\n return {\n stream: \"pipe\"\n };\n }\n if (typeof option === \"string\") {\n return {\n stream: option\n };\n }\n if (Sink.isSink(option)) {\n return {\n stream: option\n };\n }\n return {\n stream: option.stream\n };\n };\n const resolveAdditionalFds = options => {\n if (Predicate.isUndefined(options.additionalFds)) {\n return [];\n }\n const result = [];\n for (const [name, config] of Object.entries(options.additionalFds)) {\n const fd = ChildProcess.parseFdName(name);\n if (Predicate.isNotUndefined(fd)) {\n result.push({\n fd,\n config\n });\n }\n }\n // Sort by fd number to ensure correct ordering\n return result.sort((a, b) => a.fd - b.fd);\n };\n const buildStdioArray = (stdinConfig, stdoutConfig, stderrConfig, additionalFds) => {\n const stdio = [inputToStdioOption(stdinConfig.stream), outputToStdioOption(stdoutConfig.stream), outputToStdioOption(stderrConfig.stream)];\n if (additionalFds.length === 0) {\n return stdio;\n }\n // Find the maximum fd number to size the array correctly\n const maxFd = additionalFds.reduce((max, {\n fd\n }) => Math.max(max, fd), 2);\n // Fill gaps with \"ignore\"\n for (let i = 3; i <= maxFd; i++) {\n stdio[i] = \"ignore\";\n }\n // Set up additional fds as \"pipe\"\n for (const {\n fd\n } of additionalFds) {\n stdio[fd] = \"pipe\";\n }\n return stdio;\n };\n const setupAdditionalFds = Effect.fnUntraced(function* (command, childProcess, additionalFds) {\n if (additionalFds.length === 0) {\n return {\n getInputFd: () => Sink.drain,\n getOutputFd: () => Stream.empty\n };\n }\n const inputSinks = new Map();\n const outputStreams = new Map();\n for (const {\n config,\n fd\n } of additionalFds) {\n const nodeStream = childProcess.stdio[fd];\n switch (config.type) {\n case \"input\":\n {\n // Create a sink to write to for input file descriptors\n let sink = Sink.drain;\n if (nodeStream && \"write\" in nodeStream) {\n sink = NodeSink.fromWritable({\n evaluate: () => nodeStream,\n onError: error => toPlatformError(`fromWritable(fd${fd})`, toError(error), command)\n });\n }\n // If user provided a stream, pipe it into the sink\n if (config.stream) {\n yield* Effect.forkScoped(Stream.run(config.stream, sink));\n }\n inputSinks.set(fd, sink);\n break;\n }\n case \"output\":\n {\n // Create a stream to read from for output file descriptors\n let stream = Stream.empty;\n if (nodeStream && \"read\" in nodeStream) {\n const passThrough = new PassThrough();\n nodeStream.on(\"error\", error => passThrough.destroy(error));\n nodeStream.pipe(passThrough);\n stream = NodeStream.fromReadable({\n evaluate: () => passThrough,\n onError: error => toPlatformError(`fromReadable(fd${fd})`, toError(error), command)\n });\n }\n // If user provided a sink, transduce the stream through it\n if (config.sink) {\n stream = Stream.transduce(stream, config.sink);\n }\n outputStreams.set(fd, stream);\n break;\n }\n }\n }\n return {\n getInputFd: fd => inputSinks.get(fd) ?? Sink.drain,\n getOutputFd: fd => outputStreams.get(fd) ?? Stream.empty\n };\n });\n const setupChildStdin = (command, childProcess, config) => Effect.suspend(() => {\n // If the child process has a standard input stream, connect it to the\n // sink that will attached to the process handle\n let sink = Sink.drain;\n if (Predicate.isNotNull(childProcess.stdin)) {\n sink = NodeSink.fromWritable({\n evaluate: () => childProcess.stdin,\n onError: error => toPlatformError(\"fromWritable(stdin)\", toError(error), command),\n endOnDone: config.endOnDone,\n encoding: config.encoding\n });\n }\n // If the user provided a `Stream`, run it into the stdin sink\n if (Stream.isStream(config.stream)) {\n return Effect.as(Effect.forkScoped(Stream.run(config.stream, sink)), sink);\n }\n return Effect.succeed(sink);\n });\n const setupChildOutputStreams = (command, childProcess, stdoutConfig, stderrConfig) => {\n let stdout = childProcess.stdout ? (() => {\n const passThrough = new PassThrough();\n childProcess.stdout.on(\"error\", error => passThrough.destroy(error));\n childProcess.stdout.pipe(passThrough);\n return NodeStream.fromReadable({\n evaluate: () => passThrough,\n onError: error => toPlatformError(\"fromReadable(stdout)\", toError(error), command)\n });\n })() : Stream.empty;\n let stderr = childProcess.stderr ? (() => {\n const passThrough = new PassThrough();\n childProcess.stderr.on(\"error\", error => passThrough.destroy(error));\n childProcess.stderr.pipe(passThrough);\n return NodeStream.fromReadable({\n evaluate: () => passThrough,\n onError: error => toPlatformError(\"fromReadable(stderr)\", toError(error), command)\n });\n })() : Stream.empty;\n if (Sink.isSink(stdoutConfig.stream)) {\n stdout = Stream.transduce(stdout, stdoutConfig.stream);\n }\n if (Sink.isSink(stderrConfig.stream)) {\n stderr = Stream.transduce(stderr, stderrConfig.stream);\n }\n const all = Stream.merge(stdout, stderr);\n return {\n stdout,\n stderr,\n all\n };\n };\n const spawn = (command, spawnOptions) => Effect.callback(resume => {\n const deferred = Deferred.makeUnsafe();\n const handle = NodeChildProcess.spawn(command.command, command.args, spawnOptions);\n handle.on(\"error\", error => {\n resume(Effect.fail(toPlatformError(\"spawn\", error, command)));\n });\n handle.on(\"exit\", (...args) => {\n Deferred.doneUnsafe(deferred, Exit.succeed(args));\n });\n handle.on(\"spawn\", () => {\n resume(Effect.succeed([handle, deferred]));\n });\n return Effect.sync(() => {\n handle.kill(\"SIGTERM\");\n });\n });\n const killProcessGroup = (command, childProcess, signal) => {\n if (globalThis.process.platform === \"win32\") {\n return Effect.callback(resume => {\n NodeChildProcess.exec(`taskkill /pid ${childProcess.pid} /T /F`, error => {\n if (error) {\n resume(Effect.fail(toPlatformError(\"kill\", toError(error), command)));\n } else {\n resume(Effect.void);\n }\n });\n });\n }\n return Effect.try({\n try: () => {\n globalThis.process.kill(-childProcess.pid, signal);\n },\n catch: error => toPlatformError(\"kill\", toError(error), command)\n });\n };\n const killProcessGroupOnExit = (childProcess, signal) => {\n if (globalThis.process.platform === \"win32\") {\n NodeChildProcess.exec(`taskkill /pid ${childProcess.pid} /T /F`, () => {\n // ignore errors during best-effort cleanup\n });\n return;\n }\n try {\n globalThis.process.kill(-childProcess.pid, signal);\n } catch {\n // ignore errors during best-effort cleanup\n }\n };\n const killProcess = (command, childProcess, signal) => Effect.suspend(() => {\n const killed = childProcess.kill(signal);\n if (!killed) {\n const error = new globalThis.Error(\"Failed to kill child process\");\n return Effect.fail(toPlatformError(\"kill\", error, command));\n }\n return Effect.void;\n });\n const withTimeout = (childProcess, command, options) => kill => {\n const killSignal = options?.killSignal ?? \"SIGTERM\";\n return Predicate.isUndefined(options?.forceKillAfter) ? kill(command, childProcess, killSignal) : Effect.timeoutOrElse(kill(command, childProcess, killSignal), {\n duration: options.forceKillAfter,\n orElse: () => kill(command, childProcess, \"SIGKILL\")\n });\n };\n /**\n * Get the appropriate source stream from a process handle based on the\n * `from` pipe option.\n */\n const getSourceStream = (handle, from) => {\n const fromOption = from ?? \"stdout\";\n switch (fromOption) {\n case \"stdout\":\n return handle.stdout;\n case \"stderr\":\n return handle.stderr;\n case \"all\":\n return handle.all;\n default:\n {\n // Handle fd3, fd4, etc.\n const fd = ChildProcess.parseFdName(fromOption);\n if (Predicate.isNotUndefined(fd)) {\n return handle.getOutputFd(fd);\n }\n // Fallback to stdout for invalid fd names\n return handle.stdout;\n }\n }\n };\n const spawnCommand = Effect.fnUntraced(function* (cmd) {\n switch (cmd._tag) {\n case \"StandardCommand\":\n {\n const stdinConfig = resolveStdinOption(cmd.options);\n const stdoutConfig = resolveOutputOption(cmd.options, \"stdout\");\n const stderrConfig = resolveOutputOption(cmd.options, \"stderr\");\n const resolvedAdditionalFds = resolveAdditionalFds(cmd.options);\n let isReferenced = true;\n const cwd = yield* resolveWorkingDirectory(cmd.options);\n const env = resolveEnvironment(cmd.options);\n const stdio = buildStdioArray(stdinConfig, stdoutConfig, stderrConfig, resolvedAdditionalFds);\n const [childProcess, exitSignal] = yield* Effect.acquireRelease(spawn(cmd, {\n cwd,\n env,\n stdio,\n detached: cmd.options.detached ?? process.platform !== \"win32\",\n shell: cmd.options.shell\n }), Effect.fnUntraced(function* ([childProcess, exitSignal]) {\n const exited = yield* Deferred.isDone(exitSignal);\n const killWithTimeout = withTimeout(childProcess, cmd, cmd.options);\n if (exited) {\n // Process already exited, check if children need cleanup\n const [code] = yield* Deferred.await(exitSignal);\n if (code !== 0 && Predicate.isNotNull(code)) {\n // Non-zero exit code ,attempt to clean up process group\n return yield* Effect.ignore(killWithTimeout(killProcessGroup));\n }\n return yield* Effect.void;\n }\n if (!isReferenced) {\n return yield* Effect.void;\n }\n // Process is still running, kill it\n return yield* killWithTimeout((command, childProcess, signal) => Effect.catch(killProcessGroup(command, childProcess, signal), () => killProcess(command, childProcess, signal))).pipe(Effect.andThen(Deferred.await(exitSignal)), Effect.ignore);\n }));\n const pid = ProcessId(childProcess.pid);\n childProcess.on(\"exit\", code => {\n if (code !== 0 && Predicate.isNotNull(code)) {\n killProcessGroupOnExit(childProcess, cmd.options.killSignal ?? \"SIGTERM\");\n }\n });\n const reref = Effect.sync(() => {\n if (!isReferenced) {\n childProcess.ref();\n isReferenced = true;\n }\n });\n const unref = Effect.sync(() => {\n if (isReferenced) {\n childProcess.unref();\n isReferenced = false;\n }\n return reref;\n });\n const stdin = yield* setupChildStdin(cmd, childProcess, stdinConfig);\n const {\n all,\n stderr,\n stdout\n } = setupChildOutputStreams(cmd, childProcess, stdoutConfig, stderrConfig);\n const {\n getInputFd,\n getOutputFd\n } = yield* setupAdditionalFds(cmd, childProcess, resolvedAdditionalFds);\n const isRunning = Effect.map(Deferred.isDone(exitSignal), done => !done);\n const exitCode = Effect.flatMap(Deferred.await(exitSignal), ([code, signal]) => {\n if (Predicate.isNotNull(code)) {\n return Effect.succeed(ExitCode(code));\n }\n // If code is `null`, then `signal` must be defined. See the NodeJS\n // documentation for the `\"exit\"` event on a `child_process`.\n // https://nodejs.org/api/child_process.html#child_process_event_exit\n const error = new globalThis.Error(`Process interrupted due to receipt of signal: '${signal}'`);\n return Effect.fail(toPlatformError(\"exitCode\", error, cmd));\n });\n const kill = options => {\n const killWithTimeout = withTimeout(childProcess, cmd, options);\n return killWithTimeout((command, childProcess, signal) => Effect.catch(killProcessGroup(command, childProcess, signal), () => killProcess(command, childProcess, signal))).pipe(Effect.andThen(Deferred.await(exitSignal)), Effect.asVoid);\n };\n return makeHandle({\n pid,\n exitCode,\n isRunning,\n kill,\n stdin,\n stdout,\n stderr,\n all,\n getInputFd,\n getOutputFd,\n unref\n });\n }\n case \"PipedCommand\":\n {\n const {\n commands,\n pipeOptions\n } = flattenCommand(cmd);\n const [root, ...pipeline] = commands;\n const handles = [yield* spawnCommand(root)];\n for (let i = 0; i < pipeline.length; i++) {\n const command = pipeline[i];\n const options = pipeOptions[i] ?? {};\n const stdinConfig = resolveStdinOption(command.options);\n // Get the appropriate stream from the source based on `from` option\n const sourceStream = Stream.unwrap(Effect.succeed(getSourceStream(handles[handles.length - 1], options.from)));\n // Determine where to pipe: stdin or custom fd\n const toOption = options.to ?? \"stdin\";\n if (toOption === \"stdin\") {\n // Pipe to stdin (default behavior)\n handles.push(yield* spawnCommand(ChildProcess.make(command.command, command.args, {\n ...command.options,\n stdin: {\n ...stdinConfig,\n stream: sourceStream\n }\n })));\n } else {\n // Pipe to custom fd (fd3, fd4, etc.)\n const fd = ChildProcess.parseFdName(toOption);\n if (Predicate.isNotUndefined(fd)) {\n const fdName = ChildProcess.fdName(fd);\n const existingFds = command.options.additionalFds ?? {};\n handles.push(yield* spawnCommand(ChildProcess.make(command.command, command.args, {\n ...command.options,\n additionalFds: {\n ...existingFds,\n [fdName]: {\n type: \"input\",\n stream: sourceStream\n }\n }\n })));\n } else {\n // Invalid fd name, fall back to stdin\n handles.push(yield* spawnCommand(ChildProcess.make(command.command, command.args, {\n ...command.options,\n stdin: {\n ...stdinConfig,\n stream: sourceStream\n }\n })));\n }\n }\n }\n const handle = handles[handles.length - 1];\n const unref = Effect.gen(function* () {\n const rerefs = [];\n for (const handle of handles) {\n rerefs.push(yield* handle.unref);\n }\n return Effect.forEach([...rerefs].reverse(), reref => reref, {\n discard: true\n });\n });\n return makeHandle({\n pid: handle.pid,\n exitCode: handle.exitCode,\n isRunning: handle.isRunning,\n kill: handle.kill,\n stdin: handle.stdin,\n stdout: handle.stdout,\n stderr: handle.stderr,\n all: handle.all,\n getInputFd: handle.getInputFd,\n getOutputFd: handle.getOutputFd,\n unref\n });\n }\n }\n });\n return makeSpawner(spawnCommand);\n});\n/**\n * Layer that provides the `NodeChildProcessSpawner` implementation.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = /*#__PURE__*/Layer.effect(ChildProcessSpawner, make);\n/**\n * Flattens a `Command` into an array of `StandardCommand`s along with pipe\n * options for each connection.\n *\n * @category transforming\n * @since 4.0.0\n */\nexport const flattenCommand = command => {\n const commands = [];\n const pipeOptions = [];\n const flatten = cmd => {\n switch (cmd._tag) {\n case \"StandardCommand\":\n {\n commands.push(cmd);\n break;\n }\n case \"PipedCommand\":\n {\n // Recursively flatten left side first\n flatten(cmd.left);\n // Store the pipe options for this connection\n pipeOptions.push(cmd.options);\n // Then flatten right side\n flatten(cmd.right);\n break;\n }\n }\n };\n flatten(command);\n // The commands array is guaranteed to be non-empty since we always have at\n // least one command in the input. We validate this at runtime and return a\n // properly typed tuple.\n if (commands.length === 0) {\n // This should never happen given a valid Command input\n throw new Error(\"flattenCommand produced empty commands array\");\n }\n const [first, ...rest] = commands;\n const nonEmptyCommands = [first, ...rest];\n return {\n commands: nonEmptyCommands,\n pipeOptions\n };\n};\n//# sourceMappingURL=NodeChildProcessSpawner.js.map","/**\n * Shared Node-compatible implementation of Effect's `FileSystem` service.\n *\n * This module adapts Node's `node:fs`, `node:os`, and `node:path` APIs into a\n * `FileSystem` layer for Effect programs running on Node-compatible runtimes.\n * Platform packages use it to provide file and directory I/O, permissions,\n * links, metadata, temporary files and directories, and file watching through\n * the shared `FileSystem` service.\n *\n * @since 4.0.0\n */\nimport * as Cause from \"effect/Cause\";\nimport * as Effect from \"effect/Effect\";\nimport { effectify } from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport { pipe } from \"effect/Function\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport * as Error from \"effect/PlatformError\";\nimport * as Queue from \"effect/Queue\";\nimport * as Stream from \"effect/Stream\";\nimport * as Crypto from \"node:crypto\";\nimport * as NFS from \"node:fs\";\nimport * as OS from \"node:os\";\nimport * as Path from \"node:path\";\nimport { handleErrnoException } from \"./internal/utils.js\";\nconst handleBadArgument = method => err => Error.badArgument({\n module: \"FileSystem\",\n method,\n description: err.message ?? String(err)\n});\n// == access\nconst access = /*#__PURE__*/(() => {\n const nodeAccess = /*#__PURE__*/effectify(NFS.access, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"access\"), /*#__PURE__*/handleBadArgument(\"access\"));\n return (path, options) => {\n let mode = NFS.constants.F_OK;\n if (options?.readable) {\n mode |= NFS.constants.R_OK;\n }\n if (options?.writable) {\n mode |= NFS.constants.W_OK;\n }\n return nodeAccess(path, mode);\n };\n})();\n// == copy\nconst copy = /*#__PURE__*/(() => {\n const nodeCp = /*#__PURE__*/effectify(NFS.cp, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"copy\"), /*#__PURE__*/handleBadArgument(\"copy\"));\n return (fromPath, toPath, options) => nodeCp(fromPath, toPath, {\n force: options?.overwrite ?? false,\n preserveTimestamps: options?.preserveTimestamps ?? false,\n recursive: true\n });\n})();\n// == copyFile\nconst copyFile = /*#__PURE__*/(() => {\n const nodeCopyFile = /*#__PURE__*/effectify(NFS.copyFile, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"copyFile\"), /*#__PURE__*/handleBadArgument(\"copyFile\"));\n return (fromPath, toPath) => nodeCopyFile(fromPath, toPath);\n})();\n// == chmod\nconst chmod = /*#__PURE__*/(() => {\n const nodeChmod = /*#__PURE__*/effectify(NFS.chmod, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"chmod\"), /*#__PURE__*/handleBadArgument(\"chmod\"));\n return (path, mode) => nodeChmod(path, mode);\n})();\n// == chown\nconst chown = /*#__PURE__*/(() => {\n const nodeChown = /*#__PURE__*/effectify(NFS.chown, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"chown\"), /*#__PURE__*/handleBadArgument(\"chown\"));\n return (path, uid, gid) => nodeChown(path, uid, gid);\n})();\n// == glob\nconst glob = /*#__PURE__*/(() => {\n const nodeGlob = /*#__PURE__*/effectify(NFS.glob, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"glob\"), /*#__PURE__*/handleBadArgument(\"glob\"));\n return (pattern, options) => nodeGlob(pattern, {\n cwd: options?.root,\n exclude: options?.exclude\n });\n})();\n// == link\nconst link = /*#__PURE__*/(() => {\n const nodeLink = /*#__PURE__*/effectify(NFS.link, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"link\"), /*#__PURE__*/handleBadArgument(\"link\"));\n return (existingPath, newPath) => nodeLink(existingPath, newPath);\n})();\n// == makeDirectory\nconst makeDirectory = /*#__PURE__*/(() => {\n const nodeMkdir = /*#__PURE__*/effectify(NFS.mkdir, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"makeDirectory\"), /*#__PURE__*/handleBadArgument(\"makeDirectory\"));\n return (path, options) => nodeMkdir(path, {\n recursive: options?.recursive ?? false,\n mode: options?.mode\n });\n})();\n// == makeTempDirectory\nconst makeTempDirectoryFactory = method => {\n const nodeMkdtemp = effectify(NFS.mkdtemp, handleErrnoException(\"FileSystem\", method), handleBadArgument(method));\n return options => Effect.suspend(() => {\n const prefix = options?.prefix ?? \"\";\n const directory = typeof options?.directory === \"string\" ? Path.join(options.directory, \".\") : OS.tmpdir();\n return nodeMkdtemp(prefix ? Path.join(directory, prefix) : directory + \"/\");\n });\n};\nconst makeTempDirectory = /*#__PURE__*/makeTempDirectoryFactory(\"makeTempDirectory\");\n// == remove\nconst removeFactory = method => {\n const nodeRm = effectify(NFS.rm, handleErrnoException(\"FileSystem\", method), handleBadArgument(method));\n return (path, options) => nodeRm(path, {\n recursive: options?.recursive ?? false,\n force: options?.force ?? false\n });\n};\nconst remove = /*#__PURE__*/removeFactory(\"remove\");\n// == makeTempDirectoryScoped\nconst makeTempDirectoryScoped = /*#__PURE__*/(() => {\n const makeDirectory = /*#__PURE__*/makeTempDirectoryFactory(\"makeTempDirectoryScoped\");\n const removeDirectory = /*#__PURE__*/removeFactory(\"makeTempDirectoryScoped\");\n return options => Effect.acquireRelease(makeDirectory(options), directory => Effect.orDie(removeDirectory(directory, {\n recursive: true\n })));\n})();\n// == open\nconst openFactory = method => {\n const nodeOpen = effectify(NFS.open, handleErrnoException(\"FileSystem\", method), handleBadArgument(method));\n const nodeClose = effectify(NFS.close, handleErrnoException(\"FileSystem\", method), handleBadArgument(method));\n return (path, options) => pipe(Effect.acquireRelease(nodeOpen(path, options?.flag ?? \"r\", options?.mode), fd => Effect.orDie(nodeClose(fd))), Effect.map(fd => makeFile(FileSystem.FileDescriptor(fd), options?.flag?.startsWith(\"a\") ?? false)));\n};\nconst open = /*#__PURE__*/openFactory(\"open\");\nconst makeFile = /*#__PURE__*/(() => {\n const nodeReadFactory = method => effectify(NFS.read, handleErrnoException(\"FileSystem\", method), handleBadArgument(method));\n const nodeRead = /*#__PURE__*/nodeReadFactory(\"read\");\n const nodeReadAlloc = /*#__PURE__*/nodeReadFactory(\"readAlloc\");\n const nodeStat = /*#__PURE__*/effectify(NFS.fstat, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"stat\"), /*#__PURE__*/handleBadArgument(\"stat\"));\n const nodeTruncate = /*#__PURE__*/effectify(NFS.ftruncate, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"truncate\"), /*#__PURE__*/handleBadArgument(\"truncate\"));\n const nodeSync = /*#__PURE__*/effectify(NFS.fsync, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"sync\"), /*#__PURE__*/handleBadArgument(\"sync\"));\n const nodeWriteFactory = method => effectify(NFS.write, handleErrnoException(\"FileSystem\", method), handleBadArgument(method));\n const nodeWrite = /*#__PURE__*/nodeWriteFactory(\"write\");\n const nodeWriteAll = /*#__PURE__*/nodeWriteFactory(\"writeAll\");\n class FileImpl {\n [FileSystem.FileTypeId];\n fd;\n append;\n position = /*#__PURE__*/BigInt(0);\n constructor(fd, append) {\n this[FileSystem.FileTypeId] = FileSystem.FileTypeId;\n this.fd = fd;\n this.append = append;\n }\n get stat() {\n return Effect.map(nodeStat(this.fd), makeFileInfo);\n }\n get sync() {\n return nodeSync(this.fd);\n }\n seek(offset, from) {\n const offsetSize = FileSystem.Size(offset);\n return Effect.sync(() => {\n if (from === \"start\") {\n this.position = offsetSize;\n } else if (from === \"current\") {\n this.position = this.position + offsetSize;\n }\n return this.position;\n });\n }\n read(buffer) {\n return Effect.suspend(() => {\n const position = this.position;\n return Effect.map(nodeRead(this.fd, {\n buffer,\n position\n }), bytesRead => {\n const sizeRead = FileSystem.Size(bytesRead);\n this.position = position + sizeRead;\n return sizeRead;\n });\n });\n }\n readAlloc(size) {\n const sizeNumber = Number(size);\n return Effect.suspend(() => {\n const buffer = Buffer.allocUnsafeSlow(sizeNumber);\n const position = this.position;\n return Effect.map(nodeReadAlloc(this.fd, {\n buffer,\n position\n }), bytesRead => {\n if (bytesRead === 0) {\n return Option.none();\n }\n this.position = position + BigInt(bytesRead);\n if (bytesRead === sizeNumber) {\n return Option.some(buffer);\n }\n const dst = Buffer.allocUnsafeSlow(bytesRead);\n buffer.copy(dst, 0, 0, bytesRead);\n return Option.some(dst);\n });\n });\n }\n truncate(length) {\n return Effect.map(nodeTruncate(this.fd, length ? Number(length) : undefined), () => {\n if (!this.append) {\n const len = BigInt(length ?? 0);\n if (this.position > len) {\n this.position = len;\n }\n }\n });\n }\n write(buffer) {\n return Effect.suspend(() => {\n const position = this.position;\n return Effect.map(nodeWrite(this.fd, buffer, undefined, undefined, this.append ? undefined : Number(position)), bytesWritten => {\n const sizeWritten = FileSystem.Size(bytesWritten);\n if (!this.append) {\n this.position = position + sizeWritten;\n }\n return sizeWritten;\n });\n });\n }\n writeAllChunk(buffer) {\n return Effect.suspend(() => {\n const position = this.position;\n return Effect.flatMap(nodeWriteAll(this.fd, buffer, undefined, undefined, this.append ? undefined : Number(position)), bytesWritten => {\n if (bytesWritten === 0) {\n return Effect.fail(Error.systemError({\n module: \"FileSystem\",\n method: \"writeAll\",\n _tag: \"WriteZero\",\n pathOrDescriptor: this.fd,\n description: \"write returned 0 bytes written\"\n }));\n }\n if (!this.append) {\n this.position = position + BigInt(bytesWritten);\n }\n return bytesWritten < buffer.length ? this.writeAllChunk(buffer.subarray(bytesWritten)) : Effect.void;\n });\n });\n }\n writeAll(buffer) {\n return this.writeAllChunk(buffer);\n }\n }\n return (fd, append) => new FileImpl(fd, append);\n})();\n// == makeTempFile\nconst makeTempFileFactory = method => {\n const makeDirectory = makeTempDirectoryFactory(method);\n return Effect.fnUntraced(function* (options) {\n const directory = yield* makeDirectory(options);\n const random = Crypto.randomBytes(6).toString(\"hex\");\n const name = Path.join(directory, options?.suffix ? `${random}${options.suffix}` : random);\n yield* writeFile(name, new Uint8Array(0));\n return name;\n });\n};\nconst makeTempFile = /*#__PURE__*/makeTempFileFactory(\"makeTempFile\");\n// == makeTempFileScoped\nconst makeTempFileScoped = /*#__PURE__*/(() => {\n const makeFile = /*#__PURE__*/makeTempFileFactory(\"makeTempFileScoped\");\n const removeDirectory = /*#__PURE__*/removeFactory(\"makeTempFileScoped\");\n return options => Effect.acquireRelease(makeFile(options), file => Effect.orDie(removeDirectory(Path.dirname(file), {\n recursive: true\n })));\n})();\n// == readDirectory\nconst readDirectory = (path, options) => Effect.tryPromise({\n try: () => NFS.promises.readdir(path, options),\n catch: err => handleErrnoException(\"FileSystem\", \"readDirectory\")(err, [path])\n});\n// == readFile\nconst readFile = path => Effect.callback((resume, signal) => {\n try {\n NFS.readFile(path, {\n signal\n }, (err, data) => {\n if (err) {\n resume(Effect.fail(handleErrnoException(\"FileSystem\", \"readFile\")(err, [path])));\n } else {\n resume(Effect.succeed(data));\n }\n });\n } catch (err) {\n resume(Effect.fail(handleBadArgument(\"readFile\")(err)));\n }\n});\n// == readLink\nconst readLink = /*#__PURE__*/(() => {\n const nodeReadLink = /*#__PURE__*/effectify(NFS.readlink, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"readLink\"), /*#__PURE__*/handleBadArgument(\"readLink\"));\n return path => nodeReadLink(path);\n})();\n// == realPath\nconst realPath = /*#__PURE__*/(() => {\n const nodeRealPath = /*#__PURE__*/effectify(NFS.realpath, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"realPath\"), /*#__PURE__*/handleBadArgument(\"realPath\"));\n return path => nodeRealPath(path);\n})();\n// == rename\nconst rename = /*#__PURE__*/(() => {\n const nodeRename = /*#__PURE__*/effectify(NFS.rename, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"rename\"), /*#__PURE__*/handleBadArgument(\"rename\"));\n return (oldPath, newPath) => nodeRename(oldPath, newPath);\n})();\n// == stat\nconst makeFileInfo = stat => ({\n type: stat.isFile() ? \"File\" : stat.isDirectory() ? \"Directory\" : stat.isSymbolicLink() ? \"SymbolicLink\" : stat.isBlockDevice() ? \"BlockDevice\" : stat.isCharacterDevice() ? \"CharacterDevice\" : stat.isFIFO() ? \"FIFO\" : stat.isSocket() ? \"Socket\" : \"Unknown\",\n mtime: Option.fromNullishOr(stat.mtime),\n atime: Option.fromNullishOr(stat.atime),\n birthtime: Option.fromNullishOr(stat.birthtime),\n dev: stat.dev,\n rdev: Option.fromNullishOr(stat.rdev),\n ino: Option.fromNullishOr(stat.ino),\n mode: stat.mode,\n nlink: Option.fromNullishOr(stat.nlink),\n uid: Option.fromNullishOr(stat.uid),\n gid: Option.fromNullishOr(stat.gid),\n size: FileSystem.Size(stat.size),\n blksize: stat.blksize !== undefined ? Option.some(FileSystem.Size(stat.blksize)) : Option.none(),\n blocks: Option.fromNullishOr(stat.blocks)\n});\nconst stat = /*#__PURE__*/(() => {\n const nodeStat = /*#__PURE__*/effectify(NFS.stat, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"stat\"), /*#__PURE__*/handleBadArgument(\"stat\"));\n return path => Effect.map(nodeStat(path), makeFileInfo);\n})();\n// == symlink\nconst symlink = /*#__PURE__*/(() => {\n const nodeSymlink = /*#__PURE__*/effectify(NFS.symlink, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"symlink\"), /*#__PURE__*/handleBadArgument(\"symlink\"));\n return (target, path) => nodeSymlink(target, path);\n})();\n// == truncate\nconst truncate = /*#__PURE__*/(() => {\n const nodeTruncate = /*#__PURE__*/effectify(NFS.truncate, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"truncate\"), /*#__PURE__*/handleBadArgument(\"truncate\"));\n return (path, length) => nodeTruncate(path, length !== undefined ? Number(length) : undefined);\n})();\n// == utimes\nconst utimes = /*#__PURE__*/(() => {\n const nodeUtimes = /*#__PURE__*/effectify(NFS.utimes, /*#__PURE__*/handleErrnoException(\"FileSystem\", \"utime\"), /*#__PURE__*/handleBadArgument(\"utime\"));\n return (path, atime, mtime) => nodeUtimes(path, atime, mtime);\n})();\n// == watch\nconst watchNode = path => Stream.callback(queue => Effect.acquireRelease(Effect.sync(() => {\n const watcher = NFS.watch(path, {\n recursive: true\n }, (event, path) => {\n if (!path) return;\n switch (event) {\n case \"rename\":\n {\n Effect.runFork(Effect.matchEffect(stat(path), {\n onSuccess: _ => Queue.offer(queue, {\n _tag: \"Create\",\n path\n }),\n onFailure: _ => Queue.offer(queue, {\n _tag: \"Remove\",\n path\n })\n }));\n return;\n }\n case \"change\":\n {\n Queue.offerUnsafe(queue, {\n _tag: \"Update\",\n path\n });\n return;\n }\n }\n });\n watcher.on(\"error\", error => {\n Queue.failCauseUnsafe(queue, Cause.fail(Error.systemError({\n module: \"FileSystem\",\n _tag: \"Unknown\",\n method: \"watch\",\n pathOrDescriptor: path,\n cause: error\n })));\n });\n watcher.on(\"close\", () => {\n Queue.endUnsafe(queue);\n });\n return watcher;\n}), watcher => Effect.sync(() => watcher.close())));\nconst watch = (backend, path) => stat(path).pipe(Effect.map(stat => backend.pipe(Option.flatMap(_ => _.register(path, stat)), Option.getOrElse(() => watchNode(path)))), Stream.unwrap);\n// == writeFile\nconst writeFile = (path, data, options) => Effect.callback((resume, signal) => {\n try {\n NFS.writeFile(path, data, {\n signal,\n flag: options?.flag,\n mode: options?.mode\n }, err => {\n if (err) {\n resume(Effect.fail(handleErrnoException(\"FileSystem\", \"writeFile\")(err, [path])));\n } else {\n resume(Effect.void);\n }\n });\n } catch (err) {\n resume(Effect.fail(handleBadArgument(\"writeFile\")(err)));\n }\n});\nconst makeFileSystem = /*#__PURE__*/Effect.map(/*#__PURE__*/Effect.serviceOption(FileSystem.WatchBackend), backend => FileSystem.make({\n access,\n chmod,\n chown,\n copy,\n copyFile,\n glob,\n link,\n makeDirectory,\n makeTempDirectory,\n makeTempDirectoryScoped,\n makeTempFile,\n makeTempFileScoped,\n open,\n readDirectory,\n readFile,\n readLink,\n realPath,\n remove,\n rename,\n stat,\n symlink,\n truncate,\n utimes,\n watch(path) {\n return watch(backend, path);\n },\n writeFile\n}));\n/**\n * Provides the `FileSystem` service backed by Node filesystem APIs, including\n * file operations, directory operations, links, metadata, and file watching.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = /*#__PURE__*/Layer.effect(FileSystem.FileSystem)(makeFileSystem);\n//# sourceMappingURL=NodeFileSystem.js.map","/**\n * Node.js `FileSystem` layer for programs that perform real filesystem I/O.\n *\n * The exported layer satisfies the platform-independent `FileSystem` service\n * with Node-backed operations for files, directories, metadata, permissions,\n * links, temporary paths, and path watching. Effects still call the service from\n * `effect/FileSystem`; this module only chooses the Node implementation.\n *\n * @since 4.0.0\n */\nimport * as NodeFileSystem from \"@effect/platform-node-shared/NodeFileSystem\";\n/**\n * Provides the `FileSystem` service backed by Node filesystem APIs.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = NodeFileSystem.layer;\n//# sourceMappingURL=NodeFileSystem.js.map","/**\n * Node-compatible implementation of Effect's `Crypto` service.\n *\n * This module builds the service from `node:crypto`, using `randomBytes` for\n * random data and `createHash` for supported digest algorithms. It exports\n * `make` as the concrete service value and `layer` for providing it through\n * Effect context.\n *\n * @since 1.0.0\n */\nimport * as EffectCrypto from \"effect/Crypto\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as PlatformError from \"effect/PlatformError\";\nimport * as NodeCrypto from \"node:crypto\";\nconst toHashAlgorithm = algorithm => {\n switch (algorithm) {\n case \"SHA-1\":\n return \"sha1\";\n case \"SHA-256\":\n return \"sha256\";\n case \"SHA-384\":\n return \"sha384\";\n case \"SHA-512\":\n return \"sha512\";\n }\n};\nconst digest = (algorithm, data) => Effect.try({\n try: () => Uint8Array.from(NodeCrypto.createHash(toHashAlgorithm(algorithm)).update(data).digest()),\n catch: cause => PlatformError.systemError({\n module: \"Crypto\",\n method: \"digest\",\n _tag: \"Unknown\",\n description: \"Could not compute digest\",\n cause\n })\n});\n/**\n * The default Node.js Crypto service implementation.\n *\n * @category constructors\n * @since 1.0.0\n */\nexport const make = /*#__PURE__*/EffectCrypto.make({\n randomBytes: NodeCrypto.randomBytes,\n digest\n});\n/**\n * Layer that provides the Node.js Crypto service implementation.\n *\n * @category layers\n * @since 1.0.0\n */\nexport const layer = /*#__PURE__*/Layer.succeed(EffectCrypto.Crypto, make);\n//# sourceMappingURL=NodeCrypto.js.map","/**\n * The `NodeCrypto` module provides the Node.js `Crypto` service layer for\n * Effect programs. Provide {@link layer} at the edge of a Node application,\n * CLI, script, or test to satisfy `effect/Crypto` with Node's `node:crypto`\n * implementation for secure random bytes, UUID generation, random values, and\n * SHA digest operations.\n *\n * This module is the public Node adapter around the shared Node-compatible\n * implementation. Digest failures are reported as platform errors, and SHA-1\n * remains available only for interoperability with existing protocols.\n *\n * @since 1.0.0\n */\nimport * as NodeCrypto from \"@effect/platform-node-shared/NodeCrypto\";\n/**\n * Layer that provides the Node.js Crypto service implementation.\n *\n * @category layers\n * @since 1.0.0\n */\nexport const layer = NodeCrypto.layer;\n//# sourceMappingURL=NodeCrypto.js.map","/**\n * Node-backed provider for Effect's `Path` service.\n *\n * This module turns Node's `node:path` and `node:url` APIs into `Path` layers.\n * `layer` uses the host platform path implementation, while `layerPosix` and\n * `layerWin32` provide fixed POSIX and Windows variants. All three layers also\n * include helpers for converting between file paths and file URLs.\n *\n * @since 4.0.0\n */\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport { Path, TypeId } from \"effect/Path\";\nimport { BadArgument } from \"effect/PlatformError\";\nimport * as NodePath from \"node:path\";\nimport * as NodeUrl from \"node:url\";\nconst fromFileUrl = url => Effect.try({\n try: () => NodeUrl.fileURLToPath(url),\n catch: cause => new BadArgument({\n module: \"Path\",\n method: \"fromFileUrl\",\n cause\n })\n});\nconst toFileUrl = path => Effect.try({\n try: () => NodeUrl.pathToFileURL(path),\n catch: cause => new BadArgument({\n module: \"Path\",\n method: \"toFileUrl\",\n cause\n })\n});\n/**\n * Provides the `Path` service using Node's POSIX path implementation plus\n * file URL conversion helpers.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layerPosix = /*#__PURE__*/Layer.succeed(Path)({\n [TypeId]: TypeId,\n ...NodePath.posix,\n fromFileUrl,\n toFileUrl\n});\n/**\n * Provides the `Path` service using Node's Windows path implementation plus\n * file URL conversion helpers.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layerWin32 = /*#__PURE__*/Layer.succeed(Path)({\n [TypeId]: TypeId,\n ...NodePath.win32,\n fromFileUrl,\n toFileUrl\n});\n/**\n * Provides the default `Path` service using the host platform's Node path\n * implementation plus file URL conversion helpers.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = /*#__PURE__*/Layer.succeed(Path)({\n [TypeId]: TypeId,\n ...NodePath,\n fromFileUrl,\n toFileUrl\n});\n//# sourceMappingURL=NodePath.js.map","/**\n * Node.js layers for Effect's `Path` service.\n *\n * This module provides the default, POSIX, and Windows variants of the\n * platform-independent `Path` service by reusing the shared Node path\n * implementation. The provided path services include Node file URL conversion\n * behavior.\n *\n * @since 4.0.0\n */\nimport * as NodePath from \"@effect/platform-node-shared/NodePath\";\n/**\n * Provides the default Node `Path` service using the platform's `node:path`\n * implementation.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = NodePath.layer;\n/**\n * Provides the `Path` service using Node's POSIX path implementation,\n * regardless of the host platform.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layerPosix = NodePath.layerPosix;\n/**\n * Provides the `Path` service using Node's Windows path implementation,\n * regardless of the host platform.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layerWin32 = NodePath.layerWin32;\n//# sourceMappingURL=NodePath.js.map","/**\n * Shared Node.js implementation of the Effect `Stdio` service.\n *\n * `NodeStdio` provides {@link Stdio.Stdio} from the current Node process. The\n * exported {@link layer} reads command-line arguments from `process.argv`,\n * consumes input from `process.stdin`, and writes normal and error output to\n * `process.stdout` and `process.stderr`. Standard input remains open, and\n * standard output and error output are not ended unless requested.\n *\n * @since 4.0.0\n */\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport { systemError } from \"effect/PlatformError\";\nimport * as Stdio from \"effect/Stdio\";\nimport { fromWritable } from \"./NodeSink.js\";\nimport { fromReadable } from \"./NodeStream.js\";\n/**\n * Provides `Stdio` from `process.argv`, `process.stdin`, `process.stdout`,\n * and `process.stderr`; stdin remains open and stdout/stderr are not ended by\n * default.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = /*#__PURE__*/Layer.succeed(Stdio.Stdio, /*#__PURE__*/Stdio.make({\n args: /*#__PURE__*/Effect.sync(() => process.argv.slice(2)),\n stdout: options => fromWritable({\n evaluate: () => process.stdout,\n onError: cause => systemError({\n module: \"Stdio\",\n method: \"stdout\",\n _tag: \"Unknown\",\n cause\n }),\n endOnDone: options?.endOnDone ?? false\n }),\n stderr: options => fromWritable({\n evaluate: () => process.stderr,\n onError: cause => systemError({\n module: \"Stdio\",\n method: \"stderr\",\n _tag: \"Unknown\",\n cause\n }),\n endOnDone: options?.endOnDone ?? false\n }),\n stdin: /*#__PURE__*/fromReadable({\n evaluate: () => process.stdin,\n onError: cause => systemError({\n module: \"Stdio\",\n method: \"stdin\",\n _tag: \"Unknown\",\n cause\n }),\n closeOnDone: false\n })\n}));\n//# sourceMappingURL=NodeStdio.js.map","/**\n * Node.js `Stdio` layer for the current process.\n *\n * The exported layer reuses the shared Node stdio implementation. It satisfies\n * the platform-independent `Stdio` service by reading command-line arguments\n * from `process.argv`, consuming input from `process.stdin`, and writing output\n * streams to `process.stdout` and `process.stderr`.\n *\n * @since 4.0.0\n */\nimport * as NodeStdio from \"@effect/platform-node-shared/NodeStdio\";\n/**\n * Provides the `Stdio` service backed by the current process arguments,\n * stdin, stdout, and stderr streams.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = NodeStdio.layer;\n//# sourceMappingURL=NodeStdio.js.map","import * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport { badArgument } from \"effect/PlatformError\";\nimport * as Predicate from \"effect/Predicate\";\nimport * as Queue from \"effect/Queue\";\nimport * as RcRef from \"effect/RcRef\";\nimport * as Terminal from \"effect/Terminal\";\nimport * as readline from \"node:readline\";\n/**\n * Creates a scoped process-backed `Terminal` using Node `readline`, enabling\n * TTY raw mode while in scope and using the supplied predicate to decide when\n * key input should end.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const make = /*#__PURE__*/Effect.fnUntraced(function* (shouldQuit = defaultShouldQuit) {\n const stdin = process.stdin;\n const stdout = process.stdout;\n // Acquire readline interface with TTY setup/cleanup inside the scope\n const rlRef = yield* RcRef.make({\n acquire: Effect.acquireRelease(Effect.sync(() => {\n const rl = readline.createInterface({\n input: stdin,\n escapeCodeTimeout: 50\n });\n readline.emitKeypressEvents(stdin, rl);\n if (stdin.isTTY) {\n stdin.setRawMode(true);\n }\n return rl;\n }), rl => Effect.sync(() => {\n if (stdin.isTTY) {\n stdin.setRawMode(false);\n }\n rl.close();\n }))\n });\n const columns = Effect.sync(() => stdout.columns ?? 0);\n const rows = Effect.sync(() => stdout.rows ?? 0);\n const readInput = Effect.gen(function* () {\n yield* RcRef.get(rlRef);\n const queue = yield* Queue.make();\n const handleKeypress = (s, k) => {\n const userInput = {\n input: Option.fromUndefinedOr(s),\n key: {\n name: k.name ?? \"\",\n ctrl: !!k.ctrl,\n meta: !!k.meta,\n shift: !!k.shift\n }\n };\n Queue.offerUnsafe(queue, userInput);\n if (shouldQuit(userInput)) {\n Queue.endUnsafe(queue);\n }\n };\n yield* Effect.addFinalizer(() => Effect.sync(() => stdin.off(\"keypress\", handleKeypress)));\n stdin.on(\"keypress\", handleKeypress);\n return queue;\n });\n const readLine = Effect.scoped(Effect.flatMap(RcRef.get(rlRef), readlineInterface => Effect.callback(resume => {\n const onLine = line => resume(Effect.succeed(line));\n readlineInterface.once(\"line\", onLine);\n return Effect.sync(() => readlineInterface.off(\"line\", onLine));\n })));\n const display = prompt => Effect.uninterruptible(Effect.callback(resume => {\n stdout.write(prompt, err => Predicate.isNullish(err) ? resume(Effect.void) : resume(Effect.fail(badArgument({\n module: \"Terminal\",\n method: \"display\",\n description: \"Failed to write prompt to stdout\",\n cause: err\n }))));\n }));\n return Terminal.make({\n columns,\n rows,\n readInput,\n readLine,\n display\n });\n});\n/**\n * Provides the default process-backed `Terminal` service, ending key input on\n * Ctrl+C or Ctrl+D.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = /*#__PURE__*/Layer.effect(Terminal.Terminal, /*#__PURE__*/make(defaultShouldQuit));\nfunction defaultShouldQuit(input) {\n return input.key.ctrl && (input.key.name === \"c\" || input.key.name === \"d\");\n}\n//# sourceMappingURL=NodeTerminal.js.map","/**\n * Node.js implementation of the Effect `Terminal` service.\n *\n * This module reuses the shared Node terminal implementation. `make` creates a\n * scoped process-backed `Terminal` service, and `layer` provides the default\n * service with the standard quit behavior for key input.\n *\n * @since 4.0.0\n */\nimport * as NodeTerminal from \"@effect/platform-node-shared/NodeTerminal\";\n/**\n * Creates a scoped `Terminal` service backed by process stdin/stdout, using the\n * optional predicate to decide when key input should end the input stream.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const make = NodeTerminal.make;\n/**\n * Provides the default process-backed `Terminal` service, ending key input on\n * the default quit keys.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = NodeTerminal.layer;\n//# sourceMappingURL=NodeTerminal.js.map","import * as Layer from \"effect/Layer\";\nimport * as NodeChildProcessSpawner from \"./NodeChildProcessSpawner.js\";\nimport * as NodeCrypto from \"./NodeCrypto.js\";\nimport * as NodeFileSystem from \"./NodeFileSystem.js\";\nimport * as NodePath from \"./NodePath.js\";\nimport * as NodeStdio from \"./NodeStdio.js\";\nimport * as NodeTerminal from \"./NodeTerminal.js\";\n/**\n * Provides the default Node implementations for child process spawning,\n * filesystem, path, stdio, and terminal services.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = /*#__PURE__*/Layer.provideMerge(NodeChildProcessSpawner.layer, /*#__PURE__*/Layer.mergeAll(NodeFileSystem.layer, NodeCrypto.layer, NodePath.layer, NodeStdio.layer, NodeTerminal.layer));\n//# sourceMappingURL=NodeServices.js.map"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAa,WAAwB,sBAAc;;;;;;;AAOnD,IAAa,YAAyB,sBAAc;AACpD,IAAM,eAAe;AACrB,IAAM,cAAc;EACjB,eAAe;CAChB,GAAGA;CACH,SAAS;EACP,OAAO;GACL,KAAK;GACL,KAAK,KAAK;EACZ;CACF;AACF;;;;;;;AAOA,IAAa,cAAa,WAAU,OAAO,OAAO,OAAO,OAAO,WAAW,GAAG,MAAM;;;;;;;;AAQpF,IAAaC,UAAO,UAAS;CAC3B,MAAM,gBAAgB,SAAS,YAAY,MAAM,OAAO,CAAC,CAAC,KAAKC,KAAW,WAAUC,WAAkB,SAAS,kBAAkB,OAAO,OAAO,MAAM,OAAO,MAAM,CAAC,GAAGC,MAAa;CACnL,MAAM,eAAe,SAAS,YAAYC,WAAkB,aAAa,SAAS,OAAO,CAAC;CAC1F,OAAO,oBAAoB,GAAG;EAC5B;EACA,WAA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