@athrio/loom 0.0.5 → 0.0.7

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/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","names":["TypeId","Predicate.hasProperty","Schema.ErrorClass","Schema.String","Runtime.errorExitCode","Runtime.errorReported","Proto","Config.TrueValues","Config.FalseValues","toCodecStringTree","Schema.toCodecStringTree","Schema.decodeUnknownEffect","Effect.mapError","boolean","Config.Boolean","string","Effect.succeed","choice","Effect.fail","path","Effect.fnUntraced","FileSystem.FileSystem","Path.Path","reset","TypeId","Ansi.annotate","Ansi.bold","Ansi.combine","Ansi.italicized","Ansi.red","run","Terminal.Terminal","Terminal.QuitError","Effect.scoped","Effect.suspend","Effect.flatMap","Effect.succeed","Effect.isEffect","Effect.orDie","Queue.take","Effect.map","Effect.raceFirst","Effect.ensuring","Ansi.cursorShow","Ansi.eraseLine","Ansi.cursorTo","Ansi.eraseLines","Arr.map","Arr.reduce","Ansi.cursorDown","Arr.match","Ansi.cursorLeft","Option.isSome","Ansi.white","Ansi.blackBright","Ansi.underlined","Ansi.cyanBright","Ansi.cursorSavePosition","Ansi.cursorRestorePosition","Ansi.cursorMove","Ansi.green","Option.none","Effect.match","Option.some","Option.getOrElse","TypeId","Proto","Predicate.hasProperty","Option.none","string","Primitive.string","boolean","Primitive.boolean","choiceWithValue","Primitive.choice","choice","Primitive.path","directory","withAlias","withDescription","Option.some","map","Effect.map","optional","Effect.fnUntraced","Primitive.isBoolean","Effect.catchTags","Effect.succeed","Option.fromUndefinedOr","withMetavar","CliError.MissingArgument","Effect.mapError","CliError.InvalidValue","CliError.MissingOption","Predicate.isNotUndefined","Option.getOrUndefined","Param.string","Param.argumentKind","Param.directory","optional","Param.optional","Option.getOrElse","generateFunction","generate","generate","generate","Bash.generate","Zsh.generate","Fish.generate","Param.boolean","Param.flagKind","Param.choiceWithValue","Param.choice","Param.withAlias","Param.withDescription","Param.withMetavar","Param.optional","Param.map","Param.isParam","TypeId","Proto","Context.Service","Context.empty","Predicate.isNotUndefined","Effect.fail","CliError.ShowHelp","Param.extractSingleParams","Param.getParamMetadata","Primitive.getTypeName","Arr.map","Primitive.getChoiceKeys","Option.match","Option.some","Effect.fnUntraced","CliError.DuplicateOption","Primitive.getChoiceKeys","Param.extractSingleParams","Option.getOrUndefined","Param.getParamMetadata","Param.extractSingleParams","Effect.gen","Context.Service","Effect.gen","CliOutput.Formatter","HelpInternal.getHelpForCommandPath","Console.log","Flag.optional","Option.map","Option.isNone","CommandDescriptor.fromCommand","Completions_.generate","Option.match","Effect.gen","Param.extractSingleParams","Param.isFlagParam","Option.none","Option.some","Primitive.isBoolean","CliError.InvalidValue","Primitive.isTrueValue","Primitive.isFalseValue","CliError.UnrecognizedOption","CliError.UnknownSubcommand","Predicate.hasProperty","TypeId","make","Predicate.isNotUndefined","Effect.fnUntraced","Option.isNone","internal","CliError.ShowHelp","Effect.provideService","Param.extractSingleParams","CliError.UnrecognizedOption","Effect.gen","CliOutput.Formatter","error","GlobalFlag.BuiltIns","Console.log","Console.error","Effect.flatMap","Lexer.lex","Parser.createFlagRegistry","Param.isFlagParam","Parser.consumeGlobalFlags","Parser.parseArgs","Parser.getCommandPath","Effect.result","GlobalFlag.LogLevel","Option.match","Context.empty","Context.make","References.MinimumLogLevel","Effect.provideContext","Effect.catchFilter","CliError.isCliError","Result.succeed","Result.fail","Effect.andThen","Effect.fail","Terminal.isQuitError","Effect.interrupt","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","MutableRef.make","Latch.makeUnsafe","Exit.fail","Cause.Done","Effect.suspend","Effect.fail","Effect.flatMap","Arr.of","Effect.succeed","Effect.as","Scope.addFinalizer","Effect.sync","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","remove","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","BunFileSystem.layer","BunCrypto.layer","BunPath.layer","BunStdio.layer","BunTerminal.layer","runMain","NodeRuntime.runMain"],"sources":["../../../node_modules/effect/dist/unstable/cli/CliError.js","../../../node_modules/ini/lib/ini.js","../../../node_modules/toml/lib/parser.js","../../../node_modules/toml/lib/compiler.js","../../../node_modules/toml/index.js","../../../node_modules/effect/dist/unstable/cli/Primitive.js","../../../node_modules/effect/dist/unstable/cli/internal/ansi.js","../../../node_modules/effect/dist/unstable/cli/Prompt.js","../../../node_modules/effect/dist/unstable/cli/Param.js","../../../node_modules/effect/dist/unstable/cli/Argument.js","../../../node_modules/effect/dist/unstable/cli/CliOutput.js","../../../node_modules/effect/dist/unstable/cli/internal/completions/bash.js","../../../node_modules/effect/dist/unstable/cli/internal/completions/fish.js","../../../node_modules/effect/dist/unstable/cli/internal/completions/zsh.js","../../../node_modules/effect/dist/unstable/cli/Completions.js","../../../node_modules/effect/dist/unstable/cli/Flag.js","../../../node_modules/effect/dist/unstable/cli/internal/config.js","../../../node_modules/effect/dist/unstable/cli/internal/command.js","../../../node_modules/effect/dist/unstable/cli/internal/completions/descriptor.js","../../../node_modules/effect/dist/unstable/cli/internal/help.js","../../../node_modules/effect/dist/unstable/cli/GlobalFlag.js","../../../node_modules/effect/dist/unstable/cli/internal/lexer.js","../../../node_modules/effect/dist/unstable/cli/internal/auto-suggest.js","../../../node_modules/effect/dist/unstable/cli/internal/parser.js","../../../node_modules/effect/dist/unstable/cli/Command.js","../../../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-bun/dist/BunFileSystem.js","../../../node_modules/@effect/platform-node-shared/dist/NodeCrypto.js","../../../node_modules/@effect/platform-bun/dist/BunCrypto.js","../../../node_modules/@effect/platform-node-shared/dist/NodePath.js","../../../node_modules/@effect/platform-bun/dist/BunPath.js","../../../node_modules/@effect/platform-node-shared/dist/NodeStdio.js","../../../node_modules/@effect/platform-bun/dist/BunStdio.js","../../../node_modules/@effect/platform-node-shared/dist/NodeTerminal.js","../../../node_modules/@effect/platform-bun/dist/BunTerminal.js","../../../node_modules/@effect/platform-bun/dist/BunServices.js","../../../node_modules/@effect/platform-node-shared/dist/NodeRuntime.js","../../../node_modules/@effect/platform-bun/dist/BunRuntime.js","../../loom-lang/src/LoomLock.ts","../../loom-lang/src/LoomTangler.ts","../../loom-lang/src/weave/LoomWeaver.ts","../../loom-lang/src/weave/LoomContents.ts","../src/main.ts"],"sourcesContent":["/**\n * Defines structured errors for the unstable CLI parser and runner.\n *\n * CLI errors describe problems such as unknown or duplicate flags, missing\n * flags or arguments, invalid values, unknown subcommands, user handler\n * failures, and requests to show command help. This module includes the\n * `CliError` union, the `isCliError` guard, schema-backed error classes with\n * display messages, and the `NonShowHelpErrors` union used when parse or\n * validation errors should be shown with help output.\n *\n * @since 4.0.0\n */\nimport * as Predicate from \"../../Predicate.js\";\nimport * as Runtime from \"../../Runtime.js\";\nimport * as Schema from \"../../Schema.js\";\n/**\n * @category type IDs\n * @since 4.0.0\n */\nconst TypeId = \"~effect/cli/CliError\";\n/**\n * Type guard to check if a value is a CLI error.\n *\n * **Example** (Checking CLI errors)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError } from \"effect/unstable/cli\"\n *\n * const handleError = (error: unknown) => {\n * if (CliError.isCliError(error)) {\n * console.log(\"CLI Error:\", error.message)\n * return Effect.succeed(\"Handled CLI error\")\n * }\n * return Effect.fail(\"Unknown error\")\n * }\n *\n * // Example usage in error handling\n * const program = Effect.gen(function*() {\n * const result = yield* Effect.try({\n * try: () => ({ success: true }),\n * catch: (error) => error\n * })\n * handleError(result)\n * })\n * ```\n *\n * @category guards\n * @since 4.0.0\n */\nexport const isCliError = u => Predicate.hasProperty(u, TypeId);\n/**\n * Error thrown when an unrecognized option is encountered.\n *\n * **Example** (Creating unrecognized option errors)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError } from \"effect/unstable/cli\"\n *\n * // Creating an unrecognized option error\n * const unrecognizedError = new CliError.UnrecognizedOption({\n * option: \"--unknown-flag\",\n * command: [\"deploy\", \"production\"],\n * suggestions: [\"--verbose\", \"--force\"]\n * })\n *\n * console.log(unrecognizedError.message)\n * // \"Unrecognized flag: --unknown-flag in command deploy production\n * //\n * // Did you mean this?\n * // --verbose\n * // --force\"\n *\n * // In CLI parsing context\n * const parseCommand = Effect.gen(function*() {\n * // If parsing encounters unknown flag\n * return yield* unrecognizedError\n * })\n * ```\n *\n * @category models\n * @since 4.0.0\n */\nexport class UnrecognizedOption extends /*#__PURE__*/Schema.ErrorClass(`${TypeId}/UnrecognizedOption`)({\n _tag: /*#__PURE__*/Schema.tag(\"UnrecognizedOption\"),\n option: Schema.String,\n command: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(Schema.String)),\n suggestions: /*#__PURE__*/Schema.Array(Schema.String)\n}) {\n /**\n * Marks this value as a CLI parsing error for runtime guards.\n *\n * @since 4.0.0\n */\n [TypeId] = TypeId;\n /**\n * Formats the unrecognized option with command context and suggestions.\n *\n * @since 4.0.0\n */\n get message() {\n const suggestionText = this.suggestions.length > 0 ? `\\n\\n Did you mean this?\\n ${this.suggestions.join(\"\\n \")}` : \"\";\n const baseMessage = this.command ? `Unrecognized flag: ${this.option} in command ${this.command.join(\" \")}` : `Unrecognized flag: ${this.option}`;\n return baseMessage + suggestionText;\n }\n}\n/**\n * Error thrown when duplicate option names are detected between parent and child commands.\n *\n * **Example** (Creating duplicate option errors)\n *\n * ```ts\n * import { CliError } from \"effect/unstable/cli\"\n *\n * const duplicateError = new CliError.DuplicateOption({\n * option: \"--verbose\",\n * parentCommand: \"myapp\",\n * childCommand: \"deploy\"\n * })\n *\n * console.log(duplicateError.message)\n * // \"Duplicate flag name \"--verbose\" in parent command \"myapp\" and subcommand \"deploy\".\n * // Parent will always claim this flag (Mode A semantics). Consider renaming one of them to avoid confusion.\"\n * ```\n *\n * @category models\n * @since 4.0.0\n */\nexport class DuplicateOption extends /*#__PURE__*/Schema.ErrorClass(`${TypeId}/DuplicateOption`)({\n _tag: /*#__PURE__*/Schema.tag(\"DuplicateOption\"),\n option: Schema.String,\n parentCommand: Schema.String,\n childCommand: Schema.String\n}) {\n /**\n * Marks this value as a CLI configuration error for runtime guards.\n *\n * @since 4.0.0\n */\n [TypeId] = TypeId;\n /**\n * Explains which parent and child commands define the duplicate option.\n *\n * @since 4.0.0\n */\n get message() {\n return `Duplicate flag name \"${this.option}\" in parent command \"${this.parentCommand}\" and subcommand \"${this.childCommand}\". ` + `Parent will always claim this flag (Mode A semantics). Consider renaming one of them to avoid confusion.`;\n }\n}\n/**\n * Error thrown when a required option is missing.\n *\n * **Example** (Creating missing option errors)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError } from \"effect/unstable/cli\"\n *\n * const missingOptionError = new CliError.MissingOption({\n * option: \"api-key\"\n * })\n *\n * console.log(missingOptionError.message)\n * // \"Missing required flag: --api-key\"\n *\n * // In validation context\n * const validateRequiredOptions = (options: Record<string, string | undefined>) =>\n * Effect.gen(function*() {\n * const apiKey = options[\"api-key\"]\n * if (!apiKey) {\n * return yield* missingOptionError\n * }\n * return apiKey\n * })\n * ```\n *\n * @category models\n * @since 4.0.0\n */\nexport class MissingOption extends /*#__PURE__*/Schema.ErrorClass(`${TypeId}/MissingOption`)({\n _tag: /*#__PURE__*/Schema.tag(\"MissingOption\"),\n option: Schema.String\n}) {\n /**\n * Marks this value as a missing CLI option error for runtime guards.\n *\n * @since 4.0.0\n */\n [TypeId] = TypeId;\n /**\n * Formats the missing required flag for display.\n *\n * @since 4.0.0\n */\n get message() {\n return `Missing required flag: --${this.option}`;\n }\n}\n/**\n * Error thrown when a required positional argument is missing.\n *\n * **Example** (Creating missing argument errors)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError } from \"effect/unstable/cli\"\n *\n * const missingArgError = new CliError.MissingArgument({\n * argument: \"target\"\n * })\n *\n * console.log(missingArgError.message)\n * // \"Missing required argument: target\"\n *\n * // In argument parsing\n * const parseArguments = (args: Array<string>) =>\n * Effect.gen(function*() {\n * if (args.length === 0) {\n * return yield* missingArgError\n * }\n * return args[0]\n * })\n * ```\n *\n * @category models\n * @since 4.0.0\n */\nexport class MissingArgument extends /*#__PURE__*/Schema.ErrorClass(`${TypeId}/MissingArgument`)({\n _tag: /*#__PURE__*/Schema.tag(\"MissingArgument\"),\n argument: Schema.String\n}) {\n /**\n * Marks this value as a missing CLI argument error for runtime guards.\n *\n * @since 4.0.0\n */\n [TypeId] = TypeId;\n /**\n * Formats the missing required positional argument for display.\n *\n * @since 4.0.0\n */\n get message() {\n return `Missing required argument: ${this.argument}`;\n }\n}\n/**\n * Error thrown when an option or argument value is invalid.\n *\n * **Example** (Creating invalid value errors)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError } from \"effect/unstable/cli\"\n *\n * const invalidValueError = new CliError.InvalidValue({\n * option: \"port\",\n * value: \"abc123\",\n * expected: \"integer between 1 and 65535\",\n * kind: \"flag\"\n * })\n *\n * console.log(invalidValueError.message)\n * // \"Invalid value for flag --port: \"abc123\". Expected: integer between 1 and 65535\"\n *\n * // For positional arguments\n * const invalidArgError = new CliError.InvalidValue({\n * option: \"count\",\n * value: \"abc\",\n * expected: \"integer\",\n * kind: \"argument\"\n * })\n *\n * console.log(invalidArgError.message)\n * // \"Invalid value for argument <count>: \"abc\". Expected: integer\"\n * ```\n *\n * @category models\n * @since 4.0.0\n */\nexport class InvalidValue extends /*#__PURE__*/Schema.ErrorClass(`${TypeId}/InvalidValue`)({\n _tag: /*#__PURE__*/Schema.tag(\"InvalidValue\"),\n option: Schema.String,\n value: Schema.String,\n expected: Schema.String,\n kind: /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.Literal(\"flag\"), /*#__PURE__*/Schema.Literal(\"argument\")])\n}) {\n /**\n * Marks this value as an invalid CLI value error for runtime guards.\n *\n * @since 4.0.0\n */\n [TypeId] = TypeId;\n /**\n * Formats the invalid flag or argument value with the expected input.\n *\n * @since 4.0.0\n */\n get message() {\n if (this.kind === \"argument\") {\n return `Invalid value for argument <${this.option}>: \"${this.value}\". Expected: ${this.expected}`;\n }\n return `Invalid value for flag --${this.option}: \"${this.value}\". Expected: ${this.expected}`;\n }\n}\n/**\n * Error thrown when an unknown subcommand is encountered.\n *\n * **Example** (Creating unknown subcommand errors)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError } from \"effect/unstable/cli\"\n *\n * const unknownSubcommandError = new CliError.UnknownSubcommand({\n * subcommand: \"deplyo\", // typo\n * parent: [\"myapp\"],\n * suggestions: [\"deploy\", \"destroy\"]\n * })\n *\n * console.log(unknownSubcommandError.message)\n * // \"Unknown subcommand \"deplyo\" for \"myapp\"\n * //\n * // Did you mean this?\n * // deploy\n * // destroy\"\n *\n * // In subcommand parsing\n * const parseSubcommand = (subcommand: string) =>\n * Effect.gen(function*() {\n * const validCommands = [\"deploy\", \"destroy\", \"status\"]\n * if (!validCommands.includes(subcommand)) {\n * return yield* unknownSubcommandError\n * }\n * return subcommand\n * })\n * ```\n *\n * @category models\n * @since 4.0.0\n */\nexport class UnknownSubcommand extends /*#__PURE__*/Schema.ErrorClass(`${TypeId}/UnknownSubcommand`)({\n _tag: /*#__PURE__*/Schema.tag(\"UnknownSubcommand\"),\n subcommand: Schema.String,\n parent: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(Schema.String)),\n suggestions: /*#__PURE__*/Schema.Array(Schema.String)\n}) {\n /**\n * Marks this value as an unknown CLI subcommand error for runtime guards.\n *\n * @since 4.0.0\n */\n [TypeId] = TypeId;\n /**\n * Formats the unknown subcommand with parent command context and suggestions.\n *\n * @since 4.0.0\n */\n get message() {\n const suggestionText = this.suggestions.length > 0 ? `\\n\\n Did you mean this?\\n ${this.suggestions.join(\"\\n \")}` : \"\";\n return this.parent ? `Unknown subcommand \"${this.subcommand}\" for \"${this.parent.join(\" \")}\"${suggestionText}` : `Unknown subcommand \"${this.subcommand}\"${suggestionText}`;\n }\n}\n/**\n * Error wrapper for user handler failures in the CLI error channel.\n *\n * **Example** (Wrapping user errors)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError } from \"effect/unstable/cli\"\n *\n * // Wrapping user errors\n * const userError = new CliError.UserError({\n * cause: new Error(\"Database connection failed\")\n * })\n *\n * // In command handler\n * const deployCommand = Effect.gen(function*() {\n * const result = yield* Effect.try({\n * try: () => ({ deployed: true }),\n * catch: (error) => new CliError.UserError({ cause: error })\n * })\n * return result\n * })\n *\n * // In error handling\n * const handleError = (error: CliError.CliError): Effect.Effect<number> => {\n * if (error._tag === \"UserError\") {\n * console.log(\"Command failed:\", error.cause)\n * return Effect.succeed(1) // Exit code 1\n * }\n * return Effect.succeed(0)\n * }\n * ```\n *\n * @category models\n * @since 4.0.0\n */\nexport class UserError extends /*#__PURE__*/Schema.ErrorClass(`${TypeId}/UserError`)({\n _tag: /*#__PURE__*/Schema.tag(\"UserError\"),\n cause: /*#__PURE__*/Schema.Defect()\n}) {\n /**\n * Marks this value as a user handler error for runtime guards.\n *\n * @since 4.0.0\n */\n [TypeId] = TypeId;\n}\n/**\n * Schema for concrete CLI errors that can be reported together with help output.\n *\n * **Details**\n *\n * This excludes `ShowHelp` itself, allowing parse and validation errors to be\n * stored in `ShowHelp.errors` without nesting another help-control value.\n *\n * @category models\n * @since 4.0.0\n */\nexport const NonShowHelpErrors = /*#__PURE__*/Schema.Union([UnrecognizedOption, DuplicateOption, MissingOption, MissingArgument, InvalidValue, UnknownSubcommand, UserError]);\n/**\n * Error data requesting CLI help rendering for a command path.\n *\n * **Details**\n *\n * It is used for explicit help requests and for parse or validation failures\n * that should be shown with help text. When `errors` is non-empty, the runtime\n * exit code is `1`; otherwise it is `0`.\n *\n * @category models\n * @since 4.0.0\n */\nexport class ShowHelp extends /*#__PURE__*/Schema.ErrorClass(`${TypeId}/ShowHelp`)({\n _tag: /*#__PURE__*/Schema.tag(\"ShowHelp\"),\n commandPath: /*#__PURE__*/Schema.Array(Schema.String),\n errors: /*#__PURE__*/Schema.Array(NonShowHelpErrors)\n}) {\n [TypeId] = TypeId;\n [Runtime.errorExitCode] = this.errors.length ? 1 : 0;\n [Runtime.errorReported] = false;\n get message() {\n return \"Help requested\";\n }\n}\n//# sourceMappingURL=CliError.js.map","const { hasOwnProperty } = Object.prototype\n\nconst encode = (obj, opt = {}) => {\n if (typeof opt === 'string') {\n opt = { section: opt }\n }\n opt.align = opt.align === true\n opt.newline = opt.newline === true\n opt.sort = opt.sort === true\n opt.whitespace = opt.whitespace === true || opt.align === true\n // The `typeof` check is required because accessing the `process` directly fails on browsers.\n /* istanbul ignore next */\n opt.platform = opt.platform || (typeof process !== 'undefined' && process.platform)\n opt.bracketedArray = opt.bracketedArray !== false\n\n /* istanbul ignore next */\n const eol = opt.platform === 'win32' ? '\\r\\n' : '\\n'\n const separator = opt.whitespace ? ' = ' : '='\n const children = []\n\n const keys = opt.sort ? Object.keys(obj).sort() : Object.keys(obj)\n\n let padToChars = 0\n // If aligning on the separator, then padToChars is determined as follows:\n // 1. Get the keys\n // 2. Exclude keys pointing to objects unless the value is null or an array\n // 3. Add `[]` to array keys\n // 4. Ensure non empty set of keys\n // 5. Reduce the set to the longest `safe` key\n // 6. Get the `safe` length\n if (opt.align) {\n padToChars = safe(\n (\n keys\n .filter(k => obj[k] === null || Array.isArray(obj[k]) || typeof obj[k] !== 'object')\n .map(k => Array.isArray(obj[k]) ? `${k}[]` : k)\n )\n .concat([''])\n .reduce((a, b) => safe(a).length >= safe(b).length ? a : b)\n ).length\n }\n\n let out = ''\n const arraySuffix = opt.bracketedArray ? '[]' : ''\n\n for (const k of keys) {\n const val = obj[k]\n if (val && Array.isArray(val)) {\n for (const item of val) {\n out += safe(`${k}${arraySuffix}`).padEnd(padToChars, ' ') + separator + safe(item) + eol\n }\n } else if (val && typeof val === 'object') {\n children.push(k)\n } else {\n out += safe(k).padEnd(padToChars, ' ') + separator + safe(val) + eol\n }\n }\n\n if (opt.section && out.length) {\n out = '[' + safe(opt.section) + ']' + (opt.newline ? eol + eol : eol) + out\n }\n\n for (const k of children) {\n const nk = splitSections(k, '.').join('\\\\.')\n const section = (opt.section ? opt.section + '.' : '') + nk\n const child = encode(obj[k], {\n ...opt,\n section,\n })\n if (out.length && child.length) {\n out += eol\n }\n\n out += child\n }\n\n return out\n}\n\nfunction splitSections (str, separator) {\n var lastMatchIndex = 0\n var lastSeparatorIndex = 0\n var nextIndex = 0\n var sections = []\n\n do {\n nextIndex = str.indexOf(separator, lastMatchIndex)\n\n if (nextIndex !== -1) {\n lastMatchIndex = nextIndex + separator.length\n\n if (nextIndex > 0 && str[nextIndex - 1] === '\\\\') {\n continue\n }\n\n sections.push(str.slice(lastSeparatorIndex, nextIndex))\n lastSeparatorIndex = nextIndex + separator.length\n }\n } while (nextIndex !== -1)\n\n sections.push(str.slice(lastSeparatorIndex))\n\n return sections\n}\n\nconst decode = (str, opt = {}) => {\n opt.bracketedArray = opt.bracketedArray !== false\n const out = Object.create(null)\n let p = out\n let section = null\n // section |key = value\n const re = /^\\[([^\\]]*)\\]\\s*$|^([^=]+)(=(.*))?$/i\n const lines = str.split(/[\\r\\n]+/g)\n const duplicates = {}\n\n for (const line of lines) {\n if (!line || line.match(/^\\s*[;#]/) || line.match(/^\\s*$/)) {\n continue\n }\n const match = line.match(re)\n if (!match) {\n continue\n }\n if (match[1] !== undefined) {\n section = unsafe(match[1])\n if (section === '__proto__') {\n // not allowed\n // keep parsing the section, but don't attach it.\n p = Object.create(null)\n continue\n }\n p = out[section] = out[section] || Object.create(null)\n continue\n }\n const keyRaw = unsafe(match[2])\n let isArray\n if (opt.bracketedArray) {\n isArray = keyRaw.length > 2 && keyRaw.slice(-2) === '[]'\n } else {\n duplicates[keyRaw] = (duplicates?.[keyRaw] || 0) + 1\n isArray = duplicates[keyRaw] > 1\n }\n const key = isArray && keyRaw.endsWith('[]')\n ? keyRaw.slice(0, -2) : keyRaw\n\n if (key === '__proto__') {\n continue\n }\n const valueRaw = match[3] ? unsafe(match[4]) : true\n const value = valueRaw === 'true' ||\n valueRaw === 'false' ||\n valueRaw === 'null' ? JSON.parse(valueRaw)\n : valueRaw\n\n // Convert keys with '[]' suffix to an array\n if (isArray) {\n if (!hasOwnProperty.call(p, key)) {\n p[key] = []\n } else if (!Array.isArray(p[key])) {\n p[key] = [p[key]]\n }\n }\n\n // safeguard against resetting a previously defined\n // array by accidentally forgetting the brackets\n if (Array.isArray(p[key])) {\n p[key].push(value)\n } else {\n p[key] = value\n }\n }\n\n // {a:{y:1},\"a.b\":{x:2}} --> {a:{y:1,b:{x:2}}}\n // use a filter to return the keys that have to be deleted.\n const remove = []\n for (const k of Object.keys(out)) {\n if (!hasOwnProperty.call(out, k) ||\n typeof out[k] !== 'object' ||\n Array.isArray(out[k])) {\n continue\n }\n\n // see if the parent section is also an object.\n // if so, add it to that, and mark this one for deletion\n const parts = splitSections(k, '.')\n p = out\n const l = parts.pop()\n const nl = l.replace(/\\\\\\./g, '.')\n for (const part of parts) {\n if (part === '__proto__') {\n continue\n }\n if (!hasOwnProperty.call(p, part) || typeof p[part] !== 'object') {\n p[part] = Object.create(null)\n }\n p = p[part]\n }\n if (p === out && nl === l) {\n continue\n }\n\n p[nl] = out[k]\n remove.push(k)\n }\n for (const del of remove) {\n delete out[del]\n }\n\n return out\n}\n\nconst isQuoted = val => {\n return (val.startsWith('\"') && val.endsWith('\"')) ||\n (val.startsWith(\"'\") && val.endsWith(\"'\"))\n}\n\nconst safe = val => {\n if (\n typeof val !== 'string' ||\n val.match(/[=\\r\\n]/) ||\n val.match(/^\\[/) ||\n (val.length > 1 && isQuoted(val)) ||\n val !== val.trim()\n ) {\n return JSON.stringify(val)\n }\n return val.split(';').join('\\\\;').split('#').join('\\\\#')\n}\n\nconst unsafe = val => {\n val = (val || '').trim()\n if (isQuoted(val)) {\n // remove the single quotes before calling JSON.parse\n if (val.charAt(0) === \"'\") {\n val = val.slice(1, -1)\n }\n try {\n val = JSON.parse(val)\n } catch {\n // ignore errors\n }\n } else {\n // walk the val to find the first not-escaped ; character\n let esc = false\n let unesc = ''\n for (let i = 0, l = val.length; i < l; i++) {\n const c = val.charAt(i)\n if (esc) {\n if ('\\\\;#'.indexOf(c) !== -1) {\n unesc += c\n } else {\n unesc += '\\\\' + c\n }\n\n esc = false\n } else if (';#'.indexOf(c) !== -1) {\n break\n } else if (c === '\\\\') {\n esc = true\n } else {\n unesc += c\n }\n }\n if (esc) {\n unesc += '\\\\'\n }\n\n return unesc.trim()\n }\n return val\n}\n\nmodule.exports = {\n parse: decode,\n decode,\n stringify: encode,\n encode,\n safe,\n unsafe,\n}\n","// @generated by Peggy 5.1.0.\n//\n// https://peggyjs.org/\n\n\"use strict\";\n\nclass peg$SyntaxError extends SyntaxError {\n constructor(message, expected, found, location) {\n super(message);\n this.expected = expected;\n this.found = found;\n this.location = location;\n this.name = \"SyntaxError\";\n }\n\n format(sources) {\n let str = \"Error: \" + this.message;\n if (this.location) {\n let src = null;\n const st = sources.find(s => s.source === this.location.source);\n if (st) {\n src = st.text.split(/\\r\\n|\\n|\\r/g);\n }\n const s = this.location.start;\n const offset_s = (this.location.source && (typeof this.location.source.offset === \"function\"))\n ? this.location.source.offset(s)\n : s;\n const loc = this.location.source + \":\" + offset_s.line + \":\" + offset_s.column;\n if (src) {\n const e = this.location.end;\n const filler = \"\".padEnd(offset_s.line.toString().length, \" \");\n const line = src[s.line - 1];\n const last = s.line === e.line ? e.column : line.length + 1;\n const hatLen = (last - s.column) || 1;\n str += \"\\n --> \" + loc + \"\\n\"\n + filler + \" |\\n\"\n + offset_s.line + \" | \" + line + \"\\n\"\n + filler + \" | \" + \"\".padEnd(s.column - 1, \" \")\n + \"\".padEnd(hatLen, \"^\");\n } else {\n str += \"\\n at \" + loc;\n }\n }\n return str;\n }\n\n static buildMessage(expected, found) {\n function hex(ch) {\n return ch.codePointAt(0).toString(16).toUpperCase();\n }\n\n const nonPrintable = Object.prototype.hasOwnProperty.call(RegExp.prototype, \"unicode\")\n ? new RegExp(\"[\\\\p{C}\\\\p{Mn}\\\\p{Mc}]\", \"gu\")\n : null;\n function unicodeEscape(s) {\n if (nonPrintable) {\n return s.replace(nonPrintable, ch => \"\\\\u{\" + hex(ch) + \"}\");\n }\n return s;\n }\n\n function literalEscape(s) {\n return unicodeEscape(s\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\"/g, \"\\\\\\\"\")\n .replace(/\\0/g, \"\\\\0\")\n .replace(/\\t/g, \"\\\\t\")\n .replace(/\\n/g, \"\\\\n\")\n .replace(/\\r/g, \"\\\\r\")\n .replace(/[\\x00-\\x0F]/g, ch => \"\\\\x0\" + hex(ch))\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, ch => \"\\\\x\" + hex(ch)));\n }\n\n function classEscape(s) {\n return unicodeEscape(s\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\\]/g, \"\\\\]\")\n .replace(/\\^/g, \"\\\\^\")\n .replace(/-/g, \"\\\\-\")\n .replace(/\\0/g, \"\\\\0\")\n .replace(/\\t/g, \"\\\\t\")\n .replace(/\\n/g, \"\\\\n\")\n .replace(/\\r/g, \"\\\\r\")\n .replace(/[\\x00-\\x0F]/g, ch => \"\\\\x0\" + hex(ch))\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, ch => \"\\\\x\" + hex(ch)));\n }\n\n const DESCRIBE_EXPECTATION_FNS = {\n literal(expectation) {\n return \"\\\"\" + literalEscape(expectation.text) + \"\\\"\";\n },\n\n class(expectation) {\n const escapedParts = expectation.parts.map(\n part => (Array.isArray(part)\n ? classEscape(part[0]) + \"-\" + classEscape(part[1])\n : classEscape(part))\n );\n\n return \"[\" + (expectation.inverted ? \"^\" : \"\") + escapedParts.join(\"\") + \"]\" + (expectation.unicode ? \"u\" : \"\");\n },\n\n any() {\n return \"any character\";\n },\n\n end() {\n return \"end of input\";\n },\n\n other(expectation) {\n return expectation.description;\n },\n };\n\n function describeExpectation(expectation) {\n return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);\n }\n\n function describeExpected(expected) {\n const descriptions = expected.map(describeExpectation);\n descriptions.sort();\n\n if (descriptions.length > 0) {\n let j = 1;\n for (let i = 1; i < descriptions.length; i++) {\n if (descriptions[i - 1] !== descriptions[i]) {\n descriptions[j] = descriptions[i];\n j++;\n }\n }\n descriptions.length = j;\n }\n\n switch (descriptions.length) {\n case 1:\n return descriptions[0];\n\n case 2:\n return descriptions[0] + \" or \" + descriptions[1];\n\n default:\n return descriptions.slice(0, -1).join(\", \")\n + \", or \"\n + descriptions[descriptions.length - 1];\n }\n }\n\n function describeFound(found) {\n return found ? \"\\\"\" + literalEscape(found) + \"\\\"\" : \"end of input\";\n }\n\n return \"Expected \" + describeExpected(expected) + \" but \" + describeFound(found) + \" found.\";\n }\n}\n\nfunction peg$parse(input, options) {\n options = options !== undefined ? options : {};\n\n const peg$FAILED = {};\n const peg$source = options.grammarSource;\n\n const peg$startRuleFunctions = {\n start: peg$parsestart,\n };\n let peg$startRuleFunction = peg$parsestart;\n\n const peg$c0 = \"#\";\n const peg$c1 = \"[\";\n const peg$c2 = \"]\";\n const peg$c3 = \".\";\n const peg$c4 = \"=\";\n const peg$c5 = \"inf\";\n const peg$c6 = \"nan\";\n const peg$c7 = \"\\\"\\\"\\\"\";\n const peg$c8 = \"\\\"\";\n const peg$c9 = \"'''\";\n const peg$c10 = \"'\";\n const peg$c11 = \"\\\\\";\n const peg$c12 = \"\\r\\n\";\n const peg$c13 = \"\\\"\\\"\";\n const peg$c14 = \"''\";\n const peg$c15 = \"0\";\n const peg$c16 = \"0x\";\n const peg$c17 = \"0o\";\n const peg$c18 = \"0b\";\n const peg$c19 = \"true\";\n const peg$c20 = \"false\";\n const peg$c21 = \",\";\n const peg$c22 = \"{\";\n const peg$c23 = \"}\";\n const peg$c24 = \"-\";\n const peg$c25 = \":\";\n const peg$c26 = \"z\";\n const peg$c27 = \"t\";\n const peg$c28 = \" \";\n const peg$c29 = \"\\n\";\n const peg$c30 = \"\\r\";\n const peg$c31 = \"\\\\U\";\n const peg$c32 = \"\\\\u\";\n const peg$c33 = \"\\\\x\";\n\n const peg$r0 = /^[\\t -~\\x80-\\uFFFF]/;\n const peg$r1 = /^[+\\-]/;\n const peg$r2 = /^[^\"\\\\\\0-\\b\\v-\\x1F\\x7F\\r]/;\n const peg$r3 = /^[^'\\0-\\b\\v-\\x1F\\x7F\\r]/;\n const peg$r4 = /^[^\"\\\\\\0-\\b\\n-\\x1F\\x7F]/;\n const peg$r5 = /^[^'\\0-\\b\\n-\\x1F\\x7F]/;\n const peg$r6 = /^[eE]/;\n const peg$r7 = /^[0-9_]/;\n const peg$r8 = /^[1-9]/;\n const peg$r9 = /^[_]/;\n const peg$r10 = /^[0-9]/;\n const peg$r11 = /^[0-9a-fA-F]/;\n const peg$r12 = /^[0-7]/;\n const peg$r13 = /^[01]/;\n const peg$r14 = /^[ \\t]/;\n const peg$r15 = /^[A-Za-z0-9_\\-]/;\n const peg$r16 = /^[\"\\\\btnfre]/;\n\n const peg$e0 = peg$literalExpectation(\"#\", false);\n const peg$e1 = peg$classExpectation([\"\\t\", [\" \", \"~\"], [\"\\x80\", \"\\uFFFF\"]], false, false, false);\n const peg$e2 = peg$literalExpectation(\"[\", false);\n const peg$e3 = peg$literalExpectation(\"]\", false);\n const peg$e4 = peg$literalExpectation(\".\", false);\n const peg$e5 = peg$literalExpectation(\"=\", false);\n const peg$e6 = peg$classExpectation([\"+\", \"-\"], false, false, false);\n const peg$e7 = peg$literalExpectation(\"inf\", false);\n const peg$e8 = peg$literalExpectation(\"nan\", false);\n const peg$e9 = peg$literalExpectation(\"\\\"\\\"\\\"\", false);\n const peg$e10 = peg$literalExpectation(\"\\\"\", false);\n const peg$e11 = peg$literalExpectation(\"'''\", false);\n const peg$e12 = peg$literalExpectation(\"'\", false);\n const peg$e13 = peg$literalExpectation(\"\\\\\", false);\n const peg$e14 = peg$anyExpectation();\n const peg$e15 = peg$literalExpectation(\"\\r\\n\", false);\n const peg$e16 = peg$classExpectation([\"\\\"\", \"\\\\\", [\"\\0\", \"\\b\"], [\"\\v\", \"\\x1F\"], \"\\x7F\", \"\\r\"], true, false, false);\n const peg$e17 = peg$literalExpectation(\"\\\"\\\"\", false);\n const peg$e18 = peg$classExpectation([\"'\", [\"\\0\", \"\\b\"], [\"\\v\", \"\\x1F\"], \"\\x7F\", \"\\r\"], true, false, false);\n const peg$e19 = peg$literalExpectation(\"''\", false);\n const peg$e20 = peg$classExpectation([\"\\\"\", \"\\\\\", [\"\\0\", \"\\b\"], [\"\\n\", \"\\x1F\"], \"\\x7F\"], true, false, false);\n const peg$e21 = peg$classExpectation([\"'\", [\"\\0\", \"\\b\"], [\"\\n\", \"\\x1F\"], \"\\x7F\"], true, false, false);\n const peg$e22 = peg$classExpectation([\"e\", \"E\"], false, false, false);\n const peg$e23 = peg$literalExpectation(\"0\", false);\n const peg$e24 = peg$literalExpectation(\"0x\", false);\n const peg$e25 = peg$literalExpectation(\"0o\", false);\n const peg$e26 = peg$literalExpectation(\"0b\", false);\n const peg$e27 = peg$classExpectation([[\"0\", \"9\"], \"_\"], false, false, false);\n const peg$e28 = peg$classExpectation([[\"1\", \"9\"]], false, false, false);\n const peg$e29 = peg$classExpectation([\"_\"], false, false, false);\n const peg$e30 = peg$classExpectation([[\"0\", \"9\"]], false, false, false);\n const peg$e31 = peg$classExpectation([[\"0\", \"9\"], [\"a\", \"f\"], [\"A\", \"F\"]], false, false, false);\n const peg$e32 = peg$classExpectation([[\"0\", \"7\"]], false, false, false);\n const peg$e33 = peg$classExpectation([\"0\", \"1\"], false, false, false);\n const peg$e34 = peg$literalExpectation(\"true\", false);\n const peg$e35 = peg$literalExpectation(\"false\", false);\n const peg$e36 = peg$literalExpectation(\",\", false);\n const peg$e37 = peg$literalExpectation(\"{\", false);\n const peg$e38 = peg$literalExpectation(\"}\", false);\n const peg$e39 = peg$literalExpectation(\"-\", false);\n const peg$e40 = peg$literalExpectation(\":\", false);\n const peg$e41 = peg$literalExpectation(\"Z\", true);\n const peg$e42 = peg$literalExpectation(\"T\", true);\n const peg$e43 = peg$literalExpectation(\" \", false);\n const peg$e44 = peg$classExpectation([\" \", \"\\t\"], false, false, false);\n const peg$e45 = peg$literalExpectation(\"\\n\", false);\n const peg$e46 = peg$literalExpectation(\"\\r\", false);\n const peg$e47 = peg$classExpectation([[\"A\", \"Z\"], [\"a\", \"z\"], [\"0\", \"9\"], \"_\", \"-\"], false, false, false);\n const peg$e48 = peg$classExpectation([\"\\\"\", \"\\\\\", \"b\", \"t\", \"n\", \"f\", \"r\", \"e\"], false, false, false);\n const peg$e49 = peg$literalExpectation(\"\\\\U\", false);\n const peg$e50 = peg$literalExpectation(\"\\\\u\", false);\n const peg$e51 = peg$literalExpectation(\"\\\\x\", false);\n\n function peg$f0() { return nodes }\n function peg$f1(name) { addNode(node('ArrayPath', name, offset())) }\n function peg$f2(name) { addNode(node('ObjectPath', name, offset())) }\n function peg$f3(parts, name) { return parts.concat(name) }\n function peg$f4(name) { return [name] }\n function peg$f5(name) { return name }\n function peg$f6(name) { return name }\n function peg$f7(keys, value) { addNode(node('Assign', value, offset(), keys)) }\n function peg$f8(node) { return node.value }\n function peg$f9(node) { return node.value }\n function peg$f10(sign) { return node('Float', sign === '-' ? -Infinity : Infinity, offset()) }\n function peg$f11(sign) { return node('Float', NaN, offset()) }\n function peg$f12(body) { return node('String', body, offset()) }\n function peg$f13(chars) { return node('String', chars.join(''), offset()) }\n function peg$f14(body) { return node('String', body, offset()) }\n function peg$f15(chars) { return node('String', chars.join(''), offset()) }\n function peg$f16(head, parts, tail) {\n var result = head.join('');\n for (var i = 0; i < parts.length; i++) { result += parts[i][0] + parts[i][1].join(''); }\n return result + (tail || '');\n }\n function peg$f17() { genError(\"Invalid escape sequence\", offset()) }\n function peg$f18() { return \"\\n\" }\n function peg$f19() { return '' }\n function peg$f20() { return '\"\"' }\n function peg$f21() { return '\"' }\n function peg$f22() { return '\"\"' }\n function peg$f23() { return '\"' }\n function peg$f24(head, parts, tail) {\n var result = head.join('');\n for (var i = 0; i < parts.length; i++) { result += parts[i][0] + parts[i][1].join(''); }\n return result + (tail || '');\n }\n function peg$f25() { return \"\\n\" }\n function peg$f26() { return \"''\" }\n function peg$f27() { return \"'\" }\n function peg$f28() { return \"''\" }\n function peg$f29() { return \"'\" }\n function peg$f30() { genError(\"Invalid escape sequence\", offset()) }\n function peg$f31(left, right) { return node('Float', parseFloat(stripUnderscores(left + 'e' + right)), offset()) }\n function peg$f32(text) { return node('Float', parseFloat(stripUnderscores(text)), offset()) }\n function peg$f33(sign, digits, frac) { return (sign === '-' ? '-' : '') + digits + '.' + frac }\n function peg$f34(sign, digits, frac) { return (sign === '-' ? '-' : '') + digits + '.' + frac }\n function peg$f35(sign, digits) { return (sign === '-' ? '-' : '') + digits }\n function peg$f36() { return '0' }\n function peg$f37(sign, digits) { return (sign || '') + digits }\n function peg$f38(digits) { return node('Integer', parseInt(stripUnderscores(digits), 16), offset()) }\n function peg$f39(digits) { return node('Integer', parseInt(stripUnderscores(digits), 8), offset()) }\n function peg$f40(digits) { return node('Integer', parseInt(stripUnderscores(digits), 2), offset()) }\n function peg$f41(text) { return node('Integer', parseInt(stripUnderscores(text), 10), offset()) }\n function peg$f42(sign) { return (sign || '') + '0' }\n function peg$f43(sign, digits) { return (sign || '') + digits }\n function peg$f44() { return node('Boolean', true, offset()) }\n function peg$f45() { return node('Boolean', false, offset()) }\n function peg$f46() { return node('Array', [], offset()) }\n function peg$f47(head, v) { return v }\n function peg$f48(head, tail) {\n tail.unshift(head); return node('Array', tail, offset())\n }\n function peg$f49() { return node('InlineTable', [], offset()) }\n function peg$f50(head, e) { return e }\n function peg$f51(head, tail) {\n tail.unshift(head); return node('InlineTable', tail, offset())\n }\n function peg$f52(keys, value) { return node('InlineTableValue', value, offset(), keys) }\n function peg$f53(parts, last) { return parts.concat(last) }\n function peg$f54(k) { return [k] }\n function peg$f55(k) { return k }\n function peg$f56(t, frac) { return frac ? t + frac : t }\n function peg$f57(t) { return t + ':00' }\n function peg$f58() { return \"Z\" }\n function peg$f59(d, t, o) { var off = offset(); validateDate(d, off); validateTime(t, off); validateOffset(o, off); return node('Date', new Date(d + \"T\" + t + o), off) }\n function peg$f60(d, t) { var off = offset(); validateDate(d, off); validateTime(t, off); return node('LocalDateTime', d + \"T\" + t, off) }\n function peg$f61(d) { var off = offset(); validateDate(d, off); return node('LocalDate', d, off) }\n function peg$f62(t) { var off = offset(); validateTime(t, off); return node('LocalTime', t, off) }\n function peg$f63(ch) { return ch === 'n' ? '\\n' : ch === 't' ? '\\t' : ch === 'r' ? '\\r' : ch === '\\\\' ? '\\\\' : ch === '\"' ? '\"' : ch === 'b' ? '\\b' : ch === 'f' ? '\\f' : '\\x1B' }\n function peg$f64(digits) { return convertCodePoint(digits) }\n function peg$f65(digits) { return convertCodePoint(digits) }\n function peg$f66(digits) { return convertCodePoint(digits) }\n let peg$currPos = options.peg$currPos | 0;\n let peg$savedPos = peg$currPos;\n const peg$posDetailsCache = [{ line: 1, column: 1 }];\n let peg$maxFailPos = peg$currPos;\n let peg$maxFailExpected = options.peg$maxFailExpected || [];\n let peg$silentFails = options.peg$silentFails | 0;\n\n let peg$result;\n\n if (options.startRule) {\n if (!(options.startRule in peg$startRuleFunctions)) {\n throw new Error(\"Can't start parsing from rule \\\"\" + options.startRule + \"\\\".\");\n }\n\n peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\n }\n\n function text() {\n return input.substring(peg$savedPos, peg$currPos);\n }\n\n function offset() {\n return peg$savedPos;\n }\n\n function range() {\n return {\n source: peg$source,\n start: peg$savedPos,\n end: peg$currPos,\n };\n }\n\n function location() {\n return peg$computeLocation(peg$savedPos, peg$currPos);\n }\n\n function expected(description, location) {\n location = location !== undefined\n ? location\n : peg$computeLocation(peg$savedPos, peg$currPos);\n\n throw peg$buildStructuredError(\n [peg$otherExpectation(description)],\n input.substring(peg$savedPos, peg$currPos),\n location\n );\n }\n\n function error(message, location) {\n location = location !== undefined\n ? location\n : peg$computeLocation(peg$savedPos, peg$currPos);\n\n throw peg$buildSimpleError(message, location);\n }\n\n function peg$getUnicode(pos = peg$currPos) {\n const cp = input.codePointAt(pos);\n if (cp === undefined) {\n return \"\";\n }\n return String.fromCodePoint(cp);\n }\n\n function peg$literalExpectation(text, ignoreCase) {\n return { type: \"literal\", text, ignoreCase };\n }\n\n function peg$classExpectation(parts, inverted, ignoreCase, unicode) {\n return { type: \"class\", parts, inverted, ignoreCase, unicode };\n }\n\n function peg$anyExpectation() {\n return { type: \"any\" };\n }\n\n function peg$endExpectation() {\n return { type: \"end\" };\n }\n\n function peg$otherExpectation(description) {\n return { type: \"other\", description };\n }\n\n function peg$computePosDetails(pos) {\n let details = peg$posDetailsCache[pos];\n let p;\n\n if (details) {\n return details;\n } else {\n if (pos >= peg$posDetailsCache.length) {\n p = peg$posDetailsCache.length - 1;\n } else {\n p = pos;\n while (!peg$posDetailsCache[--p]) {}\n }\n\n details = peg$posDetailsCache[p];\n details = {\n line: details.line,\n column: details.column,\n };\n\n while (p < pos) {\n if (input.charCodeAt(p) === 10) {\n details.line++;\n details.column = 1;\n } else {\n details.column++;\n }\n\n p++;\n }\n\n peg$posDetailsCache[pos] = details;\n\n return details;\n }\n }\n\n function peg$computeLocation(startPos, endPos, offset) {\n const startPosDetails = peg$computePosDetails(startPos);\n const endPosDetails = peg$computePosDetails(endPos);\n\n const res = {\n source: peg$source,\n start: {\n offset: startPos,\n line: startPosDetails.line,\n column: startPosDetails.column,\n },\n end: {\n offset: endPos,\n line: endPosDetails.line,\n column: endPosDetails.column,\n },\n };\n if (offset && peg$source && (typeof peg$source.offset === \"function\")) {\n res.start = peg$source.offset(res.start);\n res.end = peg$source.offset(res.end);\n }\n return res;\n }\n\n function peg$fail(expected) {\n if (peg$currPos < peg$maxFailPos) { return; }\n\n if (peg$currPos > peg$maxFailPos) {\n peg$maxFailPos = peg$currPos;\n peg$maxFailExpected = [];\n }\n\n peg$maxFailExpected.push(expected);\n }\n\n function peg$buildSimpleError(message, location) {\n return new peg$SyntaxError(message, null, null, location);\n }\n\n function peg$buildStructuredError(expected, found, location) {\n return new peg$SyntaxError(\n peg$SyntaxError.buildMessage(expected, found),\n expected,\n found,\n location\n );\n }\n\n function peg$parsestart() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseline();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseline();\n }\n peg$savedPos = s0;\n s1 = peg$f0();\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseline() {\n let s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseS();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseS();\n }\n s2 = peg$parseexpression();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseS();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseS();\n }\n s4 = peg$parsecomment();\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = [];\n s6 = peg$parseNL();\n if (s6 !== peg$FAILED) {\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parseNL();\n }\n } else {\n s5 = peg$FAILED;\n }\n if (s5 === peg$FAILED) {\n s5 = peg$parseEOF();\n }\n if (s5 !== peg$FAILED) {\n s1 = [s1, s2, s3, s4, s5];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseS();\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseS();\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseNL();\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseNL();\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 === peg$FAILED) {\n s2 = peg$parseEOF();\n }\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$parseNL();\n }\n }\n\n return s0;\n }\n\n function peg$parseexpression() {\n let s0;\n\n s0 = peg$parsecomment();\n if (s0 === peg$FAILED) {\n s0 = peg$parsetable_or_array_path();\n if (s0 === peg$FAILED) {\n s0 = peg$parseassignment();\n }\n }\n\n return s0;\n }\n\n function peg$parsecomment() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 35) {\n s1 = peg$c0;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = input.charAt(peg$currPos);\n if (peg$r0.test(s3)) {\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e1); }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = input.charAt(peg$currPos);\n if (peg$r0.test(s3)) {\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e1); }\n }\n }\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsetable_or_array_path() {\n let s0, s1, s2, s3, s4, s5, s6, s7;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c1;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e2); }\n }\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 91) {\n s2 = peg$c1;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e2); }\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseS();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseS();\n }\n s4 = peg$parsetable_key();\n if (s4 !== peg$FAILED) {\n s5 = [];\n s6 = peg$parseS();\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parseS();\n }\n if (input.charCodeAt(peg$currPos) === 93) {\n s6 = peg$c2;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e3); }\n }\n if (s6 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 93) {\n s7 = peg$c2;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e3); }\n }\n if (s7 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f1(s4);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c1;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e2); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseS();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseS();\n }\n s3 = peg$parsetable_key();\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$parseS();\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseS();\n }\n if (input.charCodeAt(peg$currPos) === 93) {\n s5 = peg$c2;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e3); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f2(s3);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parsetable_key() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parsedot_ended_table_key_part();\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parsedot_ended_table_key_part();\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parsetable_key_part();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f3(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsetable_key_part();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f4(s1);\n }\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parsetable_key_part() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseS();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseS();\n }\n s2 = peg$parsesimple_key();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseS();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseS();\n }\n peg$savedPos = s0;\n s0 = peg$f5(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsedot_ended_table_key_part() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseS();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseS();\n }\n s2 = peg$parsesimple_key();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseS();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseS();\n }\n if (input.charCodeAt(peg$currPos) === 46) {\n s4 = peg$c3;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e4); }\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f6(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseassignment() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = peg$parseinline_key();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseS();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseS();\n }\n if (input.charCodeAt(peg$currPos) === 61) {\n s3 = peg$c4;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e5); }\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$parseS();\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseS();\n }\n s5 = peg$parsevalue();\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f7(s1, s5);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsekey() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseASCII_BASIC();\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseASCII_BASIC();\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parsequoted_key() {\n let s0, s1;\n\n s0 = peg$currPos;\n s1 = peg$parsedouble_quoted_single_line_string();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f8(s1);\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsesingle_quoted_single_line_string();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f9(s1);\n }\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parsevalue() {\n let s0;\n\n s0 = peg$parsestring();\n if (s0 === peg$FAILED) {\n s0 = peg$parsenumber_or_date();\n if (s0 === peg$FAILED) {\n s0 = peg$parseboolean();\n if (s0 === peg$FAILED) {\n s0 = peg$parsearray();\n if (s0 === peg$FAILED) {\n s0 = peg$parseinline_table();\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parsenumber_or_date() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r1.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (input.substr(peg$currPos, 3) === peg$c5) {\n s2 = peg$c5;\n peg$currPos += 3;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e7); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f10(s1);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r1.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (input.substr(peg$currPos, 3) === peg$c6) {\n s2 = peg$c6;\n peg$currPos += 3;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f11(s1);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$parsedatetime();\n if (s0 === peg$FAILED) {\n s0 = peg$parsefloat();\n if (s0 === peg$FAILED) {\n s0 = peg$parseinteger();\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parsestring() {\n let s0;\n\n s0 = peg$parsedouble_quoted_multiline_string();\n if (s0 === peg$FAILED) {\n s0 = peg$parsedouble_quoted_single_line_string();\n if (s0 === peg$FAILED) {\n s0 = peg$parsesingle_quoted_multiline_string();\n if (s0 === peg$FAILED) {\n s0 = peg$parsesingle_quoted_single_line_string();\n }\n }\n }\n\n return s0;\n }\n\n function peg$parsedouble_quoted_multiline_string() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 3) === peg$c7) {\n s1 = peg$c7;\n peg$currPos += 3;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e9); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseNL();\n if (s2 === peg$FAILED) {\n s2 = null;\n }\n s3 = peg$parsemlb_body();\n if (input.substr(peg$currPos, 3) === peg$c7) {\n s4 = peg$c7;\n peg$currPos += 3;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e9); }\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f12(s3);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsedouble_quoted_single_line_string() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 34) {\n s1 = peg$c8;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e10); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parsestring_char();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parsestring_char();\n }\n if (input.charCodeAt(peg$currPos) === 34) {\n s3 = peg$c8;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e10); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f13(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsesingle_quoted_multiline_string() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 3) === peg$c9) {\n s1 = peg$c9;\n peg$currPos += 3;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e11); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseNL();\n if (s2 === peg$FAILED) {\n s2 = null;\n }\n s3 = peg$parsemll_body();\n if (input.substr(peg$currPos, 3) === peg$c9) {\n s4 = peg$c9;\n peg$currPos += 3;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e11); }\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f14(s3);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsesingle_quoted_single_line_string() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 39) {\n s1 = peg$c10;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e12); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseliteral_char();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseliteral_char();\n }\n if (input.charCodeAt(peg$currPos) === 39) {\n s3 = peg$c10;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e12); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f15(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsemlb_body() {\n let s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parsemlb_content();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parsemlb_content();\n }\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parsemlb_quotes();\n if (s4 !== peg$FAILED) {\n s5 = [];\n s6 = peg$parsemlb_content();\n if (s6 !== peg$FAILED) {\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parsemlb_content();\n }\n } else {\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parsemlb_quotes();\n if (s4 !== peg$FAILED) {\n s5 = [];\n s6 = peg$parsemlb_content();\n if (s6 !== peg$FAILED) {\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parsemlb_content();\n }\n } else {\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n s3 = peg$parsemlb_trailing();\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f16(s1, s2, s3);\n\n return s0;\n }\n\n function peg$parsemlb_content() {\n let s0, s1, s2;\n\n s0 = peg$parseESCAPED();\n if (s0 === peg$FAILED) {\n s0 = peg$parsemlb_escaped_newline();\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s1 = peg$c11;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e13); }\n }\n if (s1 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e14); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f17();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c12) {\n s1 = peg$c12;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f18();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = [];\n s2 = input.charAt(peg$currPos);\n if (peg$r2.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = input.charAt(peg$currPos);\n if (peg$r2.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parsemlb_escaped_newline() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s1 = peg$c11;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e13); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseS();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseS();\n }\n s3 = peg$parseNL();\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$parseNLS();\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseNLS();\n }\n peg$savedPos = s0;\n s0 = peg$f19();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsemlb_quotes() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c13) {\n s1 = peg$c13;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e17); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.charCodeAt(peg$currPos) === 34) {\n s3 = peg$c8;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e10); }\n }\n peg$silentFails--;\n if (s3 === peg$FAILED) {\n s2 = undefined;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f20();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 34) {\n s1 = peg$c8;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e10); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.charCodeAt(peg$currPos) === 34) {\n s3 = peg$c8;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e10); }\n }\n peg$silentFails--;\n if (s3 === peg$FAILED) {\n s2 = undefined;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f21();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parsemlb_trailing() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c13) {\n s1 = peg$c13;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e17); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.substr(peg$currPos, 3) === peg$c7) {\n s3 = peg$c7;\n peg$currPos += 3;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e9); }\n }\n peg$silentFails--;\n if (s3 !== peg$FAILED) {\n peg$currPos = s2;\n s2 = undefined;\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f22();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 34) {\n s1 = peg$c8;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e10); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.substr(peg$currPos, 3) === peg$c7) {\n s3 = peg$c7;\n peg$currPos += 3;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e9); }\n }\n peg$silentFails--;\n if (s3 !== peg$FAILED) {\n peg$currPos = s2;\n s2 = undefined;\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f23();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parsemll_body() {\n let s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parsemll_content();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parsemll_content();\n }\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parsemll_quotes();\n if (s4 !== peg$FAILED) {\n s5 = [];\n s6 = peg$parsemll_content();\n if (s6 !== peg$FAILED) {\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parsemll_content();\n }\n } else {\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parsemll_quotes();\n if (s4 !== peg$FAILED) {\n s5 = [];\n s6 = peg$parsemll_content();\n if (s6 !== peg$FAILED) {\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parsemll_content();\n }\n } else {\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n s3 = peg$parsemll_trailing();\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f24(s1, s2, s3);\n\n return s0;\n }\n\n function peg$parsemll_content() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c12) {\n s1 = peg$c12;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f25();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = [];\n s2 = input.charAt(peg$currPos);\n if (peg$r3.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e18); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = input.charAt(peg$currPos);\n if (peg$r3.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e18); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n }\n\n return s0;\n }\n\n function peg$parsemll_quotes() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c14) {\n s1 = peg$c14;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e19); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.charCodeAt(peg$currPos) === 39) {\n s3 = peg$c10;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e12); }\n }\n peg$silentFails--;\n if (s3 === peg$FAILED) {\n s2 = undefined;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f26();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 39) {\n s1 = peg$c10;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e12); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.charCodeAt(peg$currPos) === 39) {\n s3 = peg$c10;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e12); }\n }\n peg$silentFails--;\n if (s3 === peg$FAILED) {\n s2 = undefined;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f27();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parsemll_trailing() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c14) {\n s1 = peg$c14;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e19); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.substr(peg$currPos, 3) === peg$c9) {\n s3 = peg$c9;\n peg$currPos += 3;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e11); }\n }\n peg$silentFails--;\n if (s3 !== peg$FAILED) {\n peg$currPos = s2;\n s2 = undefined;\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f28();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 39) {\n s1 = peg$c10;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e12); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.substr(peg$currPos, 3) === peg$c9) {\n s3 = peg$c9;\n peg$currPos += 3;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e11); }\n }\n peg$silentFails--;\n if (s3 !== peg$FAILED) {\n peg$currPos = s2;\n s2 = undefined;\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f29();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parsestring_char() {\n let s0, s1, s2;\n\n s0 = peg$parseESCAPED();\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s1 = peg$c11;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e13); }\n }\n if (s1 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e14); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f30();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = [];\n s2 = input.charAt(peg$currPos);\n if (peg$r4.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e20); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = input.charAt(peg$currPos);\n if (peg$r4.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e20); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseliteral_char() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = input.charAt(peg$currPos);\n if (peg$r5.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e21); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = input.charAt(peg$currPos);\n if (peg$r5.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e21); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parsefloat() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n s1 = peg$parsefloat_or_int_text();\n if (s1 !== peg$FAILED) {\n s2 = input.charAt(peg$currPos);\n if (peg$r6.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e22); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parsefloat_exp_text();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f31(s1, s3);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsefloat_text();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f32(s1);\n }\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parsefloat_text() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r1.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$parseFLOAT_DEC_INT();\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 46) {\n s3 = peg$c3;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e4); }\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$currPos;\n s5 = peg$parseDEC_DIGIT_SEQ();\n if (s5 !== peg$FAILED) {\n s4 = input.substring(s4, peg$currPos);\n } else {\n s4 = s5;\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f33(s1, s2, s4);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsefloat_or_int_text() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r1.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$parseFLOAT_DEC_INT();\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 46) {\n s3 = peg$c3;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e4); }\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$currPos;\n s5 = peg$parseDEC_DIGIT_SEQ();\n if (s5 !== peg$FAILED) {\n s4 = input.substring(s4, peg$currPos);\n } else {\n s4 = s5;\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f34(s1, s2, s4);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r1.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$parseFLOAT_DEC_INT();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f35(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseFLOAT_DEC_INT() {\n let s0, s1;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 48) {\n s1 = peg$c15;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e23); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f36();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseDEC_INT_NOZERO_SEQ();\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n }\n\n return s0;\n }\n\n function peg$parsefloat_exp_text() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r1.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$currPos;\n s3 = peg$parseDEC_DIGIT_SEQ();\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f37(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseinteger() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c16) {\n s1 = peg$c16;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e24); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$parseHEX_DIGIT_SEQ();\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f38(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c17) {\n s1 = peg$c17;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e25); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$parseOCT_DIGIT_SEQ();\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f39(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c18) {\n s1 = peg$c18;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e26); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$parseBIN_DIGIT_SEQ();\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f40(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsedec_integer_text();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f41(s1);\n }\n s0 = s1;\n }\n }\n }\n\n return s0;\n }\n\n function peg$parsedec_integer_text() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r1.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (input.charCodeAt(peg$currPos) === 48) {\n s2 = peg$c15;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e23); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$currPos;\n peg$silentFails++;\n s4 = input.charAt(peg$currPos);\n if (peg$r7.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e27); }\n }\n peg$silentFails--;\n if (s4 === peg$FAILED) {\n s3 = undefined;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$currPos;\n peg$silentFails++;\n if (input.charCodeAt(peg$currPos) === 46) {\n s5 = peg$c3;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e4); }\n }\n peg$silentFails--;\n if (s5 === peg$FAILED) {\n s4 = undefined;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f42(s1);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r1.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$currPos;\n s3 = peg$parseDEC_INT_NOZERO_SEQ();\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$currPos;\n peg$silentFails++;\n if (input.charCodeAt(peg$currPos) === 46) {\n s4 = peg$c3;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e4); }\n }\n peg$silentFails--;\n if (s4 === peg$FAILED) {\n s3 = undefined;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f43(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseDEC_INT_NOZERO_SEQ() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r8.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e28); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r10.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e30); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r10.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e30); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseDEC_DIGIT_SEQ() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r10.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e30); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r10.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e30); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r10.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e30); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseHEX_DIGIT_SEQ() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r11.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e31); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r11.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e31); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r11.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e31); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseOCT_DIGIT_SEQ() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r12.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e32); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r12.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e32); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r12.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e32); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseBIN_DIGIT_SEQ() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r13.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e33); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r13.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e33); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r13.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e33); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseboolean() {\n let s0, s1;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 4) === peg$c19) {\n s1 = peg$c19;\n peg$currPos += 4;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e34); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f44();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5) === peg$c20) {\n s1 = peg$c20;\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e35); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f45();\n }\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parsearray() {\n let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c1;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e2); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parsearray_sep();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parsearray_sep();\n }\n if (input.charCodeAt(peg$currPos) === 93) {\n s3 = peg$c2;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e3); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f46();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c1;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e2); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parsearray_sep();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parsearray_sep();\n }\n s3 = peg$parsevalue();\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$currPos;\n s6 = [];\n s7 = peg$parsearray_sep();\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$parsearray_sep();\n }\n if (input.charCodeAt(peg$currPos) === 44) {\n s7 = peg$c21;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e36); }\n }\n if (s7 !== peg$FAILED) {\n s8 = [];\n s9 = peg$parsearray_sep();\n while (s9 !== peg$FAILED) {\n s8.push(s9);\n s9 = peg$parsearray_sep();\n }\n s9 = peg$parsevalue();\n if (s9 !== peg$FAILED) {\n peg$savedPos = s5;\n s5 = peg$f47(s3, s9);\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$currPos;\n s6 = [];\n s7 = peg$parsearray_sep();\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$parsearray_sep();\n }\n if (input.charCodeAt(peg$currPos) === 44) {\n s7 = peg$c21;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e36); }\n }\n if (s7 !== peg$FAILED) {\n s8 = [];\n s9 = peg$parsearray_sep();\n while (s9 !== peg$FAILED) {\n s8.push(s9);\n s9 = peg$parsearray_sep();\n }\n s9 = peg$parsevalue();\n if (s9 !== peg$FAILED) {\n peg$savedPos = s5;\n s5 = peg$f47(s3, s9);\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n }\n s5 = [];\n s6 = peg$parsearray_sep();\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parsearray_sep();\n }\n if (input.charCodeAt(peg$currPos) === 44) {\n s6 = peg$c21;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e36); }\n }\n if (s6 === peg$FAILED) {\n s6 = null;\n }\n s7 = [];\n s8 = peg$parsearray_sep();\n while (s8 !== peg$FAILED) {\n s7.push(s8);\n s8 = peg$parsearray_sep();\n }\n if (input.charCodeAt(peg$currPos) === 93) {\n s8 = peg$c2;\n peg$currPos++;\n } else {\n s8 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e3); }\n }\n if (s8 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f48(s3, s4);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parsearray_sep() {\n let s0;\n\n s0 = peg$parseS();\n if (s0 === peg$FAILED) {\n s0 = peg$parseNL();\n if (s0 === peg$FAILED) {\n s0 = peg$parsecomment();\n }\n }\n\n return s0;\n }\n\n function peg$parseinline_table() {\n let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 123) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e37); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseinline_sep();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseinline_sep();\n }\n if (input.charCodeAt(peg$currPos) === 125) {\n s3 = peg$c23;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e38); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f49();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 123) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e37); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseinline_sep();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseinline_sep();\n }\n s3 = peg$parseinline_table_entry();\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$currPos;\n s6 = [];\n s7 = peg$parseinline_sep();\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$parseinline_sep();\n }\n if (input.charCodeAt(peg$currPos) === 44) {\n s7 = peg$c21;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e36); }\n }\n if (s7 !== peg$FAILED) {\n s8 = [];\n s9 = peg$parseinline_sep();\n while (s9 !== peg$FAILED) {\n s8.push(s9);\n s9 = peg$parseinline_sep();\n }\n s9 = peg$parseinline_table_entry();\n if (s9 !== peg$FAILED) {\n peg$savedPos = s5;\n s5 = peg$f50(s3, s9);\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$currPos;\n s6 = [];\n s7 = peg$parseinline_sep();\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$parseinline_sep();\n }\n if (input.charCodeAt(peg$currPos) === 44) {\n s7 = peg$c21;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e36); }\n }\n if (s7 !== peg$FAILED) {\n s8 = [];\n s9 = peg$parseinline_sep();\n while (s9 !== peg$FAILED) {\n s8.push(s9);\n s9 = peg$parseinline_sep();\n }\n s9 = peg$parseinline_table_entry();\n if (s9 !== peg$FAILED) {\n peg$savedPos = s5;\n s5 = peg$f50(s3, s9);\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n }\n s5 = [];\n s6 = peg$parseinline_sep();\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parseinline_sep();\n }\n if (input.charCodeAt(peg$currPos) === 44) {\n s6 = peg$c21;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e36); }\n }\n if (s6 === peg$FAILED) {\n s6 = null;\n }\n s7 = [];\n s8 = peg$parseinline_sep();\n while (s8 !== peg$FAILED) {\n s7.push(s8);\n s8 = peg$parseinline_sep();\n }\n if (input.charCodeAt(peg$currPos) === 125) {\n s8 = peg$c23;\n peg$currPos++;\n } else {\n s8 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e38); }\n }\n if (s8 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f51(s3, s4);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseinline_table_entry() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = peg$parseinline_key();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseS();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseS();\n }\n if (input.charCodeAt(peg$currPos) === 61) {\n s3 = peg$c4;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e5); }\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$parseS();\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseS();\n }\n s5 = peg$parsevalue();\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f52(s1, s5);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseinline_sep() {\n let s0;\n\n s0 = peg$parseS();\n if (s0 === peg$FAILED) {\n s0 = peg$parseNL();\n if (s0 === peg$FAILED) {\n s0 = peg$parsecomment();\n }\n }\n\n return s0;\n }\n\n function peg$parseinline_key() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseinline_dot_key_part();\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseinline_dot_key_part();\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseS();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseS();\n }\n s3 = peg$parsesimple_key();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f53(s1, s3);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsesimple_key();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f54(s1);\n }\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parseinline_dot_key_part() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseS();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseS();\n }\n s2 = peg$parsesimple_key();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseS();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseS();\n }\n if (input.charCodeAt(peg$currPos) === 46) {\n s4 = peg$c3;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e4); }\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f55(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsesimple_key() {\n let s0;\n\n s0 = peg$parsekey();\n if (s0 === peg$FAILED) {\n s0 = peg$parsequoted_key();\n }\n\n return s0;\n }\n\n function peg$parsesecfragment() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s2 = peg$c3;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e4); }\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseDIGIT();\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseDIGIT();\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parsedate_part() {\n let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$parseDIGIT();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseDIGIT();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseDIGIT();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseDIGIT();\n if (s5 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 45) {\n s6 = peg$c24;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e39); }\n }\n if (s6 !== peg$FAILED) {\n s7 = peg$parseDIGIT();\n if (s7 !== peg$FAILED) {\n s8 = peg$parseDIGIT();\n if (s8 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 45) {\n s9 = peg$c24;\n peg$currPos++;\n } else {\n s9 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e39); }\n }\n if (s9 !== peg$FAILED) {\n s10 = peg$parseDIGIT();\n if (s10 !== peg$FAILED) {\n s11 = peg$parseDIGIT();\n if (s11 !== peg$FAILED) {\n s2 = [s2, s3, s4, s5, s6, s7, s8, s9, s10, s11];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parsetime_part() {\n let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$currPos;\n s3 = peg$parseDIGIT();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseDIGIT();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s5 = peg$c25;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e40); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseDIGIT();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseDIGIT();\n if (s7 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s8 = peg$c25;\n peg$currPos++;\n } else {\n s8 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e40); }\n }\n if (s8 !== peg$FAILED) {\n s9 = peg$parseDIGIT();\n if (s9 !== peg$FAILED) {\n s10 = peg$parseDIGIT();\n if (s10 !== peg$FAILED) {\n s3 = [s3, s4, s5, s6, s7, s8, s9, s10];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s1 = input.substring(s1, peg$currPos);\n } else {\n s1 = s2;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parsesecfragment();\n if (s2 === peg$FAILED) {\n s2 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f56(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$currPos;\n s3 = peg$parseDIGIT();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseDIGIT();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s5 = peg$c25;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e40); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseDIGIT();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseDIGIT();\n if (s7 !== peg$FAILED) {\n s3 = [s3, s4, s5, s6, s7];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s1 = input.substring(s1, peg$currPos);\n } else {\n s1 = s2;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.charCodeAt(peg$currPos) === 58) {\n s3 = peg$c25;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e40); }\n }\n peg$silentFails--;\n if (s3 === peg$FAILED) {\n s2 = undefined;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f57(s1);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseoffset() {\n let s0, s1, s2, s3, s4, s5, s6, s7;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (s1.toLowerCase() === peg$c26) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e41); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f58();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = input.charAt(peg$currPos);\n if (peg$r1.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseDIGIT();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseDIGIT();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s5 = peg$c25;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e40); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseDIGIT();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseDIGIT();\n if (s7 !== peg$FAILED) {\n s2 = [s2, s3, s4, s5, s6, s7];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n }\n\n return s0;\n }\n\n function peg$parsedatetime() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$parsedate_part();\n if (s1 !== peg$FAILED) {\n s2 = peg$parsedatetime_delim();\n if (s2 !== peg$FAILED) {\n s3 = peg$parsetime_part();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseoffset();\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f59(s1, s3, s4);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsedate_part();\n if (s1 !== peg$FAILED) {\n s2 = peg$parsedatetime_delim();\n if (s2 !== peg$FAILED) {\n s3 = peg$parsetime_part();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f60(s1, s3);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsedate_part();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n s3 = peg$parsedatetime_delim();\n peg$silentFails--;\n if (s3 === peg$FAILED) {\n s2 = undefined;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f61(s1);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsetime_part();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f62(s1);\n }\n s0 = s1;\n }\n }\n }\n\n return s0;\n }\n\n function peg$parsedatetime_delim() {\n let s0, s1, s2, s3;\n\n s0 = input.charAt(peg$currPos);\n if (s0.toLowerCase() === peg$c27) {\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e42); }\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 32) {\n s1 = peg$c28;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e43); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n s3 = peg$parseDIGIT();\n peg$silentFails--;\n if (s3 !== peg$FAILED) {\n peg$currPos = s2;\n s2 = undefined;\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseS() {\n let s0;\n\n s0 = input.charAt(peg$currPos);\n if (peg$r14.test(s0)) {\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e44); }\n }\n\n return s0;\n }\n\n function peg$parseNL() {\n let s0, s1, s2;\n\n if (input.charCodeAt(peg$currPos) === 10) {\n s0 = peg$c29;\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e45); }\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 13) {\n s1 = peg$c30;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e46); }\n }\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 10) {\n s2 = peg$c29;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e45); }\n }\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseNLS() {\n let s0;\n\n s0 = peg$parseNL();\n if (s0 === peg$FAILED) {\n s0 = peg$parseS();\n }\n\n return s0;\n }\n\n function peg$parseEOF() {\n let s0, s1;\n\n s0 = peg$currPos;\n peg$silentFails++;\n if (input.length > peg$currPos) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e14); }\n }\n peg$silentFails--;\n if (s1 === peg$FAILED) {\n s0 = undefined;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseDIGIT() {\n let s0;\n\n s0 = input.charAt(peg$currPos);\n if (peg$r10.test(s0)) {\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e30); }\n }\n\n return s0;\n }\n\n function peg$parseHEX() {\n let s0;\n\n s0 = input.charAt(peg$currPos);\n if (peg$r11.test(s0)) {\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e31); }\n }\n\n return s0;\n }\n\n function peg$parseASCII_BASIC() {\n let s0;\n\n s0 = input.charAt(peg$currPos);\n if (peg$r15.test(s0)) {\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e47); }\n }\n\n return s0;\n }\n\n function peg$parseESCAPED() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s1 = peg$c11;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e13); }\n }\n if (s1 !== peg$FAILED) {\n s2 = input.charAt(peg$currPos);\n if (peg$r16.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e48); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f63(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$parseESCAPED_UNICODE();\n }\n\n return s0;\n }\n\n function peg$parseESCAPED_UNICODE() {\n let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c31) {\n s1 = peg$c31;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e49); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$currPos;\n s4 = peg$parseHEX();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseHEX();\n if (s5 !== peg$FAILED) {\n s6 = peg$parseHEX();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseHEX();\n if (s7 !== peg$FAILED) {\n s8 = peg$parseHEX();\n if (s8 !== peg$FAILED) {\n s9 = peg$parseHEX();\n if (s9 !== peg$FAILED) {\n s10 = peg$parseHEX();\n if (s10 !== peg$FAILED) {\n s11 = peg$parseHEX();\n if (s11 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7, s8, s9, s10, s11];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f64(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c32) {\n s1 = peg$c32;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e50); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$currPos;\n s4 = peg$parseHEX();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseHEX();\n if (s5 !== peg$FAILED) {\n s6 = peg$parseHEX();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseHEX();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f65(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c33) {\n s1 = peg$c33;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e51); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$currPos;\n s4 = peg$parseHEX();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseHEX();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f66(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n }\n\n return s0;\n }\n\n\n var nodes = [];\n var inputText = input;\n\n function resolveLineCol(off) {\n var line = 1, col = 1;\n for (var i = 0; i < off; i++) {\n if (inputText.charCodeAt(i) === 10) { line++; col = 1; }\n else { col++; }\n }\n return { line: line, column: col };\n }\n\n function genError(err, off) {\n var pos = resolveLineCol(off);\n var ex = new Error(err);\n ex.line = pos.line;\n ex.column = pos.column;\n throw ex;\n }\n\n function addNode(node) {\n nodes.push(node);\n }\n\n function node(type, value, off, key) {\n var obj = { type: type, value: value, offset: off };\n if (key) obj.key = key;\n return obj;\n }\n\n function validateDate(dateStr, off) {\n var year = dateStr.charCodeAt(0) * 1000 + dateStr.charCodeAt(1) * 100 + dateStr.charCodeAt(2) * 10 + dateStr.charCodeAt(3) - 53328;\n var month = (dateStr.charCodeAt(5) - 48) * 10 + dateStr.charCodeAt(6) - 48;\n var day = (dateStr.charCodeAt(8) - 48) * 10 + dateStr.charCodeAt(9) - 48;\n if (month < 1 || month > 12) {\n genError(\"Invalid date: month \" + month + \" out of range.\", off);\n }\n var maxDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) {\n maxDays[1] = 29;\n }\n if (day < 1 || day > maxDays[month - 1]) {\n genError(\"Invalid date: day \" + day + \" out of range for month \" + month + \".\", off);\n }\n }\n\n function validateTime(timeStr, off) {\n var hour = (timeStr.charCodeAt(0) - 48) * 10 + timeStr.charCodeAt(1) - 48;\n var minute = (timeStr.charCodeAt(3) - 48) * 10 + timeStr.charCodeAt(4) - 48;\n var second = (timeStr.charCodeAt(6) - 48) * 10 + timeStr.charCodeAt(7) - 48;\n if (hour > 23) {\n genError(\"Invalid time: hour \" + hour + \" out of range.\", off);\n }\n if (minute > 59) {\n genError(\"Invalid time: minute \" + minute + \" out of range.\", off);\n }\n if (second > 59) {\n genError(\"Invalid time: second \" + second + \" out of range.\", off);\n }\n }\n\n function validateOffset(offsetStr, off) {\n if (offsetStr === \"Z\" || offsetStr === \"z\") return;\n var hour = (offsetStr.charCodeAt(1) - 48) * 10 + offsetStr.charCodeAt(2) - 48;\n var minute = (offsetStr.charCodeAt(4) - 48) * 10 + offsetStr.charCodeAt(5) - 48;\n if (hour > 23) {\n genError(\"Invalid offset: hour \" + hour + \" out of range.\", off);\n }\n if (minute > 59) {\n genError(\"Invalid offset: minute \" + minute + \" out of range.\", off);\n }\n }\n\n function stripUnderscores(str) {\n return str.indexOf('_') === -1 ? str : str.replace(/_/g, '');\n }\n\n function convertCodePoint(str) {\n var num = parseInt(str, 16);\n\n if (\n num !== num ||\n num < 0 ||\n num > 0x10FFFF ||\n (num > 0xD7FF && num < 0xE000)\n ) {\n genError(\"Invalid Unicode escape code: \" + str, offset());\n } else {\n return String.fromCodePoint(num);\n }\n }\n\n peg$result = peg$startRuleFunction();\n\n const peg$success = (peg$result !== peg$FAILED && peg$currPos === input.length);\n function peg$throw() {\n if (peg$result !== peg$FAILED && peg$currPos < input.length) {\n peg$fail(peg$endExpectation());\n }\n\n throw peg$buildStructuredError(\n peg$maxFailExpected,\n peg$maxFailPos < input.length ? peg$getUnicode(peg$maxFailPos) : null,\n peg$maxFailPos < input.length\n ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)\n : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)\n );\n }\n if (options.peg$library) {\n return /** @type {any} */ ({\n peg$result,\n peg$currPos,\n peg$FAILED,\n peg$maxFailExpected,\n peg$maxFailPos,\n peg$success,\n peg$throw: peg$success ? undefined : peg$throw,\n });\n }\n if (peg$success) {\n return peg$result;\n } else {\n peg$throw();\n }\n}\n\nmodule.exports = {\n StartRules: [\"start\"],\n SyntaxError: peg$SyntaxError,\n parse: peg$parse,\n};\n","\"use strict\";\nfunction compile(nodes, inputText) {\n var assignedPaths = new Set();\n var valueAssignments = new Set();\n var explicitTablePaths = new Set();\n var currentPath = [];\n var ownedContainers = new WeakSet();\n var data = createTable();\n var context = data;\n\n return reduce(nodes);\n\n function reduce(nodes) {\n var node;\n for (var i = 0; i < nodes.length; i++) {\n node = nodes[i];\n switch (node.type) {\n case \"Assign\":\n assign(node);\n break;\n case \"ObjectPath\":\n setPath(node);\n break;\n case \"ArrayPath\":\n addTableArray(node);\n break;\n }\n }\n\n return data;\n }\n\n function resolveLineCol(off) {\n var line = 1, col = 1;\n for (var i = 0; i < off; i++) {\n if (inputText.charCodeAt(i) === 10) { line++; col = 1; }\n else { col++; }\n }\n return { line: line, column: col };\n }\n\n function genError(err, off) {\n var pos = resolveLineCol(off);\n var ex = new Error(err);\n ex.line = pos.line;\n ex.column = pos.column;\n throw ex;\n }\n\n function assign(node) {\n var keys = node.key;\n var value = node.value;\n var off = node.offset;\n\n if (!Array.isArray(keys)) keys = [keys];\n\n var reduced = reduceValueNode(value);\n\n var target = context;\n for (var i = 0; i < keys.length - 1; i++) {\n var k = keys[i];\n var intermediatePath = makeFullPath(keys.slice(0, i + 1));\n\n if (typeof target[k] === \"undefined\") {\n target[k] = createTable();\n assignedPaths.add(intermediatePath);\n } else if (typeof target[k] !== \"object\" || target[k] === null || Array.isArray(target[k])) {\n genError(\"Cannot redefine existing key '\" + intermediatePath + \"'.\", off);\n } else if (valueAssignments.has(intermediatePath)) {\n genError(\"Cannot redefine existing key '\" + intermediatePath + \"'.\", off);\n } else if (explicitTablePaths.has(intermediatePath) && intermediatePath !== pathKey(currentPath)) {\n genError(\"Cannot use dotted keys to extend table '\" + intermediatePath + \"' defined elsewhere.\", off);\n }\n target = target[k];\n }\n\n var lastKey = keys[keys.length - 1];\n var fullPath = makeFullPath(keys);\n\n if (typeof target[lastKey] !== \"undefined\") {\n genError(\"Cannot redefine existing key '\" + fullPath + \"'.\", off);\n }\n\n target[lastKey] = reduced;\n\n assignedPaths.add(fullPath);\n valueAssignments.add(fullPath);\n }\n\n\n function reduceValueNode(node) {\n if (node.type === \"Array\") {\n return reduceArray(node.value);\n } else if (node.type === \"InlineTable\") {\n return reduceInlineTableNode(node.value);\n } else {\n return node.value;\n }\n }\n\n function reduceInlineTableNode(values) {\n var obj = createTable();\n var definedKeys = new Set();\n\n for (var i = 0; i < values.length; i++) {\n var val = values[i];\n if (val.type !== \"InlineTableValue\") continue;\n\n var keys = val.key;\n if (!Array.isArray(keys)) keys = [keys];\n\n var reduced = reduceValueNode(val.value);\n setNestedKey(obj, keys, reduced, val.offset, definedKeys);\n\n definedKeys.add(pathKey(keys));\n }\n\n return obj;\n }\n\n function setNestedKey(obj, keys, value, off, definedKeys) {\n for (var i = 0; i < keys.length - 1; i++) {\n var k = keys[i];\n var intermediatePath = pathKey(keys.slice(0, i + 1));\n if (typeof obj[k] === \"undefined\") {\n obj[k] = createTable();\n } else if (typeof obj[k] !== \"object\" || obj[k] === null || Array.isArray(obj[k])) {\n genError(\"Cannot redefine existing key '\" + intermediatePath + \"'.\", off);\n } else if (definedKeys && definedKeys.has(intermediatePath)) {\n genError(\"Cannot extend inline table '\" + intermediatePath + \"'.\", off);\n }\n obj = obj[k];\n }\n var lastKey = keys[keys.length - 1];\n if (typeof obj[lastKey] !== \"undefined\") {\n genError(\"Cannot redefine existing key '\" + pathKey(keys) + \"'.\", off);\n }\n obj[lastKey] = value;\n }\n\n function setPath(node) {\n var path = node.value;\n var quotedPath = path.map(quoteDottedString).join(\".\");\n var off = node.offset;\n\n if (assignedPaths.has(quotedPath)) {\n genError(\"Cannot redefine existing key '\" + path + \"'.\", off);\n }\n assignedPaths.add(quotedPath);\n explicitTablePaths.add(quotedPath);\n context = deepRef(data, path, createTable(), off);\n currentPath = path;\n }\n\n function addTableArray(node) {\n var path = node.value;\n var quotedPath = path.map(quoteDottedString).join(\".\");\n var off = node.offset;\n\n if (valueAssignments.has(quotedPath)) {\n genError(\"Cannot append to statically defined array '\" + quotedPath + \"'.\", off);\n }\n\n // Clear this table array path and paths nested under it.\n assignedPaths.forEach(function(p) {\n if (isSameOrSubPath(p, quotedPath)) assignedPaths.delete(p);\n });\n valueAssignments.forEach(function(p) {\n if (isSameOrSubPath(p, quotedPath)) valueAssignments.delete(p);\n });\n assignedPaths.add(quotedPath);\n context = deepRef(data, path, createTableArray(), off);\n currentPath = path;\n\n if (context instanceof Array) {\n var newObj = createTable();\n context.push(newObj);\n context = newObj;\n } else {\n genError(\"Cannot redefine existing key '\" + path + \"'.\", off);\n }\n }\n\n function deepRef(start, keys, value, off) {\n var ctx = start;\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var traversedPath = pathKey(keys.slice(0, i + 1));\n if (typeof ctx[key] === \"undefined\") {\n if (i === keys.length - 1) {\n ctx[key] = value;\n } else {\n ctx[key] = createTable();\n }\n } else if (i !== keys.length - 1 && valueAssignments.has(traversedPath)) {\n genError(\"Cannot redefine existing key '\" + traversedPath + \"'.\", off);\n }\n\n ctx = ctx[key];\n if (i < keys.length - 1) {\n if (!isOwnedContainer(ctx)) {\n genError(\"Cannot redefine existing key '\" + traversedPath + \"'.\", off);\n }\n if (ctx instanceof Array) {\n if (!ctx.length) {\n genError(\"Cannot redefine existing key '\" + traversedPath + \"'.\", off);\n }\n ctx = ctx[ctx.length - 1];\n if (!isOwnedContainer(ctx)) {\n genError(\"Cannot redefine existing key '\" + traversedPath + \"'.\", off);\n }\n }\n }\n }\n\n return ctx;\n }\n\n function reduceArray(array) {\n return array.map(reduceValueNode);\n }\n\n function quoteDottedString(str) {\n if (str.indexOf(\".\") > -1) {\n return \"\\\"\" + str + \"\\\"\";\n } else {\n return str;\n }\n }\n\n function createTable() {\n var table = Object.create(null);\n ownedContainers.add(table);\n return table;\n }\n\n function createTableArray() {\n var tableArray = [];\n ownedContainers.add(tableArray);\n return tableArray;\n }\n\n function isOwnedContainer(value) {\n return value !== null && typeof value === \"object\" && ownedContainers.has(value);\n }\n\n function pathKey(keys) {\n return keys.map(quoteDottedString).join(\".\");\n }\n\n function makeFullPath(keys) {\n return pathKey(currentPath.concat(keys));\n }\n\n function isSameOrSubPath(path, prefix) {\n return path === prefix || path.indexOf(prefix + \".\") === 0;\n }\n}\n\nmodule.exports = {\n compile: compile\n};\n","var parser = require('./lib/parser');\nvar compiler = require('./lib/compiler');\n\nmodule.exports = {\n parse: function(input) {\n var str = input.toString();\n var nodes = parser.parse(str);\n return compiler.compile(nodes, str);\n }\n};\n","/**\n * Parses raw command-line strings into typed values.\n *\n * A `Primitive<A>` receives one string and returns an `Effect` that either\n * produces an `A` or fails with a parser message. `Argument` and `Flag` build\n * on these primitives to add names, aliases, defaults, prompts, configuration\n * fallbacks, repetition, and help metadata. Primitive parsers cover common\n * scalar values, paths, files, structured config files, schema-decoded input,\n * redacted values, and key-value pairs.\n *\n * @since 4.0.0\n */\nimport * as Ini from \"ini\";\nimport * as Toml from \"toml\";\nimport * as Yaml from \"yaml\";\nimport * as Config from \"../../Config.js\";\nimport * as Effect from \"../../Effect.js\";\nimport * as FileSystem from \"../../FileSystem.js\";\nimport { format } from \"../../Formatter.js\";\nimport { identity } from \"../../Function.js\";\nimport * as Path from \"../../Path.js\";\nimport * as Redacted from \"../../Redacted.js\";\nimport * as Schema from \"../../Schema.js\";\nconst TypeId = \"~effect/cli/Primitive\";\nconst Proto = {\n [TypeId]: {\n _A: identity\n }\n};\n/** @internal */\nexport const isTrueValue = /*#__PURE__*/Schema.is(Config.TrueValues);\n/** @internal */\nexport const isFalseValue = /*#__PURE__*/Schema.is(Config.FalseValues);\n/** @internal */\nexport const isBoolean = p => p._tag === \"Boolean\";\nconst makePrimitive = (tag, parse) => Object.assign(Object.create(Proto), {\n _tag: tag,\n parse\n});\nconst makeSchemaPrimitive = (tag, schema) => {\n const toCodecStringTree = Schema.toCodecStringTree(schema);\n const decode = Schema.decodeUnknownEffect(toCodecStringTree);\n return makePrimitive(tag, value => Effect.mapError(decode(value), error => error.message));\n};\n/**\n * Creates a primitive that parses boolean values from string input.\n *\n * **Details**\n *\n * Recognizes various forms of true/false values:\n * - True values: \"true\", \"1\", \"y\", \"yes\", \"on\"\n * - False values: \"false\", \"0\", \"n\", \"no\", \"off\"\n *\n * **Example** (Parsing boolean values)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const parseBoolean = Effect.gen(function*() {\n * const result1 = yield* Primitive.boolean.parse(\"true\")\n * console.log(result1) // true\n *\n * const result2 = yield* Primitive.boolean.parse(\"yes\")\n * console.log(result2) // true\n *\n * const result3 = yield* Primitive.boolean.parse(\"false\")\n * console.log(result3) // false\n *\n * const result4 = yield* Primitive.boolean.parse(\"0\")\n * console.log(result4) // false\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const boolean = /*#__PURE__*/makeSchemaPrimitive(\"Boolean\", Config.Boolean);\n/**\n * Creates a primitive that parses floating-point numbers from string input.\n *\n * **Example** (Parsing floating-point numbers)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const parseFloat = Effect.gen(function*() {\n * const result1 = yield* Primitive.float.parse(\"3.14\")\n * console.log(result1) // 3.14\n *\n * const result2 = yield* Primitive.float.parse(\"-42.5\")\n * console.log(result2) // -42.5\n *\n * const result3 = yield* Primitive.float.parse(\"0\")\n * console.log(result3) // 0\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const float = /*#__PURE__*/makeSchemaPrimitive(\"Float\", Schema.Finite);\n/**\n * Creates a primitive that parses integer numbers from string input.\n *\n * **Example** (Parsing integer values)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const parseInteger = Effect.gen(function*() {\n * const result1 = yield* Primitive.integer.parse(\"42\")\n * console.log(result1) // 42\n *\n * const result2 = yield* Primitive.integer.parse(\"-123\")\n * console.log(result2) // -123\n *\n * const result3 = yield* Primitive.integer.parse(\"0\")\n * console.log(result3) // 0\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const integer = /*#__PURE__*/makeSchemaPrimitive(\"Integer\", Schema.Int);\n/**\n * Creates a primitive that parses Date objects from string input.\n *\n * **Example** (Parsing date values)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const parseDate = Effect.gen(function*() {\n * const result1 = yield* Primitive.date.parse(\"2023-12-25\")\n * console.log(result1) // Date object for December 25, 2023\n *\n * const result2 = yield* Primitive.date.parse(\"2023-12-25T10:30:00Z\")\n * console.log(result2) // Date object with time\n *\n * const result3 = yield* Primitive.date.parse(\"Dec 25, 2023\")\n * console.log(result3) // Date object parsed from natural format\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const date = /*#__PURE__*/makeSchemaPrimitive(\"Date\", Schema.DateValid);\n/**\n * Creates a primitive that accepts any string value without validation.\n *\n * **Example** (Parsing string values)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const parseString = Effect.gen(function*() {\n * const result1 = yield* Primitive.string.parse(\"hello world\")\n * console.log(result1) // \"hello world\"\n *\n * const result2 = yield* Primitive.string.parse(\"\")\n * console.log(result2) // \"\"\n *\n * const result3 = yield* Primitive.string.parse(\"123\")\n * console.log(result3) // \"123\"\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const string = /*#__PURE__*/makePrimitive(\"String\", value => Effect.succeed(value));\n/**\n * Creates a primitive that accepts only specific choice values mapped to custom types.\n *\n * **Example** (Parsing choices)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * type LogLevel = \"debug\" | \"info\" | \"warn\" | \"error\"\n *\n * const logLevelPrimitive = Primitive.choice<LogLevel>([\n * [\"debug\", \"debug\"],\n * [\"info\", \"info\"],\n * [\"warn\", \"warn\"],\n * [\"error\", \"error\"]\n * ])\n *\n * const parseLogLevel = Effect.gen(function*() {\n * const result1 = yield* logLevelPrimitive.parse(\"info\")\n * console.log(result1) // \"info\"\n *\n * const result2 = yield* logLevelPrimitive.parse(\"debug\")\n * console.log(result2) // \"debug\"\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const choice = choices => {\n const choiceMap = new Map(choices);\n const validChoices = choices.map(([key]) => format(key)).join(\" | \");\n const primitive = makePrimitive(\"Choice\", value => {\n if (choiceMap.has(value)) {\n return Effect.succeed(choiceMap.get(value));\n }\n return Effect.fail(`Expected ${validChoices}, got ${format(value)}`);\n });\n return Object.assign(primitive, {\n choiceKeys: choices.map(([key]) => key)\n });\n};\n/**\n * Creates a primitive that validates and resolves file system paths.\n *\n * **Example** (Parsing file system paths)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const program = Effect.gen(function*() {\n * // Parse a file path that must exist\n * const filePrimitive = Primitive.path(\"file\", true)\n * const filePath = yield* filePrimitive.parse(\"./package.json\")\n * console.log(filePath) // Absolute path to package.json\n *\n * // Parse a directory path\n * const dirPrimitive = Primitive.path(\"directory\", false)\n * const dirPath = yield* dirPrimitive.parse(\"./src\")\n * console.log(dirPath) // Absolute path to src directory\n *\n * // Parse any path type\n * const anyPrimitive = Primitive.path(\"either\", false)\n * const anyPath = yield* anyPrimitive.parse(\"./some/path\")\n * console.log(anyPath) // Absolute path\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const path = (pathType, mustExist) => makePrimitive(\"Path\", Effect.fnUntraced(function* (value) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n // Resolve the path to absolute\n const absolutePath = path.isAbsolute(value) ? value : path.resolve(value);\n // Check if path exists\n const exists = yield* Effect.mapError(fs.exists(absolutePath), error => `Failed to check path existence: ${error.message}`);\n // Validate existence requirements\n if (mustExist === true && !exists) {\n return yield* Effect.fail(`Path does not exist: ${absolutePath}`);\n }\n // Validate path type if it exists\n if (exists && pathType !== \"either\") {\n const stat = yield* Effect.mapError(fs.stat(absolutePath), error => `Failed to stat path: ${error.message}`);\n if (pathType === \"file\" && stat.type !== \"File\") {\n return yield* Effect.fail(`Path is not a file: ${absolutePath}`);\n }\n if (pathType === \"directory\" && stat.type !== \"Directory\") {\n return yield* Effect.fail(`Path is not a directory: ${absolutePath}`);\n }\n }\n return absolutePath;\n}));\n/**\n * Creates a primitive that wraps string input in `Redacted`.\n *\n * **Details**\n *\n * The wrapped value is hidden when formatted or inspected, while the original\n * string remains available through the `Redacted` API when explicitly needed.\n *\n * **Example** (Parsing redacted values)\n *\n * ```ts\n * import { Effect, Redacted } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const parseRedacted = Effect.gen(function*() {\n * const result = yield* Primitive.redacted.parse(\"secret-password\")\n * console.log(Redacted.value(result)) // \"secret-password\"\n * console.log(String(result)) // \"<redacted>\"\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const redacted = /*#__PURE__*/makePrimitive(\"Redacted\", value => Effect.succeed(Redacted.make(value)));\n/**\n * Creates a primitive that reads and returns the contents of a file as a string.\n *\n * **Example** (Reading file text)\n *\n * ```ts\n * import { Effect, Schema } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const ConfigSchema = Schema.Struct({\n * name: Schema.String,\n * version: Schema.String,\n * port: Schema.Number\n * })\n * const decodeConfig = Schema.decodeUnknownEffect(\n * Schema.fromJsonString(ConfigSchema)\n * )\n *\n * const readConfigFile = Effect.gen(function*() {\n * const content = yield* Primitive.fileText.parse(\"./config.json\")\n * console.log(content) // {\"name\":\"my-app\",\"version\":\"1.0.0\",\"port\":3000}\n *\n * const config = yield* decodeConfig(content)\n * console.log(config) // { name: \"my-app\", version: \"1.0.0\", port: 3000 }\n * return config\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileText = /*#__PURE__*/makePrimitive(\"FileText\", /*#__PURE__*/Effect.fnUntraced(function* (filePath) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n // Resolve to absolute path\n const absolutePath = path.isAbsolute(filePath) ? filePath : path.resolve(filePath);\n // Check if file exists\n const exists = yield* Effect.mapError(fs.exists(absolutePath), error => `Failed to check file existence: ${error.message}`);\n if (!exists) {\n return yield* Effect.fail(`File does not exist: ${absolutePath}`);\n }\n // Check if it's actually a file\n const stat = yield* Effect.mapError(fs.stat(absolutePath), error => `Failed to stat file: ${error.message}`);\n if (stat.type !== \"File\") {\n return yield* Effect.fail(`Path is not a file: ${absolutePath}`);\n }\n // Read file content\n const content = yield* Effect.mapError(fs.readFileString(absolutePath), error => `Failed to read file: ${error.message}`);\n return content;\n}));\nconst fileParsers = {\n ini: content => Ini.parse(content),\n json: content => JSON.parse(content),\n toml: content => Toml.parse(content),\n yml: content => Yaml.parse(content),\n yaml: content => Yaml.parse(content)\n};\n/**\n * Creates a primitive that reads a file and parses its content as structured\n * data.\n *\n * **Details**\n *\n * The parser is selected from `options.format` when provided, otherwise from\n * the file extension. Supported formats include INI, JSON, TOML, YAML, and YML.\n *\n * **Example** (Parsing file content)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const tomlFilePrimitive = Primitive.fileParse({ format: \"toml\" })\n *\n * const loadConfig = Effect.gen(function*() {\n * const config = yield* tomlFilePrimitive.parse(\"./config.toml\")\n * console.log(config) // { name: \"my-app\", version: \"1.0.0\", port: 3000 }\n * return config\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileParse = options => {\n return makePrimitive(\"FileParse\", Effect.fnUntraced(function* (filePath) {\n const fileFormat = options?.format ?? filePath.split(\".\").pop();\n const parser = fileParsers[fileFormat];\n if (parser === undefined) {\n return yield* Effect.fail(`Unsupported file format: ${fileFormat}`);\n }\n const content = yield* fileText.parse(filePath);\n return yield* Effect.try({\n try: () => parser(content),\n catch: error => `Failed to parse '.${fileFormat}' file content: ${error}`\n });\n }));\n};\n/**\n * Reads and parses file content using the specified schema.\n *\n * **Example** (Parsing file content with a schema)\n *\n * ```ts\n * import { Effect, Schema } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const ConfigSchema = Schema.Struct({\n * name: Schema.String,\n * version: Schema.String,\n * port: Schema.Number\n * })\n *\n * const jsonConfigPrimitive = Primitive.fileSchema(ConfigSchema, {\n * format: \"json\"\n * })\n *\n * const loadConfig = Effect.gen(function*() {\n * const config = yield* jsonConfigPrimitive.parse(\"./config.json\")\n * console.log(config) // { name: \"my-app\", version: \"1.0.0\", port: 3000 }\n * return config\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileSchema = (schema, options) => {\n const decode = Schema.decodeUnknownEffect(schema);\n return makePrimitive(\"FileSchema\", Effect.fnUntraced(function* (filePath) {\n const content = yield* fileParse(options).parse(filePath);\n return yield* Effect.mapError(decode(content), error => options?.errorFormatter?.(error.issue) ?? error.toString());\n }));\n};\n/**\n * Parses a single `key=value` pair into a record object.\n *\n * **Example** (Parsing key-value pairs)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const parseKeyValue = Effect.gen(function*() {\n * const result1 = yield* Primitive.keyValuePair.parse(\"name=john\")\n * console.log(result1) // { name: \"john\" }\n *\n * const result2 = yield* Primitive.keyValuePair.parse(\"port=3000\")\n * console.log(result2) // { port: \"3000\" }\n *\n * const result3 = yield* Primitive.keyValuePair.parse(\"debug=true\")\n * console.log(result3) // { debug: \"true\" }\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const keyValuePair = /*#__PURE__*/makePrimitive(\"KeyValuePair\", /*#__PURE__*/Effect.fnUntraced(function* (value) {\n const parts = value.split(\"=\");\n if (parts.length !== 2) {\n return yield* Effect.fail(`Invalid key=value format. Expected format: key=value, got: ${value}`);\n }\n const [key, val] = parts;\n if (!key || !val) {\n return yield* Effect.fail(`Invalid key=value format. Both key and value must be non-empty. Got: ${value}`);\n }\n return {\n [key]: val\n };\n}));\n/**\n * Creates a sentinel primitive that always fails to parse a value.\n *\n * **When to use**\n *\n * Use when you need a CLI primitive for flags that do not accept values.\n *\n * **Example** (Rejecting option values)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const program = Effect.gen(function*() {\n * // This will always fail - useful for boolean flags\n * return yield* Primitive.none.parse(\"any-value\")\n * })\n *\n * // The above effect will fail with \"This option does not accept values\"\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const none = /*#__PURE__*/makePrimitive(\"None\", () => Effect.fail(\"This option does not accept values\"));\n/**\n * Gets a human-readable type name for a primitive.\n *\n * **When to use**\n *\n * Use when you need the display type name for a `Primitive`, such as when\n * generating CLI help documentation.\n *\n * **Example** (Getting primitive type names)\n *\n * ```ts\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * console.log(Primitive.getTypeName(Primitive.string)) // \"string\"\n * console.log(Primitive.getTypeName(Primitive.integer)) // \"integer\"\n * console.log(Primitive.getTypeName(Primitive.boolean)) // \"boolean\"\n * console.log(Primitive.getTypeName(Primitive.date)) // \"date\"\n * console.log(Primitive.getTypeName(Primitive.keyValuePair)) // \"key=value\"\n *\n * const logLevelChoice = Primitive.choice([\n * [\"debug\", \"debug\"],\n * [\"info\", \"info\"]\n * ])\n * console.log(Primitive.getTypeName(logLevelChoice)) // \"choice\"\n * ```\n *\n * @category getters\n * @since 4.0.0\n */\nexport const getTypeName = primitive => {\n switch (primitive._tag) {\n case \"Boolean\":\n return \"boolean\";\n case \"String\":\n return \"string\";\n case \"Integer\":\n return \"integer\";\n case \"Float\":\n return \"number\";\n case \"Date\":\n return \"date\";\n case \"Path\":\n return \"path\";\n case \"Choice\":\n return \"choice\";\n case \"Redacted\":\n return \"string\";\n case \"FileText\":\n return \"file\";\n case \"FileParse\":\n return \"file\";\n case \"FileSchema\":\n return \"file\";\n case \"KeyValuePair\":\n return \"key=value\";\n case \"None\":\n return \"none\";\n default:\n return \"value\";\n }\n};\n/** @internal */\nexport const getChoiceKeys = primitive => primitive._tag === \"Choice\" ? primitive.choiceKeys : undefined;\n//# sourceMappingURL=Primitive.js.map","/**\n * Internal ANSI escape sequence helpers used by the unstable CLI rendering\n * implementation. This module centralizes the control codes for text styling,\n * cursor movement, line erasing, and terminal notifications so renderers can\n * compose terminal output without scattering raw escape sequences throughout\n * the CLI internals.\n *\n * The helpers deliberately work with plain strings because terminal rendering\n * is sensitive to ordering: style codes must be reset after annotated text,\n * cursor operations must account for one-based terminal coordinates, and line\n * clearing usually needs to preserve the cursor position expected by the next\n * frame.\n */\nconst ESC = \"\\x1B[\";\nconst BEL = \"\\x07\";\nconst SEP = \";\";\n/** @internal */\nexport const reset = `${ESC}0m`;\n/** @internal */\nexport const bold = `${ESC}1m`;\n/** @internal */\nexport const italicized = `${ESC}3m`;\n/** @internal */\nexport const underlined = `${ESC}4m`;\n/** @internal */\nexport const strikethrough = `${ESC}9m`;\n/** @internal */\nexport const cursorShow = `${ESC}?25h`;\n/** @internal */\nexport const cursorHide = `${ESC}?25l`;\n/** @internal */\nexport const cursorLeft = `${ESC}G`;\n/** @internal */\nexport const cursorSavePosition = `${ESC}s`;\n/** @internal */\nexport const cursorRestorePosition = `${ESC}u`;\n/** @internal */\nexport const eraseLine = `${ESC}2K`;\n/** @internal */\nexport const beep = BEL;\n/** @internal */\nexport const red = `${ESC}31m`;\n/** @internal */\nexport const green = `${ESC}32m`;\n/** @internal */\nexport const white = `${ESC}37m`;\n/** @internal */\nexport const blackBright = `${ESC}90m`;\n/** @internal */\nexport const cyanBright = `${ESC}96m`;\nexport const annotate = (text, ...styles) => {\n const flat = styles.flat();\n return `${flat.join(\"\")}${text}${reset}`;\n};\nexport const combine = (...styles) => styles;\n/** @internal */\nexport const cursorTo = (column, row) => {\n if (row === undefined) {\n return `\\x1b${Math.max(column + 1, 0)} G`;\n }\n return `\\x1b${row + 1}${SEP}${Math.max(column + 1, 0)} H`;\n};\n/** @internal */\nexport const cursorDown = (lines = 1) => {\n return `${ESC}${lines}B`;\n};\n/** @internal */\nexport const cursorMove = (column, row = 0) => {\n let command = \"\";\n if (row < 0) {\n command += `${ESC}${-row}A`;\n }\n if (row > 0) {\n command += `${ESC}${row}B`;\n }\n if (column > 0) {\n command += `${ESC}${column}C`;\n }\n if (column < 0) {\n command += `${ESC}${-column}D`;\n }\n return command;\n};\n/** @internal */\nexport const eraseLines = rows => {\n let command = \"\";\n for (let i = 0; i < rows; i++) {\n command += `${ESC}2K` + (i < rows - 1 ? `${ESC}1A` : \"\");\n }\n if (rows > 0) {\n command += `${ESC}G`;\n }\n return command;\n};\n//# sourceMappingURL=ansi.js.map","/**\n * Builds interactive terminal prompts for CLI applications.\n *\n * A `Prompt<A>` describes a small terminal UI that renders frames, reads\n * keyboard input, validates responses, and eventually produces an `A`. Prompts\n * can ask for simple values, selections, lists, files, hidden text, or custom\n * interactions. This module includes prompt constructors, tools for combining\n * and transforming prompt output, and support for running prompts through the\n * `Terminal` service.\n *\n * @since 4.0.0\n */\nimport * as Arr from \"../../Array.js\";\nimport * as Data from \"../../Data.js\";\nimport * as Effect from \"../../Effect.js\";\nimport * as Effectable from \"../../Effectable.js\";\nimport * as FileSystem from \"../../FileSystem.js\";\nimport { dual, pipe } from \"../../Function.js\";\nimport * as EffectNumber from \"../../Number.js\";\nimport * as Option from \"../../Option.js\";\nimport * as Path from \"../../Path.js\";\nimport * as Predicate from \"../../Predicate.js\";\nimport * as Queue from \"../../Queue.js\";\nimport * as Redacted from \"../../Redacted.js\";\nimport * as Terminal from \"../../Terminal.js\";\nimport * as Ansi from \"./internal/ansi.js\";\nconst TypeId = \"~effect/cli/Prompt\";\n/**\n * Returns `true` if the provided value is a `Prompt`.\n *\n * @category guards\n * @since 4.0.0\n */\nexport const isPrompt = u => Predicate.hasProperty(u, TypeId);\nconst defaultFigures = {\n arrowUp: \"↑\",\n arrowDown: \"↓\",\n arrowLeft: \"←\",\n arrowRight: \"→\",\n radioOn: \"◉\",\n radioOff: \"◯\",\n checkboxOn: \"☒\",\n checkboxOff: \"☐\",\n tick: \"✔\",\n cross: \"✖\",\n ellipsis: \"…\",\n pointerSmall: \"›\",\n line: \"─\",\n pointer: \"❯\"\n};\nconst windowsFigures = {\n arrowUp: defaultFigures.arrowUp,\n arrowDown: defaultFigures.arrowDown,\n arrowLeft: defaultFigures.arrowLeft,\n arrowRight: defaultFigures.arrowRight,\n radioOn: \"(*)\",\n radioOff: \"( )\",\n checkboxOn: \"[*]\",\n checkboxOff: \"[ ]\",\n tick: \"√\",\n cross: \"×\",\n ellipsis: \"...\",\n pointerSmall: \"»\",\n line: \"─\",\n pointer: \">\"\n};\n/** @internal */\nexport const platformFigures = /*#__PURE__*/Effect.map(/*#__PURE__*/Effect.sync(() => process.platform === \"win32\"), isWindows => isWindows ? windowsFigures : defaultFigures);\n/**\n * Runs all the provided prompts in sequence respecting the structure provided\n * in input.\n *\n * **Details**\n *\n * Supports either a tuple / iterable of prompts or a record / struct of prompts\n * as an argument.\n *\n * **Example** (Collecting prompt results)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Prompt } from \"effect/unstable/cli\"\n *\n * const username = Prompt.text({\n * message: \"Enter your username: \"\n * })\n *\n * const password = Prompt.password({\n * message: \"Enter your password: \",\n * validate: (value) =>\n * value.length === 0\n * ? Effect.fail(\"Password cannot be empty\")\n * : Effect.succeed(value)\n * })\n *\n * const allWithTuple = Prompt.all([username, password])\n *\n * const allWithRecord = Prompt.all({ username, password })\n * ```\n *\n * @category collecting & elements\n * @since 4.0.0\n */\nexport const all = function () {\n if (arguments.length === 1) {\n if (isPrompt(arguments[0])) {\n return map(arguments[0], x => [x]);\n } else if (Array.isArray(arguments[0])) {\n return allTupled(arguments[0]);\n } else {\n const entries = Object.entries(arguments[0]);\n let result = map(entries[0][1], value => ({\n [entries[0][0]]: value\n }));\n if (entries.length === 1) {\n return result;\n }\n const rest = entries.slice(1);\n for (const [key, prompt] of rest) {\n result = result.pipe(flatMap(record => prompt.pipe(map(value => ({\n ...record,\n [key]: value\n })))));\n }\n return result;\n }\n }\n return allTupled(arguments[0]);\n};\nconst annotateLine = line => Ansi.annotate(line, Ansi.bold);\nconst annotateErrorLine = line => Ansi.annotate(line, Ansi.combine(Ansi.italicized, Ansi.red));\n/**\n * Creates a confirmation prompt that asks the user to choose a boolean yes/no\n * value.\n *\n * **When to use**\n *\n * Use to ask for a yes/no answer that can be submitted directly.\n *\n * **Details**\n *\n * `initial` defaults to `false`. Enter submits the current default, yes-style\n * input submits `true`, no-style input submits `false`, and other input beeps.\n *\n * @see {@link toggle} for an interactive switch-before-submit boolean prompt\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const confirm = options => {\n const opts = {\n initial: false,\n ...options,\n label: {\n confirm: \"yes\",\n deny: \"no\",\n ...options.label\n },\n placeholder: {\n defaultConfirm: \"(Y/n)\",\n defaultDeny: \"(y/N)\",\n ...options.placeholder\n }\n };\n const initialState = {\n value: opts.initial\n };\n return custom(initialState, {\n render: handleConfirmRender(opts),\n process: input => handleConfirmProcess(input, opts.initial),\n clear: handleConfirmClear(opts)\n });\n};\n/**\n * Creates a custom `Prompt` from the specified initial state and handlers.\n *\n * **Details**\n *\n * The initial state can either be a pure value or an `Effect`. This is\n * particularly useful when the initial state of the `Prompt` must be computed\n * by performing an effectful computation, such as reading data from the file\n * system. A `Prompt` runs as a render loop: `render` returns ANSI output for\n * the current frame, the `Terminal` obtains user input, `process` returns the\n * next prompt action, and `clear` returns ANSI output used to clear the previous\n * frame.\n *\n * Optionally, an external `events` dequeue can be provided as the third\n * argument. When present, the render loop will race user input against events\n * from the dequeue, allowing background events to trigger re-renders without\n * waiting for a keypress. When an event is received from the dequeue, the\n * `receive` handler is called instead of `process`.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const custom = (initialState, ...args) => {\n const [events, handlers] = args.length === 1 ? [undefined, args[0]] : [args[0], args[1]];\n const op = Object.create(proto);\n op._tag = \"Loop\";\n op.initialState = initialState;\n op.render = handlers.render;\n op.process = handlers.process;\n op.clear = handlers.clear;\n op.events = events;\n return op;\n};\n/**\n * Creates a date prompt that lets the user edit a formatted date value and\n * validates the final `Date` before submission.\n *\n * **Details**\n *\n * `initial` defaults to the current `Date`, `dateMask` defaults to\n * `YYYY-MM-DD HH:mm:ss`, mask parsing creates editable date parts plus literal\n * tokens, `locales` customizes month and weekday labels, and `validate` runs on\n * submission.\n *\n * **Gotchas**\n *\n * A supplied `initial` `Date` is edited in place during prompt interaction.\n * Date edits use JavaScript `Date` setters, so out-of-range typed values can\n * normalize before validation. If the prompt is meant to be editable,\n * `dateMask` should contain at least one editable date token.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const date = options => {\n const opts = {\n initial: new Date(),\n dateMask: \"YYYY-MM-DD HH:mm:ss\",\n validate: Effect.succeed,\n ...options,\n locales: {\n ...defaultLocales,\n ...options.locales\n }\n };\n const dateParts = makeDateParts(opts.dateMask, opts.initial, opts.locales);\n const initialCursorPosition = dateParts.findIndex(part => !part.isToken());\n const initialState = {\n dateParts,\n typed: \"\",\n cursor: initialCursorPosition,\n value: opts.initial,\n error: Option.none()\n };\n return custom(initialState, {\n render: handleDateRender(opts),\n process: handleDateProcess(opts),\n clear: handleDateClear(opts)\n });\n};\n/**\n * Creates a file-system selection prompt and returns the selected path.\n *\n * **Details**\n *\n * The prompt can be configured to select files, directories, or either path\n * type.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const file = (options = {}) => {\n const opts = {\n type: options.type ?? \"file\",\n message: options.message ?? `Choose a file`,\n startingPath: Option.fromUndefinedOr(options.startingPath),\n default: Option.fromUndefinedOr(options.default),\n maxPerPage: options.maxPerPage ?? 10,\n filter: options.filter ?? (() => Effect.succeed(true))\n };\n const initialState = Effect.gen(function* () {\n const currentPath = yield* resolveCurrentPath(Option.none(), opts);\n const path = yield* Path.Path;\n const defaultPath = Option.map(opts.default, defaultValue => path.resolve(currentPath, defaultValue));\n const initialPath = Option.match(defaultPath, {\n onNone: () => currentPath,\n onSome: defaultPath => path.dirname(defaultPath)\n });\n const files = yield* getFileList(initialPath, opts);\n const cursor = Option.match(defaultPath, {\n onNone: () => 0,\n onSome: defaultPath => {\n const index = files.indexOf(path.basename(defaultPath));\n return index === -1 ? 0 : index;\n }\n });\n const confirm = Confirm.Hide();\n return {\n cursor,\n files,\n allFiles: files,\n query: \"\",\n path: Option.map(defaultPath, path.dirname),\n confirm\n };\n });\n return custom(initialState, {\n render: handleFileRender(opts),\n process: handleFileProcess(opts),\n clear: handleFileClear(opts)\n });\n};\n/**\n * Composes prompts by using the output of this prompt to create the next prompt.\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const flatMap = /*#__PURE__*/dual(2, (self, f) => {\n const op = Object.create(proto);\n op._tag = \"OnSuccess\";\n op.prompt = self;\n op.onSuccess = f;\n return op;\n});\n/**\n * Creates a floating-point number prompt.\n *\n * **Details**\n *\n * The prompt supports minimum and maximum bounds, keyboard step sizes, display\n * precision, and additional validation before submission.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const float = options => {\n const opts = {\n default: 0,\n min: Number.NEGATIVE_INFINITY,\n max: Number.POSITIVE_INFINITY,\n incrementBy: 1,\n decrementBy: 1,\n precision: 2,\n validate: n => {\n if (n < opts.min) {\n return Effect.fail(`${n} must be greater than or equal to ${opts.min}`);\n }\n if (n > opts.max) {\n return Effect.fail(`${n} must be less than or equal to ${opts.max}`);\n }\n return Effect.succeed(n);\n },\n ...options\n };\n const initialValue = options.default === undefined ? \"\" : `${opts.default}`;\n const initialState = {\n cursor: initialValue.length,\n value: initialValue,\n error: Option.none()\n };\n return custom(initialState, {\n render: handleRenderFloat(opts),\n process: handleProcessFloat(opts),\n clear: handleNumberClear(opts)\n });\n};\n/**\n * Creates a text prompt that does not echo typed input and returns the\n * submitted value wrapped in `Redacted`.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const hidden = options => basePrompt(options, \"hidden\").pipe(map(Redacted.make));\n/**\n * Creates an integer prompt.\n *\n * **Details**\n *\n * The prompt supports minimum and maximum bounds, keyboard step sizes, and\n * additional validation before submission.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const integer = options => {\n const opts = {\n default: 0,\n min: Number.NEGATIVE_INFINITY,\n max: Number.POSITIVE_INFINITY,\n incrementBy: 1,\n decrementBy: 1,\n validate: n => {\n if (n < opts.min) {\n return Effect.fail(`${n} must be greater than or equal to ${opts.min}`);\n }\n if (n > opts.max) {\n return Effect.fail(`${n} must be less than or equal to ${opts.max}`);\n }\n return Effect.succeed(n);\n },\n ...options\n };\n const initialValue = options.default === undefined ? \"\" : `${opts.default}`;\n const initialState = {\n cursor: initialValue.length,\n value: initialValue,\n error: Option.none()\n };\n return custom(initialState, {\n render: handleRenderInteger(opts),\n process: handleProcessInteger(opts),\n clear: handleNumberClear(opts)\n });\n};\n/**\n * Creates a text prompt that returns an array of strings by splitting the\n * submitted input on the configured delimiter.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const list = options => text(options).pipe(map(output => output.split(options.delimiter || \",\")));\n/**\n * Transforms the output value produced by a prompt.\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const map = /*#__PURE__*/dual(2, (self, f) => flatMap(self, a => succeed(f(a))));\n/**\n * Creates a password prompt that masks typed input and returns the submitted\n * value wrapped in `Redacted`.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const password = options => basePrompt(options, \"password\").pipe(map(Redacted.make));\n/**\n * Runs a prompt by reading terminal input and rendering prompt frames until the\n * prompt submits a value.\n *\n * **Gotchas**\n *\n * The returned effect may fail with `Terminal.QuitError` if terminal input ends\n * or the prompt is quit.\n *\n * @category execution\n * @since 4.0.0\n */\nexport const run = /*#__PURE__*/Effect.fnUntraced(function* (self) {\n const terminal = yield* Terminal.Terminal;\n const input = yield* terminal.readInput;\n return yield* runWithInput(self, terminal, input);\n}, /*#__PURE__*/Effect.mapError(() => new Terminal.QuitError({})), Effect.scoped);\nconst getSelectInitialIndex = choices => {\n let initialIndex = 0;\n let seenSelected = -1;\n for (let i = 0; i < choices.length; i++) {\n const choice = choices[i];\n if (choice.selected === true) {\n if (seenSelected !== -1) {\n throw new Error(\"InvalidArgumentException: only a single choice can be selected by default for Prompt.select\");\n }\n seenSelected = i;\n }\n }\n if (seenSelected !== -1) {\n initialIndex = seenSelected;\n }\n return initialIndex;\n};\n/**\n * Creates a prompt that lets the user select a single value from a list of\n * choices.\n *\n * **Gotchas**\n *\n * At most one choice may be marked as selected by default.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const select = options => {\n const opts = {\n maxPerPage: 10,\n ...options\n };\n const initialIndex = getSelectInitialIndex(opts.choices);\n return custom(initialIndex, {\n render: handleSelectRender(opts),\n process: handleSelectProcess(opts),\n clear: handleSelectClear(opts)\n });\n};\n/**\n * Creates a prompt that lets users filter select choices by typing.\n *\n * **Example** (Filtering choices with autocomplete)\n *\n * ```ts\n * import { Prompt } from \"effect/unstable/cli\"\n *\n * const language = Prompt.autoComplete({\n * message: \"Choose a language\",\n * choices: [\n * { title: \"TypeScript\", value: \"ts\" },\n * { title: \"Rust\", value: \"rs\" },\n * { title: \"Kotlin\", value: \"kt\" }\n * ]\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const autoComplete = options => {\n const opts = {\n maxPerPage: 10,\n filterLabel: \"filter\",\n filterPlaceholder: \"type to filter\",\n emptyMessage: \"No matches\",\n ...options\n };\n const initialIndex = getSelectInitialIndex(opts.choices);\n const filtered = filterAutoCompleteChoices(opts.choices, \"\");\n const index = filtered.length === 0 ? 0 : filtered.includes(initialIndex) ? initialIndex : filtered[0];\n const initialState = {\n query: \"\",\n index,\n filtered\n };\n return custom(initialState, {\n render: handleAutoCompleteRender(opts),\n process: handleAutoCompleteProcess(opts),\n clear: handleAutoCompleteClear(opts)\n });\n};\n/**\n * Creates a prompt that lets the user select multiple choices and returns their\n * values as an array.\n *\n * **Details**\n *\n * The prompt supports default selected choices, bulk-selection commands, and\n * minimum or maximum selection counts.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const multiSelect = options => {\n const opts = {\n maxPerPage: 10,\n ...options\n };\n // Seed initial selection from choices marked as selected: true\n const initialSelected = new Set();\n for (let i = 0; i < opts.choices.length; i++) {\n const choice = opts.choices[i];\n if (choice.selected === true) {\n initialSelected.add(i);\n }\n }\n const initialState = {\n index: 0,\n selectedIndices: initialSelected,\n error: Option.none()\n };\n return custom(initialState, {\n render: handleMultiSelectRender(opts),\n process: handleMultiSelectProcess(opts),\n clear: handleMultiSelectClear(opts)\n });\n};\n/**\n * Creates a `Prompt` which immediately succeeds with the specified value.\n *\n * **Details**\n *\n * This prompt does not attempt to obtain user input or render anything to the\n * screen.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const succeed = value => {\n const op = Object.create(proto);\n op._tag = \"Succeed\";\n op.value = value;\n return op;\n};\n/**\n * Creates a text-entry prompt that echoes input and returns the submitted\n * string after validation.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const text = options => basePrompt(options, \"text\");\n/**\n * Creates a toggle prompt that lets the user switch between active and inactive\n * states and returns the selected boolean value.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const toggle = options => {\n const opts = {\n initial: false,\n active: \"on\",\n inactive: \"off\",\n ...options\n };\n return custom(opts.initial, {\n render: handleToggleRender(opts),\n process: handleToggleProcess,\n clear: () => handleToggleClear(opts)\n });\n};\nconst proto = {\n ... /*#__PURE__*/Effectable.Prototype({\n label: \"Prompt\",\n evaluate() {\n return run(this);\n }\n }),\n [TypeId]: {\n _Output: _ => _\n }\n};\nconst allTupled = arg => {\n if (arg.length === 0) {\n return succeed([]);\n }\n if (arg.length === 1) {\n return map(arg[0], x => [x]);\n }\n let result = map(arg[0], x => [x]);\n for (let i = 1; i < arg.length; i++) {\n const curr = arg[i];\n result = flatMap(result, tuple => map(curr, a => [...tuple, a]));\n }\n return result;\n};\nconst runWithInput = (prompt, terminal, input) => Effect.suspend(() => {\n const op = prompt;\n switch (op._tag) {\n case \"Loop\":\n {\n return runLoop(op, terminal, input);\n }\n case \"OnSuccess\":\n {\n return Effect.flatMap(runWithInput(op.prompt, terminal, input), a => runWithInput(op.onSuccess(a), terminal, input));\n }\n case \"Succeed\":\n {\n return Effect.succeed(op.value);\n }\n }\n});\nconst runLoop = /*#__PURE__*/Effect.fnUntraced(function* (loop, terminal, input) {\n let state = Effect.isEffect(loop.initialState) ? yield* loop.initialState : loop.initialState;\n let action = Action.NextFrame({\n state\n });\n while (true) {\n const msg = yield* loop.render(state, action);\n yield* Effect.orDie(terminal.display(msg));\n if (loop.events) {\n const takeInput = Queue.take(input).pipe(Effect.map(input => ({\n _tag: \"Input\",\n input\n })));\n const result = yield* Effect.raceFirst(takeInput, Queue.take(loop.events).pipe(Effect.map(value => ({\n _tag: \"Event\",\n value\n }))));\n action = yield* loop.process(result, state);\n } else {\n const result = yield* Queue.take(input);\n action = yield* loop.process(result, state);\n }\n switch (action._tag) {\n case \"Beep\":\n continue;\n case \"NextFrame\":\n {\n yield* Effect.orDie(terminal.display(yield* loop.clear(state, action)));\n state = action.state;\n continue;\n }\n case \"Submit\":\n {\n yield* Effect.orDie(terminal.display(yield* loop.clear(state, action)));\n const msg = yield* loop.render(state, action);\n yield* Effect.orDie(terminal.display(msg));\n return action.value;\n }\n }\n }\n}, (effect, _, terminal) => Effect.ensuring(effect, Effect.orDie(terminal.display(Ansi.cursorShow))));\nconst Action = /*#__PURE__*/Data.taggedEnum();\n/**\n * Clears all lines taken up by the specified `text`.\n */\nconst eraseText = (text, columns) => {\n if (columns === 0) {\n return Ansi.eraseLine + Ansi.cursorTo(0);\n }\n let rows = 0;\n const lines = text.split(NEWLINE_REGEXP);\n for (const line of lines) {\n rows += 1 + Math.floor(Math.max(line.length - 1, 0) / columns);\n }\n return Ansi.eraseLines(rows);\n};\nconst lines = (prompt, columns) => {\n const lines = prompt.split(NEWLINE_REGEXP);\n return columns === 0 ? lines.length : pipe(Arr.map(lines, line => Math.ceil(line.length / columns)), Arr.reduce(0, (left, right) => left + right));\n};\nconst clearOutputWithError = (outputText, columns, errorText) => {\n if (errorText !== undefined && errorText.length > 0) {\n return Ansi.cursorDown(lines(errorText, columns)) + eraseText(`\\n${errorText}`, columns) + eraseText(outputText, columns);\n }\n return eraseText(outputText, columns);\n};\nconst renderBeep = Ansi.beep;\nconst NEWLINE_REGEXP = /\\r?\\n/;\nconst handleConfirmClear = options => {\n return Effect.fnUntraced(function* (state, _) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* platformFigures;\n const confirmMessage = state.value ? options.placeholder.defaultConfirm : options.placeholder.defaultDeny;\n const promptText = renderConfirmOutput(confirmMessage, \"?\", figures.pointerSmall, options, {\n plain: true\n });\n const clearOutput = eraseText(promptText, columns);\n const resetCurrentLine = Ansi.eraseLine + Ansi.cursorLeft;\n return clearOutput + resetCurrentLine;\n });\n};\nconst renderConfirmOutput = (confirm, leadingSymbol, trailingSymbol, options, renderOptions) => renderPrompt(confirm, options.message, leadingSymbol, trailingSymbol, renderOptions);\nconst renderConfirmNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n // Marking these explicitly as present with `!` because they always will be\n // and there is really no value in adding a `DeepRequired` type helper just\n // for these internal cases\n const confirmMessage = state.value ? options.placeholder.defaultConfirm : options.placeholder.defaultDeny;\n const confirm = Ansi.annotate(confirmMessage, Ansi.blackBright);\n const promptMsg = renderConfirmOutput(confirm, leadingSymbol, trailingSymbol, options);\n return Ansi.cursorHide + promptMsg;\n});\nconst renderConfirmSubmission = /*#__PURE__*/Effect.fnUntraced(function* (value, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const confirmMessage = value ? options.label.confirm : options.label.deny;\n const promptMsg = renderConfirmOutput(confirmMessage, leadingSymbol, trailingSymbol, options);\n return promptMsg + \"\\n\";\n});\nconst handleConfirmRender = options => {\n return (_, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderConfirmNextFrame(state, options),\n Submit: ({\n value\n }) => renderConfirmSubmission(value, options)\n });\n };\n};\nconst TRUE_VALUE_REGEXP = /^y|t$/;\nconst FALSE_VALUE_REGEXP = /^n|f$/;\nconst handleConfirmProcess = (input, defaultValue) => {\n const value = Option.getOrElse(input.input, () => \"\");\n if (input.key.name === \"enter\" || input.key.name === \"return\") {\n return Effect.succeed(Action.Submit({\n value: defaultValue\n }));\n }\n if (TRUE_VALUE_REGEXP.test(value.toLowerCase())) {\n return Effect.succeed(Action.Submit({\n value: true\n }));\n }\n if (FALSE_VALUE_REGEXP.test(value.toLowerCase())) {\n return Effect.succeed(Action.Submit({\n value: false\n }));\n }\n return Effect.succeed(Action.Beep());\n};\nconst handleDateClear = options => {\n return Effect.fnUntraced(function* (state, _) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* platformFigures;\n const resetCurrentLine = Ansi.eraseLine + Ansi.cursorLeft;\n const parts = Arr.reduce(state.dateParts, \"\", (doc, part) => doc + part.toString());\n const promptText = renderDateOutput(\"?\", figures.pointerSmall, parts, options, {\n plain: true\n });\n const errorText = Option.isSome(state.error) ? Arr.match(state.error.value.split(NEWLINE_REGEXP), {\n onEmpty: () => \"\",\n onNonEmpty: errorLines => `${figures.pointerSmall} ${errorLines.join(\"\\n\")}`\n }) : \"\";\n const clearOutput = clearOutputWithError(promptText, columns, errorText);\n return clearOutput + resetCurrentLine;\n });\n};\nconst renderDateError = (state, pointer) => {\n if (Option.isSome(state.error)) {\n const errorLines = state.error.value.split(NEWLINE_REGEXP);\n if (Arr.isReadonlyArrayNonEmpty(errorLines)) {\n const prefix = Ansi.annotate(pointer, Ansi.red) + \" \";\n const lines = Arr.map(errorLines, str => annotateErrorLine(str));\n return Ansi.cursorSavePosition + \"\\n\" + prefix + lines.join(\"\\n\") + Ansi.cursorRestorePosition;\n }\n }\n return \"\";\n};\nconst renderParts = (state, submitted = false) => {\n return Arr.reduce(state.dateParts, \"\", (doc, part, currentIndex) => {\n const partDoc = part.toString();\n if (currentIndex === state.cursor && !submitted) {\n const annotation = Ansi.combine(Ansi.underlined, Ansi.cyanBright);\n return doc + Ansi.annotate(partDoc, annotation);\n }\n return doc + partDoc;\n });\n};\nconst renderDateOutput = (leadingSymbol, trailingSymbol, parts, options, renderOptions) => renderPrompt(parts, options.message, leadingSymbol, trailingSymbol, renderOptions);\nconst renderDateNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n const parts = renderParts(state);\n const promptMsg = renderDateOutput(leadingSymbol, trailingSymbol, parts, options);\n const errorMsg = renderDateError(state, figures.pointerSmall);\n return Ansi.cursorHide + promptMsg + errorMsg;\n});\nconst renderDateSubmission = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const parts = renderParts(state, true);\n const promptMsg = renderDateOutput(leadingSymbol, trailingSymbol, parts, options);\n return promptMsg + \"\\n\";\n});\nconst processUp = state => {\n state.dateParts[state.cursor].increment();\n return Action.NextFrame({\n state: {\n ...state,\n typed: \"\"\n }\n });\n};\nconst processDown = state => {\n state.dateParts[state.cursor].decrement();\n return Action.NextFrame({\n state: {\n ...state,\n typed: \"\"\n }\n });\n};\nconst processDateCursorLeft = state => {\n const previous = state.dateParts[state.cursor].previousPart();\n if (Option.isSome(previous)) {\n return Action.NextFrame({\n state: {\n ...state,\n typed: \"\",\n cursor: state.dateParts.indexOf(previous.value)\n }\n });\n }\n return Action.Beep();\n};\nconst processDateCursorRight = state => {\n const next = state.dateParts[state.cursor].nextPart();\n if (Option.isSome(next)) {\n return Action.NextFrame({\n state: {\n ...state,\n typed: \"\",\n cursor: state.dateParts.indexOf(next.value)\n }\n });\n }\n return Action.Beep();\n};\nconst processDateNext = state => {\n const next = state.dateParts[state.cursor].nextPart();\n const cursor = Option.match(next, {\n onNone: () => state.dateParts.findIndex(part => !part.isToken()),\n onSome: next => state.dateParts.indexOf(next)\n });\n return Action.NextFrame({\n state: {\n ...state,\n cursor\n }\n });\n};\nconst defaultDateProcessor = (value, state) => {\n if (/\\d/.test(value)) {\n const typed = state.typed + value;\n state.dateParts[state.cursor].setValue(typed);\n return Action.NextFrame({\n state: {\n ...state,\n typed\n }\n });\n }\n return Action.Beep();\n};\nconst defaultLocales = {\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n monthsShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n weekdays: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n weekdaysShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"]\n};\nconst handleDateRender = options => {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderDateNextFrame(state, options),\n Submit: () => renderDateSubmission(state, options)\n });\n };\n};\nconst handleDateProcess = options => {\n return (input, state) => {\n switch (input.key.name) {\n case \"left\":\n {\n return Effect.succeed(processDateCursorLeft(state));\n }\n case \"right\":\n {\n return Effect.succeed(processDateCursorRight(state));\n }\n case \"k\":\n case \"up\":\n {\n return Effect.succeed(processUp(state));\n }\n case \"j\":\n case \"down\":\n {\n return Effect.succeed(processDown(state));\n }\n case \"tab\":\n {\n return Effect.succeed(processDateNext(state));\n }\n case \"enter\":\n case \"return\":\n {\n return Effect.match(options.validate(state.value), {\n onFailure: error => Action.NextFrame({\n state: {\n ...state,\n error: Option.some(error)\n }\n }),\n onSuccess: value => Action.Submit({\n value\n })\n });\n }\n default:\n {\n return Effect.succeed(defaultDateProcessor(Option.getOrElse(input.input, () => \"\"), state));\n }\n }\n };\n};\nconst DATE_PART_REGEXP = /\\\\(.)|\"((?:\\\\[\"\\\\]|[^\"])+)\"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;\nconst regExpGroups = {\n 1: ({\n token,\n ...opts\n }) => new Token({\n token: token.replace(/\\\\(.)/g, \"$1\"),\n ...opts\n }),\n 2: opts => new Day(opts),\n 3: opts => new Month(opts),\n 4: opts => new Year(opts),\n 5: opts => new Meridiem(opts),\n 6: opts => new Hours(opts),\n 7: opts => new Minutes(opts),\n 8: opts => new Seconds(opts),\n 9: opts => new Milliseconds(opts)\n};\nconst makeDateParts = (dateMask, date, locales) => {\n const parts = [];\n let result = null;\n // oxlint-disable-next-line no-cond-assign\n while (result = DATE_PART_REGEXP.exec(dateMask)) {\n const match = result.shift();\n const index = result.findIndex(group => group !== undefined);\n if (index in regExpGroups) {\n const token = result[index] || match;\n parts.push(regExpGroups[index]({\n token,\n date,\n parts,\n locales\n }));\n } else {\n parts.push(new Token({\n token: result[index] || match,\n date,\n parts,\n locales\n }));\n }\n }\n const orderedParts = parts.reduce((array, element) => {\n const lastElement = array[array.length - 1];\n if (element.isToken() && lastElement !== undefined && lastElement.isToken()) {\n lastElement.setValue(element.token);\n } else {\n array.push(element);\n }\n return array;\n }, Arr.empty());\n parts.splice(0, parts.length, ...orderedParts);\n return parts;\n};\nclass DatePart {\n token;\n date;\n parts;\n locales;\n constructor(params) {\n this.token = params.token;\n this.locales = params.locales;\n this.date = params.date || new Date();\n this.parts = params.parts || [this];\n }\n /**\n * Returns `true` if this `DatePart` is a `Token`, `false` otherwise.\n */\n isToken() {\n return false;\n }\n /**\n * Retrieves the next date part in the list of parts.\n */\n nextPart() {\n const currentPartIndex = Option.getOrElse(Arr.findFirstIndex(this.parts, part => part === this), () => 0);\n return Arr.findFirst(this.parts.slice(currentPartIndex + 1), part => !part.isToken());\n }\n /**\n * Retrieves the previous date part in the list of parts.\n */\n previousPart() {\n const currentPartIndex = Arr.findFirstIndex(this.parts, part => part === this);\n if (Option.isSome(currentPartIndex)) {\n return Arr.findLast(this.parts.slice(0, currentPartIndex.value), part => !part.isToken());\n }\n return Option.none();\n }\n toString() {\n return String(this.date);\n }\n}\nclass Token extends DatePart {\n increment() {}\n decrement() {}\n setValue(value) {\n this.token = this.token + value;\n }\n isToken() {\n return true;\n }\n toString() {\n return this.token;\n }\n}\nclass Milliseconds extends DatePart {\n increment() {\n this.date.setMilliseconds(this.date.getMilliseconds() + 1);\n }\n decrement() {\n this.date.setMilliseconds(this.date.getMilliseconds() - 1);\n }\n setValue(value) {\n this.date.setMilliseconds(Number.parseInt(value.slice(-this.token.length)));\n }\n toString() {\n const millis = `${this.date.getMilliseconds()}`;\n return millis.padStart(4, \"0\").substring(0, this.token.length);\n }\n}\nclass Seconds extends DatePart {\n increment() {\n this.date.setSeconds(this.date.getSeconds() + 1);\n }\n decrement() {\n this.date.setSeconds(this.date.getSeconds() - 1);\n }\n setValue(value) {\n this.date.setSeconds(Number.parseInt(value.slice(-2)));\n }\n toString() {\n const seconds = `${this.date.getSeconds()}`;\n return this.token.length > 1 ? seconds.padStart(2, \"0\") : seconds;\n }\n}\nclass Minutes extends DatePart {\n increment() {\n this.date.setMinutes(this.date.getMinutes() + 1);\n }\n decrement() {\n this.date.setMinutes(this.date.getMinutes() - 1);\n }\n setValue(value) {\n this.date.setMinutes(Number.parseInt(value.slice(-2)));\n }\n toString() {\n const minutes = `${this.date.getMinutes()}`;\n return this.token.length > 1 ? minutes.padStart(2, \"0\") : minutes;\n }\n}\nclass Hours extends DatePart {\n increment() {\n this.date.setHours(this.date.getHours() + 1);\n }\n decrement() {\n this.date.setHours(this.date.getHours() - 1);\n }\n setValue(value) {\n this.date.setHours(Number.parseInt(value.slice(-2)));\n }\n toString() {\n const hours = /h/.test(this.token) ? this.date.getHours() % 12 || 12 : this.date.getHours();\n return this.token.length > 1 ? `${hours}`.padStart(2, \"0\") : `${hours}`;\n }\n}\nclass Day extends DatePart {\n increment() {\n this.date.setDate(this.date.getDate() + 1);\n }\n decrement() {\n this.date.setDate(this.date.getDate() - 1);\n }\n setValue(value) {\n this.date.setDate(Number.parseInt(value.slice(-2)));\n }\n toString() {\n const date = this.date.getDate();\n const day = this.date.getDay();\n switch (this.token) {\n case \"DD\":\n return `${date}`.padStart(2, \"0\");\n case \"Do\":\n return `${date}${this.ordinalIndicator(date)}`;\n case \"d\":\n return `${day + 1}`;\n case \"ddd\":\n return this.locales.weekdaysShort[day];\n case \"dddd\":\n return this.locales.weekdays[day];\n default:\n return `${date}`;\n }\n }\n ordinalIndicator(day) {\n switch (day % 10) {\n case 1:\n return \"st\";\n case 2:\n return \"nd\";\n case 3:\n return \"rd\";\n default:\n return \"th\";\n }\n }\n}\nclass Month extends DatePart {\n increment() {\n this.date.setMonth(this.date.getMonth() + 1);\n }\n decrement() {\n this.date.setMonth(this.date.getMonth() - 1);\n }\n setValue(value) {\n const month = Number.parseInt(value.slice(-2)) - 1;\n this.date.setMonth(month < 0 ? 0 : month);\n }\n toString() {\n const month = this.date.getMonth();\n switch (this.token.length) {\n case 2:\n return `${month + 1}`.padStart(2, \"0\");\n case 3:\n return this.locales.monthsShort[month];\n case 4:\n return this.locales.months[month];\n default:\n return `${month + 1}`;\n }\n }\n}\nclass Year extends DatePart {\n increment() {\n this.date.setFullYear(this.date.getFullYear() + 1);\n }\n decrement() {\n this.date.setFullYear(this.date.getFullYear() - 1);\n }\n setValue(value) {\n this.date.setFullYear(Number.parseInt(value.slice(-4)));\n }\n toString() {\n const year = `${this.date.getFullYear()}`.padStart(4, \"0\");\n return this.token.length === 2 ? year.substring(-2) : year;\n }\n}\nclass Meridiem extends DatePart {\n increment() {\n this.date.setHours((this.date.getHours() + 12) % 24);\n }\n decrement() {\n this.increment();\n }\n setValue(_value) {}\n toString() {\n const meridiem = this.date.getHours() > 12 ? \"pm\" : \"am\";\n return /A/.test(this.token) ? meridiem.toUpperCase() : meridiem;\n }\n}\nconst CONFIRM_MESSAGE = \"The selected directory contains files. Would you like to traverse the selected directory?\";\nconst FILE_FILTER_LABEL = \"filter\";\nconst FILE_FILTER_PLACEHOLDER = \"type to filter\";\nconst FILE_EMPTY_MESSAGE = \"No matches\";\nconst Confirm = /*#__PURE__*/Data.taggedEnum();\nconst showConfirmation = /*#__PURE__*/Confirm.$is(\"Show\");\nconst resolveCurrentPath = (path, options) => {\n if (Option.isSome(path)) {\n return Effect.succeed(path.value);\n }\n if (Option.isSome(options.startingPath)) {\n const startingPath = options.startingPath.value;\n return Effect.flatMap(FileSystem.FileSystem, fs =>\n // Ensure the user provided starting path exists\n Effect.orDie(fs.exists(startingPath)).pipe(Effect.flatMap(exists => exists ? Effect.void : Effect.die(`The provided starting path '${startingPath}' does not exist`)), Effect.as(startingPath)));\n }\n return Effect.sync(() => process.cwd());\n};\nconst getFileList = /*#__PURE__*/Effect.fnUntraced(function* (directory, options) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const files = yield* Effect.orDie(fs.readDirectory(directory)).pipe(\n // Always prepend the `\"..\"` option to the file list but allow it\n // to be filtered out if the user so desires\n Effect.map(files => [\"..\", ...files]));\n return yield* Effect.filter(files, file => {\n const result = options.filter(file);\n const userDefinedFilter = Effect.isEffect(result) ? result : Effect.succeed(result);\n const directoryFilter = options.type === \"directory\" ? Effect.map(Effect.orDie(fs.stat(path.join(directory, file))), info => info.type === \"Directory\") : Effect.succeed(true);\n return Effect.zipWith(userDefinedFilter, directoryFilter, (a, b) => a && b);\n }, {\n concurrency: files.length\n });\n});\nconst filterFiles = (files, query) => {\n if (query.length === 0) {\n return files;\n }\n const normalizedQuery = query.toLowerCase();\n const filtered = [];\n for (let index = 0; index < files.length; index++) {\n if (files[index].toLowerCase().includes(normalizedQuery)) {\n filtered.push(files[index]);\n }\n }\n return filtered;\n};\nconst updateFileState = (state, query, allFiles = state.allFiles) => {\n const files = filterFiles(allFiles, query);\n if (files.length === 0) {\n return {\n ...state,\n query,\n allFiles,\n files,\n cursor: 0\n };\n }\n const selected = state.files[state.cursor];\n const cursor = selected === undefined ? 0 : files.indexOf(selected);\n return {\n ...state,\n query,\n allFiles,\n files,\n cursor: cursor === -1 ? 0 : cursor\n };\n};\nconst handleFileClear = options => {\n return Effect.fnUntraced(function* (state, _) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const path = yield* Path.Path;\n const figures = yield* platformFigures;\n const currentPath = yield* resolveCurrentPath(state.path, options);\n const selectedPath = state.files[state.cursor];\n const resolvedPath = selectedPath === undefined ? currentPath : path.resolve(currentPath, selectedPath);\n const resolvedPathText = `${figures.pointerSmall} ${resolvedPath}`;\n const isConfirming = showConfirmation(state.confirm);\n const promptText = isConfirming ? renderPrompt(\"(Y/n)\", CONFIRM_MESSAGE, \"?\", figures.pointerSmall, {\n plain: true\n }) : renderPrompt(renderFileFilter(state, {\n plain: true\n }), options.message, figures.tick, figures.ellipsis, {\n plain: true\n });\n const filesText = isConfirming ? \"\" : renderFiles(state, state.files, figures, options, {\n plain: true\n });\n const outputText = isConfirming ? `${promptText}\\n${resolvedPathText}` : `${promptText}\\n${resolvedPathText}\\n${filesText}`;\n const clearOutput = eraseText(outputText, columns);\n const resetCurrentLine = Ansi.eraseLine + Ansi.cursorLeft;\n return clearOutput + resetCurrentLine;\n });\n};\nconst renderPrompt = (confirm, message, leadingSymbol, trailingSymbol, options) => {\n const prefix = leadingSymbol + \" \";\n const annotate = options?.plain === true ? line => line : annotateLine;\n return Arr.match(message.split(NEWLINE_REGEXP), {\n onEmpty: () => prefix + \" \" + trailingSymbol + \" \" + confirm,\n onNonEmpty: promptLines => {\n const lines = Arr.map(promptLines, line => annotate(line));\n return prefix + lines.join(\"\\n\") + \" \" + trailingSymbol + \" \" + confirm;\n }\n });\n};\nconst renderPrefix = (state, toDisplay, currentIndex, length, figures, renderOptions) => {\n let prefix = \" \";\n if (currentIndex === toDisplay.startIndex && toDisplay.startIndex > 0) {\n prefix = figures.arrowUp;\n } else if (currentIndex === toDisplay.endIndex - 1 && toDisplay.endIndex < length) {\n prefix = figures.arrowDown;\n }\n if (state.cursor === currentIndex) {\n return renderOptions?.plain === true ? figures.pointer + prefix : Ansi.annotate(figures.pointer, Ansi.cyanBright) + prefix;\n }\n return prefix + \" \";\n};\nconst renderFileName = (file, isSelected, renderOptions) => {\n if (renderOptions?.plain === true) {\n return file;\n }\n return isSelected ? Ansi.annotate(file, Ansi.combine(Ansi.underlined, Ansi.cyanBright)) : file;\n};\nconst renderFileFilter = (state, renderOptions) => {\n const filterValue = state.query.length === 0 ? renderOptions?.plain === true ? FILE_FILTER_PLACEHOLDER : Ansi.annotate(FILE_FILTER_PLACEHOLDER, Ansi.blackBright) : renderOptions?.plain === true ? state.query : Ansi.annotate(state.query, Ansi.combine(Ansi.underlined, Ansi.cyanBright));\n return `[${FILE_FILTER_LABEL}: ${filterValue}]`;\n};\nconst renderFiles = (state, files, figures, options, renderOptions) => {\n const length = files.length;\n if (length === 0) {\n return renderOptions?.plain === true ? FILE_EMPTY_MESSAGE : Ansi.annotate(FILE_EMPTY_MESSAGE, Ansi.blackBright);\n }\n const toDisplay = entriesToDisplay(state.cursor, length, options.maxPerPage);\n const documents = [];\n for (let index = toDisplay.startIndex; index < toDisplay.endIndex; index++) {\n const isSelected = state.cursor === index;\n const prefix = renderPrefix(state, toDisplay, index, length, figures, renderOptions);\n const fileName = renderFileName(files[index], isSelected, renderOptions);\n documents.push(prefix + fileName);\n }\n return documents.join(\"\\n\");\n};\nconst renderFileNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const path = yield* Path.Path;\n const figures = yield* platformFigures;\n const currentPath = yield* resolveCurrentPath(state.path, options);\n const selectedPath = state.files[state.cursor];\n const resolvedPath = selectedPath === undefined ? currentPath : path.resolve(currentPath, selectedPath);\n const resolvedPathMsg = Ansi.annotate(figures.pointerSmall + \" \" + resolvedPath, Ansi.blackBright);\n if (showConfirmation(state.confirm)) {\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n const confirm = Ansi.annotate(\"(Y/n)\", Ansi.blackBright);\n const promptMsg = renderPrompt(confirm, CONFIRM_MESSAGE, leadingSymbol, trailingSymbol);\n return Ansi.cursorHide + promptMsg + \"\\n\" + resolvedPathMsg;\n }\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderPrompt(renderFileFilter(state), options.message, leadingSymbol, trailingSymbol);\n const files = renderFiles(state, state.files, figures, options);\n return Ansi.cursorHide + promptMsg + \"\\n\" + resolvedPathMsg + \"\\n\" + files;\n});\nconst renderFileSubmission = /*#__PURE__*/Effect.fnUntraced(function* (state, value, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderPrompt(renderFileFilter(state), options.message, leadingSymbol, trailingSymbol);\n return promptMsg + \" \" + Ansi.annotate(value, Ansi.white) + \"\\n\";\n});\nconst handleFileRender = options => {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderFileNextFrame(state, options),\n Submit: ({\n value\n }) => renderFileSubmission(state, value, options)\n });\n };\n};\nconst processFileCursorUp = state => {\n if (state.files.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n const cursor = state.cursor - 1;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor: cursor < 0 ? state.files.length - 1 : cursor\n }\n }));\n};\nconst processFileCursorDown = state => {\n if (state.files.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor: (state.cursor + 1) % state.files.length\n }\n }));\n};\nconst processFileBackspace = state => {\n if (state.query.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n const query = state.query.slice(0, state.query.length - 1);\n return Effect.succeed(Action.NextFrame({\n state: updateFileState(state, query)\n }));\n};\nconst processFileClear = state => Effect.succeed(Action.NextFrame({\n state: updateFileState(state, \"\")\n}));\nconst processFileInput = (input, state) => {\n if (input.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n const query = state.query + input;\n return Effect.succeed(Action.NextFrame({\n state: updateFileState(state, query)\n }));\n};\nconst processSelection = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n if (state.files.length === 0) {\n return Action.Beep();\n }\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const currentPath = yield* resolveCurrentPath(state.path, options);\n const selectedPath = state.files[state.cursor];\n const resolvedPath = path.resolve(currentPath, selectedPath);\n const info = yield* Effect.orDie(fs.stat(resolvedPath));\n if (info.type === \"Directory\") {\n const files = yield* getFileList(resolvedPath, options);\n const filesWithoutParent = files.filter(file => file !== \"..\");\n // If the user selected a directory AND the prompt type can result with\n // a directory, we must confirm:\n // - If the selected directory has any files\n // - Confirm whether or not the user wants to traverse those files\n if (options.type === \"directory\" || options.type === \"either\") {\n return filesWithoutParent.length === 0\n // Directory is empty so it's safe to select it\n ? Action.Submit({\n value: resolvedPath\n })\n // Directory has contents - show confirmation to user\n : Action.NextFrame({\n state: {\n ...state,\n confirm: Confirm.Show()\n }\n });\n }\n return Action.NextFrame({\n state: {\n cursor: 0,\n files,\n allFiles: files,\n query: \"\",\n path: Option.some(resolvedPath),\n confirm: Confirm.Hide()\n }\n });\n }\n return Action.Submit({\n value: resolvedPath\n });\n});\nconst handleFileProcess = options => {\n return Effect.fnUntraced(function* (input, state) {\n if (input.key.ctrl) {\n if (input.key.name === \"u\") {\n if (showConfirmation(state.confirm)) {\n return Action.Beep();\n }\n return yield* processFileClear(state);\n }\n return Action.Beep();\n }\n switch (input.key.name) {\n case \"k\":\n case \"up\":\n {\n return yield* processFileCursorUp(state);\n }\n case \"j\":\n case \"down\":\n case \"tab\":\n {\n return yield* processFileCursorDown(state);\n }\n case \"backspace\":\n {\n if (showConfirmation(state.confirm)) {\n return Action.Beep();\n }\n return yield* processFileBackspace(state);\n }\n case \"enter\":\n case \"return\":\n {\n return yield* processSelection(state, options);\n }\n case \"y\":\n case \"t\":\n {\n if (showConfirmation(state.confirm)) {\n const path = yield* Path.Path;\n const currentPath = yield* resolveCurrentPath(state.path, options);\n const selectedPath = state.files[state.cursor];\n const resolvedPath = path.resolve(currentPath, selectedPath);\n const files = yield* getFileList(resolvedPath, options);\n return Action.NextFrame({\n state: {\n cursor: 0,\n files,\n allFiles: files,\n query: \"\",\n path: Option.some(resolvedPath),\n confirm: Confirm.Hide()\n }\n });\n }\n return yield* processFileInput(Option.getOrElse(input.input, () => \"\"), state);\n }\n case \"n\":\n case \"f\":\n {\n if (showConfirmation(state.confirm)) {\n const path = yield* Path.Path;\n const currentPath = yield* resolveCurrentPath(state.path, options);\n const selectedPath = state.files[state.cursor];\n const resolvedPath = path.resolve(currentPath, selectedPath);\n return Action.Submit({\n value: resolvedPath\n });\n }\n return yield* processFileInput(Option.getOrElse(input.input, () => \"\"), state);\n }\n default:\n {\n if (showConfirmation(state.confirm)) {\n return Action.Beep();\n }\n return yield* processFileInput(Option.getOrElse(input.input, () => \"\"), state);\n }\n }\n });\n};\nconst renderMultiSelectError = (state, pointer, renderOptions) => {\n if (Option.isSome(state.error)) {\n return Arr.match(state.error.value.split(NEWLINE_REGEXP), {\n onEmpty: () => \"\",\n onNonEmpty: errorLines => {\n if (renderOptions?.plain === true) {\n return `${pointer} ${errorLines.join(\"\\n\")}`;\n }\n const prefix = Ansi.annotate(pointer, Ansi.red) + \" \";\n const lines = Arr.map(errorLines, str => annotateErrorLine(str));\n return Ansi.cursorSavePosition + \"\\n\" + prefix + lines.join(\"\\n\") + Ansi.cursorRestorePosition;\n }\n });\n }\n return \"\";\n};\nconst renderChoiceDescription = (choice, isActive, renderOptions) => {\n if (!choice.disabled && choice.description && isActive) {\n return renderOptions?.plain === true ? \"- \" + choice.description : Ansi.annotate(\"- \" + choice.description, Ansi.blackBright);\n }\n return \"\";\n};\nconst metaOptionsCount = 2;\nconst renderMultiSelectTitle = (title, isHighlighted, renderOptions) => {\n if (renderOptions?.plain === true || !isHighlighted) {\n return title;\n }\n return Ansi.annotate(title, Ansi.combine(Ansi.underlined, Ansi.cyanBright));\n};\nconst renderMultiSelectChoices = (state, options, figures, renderOptions) => {\n const choices = options.choices;\n const totalChoices = choices.length;\n const selectedCount = state.selectedIndices.size;\n const allSelected = selectedCount === totalChoices;\n const selectAllText = allSelected ? options?.selectNone ?? \"Select None\" : options?.selectAll ?? \"Select All\";\n const inverseSelectionText = options?.inverseSelection ?? \"Inverse Selection\";\n const metaOptions = [{\n title: selectAllText\n }, {\n title: inverseSelectionText\n }];\n const allChoices = [...metaOptions, ...choices];\n const toDisplay = entriesToDisplay(state.index, allChoices.length, options.maxPerPage);\n const documents = [];\n for (let index = toDisplay.startIndex; index < toDisplay.endIndex; index++) {\n const choice = allChoices[index];\n const isHighlighted = state.index === index;\n let prefix = \" \";\n if (index === toDisplay.startIndex && toDisplay.startIndex > 0) {\n prefix = figures.arrowUp;\n } else if (index === toDisplay.endIndex - 1 && toDisplay.endIndex < allChoices.length) {\n prefix = figures.arrowDown;\n }\n if (index < metaOptions.length) {\n // Meta options\n const title = renderMultiSelectTitle(choice.title, isHighlighted, renderOptions);\n documents.push(prefix + \" \" + title);\n } else {\n // Regular choices\n const choiceIndex = index - metaOptions.length;\n const isSelected = state.selectedIndices.has(choiceIndex);\n const checkbox = isSelected ? figures.checkboxOn : figures.checkboxOff;\n const annotatedCheckbox = isHighlighted && renderOptions?.plain !== true ? Ansi.annotate(checkbox, Ansi.cyanBright) : checkbox;\n const title = renderMultiSelectTitle(choice.title, isHighlighted, renderOptions);\n const description = renderChoiceDescription(choice, isHighlighted, renderOptions);\n documents.push(prefix + \" \" + annotatedCheckbox + \" \" + title + \" \" + description);\n }\n }\n return documents.join(\"\\n\");\n};\nconst renderMultiSelectNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const choices = renderMultiSelectChoices(state, options, figures);\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n const promptMsg = renderSelectOutput(leadingSymbol, trailingSymbol, options);\n const error = renderMultiSelectError(state, figures.pointer);\n return Ansi.cursorHide + promptMsg + \"\\n\" + choices + error;\n});\nconst renderMultiSelectSubmission = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const selectedChoices = Array.from(state.selectedIndices).sort(EffectNumber.Order).map(index => options.choices[index].title);\n const selectedText = selectedChoices.join(\", \");\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderSelectOutput(leadingSymbol, trailingSymbol, options);\n return promptMsg + \" \" + Ansi.annotate(selectedText, Ansi.white) + \"\\n\";\n});\nconst processMultiSelectCursorUp = (state, totalChoices) => {\n const newIndex = state.index === 0 ? totalChoices - 1 : state.index - 1;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n index: newIndex\n }\n }));\n};\nconst processMultiSelectCursorDown = (state, totalChoices) => {\n const newIndex = (state.index + 1) % totalChoices;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n index: newIndex\n }\n }));\n};\nconst processSpace = (state, options) => {\n const selectedIndices = new Set(state.selectedIndices);\n if (state.index === 0) {\n if (state.selectedIndices.size === options.choices.length) {\n selectedIndices.clear();\n } else {\n for (let i = 0; i < options.choices.length; i++) {\n selectedIndices.add(i);\n }\n }\n } else if (state.index === 1) {\n for (let i = 0; i < options.choices.length; i++) {\n if (state.selectedIndices.has(i)) {\n selectedIndices.delete(i);\n } else {\n selectedIndices.add(i);\n }\n }\n } else {\n const choiceIndex = state.index - metaOptionsCount;\n if (selectedIndices.has(choiceIndex)) {\n selectedIndices.delete(choiceIndex);\n } else {\n selectedIndices.add(choiceIndex);\n }\n }\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n selectedIndices\n }\n }));\n};\nconst handleMultiSelectClear = options => Effect.fnUntraced(function* (state, _) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* platformFigures;\n const clearPrompt = Ansi.eraseLine + Ansi.cursorLeft;\n const promptText = renderSelectOutput(\"?\", figures.pointerSmall, options, {\n plain: true\n });\n const choicesText = renderMultiSelectChoices(state, options, figures, {\n plain: true\n });\n const errorText = renderMultiSelectError(state, figures.pointer, {\n plain: true\n });\n const clearOutput = clearOutputWithError(`${promptText}\\n${choicesText}`, columns, errorText);\n return clearOutput + clearPrompt;\n});\nconst handleMultiSelectProcess = options => {\n return (input, state) => {\n const totalChoices = options.choices.length + metaOptionsCount;\n switch (input.key.name) {\n case \"k\":\n case \"up\":\n {\n return processMultiSelectCursorUp({\n ...state,\n error: Option.none()\n }, totalChoices);\n }\n case \"j\":\n case \"down\":\n case \"tab\":\n {\n return processMultiSelectCursorDown({\n ...state,\n error: Option.none()\n }, totalChoices);\n }\n case \"space\":\n {\n return processSpace(state, options);\n }\n case \"enter\":\n case \"return\":\n {\n const selectedCount = state.selectedIndices.size;\n if (options.min !== undefined && selectedCount < options.min) {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n error: Option.some(`At least ${options.min} are required`)\n }\n }));\n }\n if (options.max !== undefined && selectedCount > options.max) {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n error: Option.some(`At most ${options.max} choices are allowed`)\n }\n }));\n }\n const selectedValues = Array.from(state.selectedIndices).sort(EffectNumber.Order).map(index => options.choices[index].value);\n return Effect.succeed(Action.Submit({\n value: selectedValues\n }));\n }\n default:\n {\n return Effect.succeed(Action.Beep());\n }\n }\n };\n};\nconst handleMultiSelectRender = options => {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderMultiSelectNextFrame(state, options),\n Submit: () => renderMultiSelectSubmission(state, options)\n });\n };\n};\nconst handleNumberClear = options => {\n return Effect.fnUntraced(function* (state, _) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* platformFigures;\n const resetCurrentLine = Ansi.eraseLine + Ansi.cursorLeft;\n const errorText = renderNumberError(state, figures.pointerSmall, {\n plain: true\n });\n const promptText = renderNumberOutput(state, \"?\", figures.pointerSmall, options, {\n plain: true\n });\n const clearOutput = clearOutputWithError(promptText, columns, errorText);\n return clearOutput + resetCurrentLine;\n });\n};\nconst renderNumberInput = (state, submitted, renderOptions) => {\n const value = state.value === \"\" ? \"\" : `${state.value}`;\n if (submitted || renderOptions?.plain === true) {\n return value;\n }\n const annotation = Option.isSome(state.error) ? Ansi.red : Ansi.combine(Ansi.underlined, Ansi.cyanBright);\n return Ansi.annotate(value, annotation);\n};\nconst renderNumberError = (state, pointer, renderOptions) => {\n if (Option.isSome(state.error)) {\n return Arr.match(state.error.value.split(NEWLINE_REGEXP), {\n onEmpty: () => \"\",\n onNonEmpty: errorLines => {\n if (renderOptions?.plain === true) {\n return `${pointer} ${errorLines.join(\"\\n\")}`;\n }\n const prefix = Ansi.annotate(pointer, Ansi.red) + \" \";\n const lines = Arr.map(errorLines, str => annotateErrorLine(str));\n return Ansi.cursorSavePosition + \"\\n\" + prefix + lines.join(\"\\n\") + Ansi.cursorRestorePosition;\n }\n });\n }\n return \"\";\n};\nconst renderNumberOutput = (state, leadingSymbol, trailingSymbol, options, renderOptions, submitted = false) => {\n const value = renderNumberInput(state, submitted, renderOptions);\n return renderPrompt(value, options.message, leadingSymbol, trailingSymbol, renderOptions);\n};\nconst renderNumberNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n const errorMsg = renderNumberError(state, figures.pointerSmall);\n const promptMsg = renderNumberOutput(state, leadingSymbol, trailingSymbol, options);\n return promptMsg + errorMsg;\n});\nconst renderNumberSubmission = /*#__PURE__*/Effect.fnUntraced(function* (nextState, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderNumberOutput(nextState, leadingSymbol, trailingSymbol, options, undefined, true);\n return promptMsg + \"\\n\";\n});\nconst processNumberBackspace = state => {\n if (state.value.length <= 0) {\n return Effect.succeed(Action.Beep());\n }\n const value = state.value.slice(0, state.value.length - 1);\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value,\n error: Option.none()\n }\n }));\n};\nconst processNumberClear = state => Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor: 0,\n value: \"\",\n error: Option.none()\n }\n}));\nconst defaultIntProcessor = (input, state) => {\n if (state.value.length === 0 && input === \"-\") {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value: \"-\",\n error: Option.none()\n }\n }));\n }\n const parsed = Number.parseInt(state.value + input);\n if (Number.isNaN(parsed)) {\n return Effect.succeed(Action.Beep());\n } else {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value: `${parsed}`,\n error: Option.none()\n }\n }));\n }\n};\nconst defaultFloatProcessor = (input, state) => {\n if (input === \".\" && state.value.includes(\".\")) {\n return Effect.succeed(Action.Beep());\n }\n if (state.value.length === 0 && input === \"-\") {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value: \"-\",\n error: Option.none()\n }\n }));\n }\n const parsed = Number.parseFloat(state.value + input);\n if (Number.isNaN(parsed)) {\n return Effect.succeed(Action.Beep());\n } else {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value: input === \".\" ? `${parsed}.` : `${parsed}`,\n error: Option.none()\n }\n }));\n }\n};\nconst handleRenderInteger = options => {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderNumberNextFrame(state, options),\n Submit: () => renderNumberSubmission(state, options)\n });\n };\n};\nconst handleProcessInteger = options => {\n return (input, state) => {\n if (input.key.ctrl && input.key.name === \"u\") {\n return processNumberClear(state);\n }\n switch (input.key.name) {\n case \"backspace\":\n {\n return processNumberBackspace(state);\n }\n case \"k\":\n case \"up\":\n {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value: state.value === \"\" || state.value === \"-\" ? `${options.incrementBy}` : `${Number.parseInt(state.value) + options.incrementBy}`,\n error: Option.none()\n }\n }));\n }\n case \"j\":\n case \"down\":\n {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value: state.value === \"\" || state.value === \"-\" ? `-${options.decrementBy}` : `${Number.parseInt(state.value) - options.decrementBy}`,\n error: Option.none()\n }\n }));\n }\n case \"enter\":\n case \"return\":\n {\n const parsed = Number.parseInt(state.value);\n if (Number.isNaN(parsed)) {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n error: Option.some(\"Must provide an integer value\")\n }\n }));\n } else {\n return Effect.match(options.validate(parsed), {\n onFailure: error => Action.NextFrame({\n state: {\n ...state,\n error: Option.some(error)\n }\n }),\n onSuccess: value => Action.Submit({\n value\n })\n });\n }\n }\n default:\n {\n return defaultIntProcessor(Option.getOrElse(input.input, () => \"\"), state);\n }\n }\n };\n};\nconst handleRenderFloat = options => {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderNumberNextFrame(state, options),\n Submit: () => renderNumberSubmission(state, options)\n });\n };\n};\nconst handleProcessFloat = options => {\n return (input, state) => {\n if (input.key.ctrl && input.key.name === \"u\") {\n return processNumberClear(state);\n }\n switch (input.key.name) {\n case \"backspace\":\n {\n return processNumberBackspace(state);\n }\n case \"k\":\n case \"up\":\n {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value: state.value === \"\" || state.value === \"-\" ? `${options.incrementBy}` : `${Number.parseFloat(state.value) + options.incrementBy}`,\n error: Option.none()\n }\n }));\n }\n case \"j\":\n case \"down\":\n {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value: state.value === \"\" || state.value === \"-\" ? `-${options.decrementBy}` : `${Number.parseFloat(state.value) - options.decrementBy}`,\n error: Option.none()\n }\n }));\n }\n case \"enter\":\n case \"return\":\n {\n const parsed = Number.parseFloat(state.value);\n if (Number.isNaN(parsed)) {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n error: Option.some(\"Must provide a floating point value\")\n }\n }));\n } else {\n return Effect.flatMap(Effect.sync(() => EffectNumber.round(parsed, options.precision)), rounded => Effect.match(options.validate(rounded), {\n onFailure: error => Action.NextFrame({\n state: {\n ...state,\n error: Option.some(error)\n }\n }),\n onSuccess: value => Action.Submit({\n value\n })\n }));\n }\n }\n default:\n {\n return defaultFloatProcessor(Option.getOrElse(input.input, () => \"\"), state);\n }\n }\n };\n};\nconst filterAutoCompleteChoices = (choices, query) => {\n const normalizedQuery = query.toLowerCase();\n const indices = [];\n for (let i = 0; i < choices.length; i++) {\n if (choices[i].title.toLowerCase().includes(normalizedQuery)) {\n indices.push(i);\n }\n }\n return indices;\n};\nconst updateAutoCompleteState = (state, options, query) => {\n const filtered = filterAutoCompleteChoices(options.choices, query);\n if (filtered.length === 0) {\n return {\n ...state,\n query,\n filtered,\n index: 0\n };\n }\n if (filtered.includes(state.index)) {\n return {\n ...state,\n query,\n filtered\n };\n }\n return {\n ...state,\n query,\n filtered,\n index: filtered[0]\n };\n};\nconst autoCompleteCursor = state => Option.getOrElse(Arr.findFirstIndex(state.filtered, index => index === state.index), () => 0);\nconst renderSelectOutput = (leadingSymbol, trailingSymbol, options, renderOptions) => renderPrompt(\"\", options.message, leadingSymbol, trailingSymbol, renderOptions);\nconst renderAutoCompleteFilter = (state, options, renderOptions) => {\n const filterValue = state.query.length === 0 ? renderOptions?.plain === true ? options.filterPlaceholder : Ansi.annotate(options.filterPlaceholder, Ansi.blackBright) : renderOptions?.plain === true ? state.query : Ansi.annotate(state.query, Ansi.combine(Ansi.underlined, Ansi.cyanBright));\n return `[${options.filterLabel}: ${filterValue}]`;\n};\nconst renderAutoCompleteOutput = (state, leadingSymbol, trailingSymbol, options, renderOptions) => {\n const filter = renderAutoCompleteFilter(state, options, renderOptions);\n return renderPrompt(filter, options.message, leadingSymbol, trailingSymbol, renderOptions);\n};\nconst renderChoicePrefix = (state, choices, toDisplay, currentIndex, figures, renderOptions) => {\n let prefix = \" \";\n if (currentIndex === toDisplay.startIndex && toDisplay.startIndex > 0) {\n prefix = figures.arrowUp;\n } else if (currentIndex === toDisplay.endIndex - 1 && toDisplay.endIndex < choices.length) {\n prefix = figures.arrowDown;\n }\n if (renderOptions?.plain === true) {\n return state === currentIndex ? figures.pointer + prefix : prefix + \" \";\n }\n if (choices[currentIndex].disabled) {\n const annotation = Ansi.combine(Ansi.bold, Ansi.blackBright);\n return state === currentIndex ? Ansi.annotate(figures.pointer, annotation) + prefix : prefix + \" \";\n }\n return state === currentIndex ? Ansi.annotate(figures.pointer, Ansi.cyanBright) + prefix : prefix + \" \";\n};\nconst renderAutoCompleteChoicePrefix = (state, options, toDisplay, currentIndex, figures, renderOptions) => {\n let prefix = \" \";\n if (currentIndex === toDisplay.startIndex && toDisplay.startIndex > 0) {\n prefix = figures.arrowUp;\n } else if (currentIndex === toDisplay.endIndex - 1 && toDisplay.endIndex < state.filtered.length) {\n prefix = figures.arrowDown;\n }\n const choiceIndex = state.filtered[currentIndex];\n if (renderOptions?.plain === true) {\n return state.index === choiceIndex ? figures.pointer + prefix : prefix + \" \";\n }\n const choice = options.choices[choiceIndex];\n if (choice.disabled) {\n const annotation = Ansi.combine(Ansi.bold, Ansi.blackBright);\n return state.index === choiceIndex ? Ansi.annotate(figures.pointer, annotation) + prefix : prefix + \" \";\n }\n return state.index === choiceIndex ? Ansi.annotate(figures.pointer, Ansi.cyanBright) + prefix : prefix + \" \";\n};\nconst renderChoiceTitle = (choice, isSelected, renderOptions) => {\n if (renderOptions?.plain === true) {\n return choice.title;\n }\n const title = choice.title;\n if (isSelected) {\n return choice.disabled ? Ansi.annotate(title, Ansi.combine(Ansi.underlined, Ansi.blackBright)) : Ansi.annotate(title, Ansi.combine(Ansi.underlined, Ansi.cyanBright));\n }\n return choice.disabled ? Ansi.annotate(title, Ansi.combine(Ansi.strikethrough, Ansi.blackBright)) : title;\n};\nconst renderSelectChoices = (state, options, figures, renderOptions) => {\n const choices = options.choices;\n const toDisplay = entriesToDisplay(state, choices.length, options.maxPerPage);\n const documents = [];\n for (let index = toDisplay.startIndex; index < toDisplay.endIndex; index++) {\n const choice = choices[index];\n const isSelected = state === index;\n const prefix = renderChoicePrefix(state, choices, toDisplay, index, figures, renderOptions);\n const title = renderChoiceTitle(choice, isSelected, renderOptions);\n const description = renderChoiceDescription(choice, isSelected, renderOptions);\n documents.push(prefix + title + \" \" + description);\n }\n return documents.join(\"\\n\");\n};\nconst renderAutoCompleteChoices = (state, options, figures, renderOptions) => {\n if (state.filtered.length === 0) {\n return renderOptions?.plain === true ? options.emptyMessage : Ansi.annotate(options.emptyMessage, Ansi.blackBright);\n }\n const cursor = autoCompleteCursor(state);\n const toDisplay = entriesToDisplay(cursor, state.filtered.length, options.maxPerPage);\n const documents = [];\n for (let index = toDisplay.startIndex; index < toDisplay.endIndex; index++) {\n const choiceIndex = state.filtered[index];\n const choice = options.choices[choiceIndex];\n const isSelected = state.index === choiceIndex;\n const prefix = renderAutoCompleteChoicePrefix(state, options, toDisplay, index, figures, renderOptions);\n const title = renderChoiceTitle(choice, isSelected, renderOptions);\n const description = renderChoiceDescription(choice, isSelected, renderOptions);\n documents.push(prefix + title + \" \" + description);\n }\n return documents.join(\"\\n\");\n};\nconst renderSelectNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const choices = renderSelectChoices(state, options, figures);\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n const promptMsg = renderSelectOutput(leadingSymbol, trailingSymbol, options);\n return Ansi.cursorHide + promptMsg + \"\\n\" + choices;\n});\nconst renderAutoCompleteNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const choices = renderAutoCompleteChoices(state, options, figures);\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n const promptMsg = renderAutoCompleteOutput(state, leadingSymbol, trailingSymbol, options);\n return Ansi.cursorHide + promptMsg + \"\\n\" + choices;\n});\nconst renderSelectSubmission = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const selected = options.choices[state].title;\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderSelectOutput(leadingSymbol, trailingSymbol, options);\n return promptMsg + \" \" + Ansi.annotate(selected, Ansi.white) + \"\\n\";\n});\nconst renderAutoCompleteSubmission = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const selected = options.choices[state.index].title;\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderAutoCompleteOutput(state, leadingSymbol, trailingSymbol, options);\n return promptMsg + \" \" + Ansi.annotate(selected, Ansi.white) + \"\\n\";\n});\nconst processSelectCursorUp = (state, choices) => {\n if (state === 0) {\n return Effect.succeed(Action.NextFrame({\n state: choices.length - 1\n }));\n }\n return Effect.succeed(Action.NextFrame({\n state: state - 1\n }));\n};\nconst processSelectCursorDown = (state, choices) => {\n if (state === choices.length - 1) {\n return Effect.succeed(Action.NextFrame({\n state: 0\n }));\n }\n return Effect.succeed(Action.NextFrame({\n state: state + 1\n }));\n};\nconst processSelectNext = (state, choices) => {\n return Effect.succeed(Action.NextFrame({\n state: (state + 1) % choices.length\n }));\n};\nconst processAutoCompleteCursorUp = state => {\n if (state.filtered.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n const cursor = autoCompleteCursor(state);\n const nextCursor = cursor === 0 ? state.filtered.length - 1 : cursor - 1;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n index: state.filtered[nextCursor]\n }\n }));\n};\nconst processAutoCompleteCursorDown = state => {\n if (state.filtered.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n const cursor = autoCompleteCursor(state);\n const nextCursor = (cursor + 1) % state.filtered.length;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n index: state.filtered[nextCursor]\n }\n }));\n};\nconst processAutoCompleteNext = state => processAutoCompleteCursorDown(state);\nconst processAutoCompleteBackspace = (state, options) => {\n if (state.query.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n const query = state.query.slice(0, state.query.length - 1);\n return Effect.succeed(Action.NextFrame({\n state: updateAutoCompleteState(state, options, query)\n }));\n};\nconst processAutoCompleteClear = (state, options) => Effect.succeed(Action.NextFrame({\n state: updateAutoCompleteState(state, options, \"\")\n}));\nconst processAutoCompleteInput = (input, state, options) => {\n if (input.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n const query = state.query + input;\n return Effect.succeed(Action.NextFrame({\n state: updateAutoCompleteState(state, options, query)\n }));\n};\nconst handleSelectRender = options => {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderSelectNextFrame(state, options),\n Submit: () => renderSelectSubmission(state, options)\n });\n };\n};\nconst handleAutoCompleteRender = options => {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderAutoCompleteNextFrame(state, options),\n Submit: () => renderAutoCompleteSubmission(state, options)\n });\n };\n};\nconst handleSelectClear = options => Effect.fnUntraced(function* (state, _) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* platformFigures;\n const clearPrompt = Ansi.eraseLine + Ansi.cursorLeft;\n const promptText = renderSelectOutput(\"?\", figures.pointerSmall, options, {\n plain: true\n });\n const choicesText = renderSelectChoices(state, options, figures, {\n plain: true\n });\n const clearOutput = eraseText(`${promptText}\\n${choicesText}`, columns);\n return clearOutput + clearPrompt;\n});\nconst handleAutoCompleteClear = options => Effect.fnUntraced(function* (state, _) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* platformFigures;\n const clearPrompt = Ansi.eraseLine + Ansi.cursorLeft;\n const promptText = renderAutoCompleteOutput(state, \"?\", figures.pointerSmall, options, {\n plain: true\n });\n const choicesText = renderAutoCompleteChoices(state, options, figures, {\n plain: true\n });\n const clearOutput = eraseText(`${promptText}\\n${choicesText}`, columns);\n return clearOutput + clearPrompt;\n});\nconst handleSelectProcess = options => {\n return (input, state) => {\n switch (input.key.name) {\n case \"k\":\n case \"up\":\n {\n return processSelectCursorUp(state, options.choices);\n }\n case \"j\":\n case \"down\":\n {\n return processSelectCursorDown(state, options.choices);\n }\n case \"tab\":\n {\n return processSelectNext(state, options.choices);\n }\n case \"enter\":\n case \"return\":\n {\n const selected = options.choices[state];\n if (selected.disabled) {\n return Effect.succeed(Action.Beep());\n }\n return Effect.succeed(Action.Submit({\n value: selected.value\n }));\n }\n default:\n {\n return Effect.succeed(Action.Beep());\n }\n }\n };\n};\nconst handleAutoCompleteProcess = options => {\n return (input, state) => {\n if (input.key.ctrl) {\n if (input.key.name === \"u\") {\n return processAutoCompleteClear(state, options);\n }\n return Effect.succeed(Action.Beep());\n }\n switch (input.key.name) {\n case \"k\":\n case \"up\":\n {\n return processAutoCompleteCursorUp(state);\n }\n case \"j\":\n case \"down\":\n {\n return processAutoCompleteCursorDown(state);\n }\n case \"tab\":\n {\n return processAutoCompleteNext(state);\n }\n case \"backspace\":\n {\n return processAutoCompleteBackspace(state, options);\n }\n case \"enter\":\n case \"return\":\n {\n if (state.filtered.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n const selected = options.choices[state.index];\n if (selected.disabled) {\n return Effect.succeed(Action.Beep());\n }\n return Effect.succeed(Action.Submit({\n value: selected.value\n }));\n }\n default:\n {\n return processAutoCompleteInput(Option.getOrElse(input.input, () => \"\"), state, options);\n }\n }\n };\n};\nconst renderClearScreen = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* platformFigures;\n const resetCurrentLine = Ansi.eraseLine + Ansi.cursorLeft;\n const errorText = renderTextError(state, figures.pointerSmall, {\n plain: true\n });\n const clearOutput = clearOutputWithError(renderTextOutput(state, \"?\", figures.pointerSmall, options, {\n plain: true\n }), columns, errorText);\n return clearOutput + resetCurrentLine;\n});\nconst renderTextInput = (nextState, options, submitted, renderOptions) => {\n const text = nextState.value;\n if (renderOptions?.plain === true) {\n switch (options.type) {\n case \"hidden\":\n {\n return \"\";\n }\n case \"password\":\n {\n return \"*\".repeat(text.length);\n }\n case \"text\":\n {\n return text;\n }\n }\n }\n const annotation = Option.isSome(nextState.error) ? Ansi.red : submitted ? Ansi.white : nextState.value.length === 0 ? Ansi.blackBright : Ansi.combine(Ansi.underlined, Ansi.cyanBright);\n switch (options.type) {\n case \"hidden\":\n {\n return \"\";\n }\n case \"password\":\n {\n return Ansi.annotate(\"*\".repeat(text.length), annotation);\n }\n case \"text\":\n {\n return Ansi.annotate(text, annotation);\n }\n }\n};\nconst renderTextError = (nextState, pointer, renderOptions) => {\n if (Option.isSome(nextState.error)) {\n return Arr.match(nextState.error.value.split(NEWLINE_REGEXP), {\n onEmpty: () => \"\",\n onNonEmpty: errorLines => {\n if (renderOptions?.plain === true) {\n return `${pointer} ${errorLines.join(\"\\n\")}`;\n }\n const prefix = Ansi.annotate(pointer, Ansi.red) + \" \";\n const lines = Arr.map(errorLines, str => annotateErrorLine(str));\n return Ansi.cursorSavePosition + \"\\n\" + prefix + lines.join(\"\\n\") + Ansi.cursorRestorePosition;\n }\n });\n }\n return \"\";\n};\nconst renderTextOutput = (nextState, leadingSymbol, trailingSymbol, options, renderOptions, submitted = false) => {\n const value = renderTextInput(nextState, options, submitted, renderOptions);\n return renderPrompt(value, options.message, leadingSymbol, trailingSymbol, renderOptions);\n};\nconst renderTextNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n const promptMsg = renderTextOutput(state, leadingSymbol, trailingSymbol, options);\n const errorMsg = renderTextError(state, figures.pointerSmall);\n const offset = state.cursor - state.value.length;\n return promptMsg + errorMsg + Ansi.cursorMove(offset);\n});\nconst renderTextSubmission = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderTextOutput(state, leadingSymbol, trailingSymbol, options, undefined, true);\n return promptMsg + \"\\n\";\n});\nconst processTextBackspace = state => {\n if (state.cursor <= 0) {\n return Effect.succeed(Action.Beep());\n }\n const beforeCursor = state.value.slice(0, state.cursor - 1);\n const afterCursor = state.value.slice(state.cursor);\n const cursor = state.cursor - 1;\n const value = `${beforeCursor}${afterCursor}`;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor,\n value,\n error: Option.none()\n }\n }));\n};\nconst processTextClear = state => Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor: 0,\n value: \"\",\n error: Option.none()\n }\n}));\nconst processTextCursorLeft = state => {\n if (state.cursor <= 0) {\n return Effect.succeed(Action.Beep());\n }\n const cursor = state.cursor - 1;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor,\n error: Option.none()\n }\n }));\n};\nconst processTextCursorRight = state => {\n if (state.cursor >= state.value.length) {\n return Effect.succeed(Action.Beep());\n }\n const cursor = Math.min(state.cursor + 1, state.value.length);\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor,\n error: Option.none()\n }\n }));\n};\nconst processTextCursorStart = state => Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor: 0,\n error: Option.none()\n }\n}));\nconst processTextCursorEnd = state => Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor: state.value.length,\n error: Option.none()\n }\n}));\nconst processTab = (state, options) => {\n if (state.value === options.default) {\n return Effect.succeed(Action.Beep());\n }\n const value = state.value.length === 0 ? options.default : state.value;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value,\n cursor: value.length,\n error: Option.none()\n }\n }));\n};\nconst defaultTextProcessor = (input, state) => {\n const beforeCursor = state.value.slice(0, state.cursor);\n const afterCursor = state.value.slice(state.cursor);\n const value = `${beforeCursor}${input}${afterCursor}`;\n const cursor = state.cursor + input.length;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor,\n value,\n error: Option.none()\n }\n }));\n};\nconst handleTextRender = options => {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderTextNextFrame(state, options),\n Submit: () => renderTextSubmission(state, options)\n });\n };\n};\nconst handleTextProcess = options => {\n return (input, state) => {\n if (input.key.ctrl) {\n switch (input.key.name) {\n case \"u\":\n {\n return processTextClear(state);\n }\n case \"a\":\n {\n return processTextCursorStart(state);\n }\n case \"e\":\n {\n return processTextCursorEnd(state);\n }\n default:\n {\n return Effect.succeed(Action.Beep());\n }\n }\n }\n switch (input.key.name) {\n case \"backspace\":\n {\n return processTextBackspace(state);\n }\n case \"left\":\n {\n return processTextCursorLeft(state);\n }\n case \"right\":\n {\n return processTextCursorRight(state);\n }\n case \"home\":\n {\n return processTextCursorStart(state);\n }\n case \"end\":\n {\n return processTextCursorEnd(state);\n }\n case \"enter\":\n case \"return\":\n {\n const value = state.value;\n return Effect.match(options.validate(value), {\n onFailure: error => Action.NextFrame({\n state: {\n ...state,\n value,\n error: Option.some(error)\n }\n }),\n onSuccess: value => Action.Submit({\n value\n })\n });\n }\n case \"tab\":\n {\n return processTab(state, options);\n }\n default:\n {\n return defaultTextProcessor(Option.getOrElse(input.input, () => \"\"), state);\n }\n }\n };\n};\nconst handleTextClear = options => {\n return (state, _) => {\n return renderClearScreen(state, options);\n };\n};\nconst basePrompt = (options, type) => {\n const opts = {\n default: \"\",\n type,\n validate: Effect.succeed,\n ...options\n };\n const initialState = {\n cursor: opts.default.length,\n value: opts.default,\n error: Option.none()\n };\n return custom(initialState, {\n render: handleTextRender(opts),\n process: handleTextProcess(opts),\n clear: handleTextClear(opts)\n });\n};\nconst handleToggleClear = /*#__PURE__*/Effect.fnUntraced(function* (options) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* platformFigures;\n const clearPrompt = Ansi.eraseLine + Ansi.cursorLeft;\n const toggleText = `${options.active} / ${options.inactive}`;\n const promptText = renderPrompt(toggleText, options.message, \"?\", figures.pointerSmall, {\n plain: true\n });\n const clearOutput = eraseText(promptText, columns);\n return clearOutput + clearPrompt;\n});\nconst renderToggle = (value, options, submitted = false) => {\n const separator = Ansi.annotate(\"/\", Ansi.blackBright);\n const selectedAnnotation = Ansi.combine(Ansi.underlined, submitted ? Ansi.white : Ansi.cyanBright);\n const inactive = value ? options.inactive : Ansi.annotate(options.inactive, selectedAnnotation);\n const active = value ? Ansi.annotate(options.active, selectedAnnotation) : options.active;\n return active + \" \" + separator + \" \" + inactive;\n};\nconst renderToggleOutput = (toggle, leadingSymbol, trailingSymbol, options) => {\n const promptLines = options.message.split(NEWLINE_REGEXP);\n const prefix = leadingSymbol + \" \";\n if (Arr.isReadonlyArrayNonEmpty(promptLines)) {\n const lines = Arr.map(promptLines, line => annotateLine(line));\n return prefix + lines.join(\"\\n\") + \" \" + trailingSymbol + \" \" + toggle;\n }\n return prefix + \" \" + trailingSymbol + \" \" + toggle;\n};\nconst renderToggleNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n const toggle = renderToggle(state, options);\n const promptMsg = renderToggleOutput(toggle, leadingSymbol, trailingSymbol, options);\n return Ansi.cursorHide + promptMsg;\n});\nconst renderToggleSubmission = /*#__PURE__*/Effect.fnUntraced(function* (value, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const toggle = renderToggle(value, options, true);\n const promptMsg = renderToggleOutput(toggle, leadingSymbol, trailingSymbol, options);\n return promptMsg + \"\\n\";\n});\nconst activate = /*#__PURE__*/Effect.succeed(/*#__PURE__*/Action.NextFrame({\n state: true\n}));\nconst deactivate = /*#__PURE__*/Effect.succeed(/*#__PURE__*/Action.NextFrame({\n state: false\n}));\nconst handleToggleRender = options => {\n return (state, action) => {\n switch (action._tag) {\n case \"Beep\":\n {\n return Effect.succeed(renderBeep);\n }\n case \"NextFrame\":\n {\n return renderToggleNextFrame(state, options);\n }\n case \"Submit\":\n {\n return renderToggleSubmission(state, options);\n }\n }\n };\n};\nconst handleToggleProcess = (input, state) => {\n switch (input.key.name) {\n case \"0\":\n case \"j\":\n case \"delete\":\n case \"right\":\n case \"down\":\n {\n return deactivate;\n }\n case \"1\":\n case \"k\":\n case \"left\":\n case \"up\":\n {\n return activate;\n }\n case \" \":\n case \"tab\":\n {\n return state ? deactivate : activate;\n }\n case \"enter\":\n case \"return\":\n {\n return Effect.succeed(Action.Submit({\n value: state\n }));\n }\n default:\n {\n return Effect.succeed(Action.Beep());\n }\n }\n};\nconst entriesToDisplay = (cursor, total, maxVisible) => {\n const max = maxVisible === undefined ? total : maxVisible;\n let startIndex = Math.min(total - max, cursor - Math.floor(max / 2));\n if (startIndex < 0) {\n startIndex = 0;\n }\n const endIndex = Math.min(startIndex + max, total);\n return {\n startIndex,\n endIndex\n };\n};\n//# sourceMappingURL=Prompt.js.map","/**\n * Defines the shared parameter model for CLI arguments and flags.\n *\n * A `Param<Kind, A>` describes how to consume parsed command-line input and\n * return a typed value. The `Kind` decides whether the parameter reads\n * positional arguments or named flags. `Argument` and `Flag` build on this\n * module to share parsing structure, primitive constructors, help metadata,\n * aliases, defaults, prompts, configuration fallbacks, validation, schema\n * decoding, fallback parameters, and traversal helpers.\n *\n * @since 4.0.0\n */\nimport * as Config from \"../../Config.js\";\nimport * as Effect from \"../../Effect.js\";\nimport { dual, identity } from \"../../Function.js\";\nimport * as Option from \"../../Option.js\";\nimport { pipeArguments } from \"../../Pipeable.js\";\nimport * as Predicate from \"../../Predicate.js\";\nimport * as Result from \"../../Result.js\";\nimport * as Schema from \"../../Schema.js\";\nimport * as CliError from \"./CliError.js\";\nimport * as Primitive from \"./Primitive.js\";\nimport * as Prompt from \"./Prompt.js\";\nconst TypeId = \"~effect/cli/Param\";\n/**\n * Defines the kind discriminator for positional argument parameters.\n *\n * **When to use**\n *\n * Use to build low-level `Param` constructors or type positions for positional\n * argument parameters.\n *\n * @see {@link flagKind} for the named flag parameter discriminator\n * @see {@link ParamKind} for the full parameter kind union\n *\n * @category constants\n * @since 4.0.0\n */\nexport const argumentKind = \"argument\";\n/**\n * Defines the kind discriminator for flag parameters.\n *\n * **When to use**\n *\n * Use to build low-level `Param` constructors or type positions for named flag\n * parameters.\n *\n * @see {@link argumentKind} for the positional argument parameter discriminator\n *\n * @category constants\n * @since 4.0.0\n */\nexport const flagKind = \"flag\";\nconst Proto = {\n [TypeId]: {\n _A: identity\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/**\n * Type guard to check if a value is a Param.\n *\n * **Example** (Checking for params)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const maybeParam = Param.string(Param.flagKind, \"name\")\n *\n * if (Param.isParam(maybeParam)) {\n * console.log(\"This is a Param\")\n * }\n * ```\n *\n * @category refinements\n * @since 4.0.0\n */\nexport const isParam = u => Predicate.hasProperty(u, TypeId);\n/**\n * Type guard to check if a param is a Single param (not composed).\n *\n * **Example** (Checking for single params)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const nameParam = Param.string(Param.flagKind, \"name\")\n * const optionalParam = Param.optional(nameParam)\n *\n * console.log(Param.isSingle(nameParam)) // true\n * console.log(Param.isSingle(optionalParam)) // false\n * ```\n *\n * @category refinements\n * @since 4.0.0\n */\nexport const isSingle = param => Predicate.isTagged(param, \"Single\");\n/**\n * Type guard to check if a Single param is a flag (not an argument).\n *\n * @internal\n */\nexport const isFlagParam = single => single.kind === \"flag\";\n/**\n * Constructs a leaf `Single` parameter from its kind, name, primitive parser,\n * and optional help metadata.\n *\n * **Details**\n *\n * The returned parser reads either one positional argument or the named flag,\n * depending on `kind`.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const makeSingle = params => {\n const parse = args => params.kind === argumentKind ? parsePositional(params.name, params.primitiveType, args) : parseFlag(params.name, params.primitiveType, args);\n return Object.assign(Object.create(Proto), {\n _tag: \"Single\",\n ...params,\n description: params.description ?? Option.none(),\n aliases: params.aliases ?? [],\n hidden: params.hidden ?? false,\n parse\n });\n};\n/**\n * Creates a string parameter.\n *\n * **Example** (Creating string parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Create a string flag\n * const nameFlag = Param.string(Param.flagKind, \"name\")\n *\n * // Create a string argument\n * const fileArg = Param.string(Param.argumentKind, \"file\")\n *\n * // Usage in CLI: --name \"John Doe\" or as positional argument\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const string = (kind, name) => makeSingle({\n name,\n primitiveType: Primitive.string,\n kind\n});\n/**\n * Creates a boolean parameter.\n *\n * **Example** (Creating boolean parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Create a boolean flag\n * const verboseFlag = Param.boolean(Param.flagKind, \"verbose\")\n *\n * // Create a boolean argument\n * const enableArg = Param.boolean(Param.argumentKind, \"enable\")\n *\n * // Usage in CLI: --verbose (defaults to true when present, false when absent)\n * // or as positional: true/false\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const boolean = (kind, name) => makeSingle({\n name,\n primitiveType: Primitive.boolean,\n kind\n});\n/**\n * Creates an integer parameter.\n *\n * **Example** (Creating integer parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Create an integer flag\n * const portFlag = Param.integer(Param.flagKind, \"port\")\n *\n * // Create an integer argument\n * const countArg = Param.integer(Param.argumentKind, \"count\")\n *\n * // Usage in CLI: --port 8080 or as positional argument: 42\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const integer = (kind, name) => makeSingle({\n name,\n primitiveType: Primitive.integer,\n kind\n});\n/**\n * Creates a floating-point number parameter.\n *\n * **Example** (Creating float parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Create a float flag\n * const rateFlag = Param.float(Param.flagKind, \"rate\")\n *\n * // Create a float argument\n * const thresholdArg = Param.float(Param.argumentKind, \"threshold\")\n *\n * // Usage in CLI: --rate 0.95 or as positional argument: 3.14159\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const float = (kind, name) => makeSingle({\n name,\n primitiveType: Primitive.float,\n kind\n});\n/**\n * Creates a date parameter that parses ISO date strings.\n *\n * **Example** (Creating date parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Create a date flag\n * const startFlag = Param.date(Param.flagKind, \"start-date\")\n *\n * // Create a date argument\n * const dueDateArg = Param.date(Param.argumentKind, \"due-date\")\n *\n * // Usage in CLI: --start-date \"2023-12-25\" or as positional: \"2023-01-01\"\n * // Parses to JavaScript Date object\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const date = (kind, name) => makeSingle({\n name,\n primitiveType: Primitive.date,\n kind\n});\n/**\n * Constructs command-line params that represent a choice between several\n * inputs. The input will be mapped to it's associated value during parsing.\n *\n * **Example** (Creating valued choices)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * type Animal = Dog | Cat\n *\n * interface Dog {\n * readonly _tag: \"Dog\"\n * }\n *\n * interface Cat {\n * readonly _tag: \"Cat\"\n * }\n *\n * const animal = Param.choiceWithValue(Param.flagKind, \"animal\", [\n * [\"dog\", { _tag: \"Dog\" }],\n * [\"cat\", { _tag: \"Cat\" }]\n * ])\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const choiceWithValue = (kind, name, choices) => makeSingle({\n name,\n primitiveType: Primitive.choice(choices),\n kind\n});\n/**\n * Constructs command-line params that represent a choice between several\n * string inputs.\n *\n * **Example** (Creating string choices)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const logLevel = Param.choice(Param.flagKind, \"log-level\", [\n * \"debug\",\n * \"info\",\n * \"warn\",\n * \"error\"\n * ])\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const choice = (kind, name, choices) => {\n const mappedChoices = choices.map(value => [value, value]);\n return choiceWithValue(kind, name, mappedChoices);\n};\n/**\n * Creates a path parameter that accepts file or directory paths.\n *\n * **Example** (Creating path parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Basic path parameter\n * const outputPath = Param.path(Param.flagKind, \"output\")\n *\n * // Path that must exist\n * const inputPath = Param.path(Param.flagKind, \"input\", { mustExist: true })\n *\n * // File-only path\n * const configFile = Param.path(Param.flagKind, \"config\", {\n * pathType: \"file\",\n * mustExist: true,\n * typeName: \"config-file\"\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const path = (kind, name, options) => makeSingle({\n name,\n kind,\n primitiveType: Primitive.path(options?.pathType ?? \"either\", options?.mustExist),\n typeName: options?.typeName\n});\n/**\n * Creates a directory path parameter.\n *\n * **Details**\n *\n * This is a convenience function that creates a path parameter with the\n * `pathType` set to `\"directory\"` and a default type name of `\"directory\"`.\n *\n * **Example** (Creating directory parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Basic directory parameter\n * const outputDir = Param.directory(Param.flagKind, \"output-dir\")\n *\n * // Directory that must exist\n * const sourceDir = Param.directory(Param.flagKind, \"source\", { mustExist: true })\n *\n * // Usage: --output-dir /path/to/dir --source /existing/dir\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const directory = (kind, name, options) => path(kind, name, {\n pathType: \"directory\",\n typeName: \"directory\",\n mustExist: options?.mustExist\n});\n/**\n * Creates a file path parameter.\n *\n * **Details**\n *\n * This is a convenience function that creates a path parameter with a\n * `pathType` set to `\"file\"` and a default type name of `\"file\"`.\n *\n * **Example** (Creating file parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Basic file parameter\n * const outputFile = Param.file(Param.flagKind, \"output\")\n *\n * // File that must exist\n * const inputFile = Param.file(Param.flagKind, \"input\", { mustExist: true })\n *\n * // Usage: --output result.txt --input existing-file.txt\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const file = (kind, name, options) => path(kind, name, {\n pathType: \"file\",\n typeName: \"file\",\n mustExist: options?.mustExist\n});\n/**\n * Creates a redacted parameter for sensitive data like passwords.\n * The value is masked in help output and logging.\n *\n * **Example** (Creating redacted parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Create a password parameter\n * const password = Param.redacted(Param.flagKind, \"password\")\n *\n * // Create an API key argument\n * const apiKey = Param.redacted(Param.argumentKind, \"api-key\")\n *\n * // Usage: --password (value will be hidden in help/logs)\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const redacted = (kind, name) => makeSingle({\n name,\n primitiveType: Primitive.redacted,\n kind\n});\n/**\n * Creates a parameter that reads and returns file content as a string.\n *\n * **Example** (Reading file text)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Read a config file as string\n * const configContent = Param.fileText(Param.flagKind, \"config\")\n *\n * // Read a template file as argument\n * const templateContent = Param.fileText(Param.argumentKind, \"template\")\n *\n * // Usage: --config config.txt (reads file content into string)\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileText = (kind, name) => makeSingle({\n name,\n primitiveType: Primitive.fileText,\n kind\n});\n/**\n * Creates a param that reads and parses the content of the specified file.\n *\n * **Details**\n *\n * The parser that is utilized will depend on the specified `format`, or the\n * extension of the file passed on the command-line if no `format` is specified.\n *\n * **Example** (Parsing file contents)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Will use the extension of the file passed on the command line to determine\n * // the parser to use\n * const config = Param.fileParse(Param.flagKind, \"config\")\n *\n * // Will use the JSON parser\n * const jsonConfig = Param.fileParse(Param.flagKind, \"json-config\", {\n * format: \"json\"\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileParse = (kind, name, options) => makeSingle({\n name,\n primitiveType: Primitive.fileParse(options),\n kind\n});\n/**\n * Creates a parameter that reads and validates file content using a schema.\n *\n * **Example** (Validating file contents)\n *\n * ```ts\n * import { Schema } from \"effect\"\n * import { Param } from \"effect/unstable/cli\"\n * // Parse JSON config file\n * const configSchema = Schema.Struct({\n * port: Schema.Number,\n * host: Schema.String\n * })\n *\n * const config = Param.fileSchema(Param.flagKind, \"config\", configSchema, {\n * format: \"json\"\n * })\n *\n * // Parse YAML file\n * const yamlConfig = Param.fileSchema(Param.flagKind, \"config\", configSchema, {\n * format: \"yaml\"\n * })\n *\n * // Usage: --config config.json (reads and validates file content)\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileSchema = (kind, name, schema, options) => makeSingle({\n name,\n primitiveType: Primitive.fileSchema(schema, options),\n kind\n});\n/**\n * Creates a param that parses key=value pairs.\n *\n * **When to use**\n *\n * Use when you need command-line options or arguments that collect `key=value`\n * configuration entries.\n *\n * **Details**\n *\n * Requires at least one key=value pair. The parsed pairs are merged into a\n * single record object.\n *\n * **Example** (Parsing key-value pairs)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const env = Param.keyValuePair(Param.flagKind, \"env\")\n * // --env FOO=bar --env BAZ=qux will parse to { FOO: \"bar\", BAZ: \"qux\" }\n *\n * const props = Param.keyValuePair(Param.flagKind, \"property\")\n * // --property name=value --property debug=true\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const keyValuePair = (kind, name) => map(variadic(makeSingle({\n name,\n primitiveType: Primitive.keyValuePair,\n kind\n}), {\n min: 1\n}), objects => Object.assign({}, ...objects));\n/**\n * Creates an empty sentinel parameter that always fails to parse.\n *\n * **When to use**\n *\n * Use when you need an empty CLI parameter sentinel for optional parameter\n * construction or internal combinators.\n *\n * **Example** (Creating sentinel parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const disabledDebugParam = Param.none(Param.flagKind)\n *\n * const makeDebugParam = (enableDebug: boolean) =>\n * enableDebug ? Param.string(Param.flagKind, \"debug\") : disabledDebugParam\n *\n * console.log(makeDebugParam(true) === disabledDebugParam) // false\n * console.log(makeDebugParam(false) === disabledDebugParam) // true\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const none = kind => makeSingle({\n name: \"__none__\",\n primitiveType: Primitive.none,\n kind\n});\nconst FLAG_DASH_REGEXP = /^-+/;\n/**\n * Adds an alias to an option.\n *\n * **When to use**\n *\n * Use when you need a CLI parameter to accept an alternate name, such as \"-f\"\n * for \"--force\".\n *\n * **Details**\n *\n * This works on any param structure by recursively finding the underlying\n * `Single` node and applying the alias there.\n *\n * **Example** (Adding parameter aliases)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const force = Param.boolean(Param.flagKind, \"force\").pipe(\n * Param.withAlias(\"-f\"),\n * Param.withAlias(\"-F\")\n * )\n *\n * // Also works on composed params:\n * const count = Param.integer(Param.flagKind, \"count\").pipe(\n * Param.optional,\n * Param.withAlias(\"-c\") // finds the underlying Single and adds alias\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withAlias = /*#__PURE__*/dual(2, (self, alias) => {\n return transformSingle(self, single => makeSingle({\n ...single,\n aliases: [...single.aliases, alias.replace(FLAG_DASH_REGEXP, \"\")]\n }));\n});\n/**\n * Adds a description to an option for help text.\n *\n * **Details**\n *\n * Descriptions provide users with information about what the option does\n * when they view help documentation.\n *\n * **Example** (Adding help descriptions)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const verbose = Param.boolean(Param.flagKind, \"verbose\").pipe(\n * Param.withAlias(\"-v\"),\n * Param.withDescription(\"Enable verbose output\")\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withDescription = /*#__PURE__*/dual(2, (self, description) => {\n return transformSingle(self, single => makeSingle({\n ...single,\n description: Option.some(description)\n }));\n});\n/**\n * Hides a parameter from generated help output and completions while keeping\n * it parseable on the command line.\n *\n * **When to use**\n *\n * Use when experimental, internal, or deprecated flags should be accepted but\n * not advertised.\n *\n * **Example** (Hiding a flag from help)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const experimental = Param.boolean(Param.flagKind, \"experimental-foo\").pipe(\n * Param.withHidden\n * )\n * ```\n *\n * @category metadata\n * @since 4.0.0\n */\nexport const withHidden = self => transformSingle(self, single => makeSingle({\n ...single,\n hidden: true\n}));\n/**\n * Transforms the parsed value of an option using a mapping function.\n *\n * **Example** (Mapping parsed values)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const port = Param.integer(Param.flagKind, \"port\").pipe(\n * Param.map((n) => ({ port: n, url: `http://localhost:${n}` }))\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const map = /*#__PURE__*/dual(2, (self, f) => {\n const parse = args => Effect.map(self.parse(args), ([operands, value]) => [operands, f(value)]);\n return Object.assign(Object.create(Proto), {\n _tag: \"Map\",\n kind: self.kind,\n param: self,\n f,\n parse\n });\n});\nconst transform = (self, f) => Object.assign(Object.create(Proto), {\n _tag: \"Transform\",\n kind: self.kind,\n param: self,\n f,\n parse: f(self.parse)\n});\n/**\n * Transforms the parsed value of an option using an effectful mapping function.\n *\n * **Example** (Mapping parsed values effectfully)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError, Param } from \"effect/unstable/cli\"\n *\n * const validatedEmail = Param.string(Param.flagKind, \"email\").pipe(\n * Param.mapEffect((email) =>\n * email.includes(\"@\")\n * ? Effect.succeed(email)\n * : Effect.fail(\n * new CliError.InvalidValue({\n * option: \"email\",\n * value: email,\n * expected: \"valid email format\",\n * kind: \"flag\"\n * })\n * )\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const mapEffect = /*#__PURE__*/dual(2, (self, f) => transform(self, parse => args => Effect.flatMap(parse(args), ([leftover, a]) => f(a).pipe(Effect.map(b => [leftover, b])))));\n/**\n * Transforms the parsed value of an option using a function that may throw,\n * converting any thrown errors into failure messages.\n *\n * **Example** (Mapping thrown errors)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const parsedJson = Param.string(Param.flagKind, \"config\").pipe(\n * Param.mapTryCatch(\n * (str) => JSON.parse(str),\n * (error) =>\n * `Invalid JSON: ${error instanceof Error ? error.message : String(error)}`\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const mapTryCatch = /*#__PURE__*/dual(3, (self, f, onError) => {\n const single = getUnderlyingSingleOrThrow(self);\n return transform(self, parse => args => Effect.flatMap(parse(args), ([leftover, a]) => Effect.try({\n try: () => f(a),\n catch: error => onError(error)\n }).pipe(Effect.mapError(error => new CliError.InvalidValue({\n option: single.name,\n value: String(a),\n expected: error,\n kind: single.kind\n })), Effect.map(b => [leftover, b]))));\n});\n/**\n * Makes a flag or positional argument optional.\n *\n * **Details**\n *\n * When the parameter is absent, parsing succeeds with `Option.none()` instead\n * of failing with a missing option or missing argument error. When present, the\n * parsed value is wrapped in `Option.some()`.\n *\n * **Example** (Making parameters optional)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Create an optional port option\n * // - When not provided: returns Option.none()\n * // - When provided: returns Option.some(parsedValue)\n * const port = Param.optional(Param.integer(Param.flagKind, \"port\"))\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const optional = param => {\n const parse = Effect.fnUntraced(function* (args) {\n const single = getUnderlyingSingleOrThrow(param);\n // Handle boolean params that are explicitly marked as optional (i.e. the\n // end user wants to return `Option.none()` instead of `false` when the\n // flag (or its negated variant) are not present on the command line\n if (isFlagParam(single) && Primitive.isBoolean(single.primitiveType) && ![single.name, ...single.aliases].some(name => (args.flags[name] ?? []).length > 0)) {\n return [args.arguments, Option.none()];\n }\n return yield* param.parse(args).pipe(Effect.map(([leftover, value]) => [leftover, Option.some(value)]),\n // Catch both MissingOption (for flags) and MissingArgument (for positional arguments)\n Effect.catchTags({\n MissingOption: () => Effect.succeed([args.arguments, Option.none()]),\n MissingArgument: () => Effect.succeed([args.arguments, Option.none()])\n }));\n });\n return Object.assign(Object.create(Proto), {\n _tag: \"Optional\",\n kind: param.kind,\n param,\n parse\n });\n};\n/**\n * Makes a flag or positional argument optional by supplying a fallback value.\n *\n * **Details**\n *\n * The fallback may be a pure value or an effect. It is used only when the\n * parameter is absent; provided values are parsed normally.\n *\n * **Example** (Providing default values)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Using the pipe operator to make an option optional\n * const port = Param.integer(Param.flagKind, \"port\").pipe(\n * Param.withDefault(8080)\n * )\n *\n * // Can also be used with other combinators\n * const verbose = Param.boolean(Param.flagKind, \"verbose\").pipe(\n * Param.withAlias(\"-v\"),\n * Param.withDescription(\"Enable verbose output\"),\n * Param.withDefault(false)\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withDefault = /*#__PURE__*/dual(2, (self, defaultValue) => {\n if (!Effect.isEffect(defaultValue)) {\n return map(optional(self), Option.getOrElse(() => defaultValue));\n }\n return mapEffect(optional(self), Option.match({\n onNone: () => defaultValue,\n onSome: Effect.succeed\n }));\n});\n/**\n * Adds a fallback config that is loaded when a required parameter is missing.\n *\n * **When to use**\n *\n * Use when you need config to provide a fallback source for required flags or\n * arguments that are absent from CLI input.\n *\n * **Details**\n *\n * Provided CLI values win. Config is loaded only after a missing option or\n * missing argument error.\n *\n * **Gotchas**\n *\n * Missing config preserves the original missing-parameter error. Config parse\n * failure becomes `CliError.InvalidValue`.\n *\n * @see {@link withDefault} for a pure default value\n * @see {@link withFallbackPrompt} for prompting interactively when input is missing\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withFallbackConfig = /*#__PURE__*/dual(2, (self, config) => {\n const toInvalidValue = (error, configError) => new CliError.InvalidValue({\n option: error._tag === \"MissingOption\" ? error.option : error.argument,\n value: \"config\",\n expected: configError.message,\n kind: error._tag === \"MissingOption\" ? \"flag\" : \"argument\"\n });\n const runConfig = (error, args) => Config.option(config).pipe(Effect.mapError(configError => toInvalidValue(error, configError)), Effect.flatMap(Option.match({\n onNone: () => Effect.fail(error),\n onSome: value => Effect.succeed([args.arguments, value])\n })));\n return transform(self, parse => args => parse(args).pipe(Effect.catchTag([\"MissingOption\", \"MissingArgument\"], error => runConfig(error, args))));\n});\n/**\n * Adds a fallback prompt that is shown when a required parameter is missing.\n *\n * **When to use**\n *\n * Use when a CLI should ask interactively for a missing required flag or\n * argument.\n *\n * **Details**\n *\n * `FallbackPrompt` accepts either a `Prompt` or an effect that builds one.\n * Effectful prompt creation is lazy and runs only when the fallback is needed.\n *\n * **Gotchas**\n *\n * This only handles missing options and missing arguments. Invalid values do not\n * prompt, and prompt cancellation re-fails with the original missing error.\n *\n * @see {@link FallbackPrompt} for accepted fallback prompt forms\n * @see {@link withFallbackConfig} for loading a fallback from config\n * @see {@link withDefault} for a pure default value\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withFallbackPrompt = /*#__PURE__*/dual(2, (self, prompt) => {\n const runPrompt = (error, args) => Effect.flatMap(Prompt.isPrompt(prompt) ? Effect.succeed(prompt) : prompt, Prompt.run).pipe(Effect.map(value => [args.arguments, value]), Effect.catchTag(\"QuitError\", () => Effect.fail(error)));\n return transform(self, parse => args => parse(args).pipe(Effect.catchTag([\"MissingOption\", \"MissingArgument\"], error => runPrompt(error, args))));\n});\n/**\n * Creates a variadic parameter that can be specified multiple times.\n *\n * **Details**\n *\n * This is the base combinator for creating parameters that accept multiple values.\n * The `min` and `max` parameters are optional. When they are not provided, the\n * parameter can be specified any number of times, from 0 to infinity.\n *\n * **Example** (Accepting multiple values)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Basic variadic parameter (0 to infinity)\n * const tags = Param.variadic(Param.string(Param.flagKind, \"tag\"))\n *\n * // Variadic with minimum count\n * const inputs = Param.variadic(\n * Param.string(Param.flagKind, \"input\"),\n * { min: 1 } // at least 1 required\n * )\n *\n * // Variadic with both min and max\n * const limited = Param.variadic(Param.string(Param.flagKind, \"item\"), {\n * min: 2, // at least 2 times\n * max: 2 // at most 2 times\n * })\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const variadic = (self, options) => {\n const single = getUnderlyingSingleOrThrow(self);\n const parse = args => {\n if (single.kind === \"argument\") {\n return parsePositionalVariadic(self, single, args, options);\n } else {\n return parseOptionVariadic(self, single, args, options);\n }\n };\n return Object.assign(Object.create(Proto), {\n _tag: \"Variadic\",\n kind: self.kind,\n param: self,\n min: Option.fromUndefinedOr(options?.min),\n max: Option.fromUndefinedOr(options?.max),\n parse\n });\n};\n/**\n * Wraps an option to allow it to be specified multiple times within a range.\n *\n * **Details**\n *\n * This combinator transforms an option to accept between `min` and `max`\n * occurrences on the command line, returning an array of all provided values.\n *\n * **Example** (Bounding repeated values)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Allow 1-3 file inputs\n * const files = Param.string(Param.flagKind, \"file\").pipe(\n * Param.between(1, 3),\n * Param.withAlias(\"-f\")\n * )\n *\n * // Parse: --file a.txt --file b.txt\n * // Result: [\"a.txt\", \"b.txt\"]\n *\n * // Allow 0 or more tags\n * const tags = Param.string(Param.flagKind, \"tag\").pipe(\n * Param.between(0, Number.MAX_SAFE_INTEGER)\n * )\n *\n * // Parse: --tag dev --tag staging --tag v1.0\n * // Result: [\"dev\", \"staging\", \"v1.0\"]\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const between = /*#__PURE__*/dual(3, (self, min, max) => {\n if (min < 0) {\n throw new Error(\"between: min must be non-negative\");\n }\n if (max < min) {\n throw new Error(\"between: max must be greater than or equal to min\");\n }\n return variadic(self, {\n min,\n max\n });\n});\n/**\n * Wraps an option to allow it to be specified at most `max` times.\n *\n * **Details**\n *\n * This combinator transforms an option to accept between 0 and `max`\n * occurrences on the command line, returning an array of all provided values.\n *\n * **Example** (Limiting repeated values)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Allow at most 3 warning suppressions\n * const suppressions = Param.string(Param.flagKind, \"suppress\").pipe(\n * Param.atMost(3)\n * )\n *\n * // Parse: --suppress warning1 --suppress warning2\n * // Result: [\"warning1\", \"warning2\"]\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const atMost = /*#__PURE__*/dual(2, (self, max) => {\n if (max < 0) {\n throw new Error(\"atMost: max must be non-negative\");\n }\n return variadic(self, {\n max\n });\n});\n/**\n * Wraps an option to require it to be specified at least `min` times.\n *\n * **Details**\n *\n * This combinator transforms an option to accept at least `min`\n * occurrences on the command line, returning an array of all provided values.\n *\n * **Example** (Requiring repeated values)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Require at least 2 input files\n * const inputs = Param.string(Param.flagKind, \"input\").pipe(\n * Param.atLeast(2),\n * Param.withAlias(\"-i\")\n * )\n *\n * // Parse: --input file1.txt --input file2.txt --input file3.txt\n * // Result: [\"file1.txt\", \"file2.txt\", \"file3.txt\"]\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const atLeast = /*#__PURE__*/dual(2, (self, min) => {\n if (min < 0) {\n throw new Error(\"atLeast: min must be non-negative\");\n }\n return variadic(self, {\n min\n });\n});\n/**\n * Filters and transforms parsed values, failing with a custom error message\n * if the filter function returns `Option.none()`.\n *\n * **When to use**\n *\n * Use when you need validation and transformation in a single parameter\n * combinator.\n *\n * **Example** (Filtering and transforming values)\n *\n * ```ts\n * import { Option } from \"effect\"\n * import { Param } from \"effect/unstable/cli\"\n * const positiveInt = Param.integer(Param.flagKind, \"count\").pipe(\n * Param.filterMap(\n * (n) => n > 0 ? Option.some(n) : Option.none(),\n * (n) => `Expected positive integer, got ${n}`\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const filterMap = /*#__PURE__*/dual(3, (self, filter, onNone) => mapEffect(self, Effect.fnUntraced(function* (a) {\n const result = filter(a);\n if (Option.isSome(result)) {\n return result.value;\n }\n const single = getUnderlyingSingleOrThrow(self);\n return yield* new CliError.InvalidValue({\n option: single.name,\n value: String(a),\n expected: onNone(a),\n kind: single.kind\n });\n})));\n/**\n * Filters parsed values, failing with a custom error message if the predicate returns false.\n *\n * **Example** (Filtering parsed values)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const evenNumber = Param.integer(Param.flagKind, \"num\").pipe(\n * Param.filter(\n * (n) => n % 2 === 0,\n * (n) => `Expected even number, got ${n}`\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const filter = /*#__PURE__*/dual(3, (self, predicate, onFalse) => filterMap(self, Option.liftPredicate(predicate), onFalse));\n/**\n * Sets a custom metavar (placeholder name) for the param in help documentation.\n *\n * **Details**\n *\n * The metavar is displayed in usage text to indicate what value the user should provide.\n * For example, `--output FILE` shows `FILE` as the metavar.\n *\n * **Example** (Setting metavars)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const port = Param.integer(Param.flagKind, \"port\").pipe(\n * Param.withMetavar(\"PORT\"),\n * Param.filter(\n * (p) => p >= 1 && p <= 65535,\n * () => \"Port must be between 1 and 65535\"\n * )\n * )\n * ```\n *\n * @category metadata\n * @since 4.0.0\n */\nexport const withMetavar = /*#__PURE__*/dual(2, (self, metavar) => transformSingle(self, single => makeSingle({\n ...single,\n typeName: metavar\n})));\n/**\n * Validates parsed values against a Schema, providing detailed error messages.\n *\n * **Example** (Validating with schemas)\n *\n * ```ts\n * import { Schema } from \"effect\"\n * import { Param } from \"effect/unstable/cli\"\n * const isEmail = Schema.isPattern(/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/)\n *\n * const Email = Schema.String.pipe(\n * Schema.check(isEmail)\n * )\n *\n * const email = Param.string(Param.flagKind, \"email\").pipe(\n * Param.withSchema(Email)\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withSchema = /*#__PURE__*/dual(2, (self, schema) => {\n const decodeParam = Schema.decodeUnknownEffect(schema);\n return mapEffect(self, value => Effect.mapError(decodeParam(value), error => {\n const single = getUnderlyingSingleOrThrow(self);\n return new CliError.InvalidValue({\n option: single.name,\n value: String(value),\n expected: `Schema validation failed: ${error.message}`,\n kind: single.kind\n });\n }));\n});\n/**\n * Provides a fallback param to use if this param fails to parse.\n *\n * **Example** (Falling back to another parameter)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const config = Param.file(Param.flagKind, \"config\").pipe(\n * Param.orElse(() => Param.string(Param.flagKind, \"config-url\"))\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const orElse = /*#__PURE__*/dual(2, (self, orElse) => transform(self, parse => args => Effect.catch(parse(args), err => orElse(err).parse(args))));\n/**\n * Provides a fallback param and returns a `Result` indicating which param\n * succeeded.\n *\n * **Details**\n *\n * The original param's value is returned as `Result.succeed`, while the\n * fallback param's value is returned as `Result.fail`.\n *\n * **Example** (Returning fallback results)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const configSource = Param.file(Param.flagKind, \"config\").pipe(\n * Param.orElseResult(() => Param.string(Param.flagKind, \"config-url\"))\n * )\n * // Returns Result<string, string>\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const orElseResult = /*#__PURE__*/dual(2, (self, orElse) => {\n return transform(self, parse => args => Effect.catch(Effect.map(parse(args), ([leftover, value]) => [leftover, Result.succeed(value)]), err => Effect.map(orElse(err).parse(args), ([leftover, value]) => [leftover, Result.fail(value)])));\n});\n// =============================================================================\n// Parsing Utilities\n// =============================================================================\nconst parsePositional = /*#__PURE__*/Effect.fnUntraced(function* (name, primitiveType, args) {\n if (args.arguments.length === 0) {\n return yield* new CliError.MissingArgument({\n argument: name\n });\n }\n const arg = args.arguments[0];\n const value = yield* Effect.mapError(primitiveType.parse(arg), error => new CliError.InvalidValue({\n option: name,\n value: arg,\n expected: error,\n kind: \"argument\"\n }));\n return [args.arguments.slice(1), value];\n});\nconst parseFlag = /*#__PURE__*/Effect.fnUntraced(function* (name, primitiveType, args) {\n const providedValues = args.flags[name];\n if (providedValues === undefined || providedValues.length === 0) {\n // Option not provided (empty array due to initialization)\n if (Primitive.isBoolean(primitiveType)) {\n // Boolean params default to false when not present\n return [args.arguments, false];\n } else {\n return yield* new CliError.MissingOption({\n option: name\n });\n }\n }\n // Parse the first value (later we can handle multiple)\n const arg = providedValues[0];\n const value = yield* Effect.mapError(primitiveType.parse(arg), error => new CliError.InvalidValue({\n option: name,\n value: arg,\n expected: error,\n kind: \"flag\"\n }));\n return [args.arguments, value];\n});\nconst parsePositionalVariadic = /*#__PURE__*/Effect.fnUntraced(function* (self, single, args, options) {\n const results = [];\n const minValue = options?.min ?? 0;\n const maxValue = options?.max ?? Number.POSITIVE_INFINITY;\n let count = 0;\n let currentArgs = args.arguments;\n while (currentArgs.length > 0 && count < maxValue) {\n const [remainingArgs, value] = yield* self.parse({\n flags: args.flags,\n arguments: currentArgs\n });\n results.push(value);\n currentArgs = remainingArgs;\n count++;\n }\n if (count < minValue) {\n return yield* new CliError.InvalidValue({\n option: single.name,\n value: `${count} values`,\n expected: `at least ${minValue} value${minValue === 1 ? \"\" : \"s\"}`,\n kind: single.kind\n });\n }\n return [currentArgs, results];\n});\nconst parseOptionVariadic = /*#__PURE__*/Effect.fnUntraced(function* (self, single, args, options) {\n const results = [];\n const names = [single.name, ...single.aliases];\n const values = names.flatMap(name => args.flags[name] ?? []);\n const count = values.length;\n // Validate count constraints\n if (Predicate.isNotUndefined(options?.min) && count < options.min) {\n return yield* count === 0 ? new CliError.MissingOption({\n option: single.name\n }) : new CliError.InvalidValue({\n option: single.name,\n value: `${count} occurrences`,\n expected: `at least ${options.min} value${options.min === 1 ? \"\" : \"s\"}`,\n kind: single.kind\n });\n }\n if (Predicate.isNotUndefined(options?.max) && count > options.max) {\n return yield* new CliError.InvalidValue({\n option: single.name,\n value: `${count} occurrences`,\n expected: `at most ${options.max} value${options.max === 1 ? \"\" : \"s\"}`,\n kind: single.kind\n });\n }\n // Parse each value individually\n for (const value of values) {\n const [, parsedValue] = yield* self.parse({\n flags: {\n [single.name]: [value]\n },\n arguments: []\n });\n results.push(parsedValue);\n }\n return [args.arguments, results];\n});\n/**\n * Type-safe param matcher that handles the unsafe casting internally.\n * This provides a clean API for pattern matching on param types while\n * maintaining type safety at the call site.\n */\nconst matchParam = (param, patterns) => {\n const p = param;\n switch (p._tag) {\n case \"Single\":\n return patterns.Single(p);\n case \"Map\":\n return patterns.Map(p);\n case \"Transform\":\n return patterns.Transform(p);\n case \"Optional\":\n return patterns.Optional(p);\n case \"Variadic\":\n return patterns.Variadic(p);\n }\n};\n/**\n * Recursively transforms a param by applying a function to any `Single` nodes.\n * This is used internally by combinators like `withAlias` to traverse the param tree.\n */\nconst transformSingle = (param, f) => {\n return matchParam(param, {\n Single: single => f(single),\n Map: mapped => map(transformSingle(mapped.param, f), mapped.f),\n Transform: mapped => transform(transformSingle(mapped.param, f), mapped.f),\n Optional: p => optional(transformSingle(p.param, f)),\n Variadic: p => variadic(transformSingle(p.param, f), {\n min: Option.getOrUndefined(p.min),\n max: Option.getOrUndefined(p.max)\n })\n });\n};\n/**\n * Extracts all Single params from a potentially nested param structure.\n * This handles all param combinators including Map, Transform, Optional, and Variadic.\n *\n * @internal\n */\nexport const extractSingleParams = param => {\n return matchParam(param, {\n Single: single => [single],\n Map: mapped => extractSingleParams(mapped.param),\n Transform: mapped => extractSingleParams(mapped.param),\n Optional: optional => extractSingleParams(optional.param),\n Variadic: variadic => extractSingleParams(variadic.param)\n });\n};\n/**\n * Gets the underlying Single param from a potentially nested param structure.\n * Throws an error if there are no singles or multiple singles found.\n *\n * @internal\n */\nexport const getUnderlyingSingleOrThrow = param => {\n const singles = extractSingleParams(param);\n if (singles.length === 0) {\n throw new Error(\"No Single param found in param structure\");\n }\n if (singles.length > 1) {\n throw new Error(`Multiple Single params found: ${singles.map(s => s.name).join(\", \")}`);\n }\n return singles[0];\n};\n/**\n * Gets param metadata by traversing the structure.\n *\n * @internal\n */\nexport const getParamMetadata = param => {\n return matchParam(param, {\n Single: () => ({\n isOptional: false,\n isVariadic: false\n }),\n Map: mapped => getParamMetadata(mapped.param),\n Transform: mapped => getParamMetadata(mapped.param),\n Optional: optional => ({\n ...getParamMetadata(optional.param),\n isOptional: true\n }),\n Variadic: variadic => ({\n ...getParamMetadata(variadic.param),\n isVariadic: true\n })\n });\n};\n//# sourceMappingURL=Param.js.map","import { dual } from \"../../Function.js\";\nimport * as Param from \"./Param.js\";\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * Creates a positional string argument.\n *\n * **Example** (Creating a string argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const filename = Argument.string(\"filename\")\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const string = name => Param.string(Param.argumentKind, name);\n/**\n * Creates a positional integer argument.\n *\n * **Example** (Creating an integer argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const count = Argument.integer(\"count\")\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const integer = name => Param.integer(Param.argumentKind, name);\n/**\n * Creates a positional file path argument.\n *\n * **Example** (Creating file path arguments)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const inputFile = Argument.file(\"input\", { mustExist: true }) // Must exist\n * const outputFile = Argument.file(\"output\", { mustExist: false }) // Must not exist\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const file = (name, options) => Param.file(Param.argumentKind, name, options);\n/**\n * Creates a positional directory path argument.\n *\n * **Example** (Creating a directory path argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const workspace = Argument.directory(\"workspace\", { mustExist: true }) // Must exist\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const directory = (name, options) => Param.directory(Param.argumentKind, name, options);\n/**\n * Creates a positional float argument.\n *\n * **Example** (Creating a float argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const ratio = Argument.float(\"ratio\")\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const float = name => Param.float(Param.argumentKind, name);\n/**\n * Creates a positional date argument.\n *\n * **Example** (Creating a date argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const startDate = Argument.date(\"start-date\")\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const date = name => Param.date(Param.argumentKind, name);\n/**\n * Creates a positional choice argument.\n *\n * **Example** (Creating a choice argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const environment = Argument.choice(\"environment\", [\"dev\", \"staging\", \"prod\"])\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const choice = (name, choices) => Param.choice(Param.argumentKind, name, choices);\n/**\n * Creates a positional path argument.\n *\n * **Example** (Creating a path argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const configPath = Argument.path(\"config\")\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const path = (name, options) => Param.path(Param.argumentKind, name, options);\n/**\n * Creates a positional redacted argument that obscures its value.\n *\n * **Example** (Creating a redacted argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const secret = Argument.redacted(\"secret\")\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const redacted = name => Param.redacted(Param.argumentKind, name);\n/**\n * Creates a positional argument that reads file content as a string.\n *\n * **Example** (Reading file text)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const config = Argument.fileText(\"config-file\")\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileText = name => Param.fileText(Param.argumentKind, name);\n/**\n * Creates a positional argument that reads a file and parses its content.\n *\n * **Details**\n *\n * The parser is chosen from the explicit `format` option or, when omitted, the\n * file extension. The parsed value is `unknown`; use `fileSchema` when the\n * parsed content should also be decoded with a Schema.\n *\n * **Example** (Parsing file content)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const config = Argument.fileParse(\"config\", { format: \"json\" })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileParse = (name, options) => Param.fileParse(Param.argumentKind, name, options);\n/**\n * Creates a positional argument that reads and validates file content using a schema.\n *\n * **Example** (Validating file content with a schema)\n *\n * ```ts\n * import { Schema } from \"effect\"\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const ConfigSchema = Schema.Struct({\n * port: Schema.Number,\n * host: Schema.String\n * })\n *\n * const config = Argument.fileSchema(\"config\", ConfigSchema)\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileSchema = (name, schema, options) => Param.fileSchema(Param.argumentKind, name, schema, options);\n/**\n * Creates an empty sentinel argument that always fails to parse.\n *\n * **Example** (Creating a sentinel argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * // Used as a placeholder or default in combinators\n * const noArg = Argument.none\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const none = /*#__PURE__*/Param.none(Param.argumentKind);\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * Makes a positional argument optional.\n *\n * **Example** (Making an argument optional)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const optionalVersion = Argument.string(\"version\").pipe(Argument.optional)\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const optional = arg => Param.optional(arg);\n/**\n * Adds a description to a positional argument.\n *\n * **Example** (Adding an argument description)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const filename = Argument.string(\"filename\").pipe(\n * Argument.withDescription(\"The input file to process\")\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withDescription = /*#__PURE__*/dual(2, (self, description) => Param.withDescription(self, description));\n/**\n * Provides a default value for a positional argument.\n *\n * **Example** (Providing a default value)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const port = Argument.integer(\"port\").pipe(Argument.withDefault(8080))\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withDefault = Param.withDefault;\n/**\n * Adds a fallback config that is loaded when a required argument is missing.\n *\n * **Example** (Loading a fallback config)\n *\n * ```ts\n * import { Config } from \"effect\"\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const repository = Argument.string(\"repository\").pipe(\n * Argument.withFallbackConfig(Config.string(\"REPOSITORY\"))\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withFallbackConfig = /*#__PURE__*/dual(2, (self, config) => Param.withFallbackConfig(self, config));\n/**\n * Adds a fallback prompt that is shown when a required argument is missing.\n *\n * **Example** (Showing a fallback prompt)\n *\n * ```ts\n * import { Argument, Prompt } from \"effect/unstable/cli\"\n *\n * const filename = Argument.string(\"filename\").pipe(\n * Argument.withFallbackPrompt(Prompt.text({ message: \"Filename\" }))\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withFallbackPrompt = /*#__PURE__*/dual(2, (self, prompt) => Param.withFallbackPrompt(self, prompt));\n/**\n * Creates a variadic positional argument that accepts multiple values.\n *\n * **Example** (Accepting multiple values)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * // Accept any number of files\n * const anyFiles = Argument.string(\"files\").pipe(Argument.variadic)\n *\n * // Accept at least 1 file\n * const atLeastOneFile = Argument.string(\"files\").pipe(\n * Argument.variadic({ min: 1 })\n * )\n *\n * // Accept between 1 and 5 files\n * const limitedFiles = Argument.string(\"files\").pipe(\n * Argument.variadic({ min: 1, max: 5 })\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const variadic = /*#__PURE__*/dual(args => Param.isParam(args[0]), (self, options) => Param.variadic(self, options));\n/**\n * Transforms the parsed value of a positional argument.\n *\n * **Example** (Mapping parsed values)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const port = Argument.integer(\"port\").pipe(\n * Argument.map((p) => ({ port: p, url: `http://localhost:${p}` }))\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const map = /*#__PURE__*/dual(2, (self, f) => Param.map(self, f));\n/**\n * Transforms the parsed value of a positional argument using an effectful function.\n *\n * **Example** (Validating values effectfully)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Argument, CliError } from \"effect/unstable/cli\"\n *\n * const files = Argument.string(\"files\").pipe(\n * Argument.mapEffect((file) =>\n * file.endsWith(\".txt\")\n * ? Effect.succeed(file)\n * : Effect.fail(\n * new CliError.UserError({\n * cause: new Error(\"Only .txt files allowed\")\n * })\n * )\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const mapEffect = /*#__PURE__*/dual(2, (self, f) => Param.mapEffect(self, f));\n/**\n * Transforms the parsed value of a positional argument using a function that may throw.\n *\n * **Example** (Mapping values that may throw)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const json = Argument.string(\"data\").pipe(\n * Argument.mapTryCatch(\n * (str) => JSON.parse(str),\n * (error) =>\n * `Invalid JSON: ${error instanceof Error ? error.message : String(error)}`\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const mapTryCatch = /*#__PURE__*/dual(3, (self, f, onError) => Param.mapTryCatch(self, f, onError));\n/**\n * Creates a variadic argument that requires at least n values.\n *\n * **Example** (Requiring a minimum number of values)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const files = Argument.string(\"files\").pipe(Argument.atLeast(1))\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const atLeast = /*#__PURE__*/dual(2, (self, min) => Param.atLeast(self, min));\n/**\n * Creates a variadic argument that accepts at most n values.\n *\n * **Example** (Limiting the maximum number of values)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const files = Argument.string(\"files\").pipe(Argument.atMost(5))\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const atMost = /*#__PURE__*/dual(2, (self, max) => Param.atMost(self, max));\n/**\n * Creates a variadic argument that accepts between min and max values.\n *\n * **Example** (Requiring a range of values)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const files = Argument.string(\"files\").pipe(Argument.between(1, 5))\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const between = /*#__PURE__*/dual(3, (self, min, max) => Param.between(self, min, max));\n/**\n * Validates parsed values against a Schema.\n *\n * **Example** (Validating parsed values with a schema)\n *\n * ```ts\n * import { Schema } from \"effect\"\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const input = Argument.string(\"input\").pipe(\n * Argument.withSchema(Schema.NonEmptyString)\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withSchema = /*#__PURE__*/dual(2, (self, schema) => Param.withSchema(self, schema));\n/**\n * Creates a positional choice argument with custom value mapping.\n *\n * **Example** (Mapping choices to values)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const logLevel = Argument.choiceWithValue(\"level\", [\n * [\"debug\", 0],\n * [\"info\", 1],\n * [\"warn\", 2],\n * [\"error\", 3]\n * ])\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const choiceWithValue = (name, choices) => Param.choiceWithValue(Param.argumentKind, name, choices);\n// -------------------------------------------------------------------------------------\n// metadata\n// -------------------------------------------------------------------------------------\n/**\n * Sets a custom metavar (placeholder name) for the argument in help documentation.\n *\n * **Details**\n *\n * The metavar is displayed in usage text to indicate what value the user should provide.\n * For example, `<FILE>` shows `FILE` as the metavar.\n *\n * **Example** (Setting a metavar)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const port = Argument.integer(\"port\").pipe(\n * Argument.withMetavar(\"PORT\")\n * )\n * ```\n *\n * @category metadata\n * @since 4.0.0\n */\nexport const withMetavar = /*#__PURE__*/dual(2, (self, metavar) => Param.withMetavar(self, metavar));\n/**\n * Filters parsed values, failing with a custom error message if the predicate returns false.\n *\n * **Example** (Filtering parsed values)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const positiveInt = Argument.integer(\"count\").pipe(\n * Argument.filter(\n * (n) => n > 0,\n * (n) => `Expected positive integer, got ${n}`\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const filter = /*#__PURE__*/dual(3, (self, predicate, onFalse) => Param.filter(self, predicate, onFalse));\n/**\n * Filters and transforms parsed values, failing with a custom error message\n * if the filter function returns None.\n *\n * **Example** (Filtering and mapping parsed values)\n *\n * ```ts\n * import { Option } from \"effect\"\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const positiveInt = Argument.integer(\"count\").pipe(\n * Argument.filterMap(\n * (n) => n > 0 ? Option.some(n) : Option.none(),\n * (n) => `Expected positive integer, got ${n}`\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const filterMap = /*#__PURE__*/dual(3, (self, f, onNone) => Param.filterMap(self, f, onNone));\n/**\n * Provides a fallback argument to use if this argument fails to parse.\n *\n * **Example** (Providing a fallback argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const value = Argument.integer(\"value\").pipe(\n * Argument.orElse(() => Argument.string(\"value\"))\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const orElse = /*#__PURE__*/dual(2, (self, that) => Param.orElse(self, that));\n/**\n * Provides a fallback argument, wrapping results in Result to distinguish which succeeded.\n *\n * **Example** (Returning which fallback succeeded)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const source = Argument.file(\"source\").pipe(\n * Argument.orElseResult(() => Argument.string(\"url\"))\n * )\n * // Returns Result<string, string>\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const orElseResult = /*#__PURE__*/dual(2, (self, that) => Param.orElseResult(self, that));\n//# sourceMappingURL=Argument.js.map","/**\n * Formats CLI help and errors as text.\n *\n * This module turns help documents, CLI errors, grouped errors, and version\n * information into strings. It does not write those strings to the terminal\n * itself. It includes the `Formatter` interface, the formatter service, a layer\n * for custom formatters, and the default formatter with configurable color\n * support.\n *\n * @since 4.0.0\n */\nimport * as Context from \"../../Context.js\";\nimport * as Layer from \"../../Layer.js\";\nimport * as Option from \"../../Option.js\";\n/**\n * Service reference for the CLI output formatter. Provides a default implementation\n * that can be overridden for custom formatting or testing.\n *\n * **Example** (Accessing the output formatter)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliOutput } from \"effect/unstable/cli\"\n *\n * // Access the formatter service\n * const program = Effect.gen(function*() {\n * const formatter = yield* CliOutput.Formatter\n *\n * // Format version information\n * const versionText = formatter.formatVersion(\"my-cli\", \"2.1.0\")\n * console.log(versionText) // \"my-cli v2.1.0\" (with colors if supported)\n *\n * return versionText\n * })\n *\n * // Run with default formatter\n * const result = Effect.runSync(program)\n * ```\n *\n * @category services\n * @since 4.0.0\n */\nexport const Formatter = /*#__PURE__*/Context.Reference(\"effect/cli/CliOutput\", {\n defaultValue: () => defaultFormatter()\n});\n/**\n * Creates a Layer that provides a custom Formatter implementation.\n *\n * **Example** (Providing a custom formatter)\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n * import { CliOutput } from \"effect/unstable/cli\"\n *\n * // Create a custom formatter without colors\n * const noColorFormatter = CliOutput.defaultFormatter({ colors: false })\n * const NoColorLayer = CliOutput.layer(noColorFormatter)\n *\n * // Create a program that uses the custom formatter\n * const program = Effect.gen(function*() {\n * const formatter = yield* CliOutput.Formatter\n * const versionText = formatter.formatVersion(\"my-cli\", \"1.0.0\")\n * yield* Console.log(`Using custom formatter: ${versionText}`)\n * }).pipe(\n * Effect.provide(NoColorLayer)\n * )\n *\n * // You can also create completely custom formatters\n * const jsonFormatter: CliOutput.Formatter = {\n * formatHelpDoc: (doc) => JSON.stringify(doc, null, 2),\n * formatCliError: (error) => JSON.stringify({ error: error.message }),\n * formatError: (error) =>\n * JSON.stringify({ type: \"error\", message: error.message }),\n * formatVersion: (name, version) => JSON.stringify({ name, version }),\n * formatErrors: (errors) => JSON.stringify(errors.map((error) => error.message))\n * }\n * const JsonLayer = CliOutput.layer(jsonFormatter)\n * ```\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = formatter => Layer.succeed(Formatter)(formatter);\n/**\n * Creates a default formatter with configurable options.\n *\n * **Example** (Creating default formatters)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError, CliOutput } from \"effect/unstable/cli\"\n *\n * // Create a formatter without colors for tests or CI environments\n * const noColorFormatter = CliOutput.defaultFormatter({ colors: false })\n *\n * // Create a formatter with colors forced on\n * const colorFormatter = CliOutput.defaultFormatter({ colors: true })\n *\n * // Auto-detect colors based on terminal support (default behavior)\n * const autoFormatter = CliOutput.defaultFormatter()\n *\n * const program = Effect.gen(function*() {\n * const formatter = colorFormatter\n *\n * // Format an error with proper styling\n * const error = new CliError.InvalidValue({\n * option: \"foo\",\n * value: \"bar\",\n * expected: \"baz\",\n * kind: \"flag\"\n * })\n * const errorText = formatter.formatError(error)\n * console.log(errorText)\n *\n * // Format version information\n * const versionText = formatter.formatVersion(\"my-tool\", \"1.2.3\")\n * console.log(versionText)\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const defaultFormatter = options => {\n const globalProcess = globalThis.process;\n const hasProcess = typeof globalProcess === \"object\" && globalProcess !== null;\n const useColor = options?.colors !== undefined ? options.colors\n // Auto-detect based on environment\n : hasProcess && typeof globalProcess.stdout === \"object\" && globalProcess.stdout !== null && globalProcess.stdout.isTTY === true && globalProcess.env?.NO_COLOR !== \"1\";\n // Color palette using ANSI escape codes\n const colors = useColor ? {\n bold: text => `\\x1b[1m${text}\\x1b[0m`,\n dim: text => `\\x1b[2m${text}\\x1b[0m`,\n cyan: text => `\\x1b[36m${text}\\x1b[0m`,\n green: text => `\\x1b[32m${text}\\x1b[0m`,\n blue: text => `\\x1b[34m${text}\\x1b[0m`,\n yellow: text => `\\x1b[33m${text}\\x1b[0m`,\n magenta: text => `\\x1b[35m${text}\\x1b[0m`\n } : {\n bold: text => text,\n dim: text => text,\n cyan: text => text,\n green: text => text,\n blue: text => text,\n yellow: text => text,\n magenta: text => text\n };\n const reset = useColor ? \"\\x1b[0m\" : \"\";\n const red = useColor ? \"\\x1b[31m\" : \"\";\n const bold = useColor ? \"\\x1b[1m\" : \"\";\n return {\n formatHelpDoc: doc => formatHelpDocImpl(doc, colors),\n formatCliError: error => error.message,\n formatError: error => {\n return `\\n${bold}${red}ERROR${reset}\\n ${error.message}${reset}`;\n },\n formatErrors: errors => {\n if (errors.length === 0) return \"\";\n if (errors.length === 1) {\n return `\\n${bold}${red}ERROR${reset}\\n ${errors[0].message}${reset}`;\n }\n // Group errors by _tag\n const grouped = new Map();\n for (const error of errors) {\n const tag = error._tag ?? \"Error\";\n const group = grouped.get(tag) ?? [];\n group.push(error);\n grouped.set(tag, group);\n }\n const sections = [];\n sections.push(`\\n${bold}${red}ERRORS${reset}`);\n for (const [, group] of grouped) {\n for (const error of group) {\n sections.push(` ${error.message}${reset}`);\n }\n }\n return sections.join(\"\\n\");\n },\n formatVersion: (name, version) => `${colors.bold(name)} ${colors.dim(\"v\")}${colors.bold(version)}`\n };\n};\n/**\n * Strips ANSI escape codes from a string to calculate visual width.\n * @internal\n */\nconst stripAnsi = text => {\n // oxlint-disable-next-line no-control-regex\n return text.replace(/\\u001B\\[[0-9;]*m/g, \"\");\n};\n/**\n * Gets the visual length of a string (excluding ANSI codes).\n * @internal\n */\nconst visualLength = text => stripAnsi(text).length;\n/**\n * Helper function to pad strings to a specified width.\n * @internal\n */\nconst pad = (s, width) => {\n const actualLength = visualLength(s);\n const padding = Math.max(0, width - actualLength);\n return s + \" \".repeat(padding);\n};\n/**\n * Renders a table with aligned columns.\n * @internal\n */\nconst renderTable = (rows, widthCap) => {\n const maxColumn = Math.max(...rows.map(r => visualLength(r.left))) + 4;\n const col = widthCap === undefined ? maxColumn : Math.min(maxColumn, widthCap);\n return rows.map(({\n left,\n right\n }) => ` ${pad(left, col)}${right}`).join(\"\\n\");\n};\nconst formatSubcommandName = (name, alias) => alias ? `${name}, ${alias}` : name;\n/**\n * Internal implementation of help formatting that accepts configurable color functions.\n * @internal\n */\nconst formatHelpDocImpl = (doc, colors) => {\n const sections = [];\n // Description section\n if (doc.description) {\n sections.push(colors.bold(\"DESCRIPTION\"));\n sections.push(` ${doc.description}`);\n sections.push(\"\");\n }\n // Usage section\n sections.push(colors.bold(\"USAGE\"));\n sections.push(` ${colors.cyan(doc.usage)}`);\n sections.push(\"\");\n // Arguments section\n if (doc.args && doc.args.length > 0) {\n sections.push(colors.bold(\"ARGUMENTS\"));\n const argRows = doc.args.map(arg => {\n let name = arg.name;\n if (arg.variadic) {\n name += \"...\";\n }\n const coloredName = colors.green(name);\n const coloredType = colors.dim(arg.type);\n const nameType = `${coloredName} ${coloredType}`;\n const optionalSuffix = arg.required ? \"\" : colors.dim(\" (optional)\");\n const description = Option.getOrElse(arg.description, () => \"\") + optionalSuffix;\n return {\n left: nameType,\n right: description\n };\n });\n sections.push(renderTable(argRows, 25));\n sections.push(\"\");\n }\n // Flags section\n if (doc.flags.length > 0) {\n sections.push(colors.bold(\"FLAGS\"));\n const flagRows = doc.flags.map(flag => {\n const names = [];\n // Add main name with -- prefix first\n names.push(colors.green(`--${flag.name}`));\n // Add aliases after (like -f) to match expected ordering\n for (const alias of flag.aliases) {\n names.push(colors.green(alias));\n }\n const namesPart = names.join(\", \");\n const typePart = flag.type !== \"boolean\" ? ` ${colors.dim(flag.type)}` : \"\";\n return {\n left: namesPart + typePart,\n right: Option.getOrElse(flag.description, () => \"\")\n };\n });\n sections.push(renderTable(flagRows));\n sections.push(\"\");\n }\n // Global Flags section\n if (doc.globalFlags && doc.globalFlags.length > 0) {\n sections.push(colors.bold(\"GLOBAL FLAGS\"));\n const globalFlagRows = doc.globalFlags.map(flag => {\n const names = [];\n // Add main name with -- prefix first\n names.push(colors.green(`--${flag.name}`));\n // Add aliases after (like -f) to match expected ordering\n for (const alias of flag.aliases) {\n names.push(colors.green(alias));\n }\n const namesPart = names.join(\", \");\n const typePart = flag.type !== \"boolean\" ? ` ${colors.dim(flag.type)}` : \"\";\n return {\n left: namesPart + typePart,\n right: Option.getOrElse(flag.description, () => \"\")\n };\n });\n sections.push(renderTable(globalFlagRows));\n sections.push(\"\");\n }\n // Subcommands section\n if (doc.subcommands && doc.subcommands.length > 0) {\n const ungrouped = doc.subcommands.find(group => group.group === undefined);\n if (ungrouped) {\n sections.push(colors.bold(\"SUBCOMMANDS\"));\n sections.push(renderTable(ungrouped.commands.map(sub => ({\n left: colors.cyan(formatSubcommandName(sub.name, sub.alias)),\n right: sub.shortDescription ?? sub.description\n })), 20));\n if (doc.subcommands.length > 1) {\n sections.push(\"\");\n }\n }\n for (const group of doc.subcommands) {\n if (group.group === undefined) continue;\n sections.push(colors.bold(`${group.group}:`));\n sections.push(renderTable(group.commands.map(sub => ({\n left: colors.cyan(formatSubcommandName(sub.name, sub.alias)),\n right: sub.shortDescription ?? sub.description\n })), 20));\n sections.push(\"\");\n }\n }\n // Examples section\n if (doc.examples && doc.examples.length > 0) {\n sections.push(colors.bold(\"EXAMPLES\"));\n let first = true;\n let previousHadDescription = false;\n for (const example of doc.examples) {\n if (example.description) {\n if (!first) sections.push(\"\");\n sections.push(` ${colors.dim(`# ${example.description}`)}`);\n } else if (previousHadDescription) {\n sections.push(\"\");\n }\n sections.push(` ${colors.cyan(example.command)}`);\n first = false;\n previousHadDescription = !!example.description;\n }\n sections.push(\"\");\n }\n // Remove trailing empty line if present\n if (sections[sections.length - 1] === \"\") {\n sections.pop();\n }\n return sections.join(\"\\n\");\n};\n//# sourceMappingURL=CliOutput.js.map","// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\nconst escapeForBash = s => s.replace(/'/g, \"'\\\\''\");\nconst sanitizeFunctionName = s => s.replace(/[^a-zA-Z0-9_]/g, \"_\");\nconst flagNamesForWordlist = flag => {\n const names = [`--${flag.name}`];\n for (const alias of flag.aliases) {\n names.push(alias.length === 1 ? `-${alias}` : `--${alias}`);\n }\n if (flag.type._tag === \"Boolean\") {\n names.push(`--no-${flag.name}`);\n }\n return names;\n};\n/**\n * Build an associative array mapping each flag form to a group index.\n * At completion time, if any form in a group appears in COMP_WORDS,\n * all forms in that group are removed from the candidate list.\n */\nconst buildFlagGroupDeclarations = (flags, lines) => {\n if (flags.length === 0) return;\n lines.push(` # Build used-flag filter`);\n lines.push(` local -A _flag_groups`);\n let groupIdx = 0;\n for (const flag of flags) {\n const forms = flagNamesForWordlist(flag);\n for (const form of forms) {\n lines.push(` _flag_groups[${form}]=${groupIdx}`);\n }\n groupIdx++;\n }\n lines.push(` local -A _used_groups`);\n lines.push(` for ((i = 1; i < cword; i++)); do`);\n lines.push(` local _g=\"\\${_flag_groups[\\${words[i]}]:-}\"`);\n lines.push(` [[ -n \"$_g\" ]] && _used_groups[$_g]=1`);\n lines.push(` done`);\n lines.push(` local _filtered_flags=\"\"`);\n lines.push(` for _f in ${flags.flatMap(flagNamesForWordlist).join(\" \")}; do`);\n lines.push(` local _g=\"\\${_flag_groups[$_f]:-}\"`);\n lines.push(` [[ -z \"$_g\" || -z \"\\${_used_groups[$_g]:-}\" ]] && _filtered_flags+=\" $_f\"`);\n lines.push(` done`);\n lines.push(``);\n};\nconst flagValueCompletion = type => {\n switch (type._tag) {\n case \"Boolean\":\n return undefined;\n case \"Choice\":\n return `COMPREPLY=( $(compgen -W '${type.values.join(\" \")}' -- \"$cur\") )`;\n case \"Path\":\n if (type.pathType === \"directory\") return `COMPREPLY=( $(compgen -d -- \"$cur\") )`;\n return `COMPREPLY=( $(compgen -f -- \"$cur\") )`;\n default:\n return undefined;\n }\n};\nconst argCompletion = type => {\n switch (type._tag) {\n case \"Choice\":\n return `COMPREPLY=( $(compgen -W '${type.values.join(\" \")}' -- \"$cur\") )`;\n case \"Path\":\n if (type.pathType === \"directory\") return `COMPREPLY=( $(compgen -d -- \"$cur\") )`;\n return `COMPREPLY=( $(compgen -f -- \"$cur\") )`;\n default:\n return undefined;\n }\n};\n// ---------------------------------------------------------------------------\n// Generator\n// ---------------------------------------------------------------------------\nconst generateFunction = (descriptor, parentPath, lines) => {\n const currentPath = [...parentPath, descriptor.name];\n const funcName = `_${currentPath.map(sanitizeFunctionName).join(\"_\")}`;\n lines.push(`${funcName}()`);\n lines.push(`{`);\n lines.push(` local cur prev words cword`);\n lines.push(` _init_completion || return`);\n lines.push(``);\n // Build flag-value dispatch\n const flagsWithValues = descriptor.flags.filter(f => f.type._tag !== \"Boolean\");\n if (flagsWithValues.length > 0) {\n lines.push(` # Flag value completions`);\n lines.push(` case \"$prev\" in`);\n for (const flag of flagsWithValues) {\n const longNames = [`--${flag.name}`];\n for (const alias of flag.aliases) {\n longNames.push(alias.length === 1 ? `-${alias}` : `--${alias}`);\n }\n const completion = flagValueCompletion(flag.type);\n if (completion) {\n lines.push(` ${longNames.join(\"|\")})`);\n lines.push(` ${completion}`);\n lines.push(` return`);\n lines.push(` ;;`);\n }\n }\n lines.push(` esac`);\n lines.push(``);\n }\n // Subcommand dispatch\n if (descriptor.subcommands.length > 0) {\n lines.push(` # Subcommand dispatch`);\n lines.push(` local i cmd`);\n lines.push(` for ((i = 1; i < cword; i++)); do`);\n lines.push(` case \"\\${words[i]}\" in`);\n for (const sub of descriptor.subcommands) {\n const subFuncName = `_${[...currentPath, sub.name].map(sanitizeFunctionName).join(\"_\")}`;\n lines.push(` ${sub.name})`);\n lines.push(` ${subFuncName}`);\n lines.push(` return`);\n lines.push(` ;;`);\n }\n lines.push(` esac`);\n lines.push(` done`);\n lines.push(``);\n }\n // Filter already-used flags (entire alias group removed when any form is used)\n buildFlagGroupDeclarations(descriptor.flags, lines);\n if (descriptor.flags.length > 0 || descriptor.subcommands.length > 0) {\n lines.push(` # Complete flags (filtered) and subcommands`);\n lines.push(` if [[ \"$cur\" == -* ]]; then`);\n if (descriptor.flags.length > 0) {\n lines.push(` COMPREPLY=( $(compgen -W \"$_filtered_flags\" -- \"$cur\") )`);\n }\n lines.push(` return`);\n lines.push(` fi`);\n lines.push(``);\n }\n // Positional argument completion\n const argsWithCompletions = descriptor.arguments.filter(a => argCompletion(a.type) !== undefined);\n if (argsWithCompletions.length > 0) {\n lines.push(` # Positional argument completions`);\n for (const arg of argsWithCompletions) {\n const comp = argCompletion(arg.type);\n lines.push(` ${comp}`);\n lines.push(` return`);\n }\n } else if (descriptor.subcommands.length > 0) {\n const subNames = descriptor.subcommands.map(s => s.name);\n lines.push(` COMPREPLY=( $(compgen -W '${subNames.join(\" \")}' -- \"$cur\") )`);\n }\n lines.push(`}`);\n lines.push(``);\n // Recurse into subcommands\n for (const sub of descriptor.subcommands) {\n generateFunction(sub, currentPath, lines);\n }\n};\n/** @internal */\nexport const generate = (executableName, descriptor) => {\n const lines = [];\n const safeName = sanitizeFunctionName(executableName);\n lines.push(`###-begin-${escapeForBash(executableName)}-completions-###`);\n lines.push(`#`);\n lines.push(`# Static completion script for Bash`);\n lines.push(`#`);\n lines.push(`# Installation:`);\n lines.push(`# ${escapeForBash(executableName)} --completions bash >> ~/.bashrc`);\n lines.push(`#`);\n lines.push(``);\n // Inline minimal _init_completion fallback for environments without\n // bash-completion installed. The real _init_completion handles edge cases\n // (= in options, redirections, etc.) but this covers the common path.\n lines.push(`if ! type _init_completion &>/dev/null; then`);\n lines.push(` _init_completion()`);\n lines.push(` {`);\n lines.push(` COMPREPLY=()`);\n lines.push(` cur=\"\\${COMP_WORDS[COMP_CWORD]}\"`);\n lines.push(` prev=\"\\${COMP_WORDS[COMP_CWORD-1]}\"`);\n lines.push(` words=(\"\\${COMP_WORDS[@]}\")`);\n lines.push(` cword=$COMP_CWORD`);\n lines.push(` }`);\n lines.push(`fi`);\n lines.push(``);\n generateFunction(descriptor, [], lines);\n lines.push(`complete -F _${safeName} ${escapeForBash(executableName)}`);\n lines.push(`###-end-${escapeForBash(executableName)}-completions-###`);\n return lines.join(\"\\n\");\n};\n//# sourceMappingURL=bash.js.map","// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\nconst escapeFishString = s => s.replace(/'/g, \"\\\\'\");\n/**\n * Build a Fish condition that checks the current subcommand context.\n *\n * For root-level completions with subcommands: `__fish_use_subcommand`\n * For nested commands: verify the parent subcommand is active AND none of its\n * child subcommands have been entered yet.\n */\nconst subcommandCondition = (parentPath, childSubcommandNames) => {\n if (parentPath.length === 0) {\n if (childSubcommandNames.length > 0) {\n return `__fish_use_subcommand`;\n }\n return ``;\n }\n const parent = parentPath[parentPath.length - 1];\n if (childSubcommandNames.length > 0) {\n // Show only when parent is active but no child subcommand has been entered\n return `__fish_seen_subcommand_from ${parent}; and not __fish_seen_subcommand_from ${childSubcommandNames.join(\" \")}`;\n }\n return `__fish_seen_subcommand_from ${parent}`;\n};\n/**\n * Build a __fish_contains_opt condition that checks whether any form of this\n * flag has already been typed. Returns the condition string without wrapping\n * quotes (the caller adds those).\n */\nconst flagContainsOptCondition = flag => {\n const optArgs = [];\n for (const alias of flag.aliases) {\n if (alias.length === 1) {\n optArgs.push(`-s ${alias}`);\n }\n }\n // Long names (fish __fish_contains_opt uses bare words for long opts)\n optArgs.push(flag.name);\n for (const alias of flag.aliases) {\n if (alias.length > 1) {\n optArgs.push(alias);\n }\n }\n if (flag.type._tag === \"Boolean\") {\n optArgs.push(`no-${flag.name}`);\n }\n return `not __fish_contains_opt ${optArgs.join(\" \")}`;\n};\nconst flagCompletionArgs = flag => {\n const args = [`-l ${flag.name}`];\n for (const alias of flag.aliases) {\n if (alias.length === 1) {\n args.push(`-s ${alias}`);\n } else {\n args.push(`-l ${alias}`);\n }\n }\n if (flag.description) {\n args.push(`-d '${escapeFishString(flag.description)}'`);\n }\n const valueArgs = flagValueArgs(flag.type);\n if (valueArgs) {\n args.push(valueArgs);\n }\n return args;\n};\nconst flagValueArgs = type => {\n switch (type._tag) {\n case \"Boolean\":\n return undefined;\n case \"Choice\":\n return `-r -f -a '${type.values.join(\" \")}'`;\n case \"Path\":\n if (type.pathType === \"directory\") return `-r -F`;\n return `-r -F`;\n default:\n // -r: requires a value, -f: don't fall back to file completion\n return `-r -f`;\n }\n};\nconst argValueArgs = type => {\n switch (type._tag) {\n case \"Choice\":\n return `-r -f -a '${type.values.join(\" \")}'`;\n case \"Path\":\n return `-r -F`;\n default:\n return undefined;\n }\n};\n// ---------------------------------------------------------------------------\n// Generator\n// ---------------------------------------------------------------------------\nconst generateCompletions = (executableName, descriptor, parentPath, lines) => {\n const allSubNames = descriptor.subcommands.map(s => s.name);\n const condition = subcommandCondition(parentPath, allSubNames);\n const conditionArg = condition ? `-n '${condition}'` : ``;\n // Suppress default file completion unless the command has path-type\n // positional arguments. Without this, fish falls back to listing files\n // even when only flags are valid.\n const hasPathArgs = descriptor.arguments.some(a => a.type._tag === \"Path\");\n if (!hasPathArgs) {\n const parts = [`complete -c ${executableName}`];\n if (conditionArg) parts.push(conditionArg);\n parts.push(`-f`);\n lines.push(parts.join(\" \"));\n }\n // Subcommand completions\n for (const sub of descriptor.subcommands) {\n const parts = [`complete -c ${executableName}`];\n if (conditionArg) parts.push(conditionArg);\n parts.push(`-f -a '${escapeFishString(sub.name)}'`);\n if (sub.description) {\n parts.push(`-d '${escapeFishString(sub.description)}'`);\n }\n lines.push(parts.join(\" \"));\n }\n // Flag completions\n for (const flag of descriptor.flags) {\n // Only apply __fish_contains_opt dedup for boolean flags. For value-taking\n // flags, the dedup condition would suppress the entry while fish is waiting\n // for a value (e.g. typing `--env <TAB>` wouldn't show choices).\n const isBoolean = flag.type._tag === \"Boolean\";\n const flagCondition = isBoolean ? condition ? `${condition}; and ${flagContainsOptCondition(flag)}` : flagContainsOptCondition(flag) : condition;\n const flagCondArg = flagCondition ? `-n '${flagCondition}'` : ``;\n const parts = [`complete -c ${executableName}`];\n if (flagCondArg) parts.push(flagCondArg);\n parts.push(...flagCompletionArgs(flag));\n lines.push(parts.join(\" \"));\n // Boolean negation\n if (isBoolean) {\n const negParts = [`complete -c ${executableName}`];\n if (flagCondArg) negParts.push(flagCondArg);\n negParts.push(`-l no-${flag.name}`);\n if (flag.description) {\n negParts.push(`-d '${escapeFishString(`Disable ${flag.name}`)}'`);\n }\n lines.push(negParts.join(\" \"));\n }\n }\n // Flags as -a entries for bare <TAB> visibility.\n // Fish only shows -l/-s entries when the current word starts with -, so\n // without this, flags are invisible on bare <TAB>. Guarded to only show\n // when NOT already typing an option (avoids duplication with -l/-s above)\n // and hidden once a flag has been used (__fish_contains_opt).\n if (descriptor.flags.length > 0) {\n const notDash = `not string match -q -- \"-*\" (commandline -ct)`;\n const bareBase = condition ? `${condition}; and ${notDash}` : notDash;\n for (const flag of descriptor.flags) {\n const bareCondition = `${bareBase}; and ${flagContainsOptCondition(flag)}`;\n const isBoolean = flag.type._tag === \"Boolean\";\n const parts = [`complete -c ${executableName}`];\n parts.push(`-n '${bareCondition}'`);\n parts.push(`-f -a '--${flag.name}'`);\n if (flag.description) {\n parts.push(`-d '${escapeFishString(flag.description)}'`);\n }\n lines.push(parts.join(\" \"));\n if (isBoolean) {\n const negParts = [`complete -c ${executableName}`];\n negParts.push(`-n '${bareCondition}'`);\n negParts.push(`-f -a '--no-${flag.name}'`);\n if (flag.description) {\n negParts.push(`-d '${escapeFishString(`Disable ${flag.name}`)}'`);\n }\n lines.push(negParts.join(\" \"));\n }\n }\n }\n // Argument completions (type hints only)\n for (const arg of descriptor.arguments) {\n const valueArg = argValueArgs(arg.type);\n if (valueArg) {\n const parts = [`complete -c ${executableName}`];\n if (conditionArg) parts.push(conditionArg);\n parts.push(valueArg);\n if (arg.description) {\n parts.push(`-d '${escapeFishString(arg.description)}'`);\n }\n lines.push(parts.join(\" \"));\n }\n }\n // Recurse into subcommands\n for (const sub of descriptor.subcommands) {\n generateCompletions(executableName, sub, [...parentPath, sub.name], lines);\n }\n};\n/** @internal */\nexport const generate = (executableName, descriptor) => {\n const lines = [];\n lines.push(`###-begin-${executableName}-completions-###`);\n lines.push(`#`);\n lines.push(`# Static completion script for Fish`);\n lines.push(`#`);\n lines.push(`# Installation:`);\n lines.push(`# ${executableName} --completions fish > ~/.config/fish/completions/${executableName}.fish`);\n lines.push(`#`);\n lines.push(``);\n generateCompletions(executableName, descriptor, [], lines);\n lines.push(``);\n lines.push(`###-end-${executableName}-completions-###`);\n return lines.join(\"\\n\");\n};\n//# sourceMappingURL=fish.js.map","// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\nconst escapeZsh = s => s.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"'\\\\''\").replace(/:/g, \"\\\\:\");\nconst sanitize = s => s.replace(/[^a-zA-Z0-9_]/g, \"_\");\n/**\n * All forms of a flag (--name, -alias, --no-name) for the exclusion group.\n */\nconst allForms = flag => {\n const forms = [`--${flag.name}`];\n for (const alias of flag.aliases) {\n forms.push(alias.length === 1 ? `-${alias}` : `--${alias}`);\n }\n if (flag.type._tag === \"Boolean\") {\n forms.push(`--no-${flag.name}`);\n }\n return forms;\n};\nconst valueAction = type => {\n switch (type._tag) {\n case \"Boolean\":\n return \"\";\n case \"Choice\":\n return `:value:(${type.values.join(\" \")})`;\n case \"Path\":\n return type.pathType === \"directory\" ? `:directory:_directories` : `:file:_files`;\n case \"Integer\":\n return `:integer:`;\n case \"Float\":\n return `:float:`;\n case \"Date\":\n return `:date:`;\n default:\n return `:value:`;\n }\n};\nconst argAction = type => {\n switch (type._tag) {\n case \"Choice\":\n return `(${type.values.join(\" \")})`;\n case \"Path\":\n return type.pathType === \"directory\" ? `_directories` : `_files`;\n default:\n return ``;\n }\n};\n/**\n * Produce _arguments optspecs for a single flag. Each spec is a complete,\n * single-quoted string — no brace expansion, no line continuations.\n */\nconst flagSpecs = flag => {\n const specs = [];\n const desc = flag.description ? `[${escapeZsh(flag.description)}]` : \"\";\n const action = valueAction(flag.type);\n const excl = `(${allForms(flag).join(\" \")})`;\n // Primary long name\n specs.push(`'${excl}--${flag.name}${desc}${action}'`);\n // Aliases\n for (const alias of flag.aliases) {\n const prefix = alias.length === 1 ? \"-\" : \"--\";\n specs.push(`'${excl}${prefix}${alias}${desc}${action}'`);\n }\n // Boolean negation\n if (flag.type._tag === \"Boolean\") {\n const negDesc = flag.description ? `[${escapeZsh(`Disable ${flag.name}`)}]` : \"\";\n specs.push(`'${excl}--no-${flag.name}${negDesc}'`);\n }\n return specs;\n};\nconst argSpec = arg => {\n const desc = arg.description ? escapeZsh(arg.description) : arg.name;\n const action = argAction(arg.type);\n const prefix = arg.variadic ? \"*\" : \"\";\n return `'${prefix}:${desc}:${action}'`;\n};\n// ---------------------------------------------------------------------------\n// Generator\n// ---------------------------------------------------------------------------\nconst generateFunction = (descriptor, parentPath, lines) => {\n const currentPath = [...parentPath, descriptor.name];\n const funcName = `_${currentPath.map(sanitize).join(\"_\")}`;\n lines.push(`${funcName}() {`);\n if (descriptor.subcommands.length > 0) {\n // _arguments -C requires these locals for the state machine\n lines.push(` local context state state_descr line`);\n lines.push(` typeset -A opt_args`);\n lines.push(``);\n // Subcommand list\n lines.push(` local -a commands`);\n lines.push(` commands=(`);\n for (const sub of descriptor.subcommands) {\n const desc = sub.description ? escapeZsh(sub.description) : \"\";\n lines.push(` '${sub.name}:${desc}'`);\n }\n lines.push(` )`);\n lines.push(``);\n // Build specs array to avoid brace expansion / line continuation issues\n lines.push(` local -a specs`);\n lines.push(` specs=(`);\n for (const flag of descriptor.flags) {\n for (const spec of flagSpecs(flag)) {\n lines.push(` ${spec}`);\n }\n }\n for (const arg of descriptor.arguments) {\n lines.push(` ${argSpec(arg)}`);\n }\n lines.push(` '1:command:->command'`);\n lines.push(` '*::arg:->args'`);\n lines.push(` )`);\n lines.push(``);\n lines.push(` _arguments -C \"\\${specs[@]}\"`);\n lines.push(``);\n // State dispatch\n lines.push(` case \"$state\" in`);\n lines.push(` command)`);\n lines.push(` _describe -t commands 'commands' commands`);\n lines.push(` ;;`);\n lines.push(` args)`);\n lines.push(` case \"$words[1]\" in`);\n for (const sub of descriptor.subcommands) {\n const subFunc = `_${[...currentPath, sub.name].map(sanitize).join(\"_\")}`;\n lines.push(` ${sub.name})`);\n lines.push(` ${subFunc}`);\n lines.push(` ;;`);\n }\n lines.push(` esac`);\n lines.push(` ;;`);\n lines.push(` esac`);\n } else {\n // Leaf command — no subcommands\n const allSpecs = [];\n for (const flag of descriptor.flags) {\n allSpecs.push(...flagSpecs(flag));\n }\n for (const arg of descriptor.arguments) {\n allSpecs.push(argSpec(arg));\n }\n if (allSpecs.length > 0) {\n lines.push(` local -a specs`);\n lines.push(` specs=(`);\n for (const spec of allSpecs) {\n lines.push(` ${spec}`);\n }\n lines.push(` )`);\n lines.push(` _arguments \"\\${specs[@]}\"`);\n }\n }\n lines.push(`}`);\n lines.push(``);\n for (const sub of descriptor.subcommands) {\n generateFunction(sub, currentPath, lines);\n }\n};\n/** @internal */\nexport const generate = (executableName, descriptor) => {\n const lines = [];\n const safeName = sanitize(executableName);\n lines.push(`#compdef ${executableName}`);\n lines.push(`###-begin-${executableName}-completions-###`);\n lines.push(`#`);\n lines.push(`# Static completion script for Zsh`);\n lines.push(`#`);\n lines.push(`# Installation:`);\n lines.push(`# ${executableName} --completions zsh > ~/.zsh/completions/_${executableName}`);\n lines.push(`# then add ~/.zsh/completions to your fpath`);\n lines.push(`#`);\n lines.push(``);\n generateFunction(descriptor, [], lines);\n lines.push(`# Handle both direct invocation and autoload`);\n lines.push(`if [[ \"\\${zsh_eval_context[-1]}\" == \"loadautofunc\" ]]; then`);\n lines.push(` _${safeName} \"$@\"`);\n lines.push(`else`);\n lines.push(` compdef _${safeName} ${executableName}`);\n lines.push(`fi`);\n lines.push(`###-end-${executableName}-completions-###`);\n return lines.join(\"\\n\");\n};\n//# sourceMappingURL=zsh.js.map","/**\n * The `Completions` module turns a plain description of an Effect CLI command\n * tree into shell completion scripts for Bash, Zsh, and Fish. It is the\n * low-level script generation surface used by the unstable CLI package and by\n * the built-in completions global flag.\n *\n * @since 4.0.0\n */\nimport * as Bash from \"./internal/completions/bash.js\";\nimport * as Fish from \"./internal/completions/fish.js\";\nimport * as Zsh from \"./internal/completions/zsh.js\";\n/**\n * Generates a shell completion script for a command descriptor.\n *\n * **When to use**\n *\n * Use when you need an installable completion script from an existing\n * `CommandDescriptor`.\n *\n * **Details**\n *\n * Dispatches by `shell` to Bash, Zsh, or Fish generation and returns a static\n * script string for `executableName`.\n *\n * @see {@link Shell} for supported shell names\n * @see {@link CommandDescriptor} for the command shape used by completion generation\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const generate = (executableName, shell, descriptor) => {\n switch (shell) {\n case \"bash\":\n return Bash.generate(executableName, descriptor);\n case \"zsh\":\n return Zsh.generate(executableName, descriptor);\n case \"fish\":\n return Fish.generate(executableName, descriptor);\n }\n};\n//# sourceMappingURL=Completions.js.map","import { dual } from \"../../Function.js\";\nimport * as Param from \"./Param.js\";\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * Creates a string flag that accepts text input.\n *\n * **Example** (Creating string flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const nameFlag = Flag.string(\"name\")\n * // Usage: --name \"John Doe\"\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const string = name => Param.string(Param.flagKind, name);\n/**\n * Creates a boolean flag that can be enabled or disabled.\n *\n * **Example** (Creating boolean flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const verboseFlag = Flag.boolean(\"verbose\")\n * // Usage: --verbose (true) or --no-verbose (false)\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const boolean = name => Param.boolean(Param.flagKind, name);\n/**\n * Creates an integer flag that accepts whole number input.\n *\n * **Example** (Creating integer flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const portFlag = Flag.integer(\"port\")\n * // Usage: --port 8080\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const integer = name => Param.integer(Param.flagKind, name);\n/**\n * Creates a float flag that accepts decimal number input.\n *\n * **Example** (Creating float flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const rateFlag = Flag.float(\"rate\")\n * // Usage: --rate 3.14\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const float = name => Param.float(Param.flagKind, name);\n/**\n * Creates a date flag that accepts date input in ISO format.\n *\n * **Example** (Creating date flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const startDateFlag = Flag.date(\"start-date\")\n * // Usage: --start-date 2023-12-25\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const date = name => Param.date(Param.flagKind, name);\n/**\n * Constructs option parameters that represent a choice between several inputs.\n * Each tuple maps a string flag value to an associated typed value.\n *\n * **Example** (Creating flag choices with values)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // simple enum like choice mapping directly to string union\n * const color = Flag.choice(\"color\", [\"red\", \"green\", \"blue\"])\n *\n * // choice with custom value mapping\n * const logLevel = Flag.choiceWithValue(\"log-level\", [\n * [\"debug\", \"Debug\" as const],\n * [\"info\", \"Info\" as const],\n * [\"error\", \"Error\" as const]\n * ])\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const choiceWithValue = (name, choices) => Param.choiceWithValue(Param.flagKind, name, choices);\n/**\n * Creates a flag that accepts one of the provided string choices and returns\n * the selected string.\n *\n * **When to use**\n *\n * Use when you need to define a named CLI flag with fixed string choices and no\n * custom value mapping.\n *\n * **Gotchas**\n *\n * An empty choices array compiles, but no input value can parse successfully.\n *\n * @see {@link choiceWithValue} for mapping accepted strings to different typed values\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const choice = (name, choices) => Param.choice(Param.flagKind, name, choices);\n/**\n * Creates a path flag that accepts file system path input with validation options.\n *\n * **Example** (Creating path flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Basic path flag\n * const pathFlag = Flag.path(\"config-path\")\n *\n * // File-only path that must exist\n * const fileFlag = Flag.path(\"input-file\", {\n * pathType: \"file\",\n * mustExist: true\n * })\n *\n * // Directory path with custom type name\n * const dirFlag = Flag.path(\"output-dir\", {\n * pathType: \"directory\",\n * typeName: \"OUTPUT_DIRECTORY\"\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const path = (name, options) => Param.path(Param.flagKind, name, options);\n/**\n * Creates a file path flag that accepts file paths with optional existence validation.\n *\n * **Example** (Creating file flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Basic file flag\n * const inputFlag = Flag.file(\"input\")\n * // Usage: --input ./data.json\n *\n * // File that must exist\n * const configFlag = Flag.file(\"config\", { mustExist: true })\n * // Usage: --config ./config.yaml (file must exist)\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const file = (name, options) => Param.file(Param.flagKind, name, options);\n/**\n * Creates a directory path flag that accepts directory paths with optional existence validation.\n *\n * **Example** (Creating directory flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Basic directory flag\n * const outputFlag = Flag.directory(\"output\")\n * // Usage: --output ./build\n *\n * // Directory that must exist\n * const sourceFlag = Flag.directory(\"source\", { mustExist: true })\n * // Usage: --source ./src (directory must exist)\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const directory = (name, options) => Param.directory(Param.flagKind, name, options);\n/**\n * Creates a string flag whose parsed value is wrapped in `Redacted.Redacted` so\n * stringification and logging redact the value.\n *\n * **Gotchas**\n *\n * Values supplied on the command line may still be visible to the operating\n * system or shell history.\n *\n * **Example** (Creating redacted flags)\n *\n * ```ts\n * import { Effect, Redacted } from \"effect\"\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const passwordFlag = Flag.redacted(\"password\")\n *\n * const program = Effect.gen(function*() {\n * const [leftover, password] = yield* passwordFlag.parse({\n * arguments: [],\n * flags: { \"password\": [\"abc123\"] }\n * })\n * const value = Redacted.value(password) // Access the underlying value\n * console.log(\"Password length:\", value.length)\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const redacted = name => Param.redacted(Param.flagKind, name);\n/**\n * Creates a flag that reads and returns file content as a string.\n *\n * **Example** (Reading file text)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const config = Flag.fileText(\"config-file\")\n * // --config-file ./app.json will read the file content\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileText = name => Param.fileText(Param.flagKind, name);\n/**\n * Creates a flag that reads and parses the content of the specified file.\n *\n * **Details**\n *\n * The parser that is utilized will depend on the specified `format`, or the\n * extension of the file passed on the command-line if no `format` is specified.\n *\n * **Example** (Parsing file contents)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Will use the extension of the file passed on the command line to determine\n * // the parser to use\n * const config = Flag.fileParse(\"config\")\n *\n * // Will use the JSON parser\n * const jsonConfig = Flag.fileParse(\"json-config\", { format: \"json\" })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileParse = (name, options) => Param.fileParse(Param.flagKind, name, options);\n/**\n * Creates a flag that reads and validates file content using the specified\n * schema.\n *\n * **Example** (Validating file contents)\n *\n * ```ts\n * import { Schema } from \"effect\"\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const ConfigSchema = Schema.Struct({\n * port: Schema.Number,\n * host: Schema.String\n * })\n *\n * const config = Flag.fileSchema(\"config\", ConfigSchema, { format: \"json\" })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileSchema = (name, schema, options) => Param.fileSchema(Param.flagKind, name, schema, options);\n/**\n * Creates a flag that parses key=value pairs.\n *\n * **When to use**\n *\n * Use when you need a CLI flag that accepts one or more `key=value`\n * configuration entries.\n *\n * **Details**\n *\n * Requires at least one key=value pair. Multiple pairs are merged into a single\n * record.\n *\n * **Example** (Parsing key-value pairs)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const env = Flag.keyValuePair(\"env\")\n * // --env FOO=bar --env BAZ=qux will parse to { FOO: \"bar\", BAZ: \"qux\" }\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const keyValuePair = name => Param.keyValuePair(Param.flagKind, name);\n/**\n * Creates an empty sentinel flag that always fails to parse.\n * This is useful for creating placeholder flags or for combinators.\n *\n * **Example** (Creating sentinel flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const makeValueFlag = (includeValue: boolean) =>\n * includeValue ? Flag.string(\"value\") : Flag.none\n *\n * console.log(makeValueFlag(true) === Flag.none) // false\n * console.log(makeValueFlag(false) === Flag.none) // true\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const none = /*#__PURE__*/Param.none(Param.flagKind);\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * Adds an alias to a flag, allowing it to be referenced by multiple names.\n *\n * **Example** (Adding flag aliases)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Flag can be used as both --verbose and -v\n * const verboseFlag = Flag.boolean(\"verbose\").pipe(\n * Flag.withAlias(\"v\")\n * )\n *\n * // Multiple aliases can be chained\n * const helpFlag = Flag.boolean(\"help\").pipe(\n * Flag.withAlias(\"h\"),\n * Flag.withAlias(\"?\")\n * )\n * ```\n *\n * @category aliasing\n * @since 4.0.0\n */\nexport const withAlias = /*#__PURE__*/dual(2, (self, alias) => Param.withAlias(self, alias));\n/**\n * Adds a description to a flag for help documentation.\n *\n * **Example** (Adding help descriptions)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const portFlag = Flag.integer(\"port\").pipe(\n * Flag.withDescription(\"The port number to listen on\")\n * )\n *\n * const configFlag = Flag.file(\"config\").pipe(\n * Flag.withDescription(\"Path to the configuration file\")\n * )\n * ```\n *\n * @category help documentation\n * @since 4.0.0\n */\nexport const withDescription = /*#__PURE__*/dual(2, (self, description) => Param.withDescription(self, description));\n// -------------------------------------------------------------------------------------\n// metadata\n// -------------------------------------------------------------------------------------\n/**\n * Sets a custom metavar (placeholder name) for the flag in help documentation.\n *\n * **Details**\n *\n * The metavar is displayed in usage text to indicate what value the user should\n * provide. For example, `--output FILE` shows `FILE` as the metavar.\n *\n * **Example** (Setting metavars)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const databaseFlag = Flag.string(\"database-url\").pipe(\n * Flag.withMetavar(\"URL\"),\n * Flag.withDescription(\"Database connection URL\")\n * )\n * // In help: --database-url URL\n *\n * const timeoutFlag = Flag.integer(\"timeout\").pipe(\n * Flag.withMetavar(\"SECONDS\")\n * )\n * // In help: --timeout SECONDS\n * ```\n *\n * @category metadata\n * @since 4.0.0\n */\nexport const withMetavar = /*#__PURE__*/dual(2, (self, metavar) => Param.withMetavar(self, metavar));\n/**\n * Hides a flag from generated help output and shell completions while keeping\n * it fully parseable on the command line.\n *\n * **When to use**\n *\n * Use when experimental or internal flags should be accepted but not advertised, such as\n * `--experimental-foo`, debug toggles, or escape hatches that are not yet committed to the\n * public CLI surface.\n *\n * **Example** (Hiding a flag from help)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Flag still parses --experimental-foo, but it does not appear in --help.\n * const experimental = Flag.boolean(\"experimental-foo\").pipe(\n * Flag.withHidden\n * )\n * ```\n *\n * @category metadata\n * @since 4.0.0\n */\nexport const withHidden = self => Param.withHidden(self);\n/**\n * Makes a flag optional, returning an Option type that can be None if not provided.\n *\n * **Example** (Making flags optional)\n *\n * ```ts\n * import { Effect, Option } from \"effect\"\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const optionalPort = Flag.optional(Flag.integer(\"port\"))\n *\n * const program = Effect.gen(function*() {\n * const [leftover, port] = yield* optionalPort.parse({\n * arguments: [],\n * flags: { \"port\": [\"4000\"] }\n * })\n * if (Option.isSome(port)) {\n * console.log(\"Port specified:\", port.value)\n * } else {\n * console.log(\"No port specified, using default\")\n * }\n * })\n * ```\n *\n * @category optionality\n * @since 4.0.0\n */\nexport const optional = param => Param.optional(param);\n/**\n * Provides a default value for a flag when it's not specified.\n *\n * **Example** (Providing default values)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const portFlag = Flag.integer(\"port\").pipe(\n * Flag.withDefault(8080)\n * )\n * // If --port is not provided, defaults to 8080\n *\n * const hostFlag = Flag.string(\"host\").pipe(\n * Flag.withDefault(\"localhost\")\n * )\n * // If --host is not provided, defaults to \"localhost\"\n * ```\n *\n * @category optionality\n * @since 4.0.0\n */\nexport const withDefault = Param.withDefault;\n/**\n * Adds a fallback config that is loaded when a required flag is missing.\n *\n * **Example** (Falling back to config)\n *\n * ```ts\n * import { Config } from \"effect\"\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const verbose = Flag.boolean(\"verbose\").pipe(\n * Flag.withFallbackConfig(Config.boolean(\"VERBOSE\"))\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withFallbackConfig = /*#__PURE__*/dual(2, (self, config) => Param.withFallbackConfig(self, config));\n/**\n * Adds a fallback prompt that is shown when a required flag is missing.\n *\n * **Example** (Falling back to prompts)\n *\n * ```ts\n * import { Flag, Prompt } from \"effect/unstable/cli\"\n *\n * const name = Flag.string(\"name\").pipe(\n * Flag.withFallbackPrompt(Prompt.text({ message: \"Name\" }))\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withFallbackPrompt = /*#__PURE__*/dual(2, (self, prompt) => Param.withFallbackPrompt(self, prompt));\n/**\n * Transforms the parsed value of a flag using a mapping function.\n *\n * **Example** (Mapping parsed values)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Convert string to uppercase\n * const nameFlag = Flag.string(\"name\").pipe(\n * Flag.map((name) => name.toUpperCase())\n * )\n *\n * // Convert port to URL\n * const urlFlag = Flag.integer(\"port\").pipe(\n * Flag.map((port) => `http://localhost:${port}`)\n * )\n * ```\n *\n * @category mapping\n * @since 4.0.0\n */\nexport const map = /*#__PURE__*/dual(2, (self, f) => Param.map(self, f));\n/**\n * Transforms the parsed value using an Effect that can perform IO operations.\n *\n * **Example** (Mapping parsed values effectfully)\n *\n * ```ts\n * import { Effect, FileSystem } from \"effect\"\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Read file size from path flag\n * const fileSizeFlag = Flag.file(\"input\").pipe(\n * Flag.mapEffect(Effect.fnUntraced(function*(path) {\n * const fs = yield* FileSystem.FileSystem\n * const stats = yield* Effect.orDie(fs.stat(path))\n * return stats.size\n * }))\n * )\n * ```\n *\n * @category mapping\n * @since 4.0.0\n */\nexport const mapEffect = /*#__PURE__*/dual(2, (self, f) => Param.mapEffect(self, f));\n/**\n * Transforms the parsed value using a function that might throw, with error handling.\n *\n * **Example** (Mapping thrown errors)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Parse JSON string with error handling\n * const jsonFlag = Flag.string(\"config\").pipe(\n * Flag.mapTryCatch(\n * (json) => JSON.parse(json),\n * (error) => `Invalid JSON: ${error}`\n * )\n * )\n *\n * // Parse URL with error handling\n * const urlFlag = Flag.string(\"url\").pipe(\n * Flag.mapTryCatch(\n * (url) => new URL(url),\n * (error) => `Invalid URL: ${error}`\n * )\n * )\n * ```\n *\n * @category mapping\n * @since 4.0.0\n */\nexport const mapTryCatch = /*#__PURE__*/dual(3, (self, f, onError) => Param.mapTryCatch(self, f, onError));\n/**\n * Ensures a flag is specified at least a minimum number of times.\n *\n * **Example** (Requiring repeated values)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const sourceFlag = Flag.atLeast(Flag.file(\"source\"), 2)\n * // Requires at least 2 source files\n * // Usage: --source file1.ts --source file2.ts\n *\n * const tagFlag = Flag.string(\"tag\").pipe(\n * Flag.atLeast(1)\n * )\n * // Requires at least 1 tag\n * ```\n *\n * @category repetition\n * @since 4.0.0\n */\nexport const atLeast = /*#__PURE__*/dual(2, (self, min) => Param.atLeast(self, min));\n/**\n * Ensures a flag is specified at most a maximum number of times.\n *\n * **Example** (Limiting repeated values)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const warningFlag = Flag.atMost(Flag.string(\"warning\"), 3)\n * // Allows up to 3 warning flags\n * // Usage: --warning w1 --warning w2 --warning w3\n *\n * const debugFlag = Flag.string(\"debug\").pipe(\n * Flag.atMost(1)\n * )\n * // Allows at most 1 debug flag\n * ```\n *\n * @category repetition\n * @since 4.0.0\n */\nexport const atMost = /*#__PURE__*/dual(2, (self, max) => Param.atMost(self, max));\n/**\n * Ensures a flag is specified between a minimum and maximum number of times.\n *\n * **Example** (Bounding repeated values)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const hostFlag = Flag.between(Flag.string(\"host\"), 1, 3)\n * // Requires 1-3 host flags\n * // Usage: --host host1 --host host2\n *\n * const excludeFlag = Flag.string(\"exclude\").pipe(\n * Flag.between(0, 5)\n * )\n * // Allows 0-5 exclude patterns\n * ```\n *\n * @category repetition\n * @since 4.0.0\n */\nexport const between = /*#__PURE__*/dual(3, (self, min, max) => Param.between(self, min, max));\n/**\n * Transforms and filters a flag value, failing with a custom error if the transformation returns None.\n *\n * **Example** (Filtering and transforming values)\n *\n * ```ts\n * import { Option } from \"effect\"\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Parse positive integers only\n * const positiveInt = Flag.integer(\"count\").pipe(\n * Flag.filterMap(\n * (n) => n > 0 ? Option.some(n) : Option.none(),\n * (n) => `Expected positive integer, got ${n}`\n * )\n * )\n *\n * // Parse valid email addresses\n * const emailFlag = Flag.string(\"email\").pipe(\n * Flag.filterMap(\n * (email) => email.includes(\"@\") ? Option.some(email) : Option.none(),\n * (email) => `Invalid email address: ${email}`\n * )\n * )\n * ```\n *\n * @category filtering\n * @since 4.0.0\n */\nexport const filterMap = /*#__PURE__*/dual(3, (self, f, onNone) => Param.filterMap(self, f, onNone));\n/**\n * Filters a flag value based on a predicate, failing with a custom error if the predicate returns false.\n *\n * **Example** (Filtering parsed values)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Ensure port is in valid range\n * const portFlag = Flag.integer(\"port\").pipe(\n * Flag.filter(\n * (port) => port >= 1 && port <= 65535,\n * (port) => `Port ${port} is out of range (1-65535)`\n * )\n * )\n *\n * // Ensure non-empty string\n * const nameFlag = Flag.string(\"name\").pipe(\n * Flag.filter(\n * (name) => name.trim().length > 0,\n * () => \"Name cannot be empty\"\n * )\n * )\n * ```\n *\n * @category filtering\n * @since 4.0.0\n */\nexport const filter = /*#__PURE__*/dual(3, (self, predicate, onFalse) => Param.filter(self, predicate, onFalse));\n/**\n * Provides an alternative flag if the first one fails to parse.\n *\n * **Example** (Falling back to another flag)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Try parsing as integer, fallback to string\n * const valueFlag = Flag.orElse(\n * Flag.integer(\"value\"),\n * () => Flag.string(\"value\")\n * )\n *\n * // Multiple input sources with fallback\n * const configFlag = Flag.orElse(\n * Flag.file(\"config\"),\n * () => Flag.string(\"config-url\")\n * )\n * ```\n *\n * @category alternatives\n * @since 4.0.0\n */\nexport const orElse = /*#__PURE__*/dual(2, (self, that) => Param.orElse(self, that));\n/**\n * Tries to parse with the first flag, then the second, returning a Result that indicates which succeeded.\n *\n * **Example** (Returning fallback results)\n *\n * ```ts\n * import { Effect, Result } from \"effect\"\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Try file path, fallback to URL\n * const sourceFlag = Flag.orElseResult(\n * Flag.file(\"source\"),\n * () => Flag.string(\"source-url\")\n * )\n *\n * const program = Effect.gen(function*() {\n * const [leftover, source] = yield* sourceFlag.parse({\n * arguments: [],\n * flags: { \"source-url\": [\"https://google.com\"] }\n * })\n * if (Result.isSuccess(source)) {\n * console.log(\"Using file:\", source.success)\n * } else {\n * console.log(\"Using URL:\", source.failure)\n * }\n * })\n * ```\n *\n * @category alternatives\n * @since 4.0.0\n */\nexport const orElseResult = /*#__PURE__*/dual(2, (self, that) => Param.orElseResult(self, that));\n/**\n * Validates and transforms a flag value using a Schema codec.\n *\n * **Example** (Validating with schemas)\n *\n * ```ts\n * import { Schema } from \"effect\"\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const isEmail = Schema.isPattern(/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/, {\n * message: \"Must be a valid email address\"\n * })\n *\n * // Parse and validate email with custom schema\n * const EmailSchema = Schema.String.pipe(\n * Schema.check(isEmail)\n * )\n *\n * const emailFlag = Flag.string(\"email\").pipe(\n * Flag.withSchema(EmailSchema)\n * )\n *\n * // Parse JSON configuration with schema validation\n * const ConfigSchema = Schema.Struct({\n * port: Schema.Number,\n * host: Schema.String,\n * ssl: Schema.optional(Schema.Boolean)\n * }).pipe(Schema.fromJsonString)\n *\n * const configFlag = Flag.string(\"config\").pipe(\n * Flag.withSchema(ConfigSchema)\n * )\n * ```\n *\n * @category schemas\n * @since 4.0.0\n */\nexport const withSchema = /*#__PURE__*/dual(2, (self, schema) => Param.withSchema(self, schema));\n//# sourceMappingURL=Flag.js.map","/**\n * Config Internal\n * ================\n *\n * The processed internal representation of a Command.Config declaration.\n * Separates the user's declared config shape from the flat parsing representation.\n *\n * Key concepts:\n * - ConfigInternal: The full processed form (flags, arguments, tree)\n * - ConfigInternal.Tree: Maps declaration keys to nodes\n * - ConfigInternal.Node: Param reference, Array, or Nested subtree\n *\n * Example transformation from Command.Config to Command.Config.Internal:\n *\n * ```ts\n * // User declares:\n * const config = {\n * verbose: Flag.boolean(\"verbose\"),\n * server: {\n * host: Flag.string(\"host\"),\n * port: Flag.integer(\"port\")\n * },\n * files: Argument.string(\"files\").pipe(Argument.variadic)\n * }\n *\n * // Becomes Config.Internal:\n * {\n * arguments: [filesParam], // Flat array of arguments\n * flags: [verboseParam, hostParam, portParam], // Flat array of flags\n * orderedParams: [verboseParam, hostParam, portParam, filesParam],\n * tree: { // Preserves nested structure\n * verbose: { _tag: \"Param\", index: 0 },\n * server: {\n * _tag: \"Nested\",\n * tree: {\n * host: { _tag: \"Param\", index: 1 },\n * port: { _tag: \"Param\", index: 2 }\n * }\n * },\n * files: { _tag: \"Param\", index: 3 }\n * }\n * }\n * ```\n *\n * This separation allows:\n * 1. Flat iteration over all params for parsing/validation\n * 2. Reconstruction of original nested shape for handler input\n */\nimport * as Param from \"../Param.js\";\n/* ========================================================================== */\n/* Type ID */\n/* ========================================================================== */\nconst ConfigInternalTypeId = \"~effect/cli/Command/Config/Internal\";\n/**\n * Parses a Command.Config into a ConfigInternal.\n *\n * Walks the config structure and:\n * 1. Extracts all Params into flat arrays (flags, arguments, orderedParams)\n * 2. Builds a tree that remembers the original nested structure\n * 3. Assigns each Param an index to link parsed values back\n *\n * @internal\n */\nexport const parseConfig = config => {\n const orderedParams = [];\n const flags = [];\n const args = [];\n function parse(config) {\n const tree = {};\n for (const key in config) {\n tree[key] = parseValue(config[key]);\n }\n return tree;\n }\n function parseValue(value) {\n if (Array.isArray(value)) {\n return {\n _tag: \"Array\",\n children: value.map(v => parseValue(v))\n };\n } else if (Param.isParam(value)) {\n const index = orderedParams.length;\n orderedParams.push(value);\n if (value.kind === \"argument\") {\n args.push(value);\n } else {\n flags.push(value);\n }\n return {\n _tag: \"Param\",\n index\n };\n } else {\n return {\n _tag: \"Nested\",\n tree: parse(value)\n };\n }\n }\n return {\n [ConfigInternalTypeId]: ConfigInternalTypeId,\n flags,\n arguments: args,\n orderedParams,\n tree: parse(config)\n };\n};\n/** @internal */\nexport const emptyConfig = /*#__PURE__*/parseConfig({});\nconst shiftNodeIndexes = (node, offset) => {\n switch (node._tag) {\n case \"Param\":\n return {\n _tag: \"Param\",\n index: node.index + offset\n };\n case \"Array\":\n return {\n _tag: \"Array\",\n children: node.children.map(child => shiftNodeIndexes(child, offset))\n };\n case \"Nested\":\n return {\n _tag: \"Nested\",\n tree: shiftTreeIndexes(node.tree, offset)\n };\n }\n};\nconst shiftTreeIndexes = (tree, offset) => {\n const output = {};\n for (const key in tree) {\n output[key] = shiftNodeIndexes(tree[key], offset);\n }\n return output;\n};\n/** @internal */\nexport const mergeConfig = (left, right) => {\n const offset = left.orderedParams.length;\n return {\n [ConfigInternalTypeId]: ConfigInternalTypeId,\n flags: [...left.flags, ...right.flags],\n arguments: [...left.arguments, ...right.arguments],\n orderedParams: [...left.orderedParams, ...right.orderedParams],\n tree: {\n ...left.tree,\n ...shiftTreeIndexes(right.tree, offset)\n }\n };\n};\n/* ========================================================================== */\n/* Reconstruction */\n/* ========================================================================== */\n/**\n * Reconstructs the original nested config shape from parsed values.\n *\n * Uses the tree as a blueprint to place each parsed value back into\n * its original position in the nested structure.\n *\n * @internal\n */\nexport const reconstructTree = (tree, results) => {\n const output = {};\n for (const key in tree) {\n output[key] = nodeValue(tree[key]);\n }\n return output;\n function nodeValue(node) {\n switch (node._tag) {\n case \"Param\":\n return results[node.index];\n case \"Array\":\n return node.children.map(child => nodeValue(child));\n case \"Nested\":\n return reconstructTree(node.tree, results);\n }\n }\n};\n//# sourceMappingURL=config.js.map","/**\n * Command Implementation\n * ======================\n *\n * Internal implementation details for CLI commands.\n * Public API is in ../Command.ts\n */\nimport * as Arr from \"../../../Array.js\";\nimport * as Context from \"../../../Context.js\";\nimport * as Effect from \"../../../Effect.js\";\nimport * as Effectable from \"../../../Effectable.js\";\nimport * as Option from \"../../../Option.js\";\nimport * as Predicate from \"../../../Predicate.js\";\nimport * as CliError from \"../CliError.js\";\nimport * as Param from \"../Param.js\";\nimport * as Primitive from \"../Primitive.js\";\nimport { emptyConfig, reconstructTree } from \"./config.js\";\n/* ========================================================================== */\n/* Type ID */\n/* ========================================================================== */\nexport const TypeId = \"~effect/cli/Command\";\n/* ========================================================================== */\n/* Casting */\n/* ========================================================================== */\n/**\n * Casts a Command to its internal implementation.\n * For use by internal modules that need access to config, parse, handle, etc.\n */\nexport const toImpl = self => self;\n/* ========================================================================== */\n/* Proto */\n/* ========================================================================== */\nexport const Proto = {\n ... /*#__PURE__*/Effectable.Prototype({\n label: \"Command\",\n evaluate() {\n return toImpl(this).service;\n }\n })\n};\n/* ========================================================================== */\n/* Constructor */\n/* ========================================================================== */\n/**\n * Internal command constructor. Only accepts already-parsed ConfigInternal.\n */\nexport const makeCommand = options => {\n const config = options.config;\n const contextConfig = options.contextConfig ?? emptyConfig;\n const service = options.service ?? Context.Service(`${TypeId}/${options.name}`);\n const annotations = options.annotations ?? Context.empty();\n const globalFlags = options.globalFlags ?? [];\n const subcommands = options.subcommands ?? [];\n const handle = (input, commandPath) => Predicate.isNotUndefined(options.handle) ? options.handle(input, commandPath) : Effect.fail(new CliError.ShowHelp({\n commandPath,\n errors: []\n }));\n const parse = options.parse ?? makeParser(config);\n const parseContext = options.parseContext ?? makeParser(contextConfig);\n const buildHelpDoc = commandPath => {\n const args = [];\n const flags = [];\n for (const arg of config.arguments) {\n const singles = Param.extractSingleParams(arg);\n const metadata = Param.getParamMetadata(arg);\n for (const single of singles) {\n args.push({\n name: single.name,\n type: single.typeName ?? Primitive.getTypeName(single.primitiveType),\n description: single.description,\n required: !metadata.isOptional,\n variadic: metadata.isVariadic\n });\n }\n }\n let usage = commandPath.length > 0 ? commandPath.join(\" \") : options.name;\n // Only render `<subcommand>` in usage when at least one visible subcommand\n // exists; an all-hidden subcommand tree should look like a leaf command.\n if (subcommands.some(group => group.commands.some(c => !c.hidden))) {\n usage += \" <subcommand>\";\n }\n usage += \" [flags]\";\n for (const arg of args) {\n const argName = arg.variadic ? `<${arg.name}...>` : `<${arg.name}>`;\n usage += ` ${arg.required ? argName : `[${argName}]`}`;\n }\n for (const option of config.flags) {\n const singles = Param.extractSingleParams(option);\n for (const single of singles) {\n // Hidden flags still parse on the command line but are omitted from\n // generated --help output.\n if (single.hidden) continue;\n flags.push(toFlagDoc(single));\n }\n }\n const subcommandDocs = [];\n for (const group of subcommands) {\n // Hidden subcommands still parse on the command line but are omitted\n // from --help. Drop the whole group when nothing visible remains so we\n // don't render an empty heading.\n const visible = group.commands.filter(c => !c.hidden);\n if (visible.length === 0) continue;\n subcommandDocs.push({\n group: group.group,\n commands: Arr.map(visible, subcommand => ({\n name: subcommand.name,\n alias: subcommand.alias,\n shortDescription: subcommand.shortDescription,\n description: subcommand.description ?? \"\"\n }))\n });\n }\n const examples = options.examples ?? [];\n return {\n description: options.description ?? \"\",\n usage,\n flags,\n annotations,\n ...(args.length > 0 && {\n args\n }),\n ...(subcommandDocs.length > 0 && {\n subcommands: subcommandDocs\n }),\n ...(examples.length > 0 && {\n examples\n })\n };\n };\n return Object.assign(Object.create(Proto), {\n [TypeId]: TypeId,\n name: options.name,\n examples: options.examples ?? [],\n annotations,\n globalFlags,\n subcommands,\n hidden: options.hidden ?? false,\n config,\n contextConfig,\n service,\n parse,\n parseContext,\n handle,\n buildHelpDoc,\n ...(Predicate.isNotUndefined(options.description) ? {\n description: options.description\n } : {}),\n ...(Predicate.isNotUndefined(options.shortDescription) ? {\n shortDescription: options.shortDescription\n } : {}),\n ...(Predicate.isNotUndefined(options.alias) ? {\n alias: options.alias\n } : {})\n });\n};\n/* ========================================================================== */\n/* Helpers */\n/* ========================================================================== */\n/**\n * Converts a single flag param into a FlagDoc for help display.\n */\nexport const toFlagDoc = single => {\n const formattedAliases = single.aliases.map(alias => alias.length === 1 ? `-${alias}` : `--${alias}`);\n return {\n name: single.name,\n aliases: formattedAliases,\n type: single.typeName ?? Primitive.getTypeName(single.primitiveType),\n description: appendChoiceKeys(single.description, Primitive.getChoiceKeys(single.primitiveType)),\n required: single.primitiveType._tag !== \"Boolean\"\n };\n};\nconst appendChoiceKeys = (description, choiceKeys) => {\n if (choiceKeys === undefined || choiceKeys.length === 0) {\n return description;\n }\n const choiceSuffix = `(choices: ${choiceKeys.join(\", \")})`;\n return Option.match(description, {\n onNone: () => Option.some(choiceSuffix),\n onSome: value => Option.some(`${value} ${choiceSuffix}`)\n });\n};\n/**\n * Creates a parser for a given config. Used as the default for both `parse`\n * and `parseContext`, and also by `withSharedFlags` to avoid constructing a\n * full throwaway command.\n */\nexport const makeParser = cfg => Effect.fnUntraced(function* (input) {\n const parsedArgs = {\n flags: input.flags,\n arguments: input.arguments\n };\n const values = yield* parseParams(parsedArgs, cfg.orderedParams);\n return reconstructTree(cfg.tree, values);\n});\n/**\n * Parses param values from parsed command arguments into their typed\n * representations.\n */\nconst parseParams = /*#__PURE__*/Effect.fnUntraced(function* (parsedArgs, params) {\n const results = [];\n let currentArguments = parsedArgs.arguments;\n for (const option of params) {\n const [remainingArguments, parsed] = yield* option.parse({\n flags: parsedArgs.flags,\n arguments: currentArguments\n });\n results.push(parsed);\n currentArguments = remainingArguments;\n }\n return results;\n});\n/**\n * Checks that inherited parent context flags do not reuse names declared by\n * child command flags.\n *\n * When `contextConfig` is supplied, it is used as the inherited flag set;\n * otherwise the parent's current context config is checked.\n */\nexport const checkForDuplicateFlags = (parent, subcommands, options) => {\n const parentImpl = toImpl(parent);\n const parentOptionNames = new Set();\n const extractNames = flags => {\n for (const option of flags) {\n const singles = Param.extractSingleParams(option);\n for (const single of singles) {\n parentOptionNames.add(single.name);\n }\n }\n };\n extractNames((options?.contextConfig ?? parentImpl.contextConfig).flags);\n for (const subcommand of subcommands) {\n const subImpl = toImpl(subcommand);\n for (const option of subImpl.config.flags) {\n const singles = Param.extractSingleParams(option);\n for (const single of singles) {\n if (parentOptionNames.has(single.name)) {\n throw new CliError.DuplicateOption({\n option: single.name,\n parentCommand: parent.name,\n childCommand: subcommand.name\n });\n }\n }\n }\n }\n};\n//# sourceMappingURL=command.js.map","/**\n * CommandDescriptor — pure-data representation of a command tree for\n * shell completion generation.\n *\n * @internal\n */\nimport * as Option from \"../../../../Option.js\";\nimport * as Param from \"../../Param.js\";\nimport * as Primitive from \"../../Primitive.js\";\nimport { toImpl } from \"../command.js\";\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\nconst toFlagType = single => {\n const tag = single.primitiveType._tag;\n switch (tag) {\n case \"Boolean\":\n return {\n _tag: \"Boolean\"\n };\n case \"Integer\":\n return {\n _tag: \"Integer\"\n };\n case \"Float\":\n return {\n _tag: \"Float\"\n };\n case \"Date\":\n return {\n _tag: \"Date\"\n };\n case \"Choice\":\n {\n const keys = Primitive.getChoiceKeys(single.primitiveType);\n return {\n _tag: \"Choice\",\n values: keys ?? []\n };\n }\n case \"Path\":\n {\n const typeName = single.typeName;\n const pathType = typeName === \"file\" ? \"file\" : typeName === \"directory\" ? \"directory\" : \"either\";\n return {\n _tag: \"Path\",\n pathType\n };\n }\n default:\n return {\n _tag: \"String\"\n };\n }\n};\nconst toArgumentType = single => {\n const tag = single.primitiveType._tag;\n switch (tag) {\n case \"Integer\":\n return {\n _tag: \"Integer\"\n };\n case \"Float\":\n return {\n _tag: \"Float\"\n };\n case \"Date\":\n return {\n _tag: \"Date\"\n };\n case \"Choice\":\n {\n const keys = Primitive.getChoiceKeys(single.primitiveType);\n return {\n _tag: \"Choice\",\n values: keys ?? []\n };\n }\n case \"Path\":\n {\n const typeName = single.typeName;\n const pathType = typeName === \"file\" ? \"file\" : typeName === \"directory\" ? \"directory\" : \"either\";\n return {\n _tag: \"Path\",\n pathType\n };\n }\n default:\n return {\n _tag: \"String\"\n };\n }\n};\n// ---------------------------------------------------------------------------\n// Extraction\n// ---------------------------------------------------------------------------\n/** @internal */\nexport const fromCommand = cmd => {\n const impl = toImpl(cmd);\n const config = impl.config;\n const flags = [];\n for (const flag of config.flags) {\n const singles = Param.extractSingleParams(flag);\n for (const single of singles) {\n if (single.kind !== \"flag\") continue;\n // Omit hidden flags from completion scripts so tab-completion in the\n // shell does not advertise flags that are absent from --help.\n if (single.hidden) continue;\n flags.push({\n name: single.name,\n aliases: single.aliases,\n description: Option.getOrUndefined(single.description),\n type: toFlagType(single)\n });\n }\n }\n const args = [];\n for (const arg of config.arguments) {\n const singles = Param.extractSingleParams(arg);\n const metadata = Param.getParamMetadata(arg);\n for (const single of singles) {\n if (single.kind !== \"argument\") continue;\n args.push({\n name: single.name,\n description: Option.getOrUndefined(single.description),\n required: !metadata.isOptional,\n variadic: metadata.isVariadic,\n type: toArgumentType(single)\n });\n }\n }\n const subcommands = [];\n for (const group of cmd.subcommands) {\n for (const subcommand of group.commands) {\n // Omit hidden subcommands from completion scripts so tab-completion in\n // the shell does not advertise commands that are absent from --help.\n if (subcommand.hidden) continue;\n subcommands.push(fromCommand(subcommand));\n }\n }\n return {\n name: cmd.name,\n description: cmd.shortDescription ?? cmd.description,\n flags,\n arguments: args,\n subcommands\n };\n};\n//# sourceMappingURL=descriptor.js.map","/**\n * Help Documentation\n * ================\n *\n * Internal helpers for generating help documentation.\n * Extracted from command.ts to avoid circular dependencies.\n */\nimport * as Effect from \"../../../Effect.js\";\nimport * as Param from \"../Param.js\";\nimport { toFlagDoc, toImpl } from \"./command.js\";\nconst dedupeGlobalFlags = flags => {\n const seen = new Set();\n const deduped = [];\n for (const flag of flags) {\n if (seen.has(flag)) {\n continue;\n }\n seen.add(flag);\n deduped.push(flag);\n }\n return deduped;\n};\n/**\n * Returns the resolved command lineage for the provided path.\n * Includes the root command as the first element.\n */\nexport const getCommandsForCommandPath = (command, commandPath) => {\n const commands = [command];\n let currentCommand = command;\n for (let i = 1; i < commandPath.length; i++) {\n const subcommandName = commandPath[i];\n let subcommand = undefined;\n for (const group of currentCommand.subcommands) {\n subcommand = group.commands.find(sub => sub.name === subcommandName);\n if (subcommand) {\n break;\n }\n }\n if (!subcommand) {\n break;\n }\n commands.push(subcommand);\n currentCommand = subcommand;\n }\n return commands;\n};\n/**\n * Returns active global flags for a command path.\n * Built-ins are prepended and declarations are collected root -> leaf.\n */\nexport const getGlobalFlagsForCommandPath = (command, commandPath, builtIns) => {\n const commands = getCommandsForCommandPath(command, commandPath);\n const declared = commands.flatMap(current => toImpl(current).globalFlags);\n return dedupeGlobalFlags([...builtIns, ...declared]);\n};\nconst collectDeclaredGlobalFlags = command => {\n const collected = [];\n const visit = current => {\n const impl = toImpl(current);\n for (const flag of impl.globalFlags) {\n collected.push(flag);\n }\n for (const group of current.subcommands) {\n for (const subcommand of group.commands) {\n visit(subcommand);\n }\n }\n };\n visit(command);\n return dedupeGlobalFlags(collected);\n};\nconst getSharedFlagsForCommandPath = (commands, currentFlags) => {\n if (commands.length <= 1) {\n return [];\n }\n const seen = new Set(currentFlags.map(flag => flag.name));\n const sharedFlags = [];\n for (const ancestor of commands.slice(0, -1)) {\n const ancestorImpl = toImpl(ancestor);\n for (const flag of ancestorImpl.contextConfig.flags) {\n const singles = Param.extractSingleParams(flag);\n for (const single of singles) {\n if (seen.has(single.name)) {\n continue;\n }\n // Hidden ancestor flags are excluded from the shared-flags section\n // of subcommand help, the same way they're excluded from the owning\n // command's own help output.\n if (single.hidden) {\n continue;\n }\n seen.add(single.name);\n sharedFlags.push(toFlagDoc(single));\n }\n }\n }\n return sharedFlags;\n};\n/**\n * Returns all global flags declared in a command tree.\n * Built-ins are prepended and command declarations are deduplicated by identity.\n */\nexport const getGlobalFlagsForCommandTree = (command, builtIns) => dedupeGlobalFlags([...builtIns, ...collectDeclaredGlobalFlags(command)]);\n/**\n * Helper function to get help documentation for a specific command path.\n * Navigates through the command hierarchy to find the right command.\n * Reads active global flags for the path and includes them in the help doc.\n */\nexport const getHelpForCommandPath = (command, commandPath, builtIns) => Effect.gen(function* () {\n const commands = getCommandsForCommandPath(command, commandPath);\n const currentCommand = commands.length > 0 ? commands[commands.length - 1] : command;\n const baseDoc = toImpl(currentCommand).buildHelpDoc(commandPath);\n const sharedFlags = getSharedFlagsForCommandPath(commands, baseDoc.flags);\n const flags = getGlobalFlagsForCommandPath(command, commandPath, builtIns);\n const globalFlagDocs = [];\n for (const flag of flags) {\n const singles = Param.extractSingleParams(flag.flag);\n for (const single of singles) {\n // Same rule as command-local flags: hidden globals are still parsed\n // and still trigger their handlers, they just don't appear under\n // \"GLOBAL FLAGS\" in --help.\n if (single.hidden) continue;\n globalFlagDocs.push({\n ...toFlagDoc(single),\n required: false\n });\n }\n }\n return {\n ...baseDoc,\n flags: [...sharedFlags, ...baseDoc.flags],\n globalFlags: globalFlagDocs\n };\n});\n//# sourceMappingURL=help.js.map","/**\n * Global flags for Effect CLI command trees. Global flags are parsed outside a\n * single command's local flags and can apply to a command and its descendants.\n *\n * This module defines two kinds of global flags: action flags, which run an\n * effect and stop normal command execution, and setting flags, which provide a\n * parsed value to the command handler through the Effect context. It also\n * defines the built-in help, version, shell-completion, and log-level flags\n * used by `Command.run` and `Command.runWith`.\n *\n * @since 4.0.0\n */\nimport * as Console from \"../../Console.js\";\nimport * as Context from \"../../Context.js\";\nimport * as Effect from \"../../Effect.js\";\nimport * as Option from \"../../Option.js\";\nimport * as CliOutput from \"./CliOutput.js\";\nimport * as Completions_ from \"./Completions.js\";\nimport * as Flag from \"./Flag.js\";\nimport * as CommandDescriptor from \"./internal/completions/descriptor.js\";\nimport * as HelpInternal from \"./internal/help.js\";\n/* ========================================================================== */\n/* Constructors */\n/* ========================================================================== */\n/**\n * Creates an Action flag that performs a side effect and exits.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const action = options => ({\n _tag: \"Action\",\n flag: options.flag,\n run: options.run\n});\n/**\n * Creates a Setting flag that configures the command handler's environment.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const setting = id => options => {\n settingIdCounter += 1;\n const ref = Context.Service(`effect/unstable/cli/GlobalFlag/${id}/${settingIdCounter}`);\n return Object.assign(ref, {\n _tag: \"Setting\",\n id,\n flag: options.flag\n });\n};\nlet settingIdCounter = 0;\n/* ========================================================================== */\n/* Built-in Flag References */\n/* ========================================================================== */\n/**\n * Defines the `--help` / `-h` global flag, which shows help documentation for the\n * active command path.\n *\n * @see {@link BuiltIns} for the default list containing this flag\n * @see {@link action} for defining custom action global flags\n *\n * @category references\n * @since 4.0.0\n */\nexport const Help = /*#__PURE__*/action({\n flag: /*#__PURE__*/Flag.boolean(\"help\").pipe(/*#__PURE__*/Flag.withAlias(\"h\"), /*#__PURE__*/Flag.withDescription(\"Show help information\")),\n run: (_, {\n command,\n commandPath\n }) => Effect.gen(function* () {\n const formatter = yield* CliOutput.Formatter;\n const helpDoc = yield* HelpInternal.getHelpForCommandPath(command, commandPath, BuiltIns);\n yield* Console.log(formatter.formatHelpDoc(helpDoc));\n })\n});\n/**\n * Defines the global action flag for showing command version information.\n *\n * **When to use**\n *\n * Use to add a built-in `--version / -v` flag to a command runner.\n *\n * @category references\n * @since 4.0.0\n */\nexport const Version = /*#__PURE__*/action({\n flag: /*#__PURE__*/Flag.boolean(\"version\").pipe(/*#__PURE__*/Flag.withAlias(\"v\"), /*#__PURE__*/Flag.withDescription(\"Show version information\")),\n run: (_, {\n command,\n version\n }) => Effect.gen(function* () {\n const formatter = yield* CliOutput.Formatter;\n yield* Console.log(formatter.formatVersion(command.name, version));\n })\n});\n/**\n * Defines the `--completions` global flag, which prints a shell completion script for\n * the given shell.\n *\n * **Details**\n *\n * Accepted values are `bash`, `zsh`, `fish`, and `sh`; `sh` is normalized to\n * `bash`.\n *\n * @category references\n * @since 4.0.0\n */\nexport const Completions = /*#__PURE__*/action({\n flag: /*#__PURE__*/Flag.choice(\"completions\", [\"bash\", \"zsh\", \"fish\", \"sh\"]).pipe(Flag.optional, /*#__PURE__*/Flag.map(v => Option.map(v, s => s === \"sh\" ? \"bash\" : s)), /*#__PURE__*/Flag.withMetavar(\"<bash|zsh|fish|sh>\"), /*#__PURE__*/Flag.withDescription(\"Print shell completion script\")),\n run: (shell, {\n command\n }) => Effect.gen(function* () {\n if (Option.isNone(shell)) return;\n const descriptor = CommandDescriptor.fromCommand(command);\n yield* Console.log(Completions_.generate(command.name, shell.value, descriptor));\n })\n});\n/**\n * Defines the global setting flag for command log level.\n *\n * **When to use**\n *\n * Use to add a built-in `--log-level` option that configures the minimum log\n * level for the command.\n *\n * @category references\n * @since 4.0.0\n */\nexport const LogLevel = /*#__PURE__*/setting(\"log-level\")({\n flag: /*#__PURE__*/Flag.choiceWithValue(\"log-level\", [[\"all\", \"All\"], [\"trace\", \"Trace\"], [\"debug\", \"Debug\"], [\"info\", \"Info\"], [\"warn\", \"Warn\"], [\"warning\", \"Warn\"], [\"error\", \"Error\"], [\"fatal\", \"Fatal\"], [\"none\", \"None\"]]).pipe(Flag.optional, /*#__PURE__*/Flag.withDescription(\"Sets the minimum log level\"), /*#__PURE__*/Flag.withMetavar(\"<all|trace|debug|info|warn|warning|error|fatal|none>\"))\n});\n/* ========================================================================== */\n/* References */\n/* ========================================================================== */\n/**\n * Built-in global flags in default precedence order.\n *\n * **When to use**\n *\n * Use when extending or inspecting the default global-flag set that\n * `Command.runWith` prepends before user-defined global flags.\n *\n * **Details**\n *\n * The built-ins are `Help`, `Version`, `Completions`, and `LogLevel`.\n * `Command.runWith` prepends these built-ins when collecting and parsing global\n * flags.\n *\n * **Gotchas**\n *\n * Action flags are processed in active flag order and the first present action\n * exits, so this array controls built-in action precedence.\n *\n * @see {@link Help} for the help action flag\n * @see {@link Version} for the version action flag\n * @see {@link Completions} for the shell-completions action flag\n * @see {@link LogLevel} for the built-in log-level setting flag\n *\n * @category references\n * @since 4.0.0\n */\nexport const BuiltIns = [Help, Version, Completions, LogLevel];\n//# sourceMappingURL=GlobalFlag.js.map","/** @internal */\nexport function lex(argv) {\n const endIndex = argv.indexOf(\"--\");\n if (endIndex === -1) {\n // No -- delimiter, lex everything normally\n return {\n tokens: lexTokens(argv),\n trailingOperands: []\n };\n }\n // Split at -- delimiter\n return {\n tokens: lexTokens(argv.slice(0, endIndex)),\n trailingOperands: argv.slice(endIndex + 1)\n };\n}\nconst lexTokens = args => {\n const tokens = [];\n for (const arg of args) {\n if (!arg.startsWith(\"-\")) {\n tokens.push({\n _tag: \"Value\",\n value: arg\n });\n } else if (arg.startsWith(\"--\")) {\n const [name, value] = arg.slice(2).split(\"=\", 2);\n tokens.push({\n _tag: \"LongOption\",\n name,\n raw: arg,\n value\n });\n } else if (arg.length > 1) {\n const flags = arg.slice(1);\n const equalIndex = flags.indexOf(\"=\");\n if (equalIndex !== -1) {\n const flag = flags.slice(0, equalIndex);\n const value = flags.slice(equalIndex + 1);\n tokens.push({\n _tag: \"ShortOption\",\n flag,\n raw: `-${flag}`,\n value\n });\n } else {\n for (const ch of flags) {\n tokens.push({\n _tag: \"ShortOption\",\n flag: ch,\n raw: `-${ch}`\n });\n }\n }\n } else {\n tokens.push({\n _tag: \"Value\",\n value: arg\n });\n }\n }\n return tokens;\n};\n//# sourceMappingURL=lexer.js.map","/**\n * Simple Levenshtein distance implementation (small N, no perf worries)\n */\nconst levenshtein = (a, b) => {\n const m = a.length;\n const n = b.length;\n const dp = Array.from({\n length: m + 1\n }, () => new Array(n + 1).fill(0));\n for (let i = 0; i <= m; i++) dp[i][0] = i;\n for (let j = 0; j <= n; j++) dp[0][j] = j;\n for (let i = 1; i <= m; i++) {\n for (let j = 1; j <= n; j++) {\n const cost = a[i - 1] === b[j - 1] ? 0 : 1;\n dp[i][j] = Math.min(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + cost);\n }\n }\n return dp[m][n];\n};\n/**\n * Return suggestions with minimum distance found, up to distance 2.\n *\n * @internal\n */\nexport const suggest = (input, candidates) => {\n const distances = candidates.map(c => [levenshtein(input, c), c]).filter(([d]) => d <= 2) // Stricter threshold\n .sort(([a], [b]) => a - b);\n if (distances.length === 0) return [];\n // Only return suggestions with the minimum distance found\n const minDistance = distances[0][0];\n return distances.filter(([d]) => d === minDistance).map(([, c]) => c);\n};\n//# sourceMappingURL=auto-suggest.js.map","/**\n * Parsing Pipeline for CLI Commands\n * ==================================\n *\n * The parser transforms raw argv tokens into structured command input through\n * three main phases:\n *\n * 1. **Lexer** (external): Converts argv strings into typed tokens\n * - LongOption: --name or --name=value\n * - ShortOption: -n or -n=value (also handles -abc as three flags)\n * - Value: positional arguments\n *\n * 2. **Built-in Extraction**: Peels off built-in flags (help/version/completions)\n * before command-specific parsing begins.\n *\n * 3. **Command Parsing**: Recursively processes command levels:\n * - Collects flags defined at this level\n * - Detects subcommand from first value token\n * - Forwards remaining tokens to child command\n *\n * Key Behaviors\n * -------------\n * - Inherited parent flags may appear before OR after the subcommand name (npm-style)\n * - Only the first Value token can open a subcommand\n * - Errors accumulate rather than throwing exceptions\n */\nimport * as Effect from \"../../../Effect.js\";\nimport * as Option from \"../../../Option.js\";\nimport * as CliError from \"../CliError.js\";\nimport * as Param from \"../Param.js\";\nimport * as Primitive from \"../Primitive.js\";\nimport { suggest } from \"./auto-suggest.js\";\nimport { toImpl } from \"./command.js\";\n/* ========================================================================== */\n/* Public API */\n/* ========================================================================== */\n/** @internal */\nexport const getCommandPath = parsedInput => Option.match(parsedInput.subcommand, {\n onNone: () => [],\n onSome: subcommand => [subcommand.name, ...getCommandPath(subcommand.parsedInput)]\n});\n/** @internal */\nexport const parseArgs = (lexResult, command, commandPath = []) => Effect.gen(function* () {\n const {\n tokens,\n trailingOperands: afterEndOfOptions\n } = lexResult;\n const newCommandPath = [...commandPath, command.name];\n const commandImpl = toImpl(command);\n const singles = commandImpl.config.flags.flatMap(Param.extractSingleParams);\n const flagParams = singles.filter(Param.isFlagParam);\n const flagRegistry = createFlagRegistry(flagParams);\n const inheritedSingles = commandImpl.contextConfig.flags.flatMap(Param.extractSingleParams);\n const inheritedFlagParams = inheritedSingles.filter(Param.isFlagParam);\n const inheritedFlagRegistry = createFlagRegistry(inheritedFlagParams);\n const inheritedNames = new Set(inheritedFlagParams.map(param => param.name));\n const context = {\n command,\n commandPath: newCommandPath,\n flagRegistry,\n inheritedFlagRegistry,\n localFlagNames: flagParams.filter(param => !inheritedNames.has(param.name)).map(param => param.name)\n };\n const result = scanCommandLevel(tokens, context);\n if (result._tag === \"Leaf\") {\n return {\n flags: result.flags,\n arguments: [...result.arguments, ...afterEndOfOptions],\n subcommand: Option.none(),\n ...(result.errors.length > 0 && {\n errors: result.errors\n })\n };\n }\n const subLex = {\n tokens: result.childTokens,\n trailingOperands: []\n };\n const subParsed = yield* parseArgs(subLex, result.sub, newCommandPath);\n const allErrors = [...result.errors, ...(subParsed.errors ?? [])];\n return {\n flags: result.flags,\n arguments: afterEndOfOptions,\n subcommand: Option.some({\n name: result.sub.name,\n parsedInput: subParsed\n }),\n ...(allErrors.length > 0 && {\n errors: allErrors\n })\n };\n});\nconst makeCursor = tokens => {\n let i = 0;\n return {\n peek: () => tokens[i],\n take: () => tokens[i++],\n rest: () => tokens.slice(i)\n };\n};\n/* ========================================================================== */\n/* Flag Registry */\n/* ========================================================================== */\n/**\n * Creates a registry for O(1) flag lookup by name or alias.\n * @internal\n */\nexport const createFlagRegistry = params => {\n const index = new Map();\n for (const param of params) {\n if (index.has(param.name)) {\n throw new Error(`Duplicate flag name \"${param.name}\" in command definition`);\n }\n index.set(param.name, param);\n for (const alias of param.aliases) {\n if (index.has(alias)) {\n throw new Error(`Duplicate flag/alias \"${alias}\" in command definition (conflicts with \"${index.get(alias).name}\")`);\n }\n index.set(alias, param);\n }\n }\n return {\n params,\n index\n };\n};\nconst buildSubcommandIndex = subcommands => {\n const index = new Map();\n const setKey = (key, command) => {\n const existing = index.get(key);\n if (existing && existing !== command) {\n throw new Error(`Duplicate subcommand name/alias \"${key}\" in command definition (conflicts with \"${existing.name}\")`);\n }\n index.set(key, command);\n };\n for (const group of subcommands) {\n for (const subcommand of group.commands) {\n setKey(subcommand.name, subcommand);\n if (subcommand.alias && subcommand.alias !== subcommand.name) {\n setKey(subcommand.alias, subcommand);\n }\n }\n }\n return index;\n};\n/* ========================================================================== */\n/* Flag Accumulator */\n/* ========================================================================== */\n/** Creates an empty flag map with all known flag names initialized to [].\n * @internal\n */\nexport const createEmptyFlagMap = params => Object.fromEntries(params.map(p => [p.name, []]));\n/**\n * Creates a mutable accumulator for collecting flag values.\n * Pre-initializes empty arrays for all known flags.\n */\nconst createFlagAccumulator = params => {\n const map = createEmptyFlagMap(params);\n return {\n add: (name, raw) => {\n if (raw !== undefined) map[name].push(raw);\n },\n merge: from => {\n for (const key in from) {\n const values = from[key];\n if (values?.length) {\n for (let i = 0; i < values.length; i++) {\n map[key].push(values[i]);\n }\n }\n }\n },\n snapshot: () => map\n };\n};\nconst isFlagToken = t => t._tag === \"LongOption\" || t._tag === \"ShortOption\";\nconst getFlagName = t => t._tag === \"LongOption\" ? t.name : t.flag;\nconst resolveFlag = (token, registry) => {\n const tokenName = getFlagName(token);\n const direct = registry.index.get(tokenName);\n if (direct && direct.name === tokenName) {\n return {\n param: direct,\n negated: false\n };\n }\n if (token._tag === \"LongOption\" && token.name.startsWith(\"no-\")) {\n const canonicalName = token.name.slice(3);\n const param = registry.index.get(canonicalName);\n if (param && param.name === canonicalName && Primitive.isBoolean(param.primitiveType)) {\n return {\n param,\n negated: true\n };\n }\n }\n if (direct) {\n return {\n param: direct,\n negated: false\n };\n }\n return undefined;\n};\nconst invalidNegatedFlagValue = (token, spec, value) => new CliError.InvalidValue({\n option: spec.name,\n value,\n expected: `omit the value and use ${token.raw} by itself to set --${spec.name} to false`,\n kind: \"flag\"\n});\n/**\n * Checks whether a token is a boolean literal value.\n * Recognizes: true/false, yes/no, on/off, 1/0\n */\nconst asBooleanLiteral = token => token?._tag === \"Value\" && (Primitive.isTrueValue(token.value) || Primitive.isFalseValue(token.value)) ? token.value : undefined;\n/* ========================================================================== */\n/* Flag Value Consumption */\n/* ========================================================================== */\n/**\n * Reads a flag's value from the token stream.\n *\n * Value resolution order:\n * 1. Inline value: --flag=value or -f=value\n * 2. Boolean special case: implicit \"true\" or explicit boolean literal\n * 3. Next token: consume following Value token if present\n */\nconst consumeFlagValue = (cursor, token, spec, negated = false) => {\n const consumed = consumeFlagValueWithTokens(cursor, token, spec, negated);\n switch (consumed._tag) {\n case \"Value\":\n return {\n _tag: \"Value\",\n value: consumed.value\n };\n case \"Error\":\n return {\n _tag: \"Error\",\n error: consumed.error\n };\n }\n};\nconst consumeFlagValueWithTokens = (cursor, token, spec, negated = false) => {\n // Inline value has highest priority\n if (negated) {\n if (token.value !== undefined) {\n return {\n _tag: \"Error\",\n error: invalidNegatedFlagValue(token, spec, token.value),\n tokens: []\n };\n }\n const literal = asBooleanLiteral(cursor.peek());\n if (literal !== undefined) {\n const literalToken = cursor.take();\n return {\n _tag: \"Error\",\n error: invalidNegatedFlagValue(token, spec, literal),\n tokens: literalToken === undefined ? [] : [literalToken]\n };\n }\n return {\n _tag: \"Value\",\n value: \"false\",\n tokens: []\n };\n }\n if (token.value !== undefined) {\n return {\n _tag: \"Value\",\n value: token.value,\n tokens: []\n };\n }\n // Boolean flags: check for explicit literal or default to \"true\"\n if (Primitive.isBoolean(spec.primitiveType)) {\n const literal = asBooleanLiteral(cursor.peek());\n const literalToken = literal !== undefined ? cursor.take() : undefined;\n return {\n _tag: \"Value\",\n value: literal ?? \"true\",\n tokens: literalToken === undefined ? [] : [literalToken]\n };\n }\n // Non-boolean: try to consume next Value token\n const next = cursor.peek();\n if (next?._tag === \"Value\") {\n const valueToken = cursor.take();\n return {\n _tag: \"Value\",\n value: next.value,\n tokens: valueToken === undefined ? [] : [valueToken]\n };\n }\n return {\n _tag: \"Value\",\n value: undefined,\n tokens: []\n };\n};\n/**\n * Consumes known flags from a token stream.\n * Unrecognized tokens are passed through to remainder.\n * Used for both global flag extraction and npm-style parent flag collection.\n * @internal\n */\nexport const consumeKnownFlags = (tokens, registry) => {\n const flagMap = createEmptyFlagMap(registry.params);\n const remainder = [];\n const errors = [];\n const cursor = makeCursor(tokens);\n for (let t = cursor.take(); t; t = cursor.take()) {\n if (!isFlagToken(t)) {\n remainder.push(t);\n continue;\n }\n const resolved = resolveFlag(t, registry);\n if (!resolved) {\n remainder.push(t);\n continue;\n }\n const consumed = consumeFlagValue(cursor, t, resolved.param, resolved.negated);\n if (consumed._tag === \"Error\") {\n errors.push(consumed.error);\n continue;\n }\n if (consumed.value !== undefined) {\n flagMap[resolved.param.name].push(consumed.value);\n }\n }\n return {\n flagMap,\n remainder,\n errors\n };\n};\nconst extractFlagParams = command => {\n const commandImpl = toImpl(command);\n const singles = commandImpl.config.flags.flatMap(Param.extractSingleParams);\n return singles.filter(Param.isFlagParam);\n};\nconst extractContextFlagParams = command => {\n const commandImpl = toImpl(command);\n const singles = commandImpl.contextConfig.flags.flatMap(Param.extractSingleParams);\n return singles.filter(Param.isFlagParam);\n};\nconst resolveFromRegistries = (token, registries) => {\n for (const registry of registries) {\n const resolved = resolveFlag(token, registry);\n if (resolved !== undefined) {\n return resolved;\n }\n }\n return undefined;\n};\nconst preserveFlag = (remainder, cursor, token, resolved) => {\n remainder.push(token);\n const consumed = consumeFlagValueWithTokens(cursor, token, resolved.param, resolved.negated);\n remainder.push(...consumed.tokens);\n};\nconst localFlagWouldPrecedeSubcommand = (token, remainingTokens, resolved, subIndex, registries) => {\n const cursor = makeCursor(remainingTokens);\n consumeFlagValueWithTokens(cursor, token, resolved.param, resolved.negated);\n for (let token = cursor.take(); token; token = cursor.take()) {\n if (isFlagToken(token)) {\n const known = resolveFromRegistries(token, registries);\n if (known !== undefined) {\n consumeFlagValueWithTokens(cursor, token, known.param, known.negated);\n }\n continue;\n }\n if (token._tag === \"Value\") {\n return subIndex.has(token.value);\n }\n }\n return false;\n};\n/**\n * Consumes global flags while walking the command tree.\n *\n * Command-local flags take precedence over global flags at the selected command\n * level. This lets commands reuse a global flag name, for example a subcommand\n * with its own `--version <value>` flag overriding the built-in global\n * `--version` action.\n * @internal\n */\nexport const consumeGlobalFlags = (tokens, command, registry) => {\n const flagMap = createEmptyFlagMap(registry.params);\n const errors = [];\n const consumeLevel = (tokens, command, ignoredRegistries) => {\n const localRegistry = createFlagRegistry(extractFlagParams(command));\n const inheritedRegistry = createFlagRegistry(extractContextFlagParams(command));\n const subIndex = buildSubcommandIndex(command.subcommands);\n const cursor = makeCursor(tokens);\n const remainder = [];\n let awaitingFirstValue = true;\n for (let token = cursor.take(); token; token = cursor.take()) {\n if (isFlagToken(token)) {\n const ignored = resolveFromRegistries(token, ignoredRegistries);\n if (ignored !== undefined) {\n preserveFlag(remainder, cursor, token, ignored);\n continue;\n }\n const inherited = resolveFlag(token, inheritedRegistry);\n if (inherited !== undefined) {\n preserveFlag(remainder, cursor, token, inherited);\n continue;\n }\n const local = resolveFlag(token, localRegistry);\n const global = resolveFlag(token, registry);\n if (local !== undefined) {\n if (global === undefined || !awaitingFirstValue || !localFlagWouldPrecedeSubcommand(token, cursor.rest(), local, subIndex, [localRegistry, inheritedRegistry, registry])) {\n preserveFlag(remainder, cursor, token, local);\n continue;\n }\n }\n if (global !== undefined) {\n const consumed = consumeFlagValueWithTokens(cursor, token, global.param, global.negated);\n if (consumed._tag === \"Error\") {\n errors.push(consumed.error);\n continue;\n }\n if (consumed.value !== undefined) {\n flagMap[global.param.name].push(consumed.value);\n }\n continue;\n }\n remainder.push(token);\n continue;\n }\n if (token._tag === \"Value\" && awaitingFirstValue) {\n const sub = subIndex.get(token.value);\n if (sub !== undefined) {\n remainder.push(token);\n remainder.push(...consumeLevel(cursor.rest(), sub, [...ignoredRegistries, inheritedRegistry]));\n return remainder;\n }\n awaitingFirstValue = false;\n }\n remainder.push(token);\n }\n return remainder;\n };\n return {\n flagMap,\n remainder: consumeLevel(tokens, command, []),\n errors\n };\n};\n/* ========================================================================== */\n/* Error Creation */\n/* ========================================================================== */\nconst createUnrecognizedFlagError = (token, params, commandPath) => {\n const printable = token._tag === \"LongOption\" ? `--${token.name}` : `-${token.flag}`;\n const validNames = [];\n for (const p of params) {\n // Exclude hidden flags so a near-miss typo cannot reveal a flag name\n // that was intentionally kept out of --help.\n if (p.hidden) continue;\n validNames.push(p.name);\n if (Primitive.isBoolean(p.primitiveType)) {\n validNames.push(`no-${p.name}`);\n }\n for (const alias of p.aliases) {\n validNames.push(alias);\n }\n }\n const suggestions = suggest(getFlagName(token), validNames).map(n => n.length === 1 ? `-${n}` : `--${n}`);\n return new CliError.UnrecognizedOption({\n option: printable,\n suggestions,\n command: commandPath\n });\n};\n/* ========================================================================== */\n/* Parse State */\n/* ========================================================================== */\nconst createParseState = registry => ({\n flags: createFlagAccumulator(registry.params),\n arguments: [],\n errors: [],\n mode: {\n _tag: \"AwaitingFirstValue\"\n }\n});\nconst toLeafResult = state => ({\n _tag: \"Leaf\",\n flags: state.flags.snapshot(),\n arguments: state.arguments,\n errors: state.errors\n});\n/* ========================================================================== */\n/* First Value Resolution */\n/* ========================================================================== */\n/**\n * Determines how to handle the first value token.\n *\n * If it matches a known subcommand:\n * - Collect inherited parent flags from remaining tokens (npm-style)\n * - Return SubcommandResult with child tokens\n *\n * Otherwise:\n * - Return Argument to treat it as a positional argument\n * - Report error if command expects subcommand but got unknown value\n */\nconst resolveFirstValue = (value, cursor, context, state) => {\n const {\n command,\n commandPath,\n inheritedFlagRegistry,\n localFlagNames\n } = context;\n const subIndex = buildSubcommandIndex(command.subcommands);\n const sub = subIndex.get(value);\n if (sub) {\n const selectedPath = [...commandPath, sub.name];\n // Local flags are not inherited by subcommands.\n const parentFlags = state.flags.snapshot();\n for (const localFlagName of localFlagNames) {\n const values = parentFlags[localFlagName];\n if (values !== undefined && values.length > 0) {\n state.errors.push(new CliError.UnrecognizedOption({\n option: `--${localFlagName}`,\n suggestions: [],\n command: selectedPath\n }));\n }\n }\n // npm-style: inherited parent flags can appear after subcommand name\n const tail = consumeKnownFlags(cursor.rest(), inheritedFlagRegistry);\n state.flags.merge(tail.flagMap);\n state.errors.push(...tail.errors);\n return {\n _tag: \"Subcommand\",\n result: {\n _tag: \"Sub\",\n flags: state.flags.snapshot(),\n sub,\n childTokens: tail.remainder,\n errors: state.errors\n }\n };\n }\n // Not a subcommand. Check if this looks like a typo.\n const expectsArgs = toImpl(command).config.arguments.length > 0;\n if (!expectsArgs && subIndex.size > 0) {\n // Exclude hidden subcommands so a typo cannot reveal a subcommand name\n // that was intentionally kept out of --help. Hidden commands still\n // resolve via subIndex when invoked by exact name.\n const visibleKeys = [];\n for (const [key, sub] of subIndex) {\n if (!sub.hidden) visibleKeys.push(key);\n }\n const suggestions = suggest(value, visibleKeys);\n state.errors.push(new CliError.UnknownSubcommand({\n subcommand: value,\n parent: commandPath,\n suggestions\n }));\n }\n return {\n _tag: \"Argument\"\n };\n};\n/* ========================================================================== */\n/* Token Processing */\n/* ========================================================================== */\n/**\n * Processes a flag token: looks up in registry, consumes value, records it.\n * Reports unrecognized flags as errors.\n */\nconst processFlag = (token, cursor, context, state) => {\n const {\n commandPath,\n flagRegistry\n } = context;\n const resolved = resolveFlag(token, flagRegistry);\n if (!resolved) {\n state.errors.push(createUnrecognizedFlagError(token, flagRegistry.params, commandPath));\n return;\n }\n const consumed = consumeFlagValue(cursor, token, resolved.param, resolved.negated);\n if (consumed._tag === \"Error\") {\n state.errors.push(consumed.error);\n return;\n }\n state.flags.add(resolved.param.name, consumed.value);\n};\n/**\n * Processes a value token based on current parsing mode.\n *\n * In AwaitingFirstValue mode:\n * - Check if value is a subcommand\n * - If so, return SubcommandResult to exit scanning\n * - If not, switch to CollectingArguments mode\n *\n * In CollectingArguments mode:\n * - Simply add value to arguments list\n */\nconst processValue = (value, cursor, context, state) => {\n if (state.mode._tag === \"AwaitingFirstValue\") {\n const result = resolveFirstValue(value, cursor, context, state);\n if (result._tag === \"Subcommand\") {\n return result.result;\n }\n state.mode = {\n _tag: \"CollectingArguments\"\n };\n }\n state.arguments.push(value);\n return undefined;\n};\n/* ========================================================================== */\n/* Command Level Scanning */\n/* ========================================================================== */\n/**\n * Scans a single command level, processing all tokens.\n *\n * For each token:\n * - Flags: Look up, consume value, record in accumulator\n * - Values: Check for subcommand (first value only), then collect as arguments\n *\n * Returns LeafResult if no subcommand detected, SubcommandResult otherwise.\n */\nconst scanCommandLevel = (tokens, context) => {\n const cursor = makeCursor(tokens);\n const state = createParseState(context.flagRegistry);\n for (let token = cursor.take(); token; token = cursor.take()) {\n if (isFlagToken(token)) {\n processFlag(token, cursor, context, state);\n continue;\n }\n if (token._tag === \"Value\") {\n const subResult = processValue(token.value, cursor, context, state);\n if (subResult) return subResult;\n }\n }\n return toLeafResult(state);\n};\n//# sourceMappingURL=parser.js.map","import * as Console from \"../../Console.js\";\nimport * as Context from \"../../Context.js\";\nimport * as Effect from \"../../Effect.js\";\nimport { dual } from \"../../Function.js\";\nimport * as Option from \"../../Option.js\";\nimport * as Predicate from \"../../Predicate.js\";\nimport * as References from \"../../References.js\";\nimport * as Result from \"../../Result.js\";\nimport * as Stdio from \"../../Stdio.js\";\nimport * as Terminal from \"../../Terminal.js\";\nimport * as CliError from \"./CliError.js\";\nimport * as CliOutput from \"./CliOutput.js\";\nimport * as GlobalFlag from \"./GlobalFlag.js\";\nimport { checkForDuplicateFlags, makeCommand, makeParser, toImpl, TypeId } from \"./internal/command.js\";\nimport { mergeConfig, parseConfig } from \"./internal/config.js\";\nimport { getGlobalFlagsForCommandPath, getGlobalFlagsForCommandTree, getHelpForCommandPath } from \"./internal/help.js\";\nimport * as Lexer from \"./internal/lexer.js\";\nimport * as Parser from \"./internal/parser.js\";\nimport * as Param from \"./Param.js\";\n/**\n * Returns `true` if the provided value is a `Command`.\n *\n * **Gotchas**\n *\n * This checks for the `Command` type-id property; it does not validate the full\n * command shape.\n *\n * @category guards\n * @since 4.0.0\n */\nexport const isCommand = u => Predicate.hasProperty(u, TypeId);\n/* ========================================================================== */\n/* Constructors */\n/* ========================================================================== */\n/**\n * Creates a `Command` from a name, an optional configuration, and an optional\n * handler.\n *\n * **Details**\n *\n * Use `withDescription` and related metadata combinators to add help text. The\n * overloads support simple commands, configured commands, and commands with\n * effectful handlers.\n *\n * **Example** (Creating commands)\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n * import { Argument, Command, Flag } from \"effect/unstable/cli\"\n *\n * // Simple command with no configuration\n * const version = Command.make(\"version\")\n *\n * // Command with simple flags\n * const greet = Command.make(\"greet\", {\n * name: Flag.string(\"name\"),\n * count: Flag.integer(\"count\").pipe(Flag.withDefault(1))\n * })\n *\n * // Command with nested configuration\n * const deploy = Command.make(\"deploy\", {\n * environment: Flag.string(\"env\").pipe(\n * Flag.withDescription(\"Target environment\")\n * ),\n * server: {\n * host: Flag.string(\"host\").pipe(Flag.withDefault(\"localhost\")),\n * port: Flag.integer(\"port\").pipe(Flag.withDefault(3000))\n * },\n * files: Argument.string(\"files\").pipe(Argument.variadic),\n * force: Flag.boolean(\"force\").pipe(Flag.withDescription(\"Force deployment\"))\n * })\n *\n * // Command with handler\n * const deployWithHandler = Command.make(\"deploy\", {\n * environment: Flag.string(\"env\"),\n * force: Flag.boolean(\"force\")\n * }, (config) =>\n * Effect.gen(function*() {\n * yield* Console.log(`Starting deployment to ${config.environment}`)\n *\n * if (!config.force && config.environment === \"production\") {\n * return yield* Effect.fail(\"Production deployments require --force flag\")\n * }\n *\n * yield* Console.log(\"Deployment completed successfully\")\n * }))\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const make = (name, config, handler) => {\n const parsedConfig = parseConfig(config ?? {});\n return makeCommand({\n name,\n config: parsedConfig,\n ...(Predicate.isNotUndefined(handler) ? {\n handle: handler\n } : {})\n });\n};\n/* ========================================================================== */\n/* Combinators */\n/* ========================================================================== */\n/**\n * Adds or replaces the handler for a command.\n *\n * **Example** (Adding command handlers)\n *\n * ```ts\n * import { Console } from \"effect\"\n * import { Command, Flag } from \"effect/unstable/cli\"\n *\n * // Command without initial handler\n * const greet = Command.make(\"greet\", {\n * name: Flag.string(\"name\")\n * })\n *\n * // Add handler later\n * const greetWithHandler = greet.pipe(\n * Command.withHandler((config: { readonly name: string }) =>\n * Console.log(`Hello, ${config.name}!`)\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withHandler = /*#__PURE__*/dual(2, (self, handler) => makeCommand({\n ...toImpl(self),\n handle: handler\n}));\nconst normalizeSubcommandEntries = entries => {\n const flat = [];\n const grouped = new Map();\n const addToGroup = (group, command) => {\n flat.push(command);\n const existing = grouped.get(group);\n if (existing) {\n existing.push(command);\n } else {\n grouped.set(group, [command]);\n }\n };\n for (const entry of entries) {\n if (isCommand(entry)) {\n addToGroup(undefined, entry);\n continue;\n }\n for (const command of entry.commands) {\n addToGroup(entry.group, command);\n }\n }\n const groups = [];\n const ungroupedCommands = grouped.get(undefined);\n if (ungroupedCommands && ungroupedCommands.length > 0) {\n groups.push({\n group: undefined,\n commands: ungroupedCommands\n });\n }\n for (const [group, commands] of grouped) {\n if (group === undefined) {\n continue;\n }\n groups.push({\n group,\n commands\n });\n }\n return {\n flat,\n groups\n };\n};\n/**\n * Adds subcommands to a command, creating a hierarchical command structure.\n *\n * **Details**\n *\n * Subcommands can access their parent's parsed configuration by yielding the parent\n * command within their handler. This enables shared parent flags that affect\n * all subcommands.\n *\n * **Example** (Adding subcommands)\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n * import { Command, Flag } from \"effect/unstable/cli\"\n *\n * // Parent command with shared flags\n * const git = Command.make(\"git\").pipe(\n * Command.withSharedFlags({\n * verbose: Flag.boolean(\"verbose\")\n * })\n * )\n *\n * // Subcommand that accesses parent config\n * const clone = Command.make(\"clone\", {\n * repository: Flag.string(\"repo\")\n * }, (config) =>\n * Effect.gen(function*() {\n * const parent = yield* git // Access parent's parsed config\n * if (parent.verbose) {\n * yield* Console.log(\"Verbose mode enabled\")\n * }\n * yield* Console.log(`Cloning ${config.repository}`)\n * }))\n *\n * const app = git.pipe(Command.withSubcommands([clone]))\n * // Usage: git --verbose clone --repo github.com/foo/bar\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withSubcommands = /*#__PURE__*/dual(2, (self, subcommands) => {\n const normalized = normalizeSubcommandEntries(subcommands);\n checkForDuplicateFlags(self, normalized.flat);\n const impl = toImpl(self);\n const byName = new Map(normalized.flat.map(s => [s.name, toImpl(s)]));\n const SubcommandStateSymbol = Symbol(\"effect/cli/SubcommandState\");\n const parse = Effect.fnUntraced(function* (raw) {\n if (Option.isNone(raw.subcommand)) {\n return yield* impl.parse(raw);\n }\n const sub = byName.get(raw.subcommand.value.name);\n if (!sub) {\n return yield* impl.parse(raw);\n }\n const context = yield* impl.parseContext(raw);\n const result = yield* sub.parse(raw.subcommand.value.parsedInput);\n return Object.assign({}, context, {\n [SubcommandStateSymbol]: {\n name: sub.name,\n result\n }\n });\n });\n const handle = Effect.fnUntraced(function* (input, path) {\n const internal = input;\n const selectedSubcommand = internal[SubcommandStateSymbol];\n if (selectedSubcommand) {\n const child = byName.get(selectedSubcommand.name);\n if (!child) {\n return yield* new CliError.ShowHelp({\n commandPath: path,\n errors: []\n });\n }\n return yield* child.handle(selectedSubcommand.result, [...path, child.name]).pipe(Effect.provideService(impl.service, input));\n }\n return yield* impl.handle(input, path);\n });\n return makeCommand({\n name: impl.name,\n config: impl.config,\n contextConfig: impl.contextConfig,\n description: impl.description,\n shortDescription: impl.shortDescription,\n alias: impl.alias,\n annotations: impl.annotations,\n globalFlags: impl.globalFlags,\n examples: impl.examples,\n service: impl.service,\n subcommands: normalized.groups,\n parse,\n parseContext: impl.parseContext,\n handle\n });\n});\n/**\n * Adds flags that are inherited by subcommands.\n *\n * **Details**\n *\n * Shared flags are available to this command's handler and to descendant\n * handlers via `yield* parentCommand`. Shared flags are accepted both before\n * and after a selected subcommand name (npm-style).\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withSharedFlags = /*#__PURE__*/dual(2, (self, sharedFlags) => {\n const impl = toImpl(self);\n const sharedConfig = parseConfig(sharedFlags);\n const mergedConfig = mergeConfig(impl.config, sharedConfig);\n const mergedContextConfig = mergeConfig(impl.contextConfig, sharedConfig);\n if (impl.subcommands.length > 0) {\n const flatSubcommands = impl.subcommands.flatMap(group => group.commands);\n checkForDuplicateFlags(self, flatSubcommands, {\n contextConfig: mergedContextConfig\n });\n }\n const parseShared = makeParser(sharedConfig);\n const parse = Effect.fnUntraced(function* (raw) {\n const base = yield* impl.parse(raw);\n const shared = yield* parseShared(raw);\n return Object.assign({}, base, shared);\n });\n const parseContext = Effect.fnUntraced(function* (raw) {\n const base = yield* impl.parseContext(raw);\n const shared = yield* parseShared(raw);\n return Object.assign({}, base, shared);\n });\n const handle = (input, commandPath) => impl.handle(input, commandPath);\n return makeCommand({\n name: impl.name,\n config: mergedConfig,\n contextConfig: mergedContextConfig,\n description: impl.description,\n shortDescription: impl.shortDescription,\n alias: impl.alias,\n annotations: impl.annotations,\n globalFlags: impl.globalFlags,\n examples: impl.examples,\n service: impl.service,\n subcommands: impl.subcommands,\n parse,\n parseContext,\n handle\n });\n});\n/**\n * Adds global flags to a command scope.\n *\n * **Details**\n *\n * Declared global flags apply to the command and all of its descendants.\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withGlobalFlags = /*#__PURE__*/dual(2, (self, globalFlags) => {\n const impl = toImpl(self);\n const next = Array.from(new Set([...impl.globalFlags, ...globalFlags]));\n return makeCommand({\n ...impl,\n globalFlags: next\n });\n});\n/**\n * Sets the description for a command.\n *\n * **Details**\n *\n * Descriptions provide users with information about what the command does\n * when they view help documentation.\n *\n * **Example** (Setting descriptions)\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n * import { Command, Flag } from \"effect/unstable/cli\"\n *\n * const deploy = Command.make(\"deploy\", {\n * environment: Flag.string(\"env\")\n * }, (config) =>\n * Effect.gen(function*() {\n * yield* Console.log(`Deploying to ${config.environment}`)\n * })).pipe(\n * Command.withDescription(\"Deploy the application to a specified environment\")\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withDescription = /*#__PURE__*/dual(2, (self, description) => makeCommand({\n ...toImpl(self),\n description\n}));\n/**\n * Sets a short description for a command.\n *\n * **Details**\n *\n * Short descriptions are used when listing subcommands in help output and\n * shell completions. If no short description is provided, the full\n * `description` is used as a fallback.\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withShortDescription = /*#__PURE__*/dual(2, (self, shortDescription) => makeCommand({\n ...toImpl(self),\n shortDescription\n}));\n/**\n * Sets an alias for a command.\n *\n * **Details**\n *\n * Aliases are accepted as alternate subcommand names during parsing and are\n * shown in help output as `name, alias`.\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withAlias = /*#__PURE__*/dual(2, (self, alias) => makeCommand({\n ...toImpl(self),\n alias\n}));\n/**\n * Hides a subcommand from parent help output, shell completions, and\n * \"did you mean?\" suggestions while keeping it fully invocable by exact name.\n *\n * **When to use**\n *\n * Use when experimental or internal subcommands should be accepted but not advertised on\n * the public CLI surface.\n *\n * **Example** (Hiding a subcommand)\n *\n * ```ts\n * import { Command } from \"effect/unstable/cli\"\n *\n * // `experimental` still runs when invoked as `mycli experimental`,\n * // but it does not appear under SUBCOMMANDS in `mycli --help`.\n * const experimental = Command.make(\"experimental\").pipe(\n * Command.withHidden\n * )\n *\n * const root = Command.make(\"mycli\").pipe(\n * Command.withSubcommands([experimental])\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withHidden = self => makeCommand({\n ...toImpl(self),\n hidden: true\n});\n/**\n * Adds a custom annotation to a command.\n *\n * **When to use**\n *\n * Use to attach one command-scoped metadata value under a `Context.Key`,\n * especially for consumers such as custom help formatters.\n *\n * **Details**\n *\n * Annotations are stored on the command's annotation context and flow into\n * generated help document annotations.\n *\n * **Gotchas**\n *\n * Adding the same `Context.Key` again replaces the earlier value.\n *\n * @see {@link annotateMerge} for merging an existing annotation context\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const annotate = /*#__PURE__*/dual(3, (self, service, value) => {\n const impl = toImpl(self);\n return makeCommand({\n ...impl,\n annotations: Context.add(impl.annotations, service, value)\n });\n});\n/**\n * Merges a Context of annotations into a command.\n *\n * **When to use**\n *\n * Use when you need to attach an already-built `Context.Context` of command\n * annotations.\n *\n * **Details**\n *\n * Merged annotations are stored on the command and exposed through generated\n * help document annotations.\n *\n * **Gotchas**\n *\n * If both contexts contain the same `Context.Key`, the incoming annotations\n * context wins.\n *\n * @see {@link annotate} for adding a single annotation without constructing a `Context`\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const annotateMerge = /*#__PURE__*/dual(2, (self, annotations) => {\n const impl = toImpl(self);\n return makeCommand({\n ...impl,\n annotations: Context.merge(impl.annotations, annotations)\n });\n});\n/**\n * Sets usage examples for a command.\n *\n * **Details**\n *\n * Examples are exposed in structured `HelpDoc` data and rendered by the\n * default formatter in an `EXAMPLES` section.\n *\n * **Example** (Adding usage examples)\n *\n * ```ts\n * import { Command } from \"effect/unstable/cli\"\n *\n * const login = Command.make(\"login\").pipe(\n * Command.withExamples([\n * { command: \"myapp login\", description: \"Log in with browser OAuth\" },\n * { command: \"myapp login --token sbp_abc123\", description: \"Log in with a token\" }\n * ])\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withExamples = /*#__PURE__*/dual(2, (self, examples) => makeCommand({\n ...toImpl(self),\n examples\n}));\n/* ========================================================================== */\n/* Providing Services */\n/* ========================================================================== */\n// Internal helper: transforms a command's handler while preserving other properties\nconst mapHandler = (self, f) => {\n const impl = toImpl(self);\n return makeCommand({\n ...impl,\n handle: (input, path) => f(impl.handle(input, path), input)\n });\n};\n/**\n * Provides the handler of a command with the services produced by a layer\n * that optionally depends on the command-line input to be created.\n *\n * **Example** (Providing command services)\n *\n * ```ts\n * import { Effect, FileSystem, PlatformError } from \"effect\"\n * import { Command, Flag } from \"effect/unstable/cli\"\n *\n * const deploy = Command.make(\"deploy\", {\n * env: Flag.string(\"env\")\n * }, (config) =>\n * Effect.gen(function*() {\n * const fs = yield* FileSystem.FileSystem\n * // Use fs...\n * })).pipe(\n * // Provide FileSystem based on the --env flag\n * Command.provide((config) =>\n * config.env === \"local\"\n * ? FileSystem.layerNoop({})\n * : FileSystem.layerNoop({\n * access: () =>\n * Effect.fail(\n * PlatformError.badArgument({\n * module: \"FileSystem\",\n * method: \"access\"\n * })\n * )\n * })\n * )\n * )\n * ```\n *\n * @category providing services\n * @since 4.0.0\n */\nexport const provide = /*#__PURE__*/dual(args => isCommand(args[0]), (self, layer, options) => mapHandler(self, (handler, input) => Effect.provide(handler, typeof layer === \"function\" ? layer(input) : layer, options)));\n/**\n * Provides the handler of a command with the implementation of a service that\n * optionally depends on the command-line input to be constructed.\n *\n * **When to use**\n *\n * Use when a command handler needs a pure service implementation, optionally\n * derived from the parsed command input.\n *\n * @category providing services\n * @since 4.0.0\n */\nexport const provideSync = /*#__PURE__*/dual(3, (self, service, implementation) => mapHandler(self, (handler, input) => Effect.provideService(handler, service, typeof implementation === \"function\" ? implementation(input) : implementation)));\n/**\n * Provides the handler of a command with the service produced by an effect\n * that optionally depends on the command-line input to be created.\n *\n * **When to use**\n *\n * Use to acquire a service effectfully for each command run, optionally using\n * parsed command input.\n *\n * @see {@link provideSync} for synchronous service acquisition\n * @see {@link provide} for providing an already-available service\n * @see {@link provideEffectDiscard} for running an effect before the handler without providing a service\n *\n * @category providing services\n * @since 4.0.0\n */\nexport const provideEffect = /*#__PURE__*/dual(3, (self, service, effect) => mapHandler(self, (handler, input) => Effect.provideServiceEffect(handler, service, typeof effect === \"function\" ? effect(input) : effect)));\n/**\n * Allows for execution of an effect, which optionally depends on command-line\n * input to be created, prior to executing the handler of a command.\n *\n * @category providing services\n * @since 4.0.0\n */\nexport const provideEffectDiscard = /*#__PURE__*/dual(2, (self, effect) => mapHandler(self, (handler, input) => Effect.andThen(typeof effect === \"function\" ? effect(input) : effect, handler)));\n/* ========================================================================== */\n/* Execution */\n/* ========================================================================== */\nconst getOutOfScopeGlobalFlagErrors = (allFlags, activeFlags, flagMap, commandPath) => {\n const activeSet = new Set(activeFlags);\n const errors = [];\n const seen = new Set();\n for (const flag of allFlags) {\n if (activeSet.has(flag)) {\n continue;\n }\n const singles = Param.extractSingleParams(flag.flag);\n for (const single of singles) {\n const entries = flagMap[single.name];\n if (!entries || entries.length === 0) {\n continue;\n }\n const option = `--${single.name}`;\n if (seen.has(option)) {\n continue;\n }\n seen.add(option);\n errors.push(new CliError.UnrecognizedOption({\n option,\n suggestions: [],\n command: commandPath\n }));\n }\n }\n return errors;\n};\nconst showHelp = (command, error) => Effect.gen(function* () {\n const formatter = yield* CliOutput.Formatter;\n const helpDoc = yield* getHelpForCommandPath(command, error.commandPath, GlobalFlag.BuiltIns);\n yield* Console.log(formatter.formatHelpDoc(helpDoc));\n if (error.errors.length > 0) {\n yield* Console.error(formatter.formatErrors(error.errors));\n }\n});\n/**\n * Runs a command using the arguments supplied by the `Stdio` service.\n *\n * **When to use**\n *\n * Use when command-line arguments should come from `Stdio` at the application\n * entry point.\n *\n * **Example** (Running commands with standard input)\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n * import { Command, Flag } from \"effect/unstable/cli\"\n *\n * const greetCommand = Command.make(\"greet\", {\n * name: Flag.string(\"name\")\n * }, (config) =>\n * Effect.gen(function*() {\n * yield* Console.log(`Hello, ${config.name}!`)\n * }))\n *\n * // Automatically gets args from the Stdio service\n * const program = Command.run(greetCommand, {\n * version: \"1.0.0\"\n * })\n * ```\n *\n * @see {@link runWith} for running a command with an explicit argument array\n *\n * @category command execution\n * @since 4.0.0\n */\nexport const run = /*#__PURE__*/dual(2, (command, config) => Stdio.Stdio.use(({\n args\n}) => Effect.flatMap(args, args => runWith(command, config)(args))));\n/**\n * Runs a command with explicitly provided arguments instead of using arguments from `Stdio`.\n *\n * **When to use**\n *\n * Use when you need to test CLI applications or programmatically execute\n * commands with specific arguments.\n *\n * **Example** (Running commands with explicit arguments)\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n * import { Command, Flag } from \"effect/unstable/cli\"\n *\n * const greet = Command.make(\"greet\", {\n * name: Flag.string(\"name\"),\n * count: Flag.integer(\"count\").pipe(Flag.withDefault(1))\n * }, (config) =>\n * Effect.gen(function*() {\n * for (let i = 0; i < config.count; i++) {\n * yield* Console.log(`Hello, ${config.name}!`)\n * }\n * }))\n *\n * // Test with specific arguments\n * const testProgram = Effect.gen(function*() {\n * const runCommand = Command.runWith(greet, { version: \"1.0.0\" })\n *\n * // Test normal execution\n * yield* runCommand([\"--name\", \"Alice\", \"--count\", \"2\"])\n *\n * // Test help display\n * yield* runCommand([\"--help\"])\n *\n * // Test version display\n * yield* runCommand([\"--version\"])\n * })\n * ```\n *\n * @category command execution\n * @since 4.0.0\n */\nexport const runWith = (command, config) => {\n const commandImpl = toImpl(command);\n return Effect.fnUntraced(function* (args) {\n const {\n tokens,\n trailingOperands\n } = Lexer.lex(args);\n // 1. Collect known global flags from the command tree\n const allFlags = getGlobalFlagsForCommandTree(command, GlobalFlag.BuiltIns);\n // 2. Extract global flag tokens\n const allFlagParams = allFlags.flatMap(f => Param.extractSingleParams(f.flag));\n const globalRegistry = Parser.createFlagRegistry(allFlagParams.filter(Param.isFlagParam));\n const {\n flagMap,\n remainder,\n errors: globalFlagErrors\n } = Parser.consumeGlobalFlags(tokens, command, globalRegistry);\n const emptyArgs = {\n flags: flagMap,\n arguments: []\n };\n // 3. Parse command arguments from remaining tokens\n const parsedArgs = yield* Parser.parseArgs({\n tokens: remainder,\n trailingOperands\n }, command);\n const commandPath = [command.name, ...Parser.getCommandPath(parsedArgs)];\n const handlerCtx = {\n command,\n commandPath,\n version: config.version\n };\n const activeFlags = getGlobalFlagsForCommandPath(command, commandPath, GlobalFlag.BuiltIns);\n // 4. Reject globals that were passed outside the active command scope\n const outOfScopeErrors = getOutOfScopeGlobalFlagErrors(allFlags, activeFlags, flagMap, commandPath);\n if (outOfScopeErrors.length > 0 || globalFlagErrors.length > 0) {\n const parseErrors = parsedArgs.errors ?? [];\n return yield* new CliError.ShowHelp({\n commandPath,\n errors: [...globalFlagErrors, ...outOfScopeErrors, ...parseErrors]\n });\n }\n // 5. Process action flags — first present action wins, then exit\n for (const flag of activeFlags) {\n if (flag._tag !== \"Action\") continue;\n const singles = Param.extractSingleParams(flag.flag);\n const hasEntry = singles.some(s => {\n const entries = flagMap[s.name];\n return entries !== undefined && entries.length > 0;\n });\n if (!hasEntry) continue;\n const [, value] = yield* flag.flag.parse(emptyArgs);\n yield* flag.run(value, handlerCtx);\n return;\n }\n // 6. Handle parsing errors\n if (parsedArgs.errors && parsedArgs.errors.length > 0) {\n return yield* new CliError.ShowHelp({\n commandPath,\n errors: parsedArgs.errors\n });\n }\n const parseResult = yield* Effect.result(commandImpl.parse(parsedArgs));\n if (parseResult._tag === \"Failure\") {\n return yield* new CliError.ShowHelp({\n commandPath,\n errors: [parseResult.failure]\n });\n }\n // 7. Provide setting values\n let program = commandImpl.handle(parseResult.success, [command.name]);\n for (const flag of activeFlags) {\n if (flag._tag !== \"Setting\") continue;\n const [, value] = yield* flag.flag.parse(emptyArgs);\n program = Effect.provideService(program, flag, value);\n }\n const [, logLevel] = yield* GlobalFlag.LogLevel.flag.parse(emptyArgs);\n program = Effect.provideService(program, GlobalFlag.LogLevel, logLevel);\n // 8. Apply built-in setting behavior\n const services = Option.match(logLevel, {\n onNone: () => Context.empty(),\n onSome: level => Context.make(References.MinimumLogLevel, level)\n });\n // 9. Run command handler with composed context\n yield* Effect.provideContext(program, services);\n }, Effect.catchFilter(error => CliError.isCliError(error) && error._tag === \"ShowHelp\" ? Result.succeed(error) : Result.fail(error), error => Effect.andThen(showHelp(command, error), Effect.fail(error))), Effect.catchFilter(e => Terminal.isQuitError(e) ? Result.succeed(e) : Result.fail(e), _ => Effect.interrupt));\n};\n//# sourceMappingURL=Command.js.map","/**\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 * Bun layer for Effect's `FileSystem` service.\n *\n * This module exposes one `layer` that provides `FileSystem` in Bun by using\n * the shared Node file-system implementation. Once the layer is provided,\n * programs use the standard `effect/FileSystem` service operations.\n *\n * @since 4.0.0\n */\nimport * as NodeFileSystem from \"@effect/platform-node-shared/NodeFileSystem\";\n/**\n * Layer that provides the `FileSystem` service for Bun using the shared Node file-system implementation.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = NodeFileSystem.layer;\n//# sourceMappingURL=BunFileSystem.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 `BunCrypto` module provides Bun's `Crypto` service layer for Effect\n * programs. Provide {@link layer} at the edge of a Bun app, CLI, script, or\n * test to satisfy `effect/Crypto` with cryptographically secure random bytes,\n * UUID generation, random values, and SHA digest operations.\n *\n * This adapter reuses the shared Node-compatible implementation, so randomness\n * and digest behavior follow Bun's `node:crypto` compatibility layer. SHA-1 is\n * present for interoperability with existing protocols, not for new\n * security-sensitive designs.\n *\n * @since 1.0.0\n */\nimport * as NodeCrypto from \"@effect/platform-node-shared/NodeCrypto\";\n/**\n * Layer that provides the Bun Crypto service implementation.\n *\n * @category layers\n * @since 1.0.0\n */\nexport const layer = NodeCrypto.layer;\n//# sourceMappingURL=BunCrypto.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 * Bun-backed layers for Effect's {@link Path} service.\n *\n * This module provides the `Path` service for Bun programs by reusing the\n * shared Node-compatible path implementation. Provide one of these layers when\n * Bun code should receive path operations from the Effect environment instead\n * of importing runtime path helpers directly.\n *\n * @since 4.0.0\n */\nimport * as NodePath from \"@effect/platform-node-shared/NodePath\";\n/**\n * Layer that provides the default `Path` service for Bun using the shared Node path implementation.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = NodePath.layer;\n/**\n * Layer that provides the POSIX `Path` service for Bun using the shared Node path implementation.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layerPosix = NodePath.layerPosix;\n/**\n * Layer that provides the Win32 `Path` service for Bun using the shared Node path implementation.\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layerWin32 = NodePath.layerWin32;\n//# sourceMappingURL=BunPath.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 * Process stdio for Bun applications.\n *\n * This module provides the Bun layer for Effect's `Stdio` service by using the\n * shared Node stdio implementation. Arguments come from `process.argv`, input\n * is read from `process.stdin`, and output and error output write to\n * `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=BunStdio.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 * Bun-backed implementation of Effect's `Terminal` service.\n *\n * This module reuses the shared Node terminal implementation for Bun. `make`\n * creates a scoped process-backed `Terminal` service, and `layer` provides the\n * default terminal 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=BunTerminal.js.map","import * as Layer from \"effect/Layer\";\nimport * as BunChildProcessSpawner from \"./BunChildProcessSpawner.js\";\nimport * as BunCrypto from \"./BunCrypto.js\";\nimport * as BunFileSystem from \"./BunFileSystem.js\";\nimport * as BunPath from \"./BunPath.js\";\nimport * as BunStdio from \"./BunStdio.js\";\nimport * as BunTerminal from \"./BunTerminal.js\";\n/**\n * Provides the default Bun 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__*/BunChildProcessSpawner.layer.pipe(/*#__PURE__*/Layer.provideMerge(/*#__PURE__*/Layer.mergeAll(BunFileSystem.layer, BunCrypto.layer, BunPath.layer, BunStdio.layer, BunTerminal.layer)));\n//# sourceMappingURL=BunServices.js.map","import * as Runtime from \"effect/Runtime\";\n/**\n * Runs an Effect as the Node process main program, interrupting the fiber on\n * `SIGINT` or `SIGTERM` and invoking the configured teardown to determine the\n * process exit code.\n *\n * @category running\n * @since 4.0.0\n */\nexport const runMain = /*#__PURE__*/Runtime.makeRunMain(({\n fiber,\n teardown\n}) => {\n let receivedSignal = false;\n fiber.addObserver(exit => {\n process.removeListener(\"SIGINT\", onSigint);\n process.removeListener(\"SIGTERM\", onSigint);\n teardown(exit, code => {\n if (receivedSignal || code !== 0) {\n process.exit(code);\n }\n });\n });\n function onSigint() {\n receivedSignal = true;\n fiber.interruptUnsafe(fiber.id);\n }\n process.on(\"SIGINT\", onSigint);\n process.on(\"SIGTERM\", onSigint);\n});\n//# sourceMappingURL=NodeRuntime.js.map","/**\n * Bun process runner for Effect programs.\n *\n * This module exports `runMain`, which runs one Effect as the main process\n * fiber in Bun. It reuses the shared Node runtime runner, including its error\n * reporting, signal handling, and optional teardown behavior.\n *\n * @since 4.0.0\n */\nimport * as NodeRuntime from \"@effect/platform-node-shared/NodeRuntime\";\n/**\n * Helps you run a main effect with built-in error handling, logging, and signal management.\n *\n * **When to use**\n *\n * Use to run a Bun application's main Effect with structured error handling,\n * log management, interrupt support, or advanced teardown capabilities.\n *\n * **Details**\n *\n * This function launches an Effect as the main entry point, setting exit codes\n * based on success or failure, handling interrupts (e.g., Ctrl+C), and optionally\n * logging errors. By default, it logs errors and uses a \"pretty\" format, but both\n * behaviors can be turned off. You can also provide custom teardown logic to\n * finalize resources or produce different exit codes.\n *\n * An optional object that can include:\n * - `disableErrorReporting`: Turn off automatic error logging.\n * - `disablePrettyLogger`: Avoid adding the pretty logger.\n * - `teardown`: Provide custom finalization logic.\n *\n * @category running\n * @since 4.0.0\n */\nexport const runMain = NodeRuntime.runMain;\n//# sourceMappingURL=BunRuntime.js.map","import { Array, Order, Schema, pipe } from 'effect'\n\nexport const LoomLockSchema = Schema.Struct({\n version: Schema.Literal(1),\n tangled: Schema.Array(Schema.String),\n})\n\nexport type LoomLock = typeof LoomLockSchema.Type\n\nexport const emptyLock: LoomLock = { version: 1, tangled: [] }\n\nexport const orphansOf = (\n lock: LoomLock,\n produced: ReadonlySet<string>,\n): ReadonlyArray<string> =>\n Array.filter(lock.tangled, (path) => !produced.has(path))\n\nconst sortedUnique = (paths: ReadonlyArray<string>): ReadonlyArray<string> =>\n pipe(paths, Array.dedupe, Array.sort(Order.String))\n\nexport const recorded = (\n lock: LoomLock,\n produced: ReadonlyArray<string>,\n): LoomLock => ({ version: 1, tangled: sortedUnique([...lock.tangled, ...produced]) })\n\nexport const pruned = (produced: ReadonlyArray<string>): LoomLock => ({\n version: 1,\n tangled: sortedUnique(produced),\n})\n","import { Array, Context, Effect, FileSystem, Layer, Option, Result, Schema, Stream, pipe } from 'effect'\nimport { dirname, relative, resolve as resolvePath } from 'node:path'\nimport { type Path } from '@athrio/loom-ast/LoomCorpusAst'\nimport { workspaceRoot } from '@athrio/loom-lang-services/LoomStore'\nimport { LoomCompiler, ignoredDirs, type TangledFile, type TangleError } from './LoomCompiler'\nimport { PackageConfig } from './PackageConfig'\nimport {\n emptyLock,\n orphansOf,\n pruned,\n recorded,\n LoomLockSchema,\n type LoomLock,\n} from './LoomLock'\n\nconst isStorePath = (name: string): boolean =>\n name.split('/').some((segment) => ignoredDirs.has(segment))\n\nexport class LoomTangler extends Context.Service<LoomTangler>()('LoomTangler', {\n make: Effect.gen(function* () {\n const compiler = yield* LoomCompiler\n const fs = yield* FileSystem.FileSystem\n const config = yield* PackageConfig\n\n const matchesDisk = (file: TangledFile): Effect.Effect<boolean> =>\n fs.readFileString(file.path).pipe(\n Effect.option,\n Effect.map(Option.contains(file.content)),\n )\n\n const writeFile = (file: TangledFile): Effect.Effect<TangledFile> =>\n matchesDisk(file).pipe(\n Effect.flatMap((same) =>\n same\n ? Effect.void\n : fs\n .makeDirectory(dirname(file.path), { recursive: true })\n .pipe(Effect.andThen(fs.writeFileString(file.path, file.content))),\n ),\n Effect.orDie,\n Effect.as(file),\n )\n\n const tangleFile = (\n entry: Path,\n ): Effect.Effect<ReadonlyArray<TangledFile>, TangleError> =>\n compiler\n .tangle(entry)\n .pipe(Effect.flatMap((files) => Effect.forEach(files, writeFile)))\n\n const loomsUnder = (dir: Path): Effect.Effect<ReadonlyArray<Path>> =>\n fs.readDirectory(dir, { recursive: true }).pipe(\n Effect.orDie,\n Effect.map((names) =>\n pipe(\n names,\n Array.filter((name) => name.endsWith('.loom') && !isStorePath(name)),\n Array.map((name) => resolvePath(dir, name)),\n ),\n ),\n )\n\n const loomsOf = (path: Path): Effect.Effect<ReadonlyArray<Path>> =>\n fs.stat(path).pipe(\n Effect.orDie,\n Effect.flatMap((info) =>\n info.type === 'Directory'\n ? loomsUnder(path)\n : Effect.succeed<ReadonlyArray<Path>>([path]),\n ),\n )\n\n const workspaceOf = (path: Path): Effect.Effect<Path> =>\n fs.stat(path).pipe(\n Effect.orDie,\n Effect.map((info) =>\n workspaceRoot(info.type === 'Directory' ? path : dirname(path)),\n ),\n )\n\n const lockFile = (root: Path): Path =>\n resolvePath(root, '.loom', 'loom.lock')\n\n const readLock = (root: Path): Effect.Effect<LoomLock> =>\n fs.readFileString(lockFile(root)).pipe(\n Effect.flatMap((text) => Effect.try(() => JSON.parse(text) as unknown)),\n Effect.flatMap(Schema.decodeUnknownEffect(LoomLockSchema)),\n Effect.orElseSucceed(() => emptyLock),\n )\n\n const writeLock = (root: Path, lock: LoomLock): Effect.Effect<void> =>\n fs\n .makeDirectory(dirname(lockFile(root)), { recursive: true })\n .pipe(\n Effect.andThen(\n fs.writeFileString(\n lockFile(root),\n JSON.stringify(lock, null, 2) + '\\n',\n ),\n ),\n Effect.orDie,\n )\n\n const tangle = (\n path: Path,\n ): Effect.Effect<ReadonlyArray<TangledFile>, TangleError> =>\n Effect.gen(function* () {\n const looms = yield* loomsOf(path)\n const written = (yield* Effect.forEach(looms, tangleFile)).flat()\n const root = yield* workspaceOf(path)\n const lock = yield* readLock(root)\n yield* writeLock(\n root,\n recorded(lock, Array.map(written, (file) => relative(root, file.path))),\n )\n return written\n })\n\n const orphanState = (\n from: Path,\n ): Effect.Effect<\n {\n readonly root: Path\n readonly produced: ReadonlyArray<string>\n readonly orphans: ReadonlyArray<string>\n },\n TangleError\n > =>\n Effect.gen(function* () {\n const root = workspaceRoot(from)\n const looms = yield* loomsUnder(root)\n const files = (\n yield* Effect.forEach(looms, (loom) => compiler.tangle(loom))\n ).flat()\n const produced = Array.map(files, (file) => relative(root, file.path))\n const lock = yield* readLock(root)\n return { root, produced, orphans: orphansOf(lock, new Set(produced)) }\n })\n\n const orphans = (\n from: Path,\n ): Effect.Effect<ReadonlyArray<Path>, TangleError> =>\n orphanState(from).pipe(\n Effect.map(({ root, orphans }) =>\n Array.map(orphans, (rel) => resolvePath(root, rel)),\n ),\n )\n\n const prune = (\n from: Path,\n ): Effect.Effect<ReadonlyArray<Path>, TangleError> =>\n Effect.gen(function* () {\n const { root, produced, orphans } = yield* orphanState(from)\n yield* Effect.forEach(orphans, (rel) =>\n fs.remove(resolvePath(root, rel), { force: true }).pipe(Effect.orDie),\n )\n yield* writeLock(root, pruned(produced))\n return Array.map(orphans, (rel) => resolvePath(root, rel))\n })\n\n const batchWindow = '50 millis'\n const batchLimit = 1000\n\n const isLoomEvent = (event: FileSystem.WatchEvent): boolean =>\n event.path.endsWith('.loom') && !isStorePath(event.path)\n\n const watchRoot = (path: Path): Effect.Effect<Path> =>\n fs.stat(path).pipe(\n Effect.orDie,\n Effect.flatMap((info) =>\n info.type === 'Directory'\n ? Effect.succeed(path)\n : config.resolve(path).pipe(\n Effect.map(({ corpusDir }) =>\n Option.getOrElse(Option.fromNullishOr(corpusDir), () => dirname(path)),\n ),\n ),\n ),\n )\n\n const watch = (\n path: Path,\n ): Stream.Stream<Result.Result<ReadonlyArray<TangledFile>, TangleError>> =>\n Stream.unwrap(\n watchRoot(path).pipe(\n Effect.map((root) =>\n Stream.concat(\n Stream.fromEffect(Effect.result(tangle(path))),\n fs.watch(root).pipe(\n Stream.filter(isLoomEvent),\n Stream.groupedWithin(batchLimit, batchWindow),\n Stream.mapEffect((events) =>\n Effect.forEach(\n Array.dedupe(\n Array.map(events, (event) => resolvePath(root, event.path)),\n ),\n (changed) => compiler.invalidate(changed),\n { discard: true },\n ).pipe(Effect.andThen(Effect.result(tangle(path)))),\n ),\n Stream.orDie,\n ),\n ),\n ),\n ),\n )\n\n return { tangle, orphans, prune, watch }\n }),\n}) {\n static readonly layer = Layer.effect(this, this.make).pipe(\n Layer.provide(LoomCompiler.layer),\n )\n}\n","import { Context, Effect, FileSystem, Layer } from 'effect'\nimport { dirname } from 'node:path'\nimport { type Path } from '@athrio/loom-ast/LoomCorpusAst'\nimport { LoomCompiler } from '../LoomCompiler'\n\nexport class LoomWeaver extends Context.Service<LoomWeaver>()('LoomWeaver', {\n make: Effect.gen(function* () {\n const compiler = yield* LoomCompiler\n const fs = yield* FileSystem.FileSystem\n\n const weave = (entry: Path, out: Path): Effect.Effect<Path> =>\n compiler.weave(entry).pipe(\n Effect.map((corpus) => JSON.stringify(corpus, null, 2)),\n Effect.flatMap((json) =>\n fs\n .makeDirectory(dirname(out), { recursive: true })\n .pipe(\n Effect.andThen(fs.writeFileString(out, json)),\n Effect.orDie,\n Effect.as(out),\n ),\n ),\n )\n\n return { weave }\n }),\n}) {\n static readonly layer = Layer.effect(this, this.make).pipe(\n Layer.provide(LoomCompiler.layer),\n )\n}\n","import { Context, Effect, FileSystem, Layer } from 'effect'\nimport { type Path } from '@athrio/loom-ast/LoomCorpusAst'\nimport { LoomCompiler } from '../LoomCompiler'\n\nexport class LoomContents extends Context.Service<LoomContents>()('LoomContents', {\n make: Effect.gen(function* () {\n const compiler = yield* LoomCompiler\n const fs = yield* FileSystem.FileSystem\n\n const write = (entry: Path): Effect.Effect<Path> =>\n compiler.contents(entry).pipe(\n Effect.flatMap((text) =>\n fs.writeFileString(entry, text).pipe(Effect.orDie, Effect.as(entry)),\n ),\n )\n\n return { write }\n }),\n}) {\n static readonly layer = Layer.effect(this, this.make).pipe(\n Layer.provide(LoomCompiler.layer),\n )\n}\n","import { Console, Effect, Option, Result, Stream } from 'effect'\nimport { Argument, Command, Flag, Prompt } from 'effect/unstable/cli'\nimport { BunRuntime, BunServices } from '@effect/platform-bun'\nimport { existsSync, readFileSync, writeFileSync } from 'node:fs'\nimport { resolve as resolvePath } from 'node:path'\nimport {\n DocumentSource,\n type TangledFile,\n type TangleError,\n} from '@athrio/loom-lang/LoomCompiler'\nimport { LoomTangler } from '@athrio/loom-lang/LoomTangler'\nimport { LoomWeaver } from '@athrio/loom-lang/weave/LoomWeaver'\nimport { LoomContents } from '@athrio/loom-lang/weave/LoomContents'\nimport { PackageConfig } from '@athrio/loom-lang/PackageConfig'\nimport { LoomConfig } from '@athrio/loom-config/LoomConfig'\nimport {\n addService,\n installedServices,\n removeService,\n servicePackage,\n storeDir,\n workspaceRoot,\n} from '@athrio/loom-lang-services/LoomStore'\n\nconst reset = '\\x1b[0m'\nconst teal = (s: string): string => `\\x1b[38;5;44m${s}${reset}`\nconst dim = (s: string): string => `\\x1b[2m${s}${reset}`\n\nconst wordmark = [\n ' ██╗ ██████╗ ██████╗ ███╗ ███╗',\n ' ██║ ██╔═══██╗██╔═══██╗████╗ ████║',\n ' ██║ ██║ ██║██║ ██║██╔████╔██║',\n ' ██║ ██║ ██║██║ ██║██║╚██╔╝██║',\n ' ███████╗╚██████╔╝╚██████╔╝██║ ╚═╝ ██║',\n ' ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝',\n].join('\\n')\n\nconst banner = Console.log(\n `\\n${teal(wordmark)}\\n ${dim('a literate framework')}\\n`,\n)\n\nconst reportWritten = (\n written: ReadonlyArray<TangledFile>,\n): Effect.Effect<void> =>\n written.length === 0\n ? Console.log('loom: no {path} sinks to tangle')\n : Effect.forEach(\n written,\n (f) => Console.log(`loom: tangled ${f.section} → ${f.path}`),\n { discard: true },\n )\n\nconst tangleOnce = (file: string) =>\n Effect.gen(function* () {\n const tangler = yield* LoomTangler\n const written = yield* tangler.tangle(resolvePath(process.cwd(), file))\n yield* reportWritten(written)\n }).pipe(\n Effect.catchTag('TangleError', (e) =>\n Console.error(e.message).pipe(\n Effect.andThen(Effect.sync(() => void (process.exitCode = 1))),\n ),\n ),\n )\n\nconst tangleWatch = (file: string) =>\n Effect.gen(function* () {\n const tangler = yield* LoomTangler\n yield* Console.log(`loom: watching ${file} — re-tangling on change`)\n yield* Stream.runForEach(\n tangler.watch(resolvePath(process.cwd(), file)),\n Result.match({\n onSuccess: reportWritten,\n onFailure: (error: TangleError) => Console.error(error.message),\n }),\n )\n })\n\nconst tangle = (file: string, watch: boolean) =>\n watch ? tangleWatch(file) : tangleOnce(file)\n\nconst orphans = (prune: boolean) =>\n Effect.gen(function* () {\n const tangler = yield* LoomTangler\n if (prune) {\n const removed = yield* tangler.prune(process.cwd())\n yield* removed.length === 0\n ? Console.log('loom: no orphans to prune')\n : Effect.forEach(removed, (path) => Console.log(`loom: pruned ${path}`))\n } else {\n const found = yield* tangler.orphans(process.cwd())\n yield* Effect.forEach(found, (path) => Console.log(path))\n }\n }).pipe(\n Effect.catchTag('TangleError', (e) =>\n Console.error(e.message).pipe(\n Effect.andThen(Effect.sync(() => void (process.exitCode = 1))),\n ),\n ),\n )\n\nconst weave = (file: string, out: string) =>\n Effect.gen(function* () {\n const weaver = yield* LoomWeaver\n const written = yield* weaver.weave(\n resolvePath(process.cwd(), file),\n resolvePath(process.cwd(), out),\n )\n yield* Console.log(`loom: wove ${file} → ${written}`)\n })\n\nconst toc = (file: string) =>\n Effect.gen(function* () {\n const contents = yield* LoomContents\n const written = yield* contents.write(resolvePath(process.cwd(), file))\n yield* Console.log(`loom: wrote the table of contents into ${written}`)\n })\n\nconst mergeMcpConfig = (root: string): void => {\n const path = resolvePath(root, '.mcp.json')\n const existing = existsSync(path)\n ? (JSON.parse(readFileSync(path, 'utf8')) as Record<string, unknown>)\n : {}\n const servers = (existing.mcpServers as Record<string, unknown> | undefined) ?? {}\n const merged = {\n ...existing,\n mcpServers: {\n ...servers,\n loom: { type: 'http', url: 'http://localhost:5710/mcp' },\n },\n }\n writeFileSync(path, JSON.stringify(merged, null, 2) + '\\n')\n}\n\nconst init = (dir: Option.Option<string>) =>\n Effect.gen(function* () {\n const root = resolvePath(process.cwd(), Option.getOrElse(dir, () => '.'))\n const config = yield* LoomConfig\n yield* banner\n\n const configFile = resolvePath(root, '.loom', 'config.yaml')\n const configured = yield* Effect.sync(() => existsSync(configFile))\n\n if (configured) {\n yield* Console.log(`\\n ${dim(`✓ using the configuration at ${configFile}`)}\\n`)\n } else {\n const language = yield* Prompt.run(\n Prompt.text({\n message: 'Primary language for specifier-less sections',\n default: 'typescript',\n }),\n )\n const activation = yield* Prompt.run(\n Prompt.text({\n message: 'Activate editor services for (space-separated language ids)',\n default: language,\n }),\n )\n const ids = activation.split(/\\s+/).filter((id) => id.length > 0)\n yield* config.materialize(root, {\n corpus: 'corpus',\n languages: Object.fromEntries(ids.map((id) => [id, {}])),\n primary: language,\n })\n yield* Effect.sync(() =>\n writeFileSync(resolvePath(root, '.loom', '.gitignore'), 'services/\\n'),\n )\n yield* Console.log(\n `\\n ${teal('✓')} wrote ${configFile}\\n` +\n ` ${dim(`primary language: ${language}`)}\\n` +\n ` ${dim(`activated: ${ids.join(', ') || 'none'}`)}\\n`,\n )\n }\n\n yield* Effect.sync(() => mergeMcpConfig(root))\n yield* Console.log(` ${teal('✓')} wrote ${resolvePath(root, '.mcp.json')}\\n`)\n }).pipe(\n Effect.catchTag('QuitError', () => Console.log(dim('\\n Cancelled.\\n'))),\n )\n\nconst updateLanguages = (\n config: LoomConfig['Service'],\n dir: string,\n change: (ids: ReadonlyArray<string>) => ReadonlyArray<string>,\n): Effect.Effect<void> =>\n Effect.gen(function* () {\n const workspace = workspaceRoot(dir)\n const current = yield* config.manifest(workspace)\n const ids = change(Object.keys(current?.languages ?? {}))\n const languages = Object.fromEntries(\n ids.map((id) => [id, current?.languages?.[id] ?? {}]),\n )\n yield* config.materialize(workspace, { ...(current ?? {}), languages })\n })\n\nconst add = (language: string) =>\n Effect.gen(function* () {\n const config = yield* LoomConfig\n const dir = process.cwd()\n yield* addService(language, dir)\n yield* updateLanguages(config, dir, (ids) => [\n ...new Set([...ids, language]),\n ])\n yield* Console.log(\n `\\n ${teal('✓')} activated ${language}\\n` +\n ` ${dim(`store: ${storeDir(dir)}`)}\\n`,\n )\n }).pipe(\n Effect.catchTag('StoreError', (error) =>\n Console.error(\n `loom: could not install ${servicePackage(error.id)} — ${String(error.cause)}`,\n ).pipe(Effect.andThen(Effect.sync(() => void (process.exitCode = 1)))),\n ),\n )\n\nconst remove = (language: string) =>\n Effect.gen(function* () {\n const config = yield* LoomConfig\n const dir = process.cwd()\n yield* removeService(language, dir)\n yield* updateLanguages(config, dir, (ids) =>\n ids.filter((id) => id !== language),\n )\n yield* Console.log(`\\n ${teal('✓')} removed ${language}\\n`)\n })\n\nconst status = Effect.gen(function* () {\n const config = yield* LoomConfig\n const dir = process.cwd()\n const manifest = yield* config.manifest(workspaceRoot(dir))\n const primary = manifest?.primary\n const languages = Object.keys(manifest?.languages ?? {})\n const installed = new Set(yield* installedServices(dir))\n const mark = (id: string): string =>\n installed.has(id)\n ? ` ${teal('●')} ${id}`\n : ` ${dim('○')} ${id}${dim(` — run \\`loom add ${id}\\``)}`\n yield* Console.log(\n `\\n ${dim('store')} ${storeDir(dir)}\\n` +\n ` ${dim('primary')} ${primary ?? dim('(none)')}\\n` +\n ` ${dim('activated')} ${\n languages.length === 0 ? dim('(none)') : languages.join(', ')\n }\\n`,\n )\n if (languages.length > 0) yield* Console.log(`${languages.map(mark).join('\\n')}\\n`)\n})\n\nconst set = (name: string, value: string) =>\n Effect.gen(function* () {\n const config = yield* LoomConfig\n const tangler = yield* LoomTangler\n const workspace = workspaceRoot(process.cwd())\n const usage = 'usage: loom set <name> <value>'\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {\n yield* Console.error(`loom: \\`${name}\\` is not a variable name — ${usage}`)\n yield* Effect.sync(() => void (process.exitCode = 1))\n return\n }\n if (value.startsWith('=')) {\n yield* Console.error(`loom: a value cannot begin with \\`=\\`; give the name and value with a space, no \\`=\\` — ${usage}`)\n yield* Effect.sync(() => void (process.exitCode = 1))\n return\n }\n const current = yield* config.manifest(workspace)\n yield* config.materialize(workspace, {\n ...(current ?? {}),\n variables: { ...(current?.variables ?? {}), [name]: value },\n })\n const corpus = resolvePath(workspace, current?.corpus ?? 'corpus')\n const written = yield* tangler.tangle(corpus)\n yield* Console.log(`loom: set ${name} = ${value} (re-tangled ${written.length} files)`)\n }).pipe(\n Effect.catchTag('TangleError', (e) =>\n Console.error(e.message).pipe(\n Effect.andThen(Effect.sync(() => void (process.exitCode = 1))),\n ),\n ),\n )\n\nconst tangleCommand = Command.make(\n 'tangle',\n { path: Argument.string('path'), watch: Flag.boolean('watch') },\n ({ path, watch }) => tangle(path, watch),\n)\n\nconst orphansCommand = Command.make(\n 'orphans',\n { prune: Flag.boolean('prune') },\n ({ prune }) => orphans(prune),\n)\n\nconst weaveCommand = Command.make(\n 'weave',\n { path: Argument.string('path'), out: Argument.string('out') },\n ({ path, out }) => weave(path, out),\n)\n\nconst tocCommand = Command.make(\n 'toc',\n { path: Argument.string('path') },\n ({ path }) => toc(path),\n)\n\nconst initCommand = Command.make(\n 'init',\n { dir: Argument.optional(Argument.directory('dir')) },\n ({ dir }) => init(dir),\n)\n\nconst addCommand = Command.make(\n 'add',\n { language: Argument.string('language') },\n ({ language }) => add(language),\n)\n\nconst removeCommand = Command.make(\n 'remove',\n { language: Argument.string('language') },\n ({ language }) => remove(language),\n)\n\nconst statusCommand = Command.make('status', {}, () => status)\n\nconst setCommand = Command.make(\n 'set',\n { name: Argument.string('name'), value: Argument.string('value') },\n ({ name, value }) => set(name, value),\n)\n\nconst loom = Command.make('loom').pipe(\n Command.withSubcommands([\n tangleCommand,\n orphansCommand,\n weaveCommand,\n tocCommand,\n initCommand,\n addCommand,\n removeCommand,\n statusCommand,\n setCommand,\n ]),\n)\n\nconst program = Command.run(loom, {\n version: '0.0.5',\n}).pipe(\n Effect.provide(LoomTangler.layer),\n Effect.provide(LoomWeaver.layer),\n Effect.provide(LoomContents.layer),\n Effect.provide(DocumentSource.layer),\n Effect.provide(PackageConfig.layer),\n Effect.provide(LoomConfig.layer),\n Effect.provide(BunServices.layer),\n)\n\nif (process.argv[2] === 'lsp') {\n const { createRequire } = await import('node:module')\n ;(globalThis as { require?: unknown }).require = createRequire(import.meta.url)\n const { startLanguageServer } = await import('@athrio/loom-lang/LoomServer')\n startLanguageServer()\n} else {\n BunRuntime.runMain(program)\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,IAAMA,WAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+Bf,IAAa,cAAa,MAAKC,YAAsB,GAAGD,QAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkC9D,IAAa,qBAAb,cAAqDE,WAAkB,GAAGF,SAAO,oBAAoB,CAAC,CAAC;CACrG,MAAmB,kBAAW,oBAAoB;CAClD,QAAQG;CACR,SAAsB,yBAA6B,0BAAaA,QAAa,CAAC;CAC9E,aAA0B,0BAAaA,QAAa;AACtD,CAAC,CAAC,CAAC;;;;;;CAMD,CAACH,YAAUA;;;;;;CAMX,IAAI,UAAU;EACZ,MAAM,iBAAiB,KAAK,YAAY,SAAS,IAAI,iCAAiC,KAAK,YAAY,KAAK,QAAQ,MAAM;EAE1H,QADoB,KAAK,UAAU,sBAAsB,KAAK,OAAO,cAAc,KAAK,QAAQ,KAAK,GAAG,MAAM,sBAAsB,KAAK,YACpH;CACvB;AACF;;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAa,kBAAb,cAAkDE,WAAkB,GAAGF,SAAO,iBAAiB,CAAC,CAAC;CAC/F,MAAmB,kBAAW,iBAAiB;CAC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Q,KAAK,OAAO,OAAO;CAC7B,MAAM,EAAE,kBAAkB,MAAM,OAAO;CACtC,WAAsC,UAAU,cAAc,OAAO,KAAK,GAAG;CAC9E,MAAM,EAAE,wBAAwB,MAAM,OAAO;CAC7C,oBAAoB;AACtB,OACE,QAAmB,OAAO"}
1
+ {"version":3,"file":"main.js","names":["TypeId","Predicate.hasProperty","Schema.ErrorClass","Schema.String","Runtime.errorExitCode","Runtime.errorReported","Proto","Config.TrueValues","Config.FalseValues","toCodecStringTree","Schema.toCodecStringTree","Schema.decodeUnknownEffect","Effect.mapError","boolean","Config.Boolean","string","Effect.succeed","choice","Effect.fail","path","Effect.fnUntraced","FileSystem.FileSystem","Path.Path","reset","TypeId","Ansi.annotate","Ansi.bold","Ansi.combine","Ansi.italicized","Ansi.red","run","Terminal.Terminal","Terminal.QuitError","Effect.scoped","Effect.suspend","Effect.flatMap","Effect.succeed","Effect.isEffect","Effect.orDie","Queue.take","Effect.map","Effect.raceFirst","Effect.ensuring","Ansi.cursorShow","Ansi.eraseLine","Ansi.cursorTo","Ansi.eraseLines","Arr.map","Arr.reduce","Ansi.cursorDown","Arr.match","Ansi.cursorLeft","Option.isSome","Ansi.white","Ansi.blackBright","Ansi.underlined","Ansi.cyanBright","Ansi.cursorSavePosition","Ansi.cursorRestorePosition","Ansi.cursorMove","Ansi.green","Option.none","Effect.match","Option.some","Option.getOrElse","TypeId","Proto","Predicate.hasProperty","Option.none","string","Primitive.string","boolean","Primitive.boolean","choiceWithValue","Primitive.choice","choice","Primitive.path","directory","withAlias","withDescription","Option.some","map","Effect.map","optional","Effect.fnUntraced","Primitive.isBoolean","Effect.catchTags","Effect.succeed","Option.fromUndefinedOr","withMetavar","CliError.MissingArgument","Effect.mapError","CliError.InvalidValue","CliError.MissingOption","Predicate.isNotUndefined","Option.getOrUndefined","Param.string","Param.argumentKind","Param.directory","optional","Param.optional","Option.getOrElse","generateFunction","generate","generate","generate","Bash.generate","Zsh.generate","Fish.generate","Param.boolean","Param.flagKind","Param.choiceWithValue","Param.choice","Param.withAlias","Param.withDescription","Param.withMetavar","Param.optional","Param.map","Param.isParam","TypeId","Proto","Context.Service","Context.empty","Predicate.isNotUndefined","Effect.fail","CliError.ShowHelp","Param.extractSingleParams","Param.getParamMetadata","Primitive.getTypeName","Arr.map","Primitive.getChoiceKeys","Option.match","Option.some","Effect.fnUntraced","CliError.DuplicateOption","Primitive.getChoiceKeys","Param.extractSingleParams","Option.getOrUndefined","Param.getParamMetadata","Param.extractSingleParams","Effect.gen","Context.Service","Effect.gen","CliOutput.Formatter","HelpInternal.getHelpForCommandPath","Console.log","Flag.optional","Option.map","Option.isNone","CommandDescriptor.fromCommand","Completions_.generate","Option.match","Effect.gen","Param.extractSingleParams","Param.isFlagParam","Option.none","Option.some","Primitive.isBoolean","CliError.InvalidValue","Primitive.isTrueValue","Primitive.isFalseValue","CliError.UnrecognizedOption","CliError.UnknownSubcommand","Predicate.hasProperty","TypeId","make","Predicate.isNotUndefined","Effect.fnUntraced","Option.isNone","internal","CliError.ShowHelp","Effect.provideService","Param.extractSingleParams","CliError.UnrecognizedOption","Effect.gen","CliOutput.Formatter","error","GlobalFlag.BuiltIns","Console.log","Console.error","Effect.flatMap","Lexer.lex","Parser.createFlagRegistry","Param.isFlagParam","Parser.consumeGlobalFlags","Parser.parseArgs","Parser.getCommandPath","Effect.result","GlobalFlag.LogLevel","Option.match","Context.empty","Context.make","References.MinimumLogLevel","Effect.provideContext","Effect.catchFilter","CliError.isCliError","Result.succeed","Result.fail","Effect.andThen","Effect.fail","Terminal.isQuitError","Effect.interrupt","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","MutableRef.make","Latch.makeUnsafe","Exit.fail","Cause.Done","Effect.suspend","Effect.fail","Effect.flatMap","Arr.of","Effect.succeed","Effect.as","Scope.addFinalizer","Effect.sync","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","remove","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","runMain","NodeRuntime.runMain"],"sources":["../../../node_modules/effect/dist/unstable/cli/CliError.js","../../../node_modules/ini/lib/ini.js","../../../node_modules/toml/lib/parser.js","../../../node_modules/toml/lib/compiler.js","../../../node_modules/toml/index.js","../../../node_modules/effect/dist/unstable/cli/Primitive.js","../../../node_modules/effect/dist/unstable/cli/internal/ansi.js","../../../node_modules/effect/dist/unstable/cli/Prompt.js","../../../node_modules/effect/dist/unstable/cli/Param.js","../../../node_modules/effect/dist/unstable/cli/Argument.js","../../../node_modules/effect/dist/unstable/cli/CliOutput.js","../../../node_modules/effect/dist/unstable/cli/internal/completions/bash.js","../../../node_modules/effect/dist/unstable/cli/internal/completions/fish.js","../../../node_modules/effect/dist/unstable/cli/internal/completions/zsh.js","../../../node_modules/effect/dist/unstable/cli/Completions.js","../../../node_modules/effect/dist/unstable/cli/Flag.js","../../../node_modules/effect/dist/unstable/cli/internal/config.js","../../../node_modules/effect/dist/unstable/cli/internal/command.js","../../../node_modules/effect/dist/unstable/cli/internal/completions/descriptor.js","../../../node_modules/effect/dist/unstable/cli/internal/help.js","../../../node_modules/effect/dist/unstable/cli/GlobalFlag.js","../../../node_modules/effect/dist/unstable/cli/internal/lexer.js","../../../node_modules/effect/dist/unstable/cli/internal/auto-suggest.js","../../../node_modules/effect/dist/unstable/cli/internal/parser.js","../../../node_modules/effect/dist/unstable/cli/Command.js","../../../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","../../../node_modules/@effect/platform-node-shared/dist/NodeRuntime.js","../../../node_modules/@effect/platform-node/dist/NodeRuntime.js","../../loom-lang/src/LoomLock.ts","../../loom-lang/src/LoomTangler.ts","../../loom-lang/src/weave/LoomWeaver.ts","../../loom-lang/src/weave/LoomContents.ts","../src/main.ts"],"sourcesContent":["/**\n * Defines structured errors for the unstable CLI parser and runner.\n *\n * CLI errors describe problems such as unknown or duplicate flags, missing\n * flags or arguments, invalid values, unknown subcommands, user handler\n * failures, and requests to show command help. This module includes the\n * `CliError` union, the `isCliError` guard, schema-backed error classes with\n * display messages, and the `NonShowHelpErrors` union used when parse or\n * validation errors should be shown with help output.\n *\n * @since 4.0.0\n */\nimport * as Predicate from \"../../Predicate.js\";\nimport * as Runtime from \"../../Runtime.js\";\nimport * as Schema from \"../../Schema.js\";\n/**\n * @category type IDs\n * @since 4.0.0\n */\nconst TypeId = \"~effect/cli/CliError\";\n/**\n * Type guard to check if a value is a CLI error.\n *\n * **Example** (Checking CLI errors)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError } from \"effect/unstable/cli\"\n *\n * const handleError = (error: unknown) => {\n * if (CliError.isCliError(error)) {\n * console.log(\"CLI Error:\", error.message)\n * return Effect.succeed(\"Handled CLI error\")\n * }\n * return Effect.fail(\"Unknown error\")\n * }\n *\n * // Example usage in error handling\n * const program = Effect.gen(function*() {\n * const result = yield* Effect.try({\n * try: () => ({ success: true }),\n * catch: (error) => error\n * })\n * handleError(result)\n * })\n * ```\n *\n * @category guards\n * @since 4.0.0\n */\nexport const isCliError = u => Predicate.hasProperty(u, TypeId);\n/**\n * Error thrown when an unrecognized option is encountered.\n *\n * **Example** (Creating unrecognized option errors)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError } from \"effect/unstable/cli\"\n *\n * // Creating an unrecognized option error\n * const unrecognizedError = new CliError.UnrecognizedOption({\n * option: \"--unknown-flag\",\n * command: [\"deploy\", \"production\"],\n * suggestions: [\"--verbose\", \"--force\"]\n * })\n *\n * console.log(unrecognizedError.message)\n * // \"Unrecognized flag: --unknown-flag in command deploy production\n * //\n * // Did you mean this?\n * // --verbose\n * // --force\"\n *\n * // In CLI parsing context\n * const parseCommand = Effect.gen(function*() {\n * // If parsing encounters unknown flag\n * return yield* unrecognizedError\n * })\n * ```\n *\n * @category models\n * @since 4.0.0\n */\nexport class UnrecognizedOption extends /*#__PURE__*/Schema.ErrorClass(`${TypeId}/UnrecognizedOption`)({\n _tag: /*#__PURE__*/Schema.tag(\"UnrecognizedOption\"),\n option: Schema.String,\n command: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(Schema.String)),\n suggestions: /*#__PURE__*/Schema.Array(Schema.String)\n}) {\n /**\n * Marks this value as a CLI parsing error for runtime guards.\n *\n * @since 4.0.0\n */\n [TypeId] = TypeId;\n /**\n * Formats the unrecognized option with command context and suggestions.\n *\n * @since 4.0.0\n */\n get message() {\n const suggestionText = this.suggestions.length > 0 ? `\\n\\n Did you mean this?\\n ${this.suggestions.join(\"\\n \")}` : \"\";\n const baseMessage = this.command ? `Unrecognized flag: ${this.option} in command ${this.command.join(\" \")}` : `Unrecognized flag: ${this.option}`;\n return baseMessage + suggestionText;\n }\n}\n/**\n * Error thrown when duplicate option names are detected between parent and child commands.\n *\n * **Example** (Creating duplicate option errors)\n *\n * ```ts\n * import { CliError } from \"effect/unstable/cli\"\n *\n * const duplicateError = new CliError.DuplicateOption({\n * option: \"--verbose\",\n * parentCommand: \"myapp\",\n * childCommand: \"deploy\"\n * })\n *\n * console.log(duplicateError.message)\n * // \"Duplicate flag name \"--verbose\" in parent command \"myapp\" and subcommand \"deploy\".\n * // Parent will always claim this flag (Mode A semantics). Consider renaming one of them to avoid confusion.\"\n * ```\n *\n * @category models\n * @since 4.0.0\n */\nexport class DuplicateOption extends /*#__PURE__*/Schema.ErrorClass(`${TypeId}/DuplicateOption`)({\n _tag: /*#__PURE__*/Schema.tag(\"DuplicateOption\"),\n option: Schema.String,\n parentCommand: Schema.String,\n childCommand: Schema.String\n}) {\n /**\n * Marks this value as a CLI configuration error for runtime guards.\n *\n * @since 4.0.0\n */\n [TypeId] = TypeId;\n /**\n * Explains which parent and child commands define the duplicate option.\n *\n * @since 4.0.0\n */\n get message() {\n return `Duplicate flag name \"${this.option}\" in parent command \"${this.parentCommand}\" and subcommand \"${this.childCommand}\". ` + `Parent will always claim this flag (Mode A semantics). Consider renaming one of them to avoid confusion.`;\n }\n}\n/**\n * Error thrown when a required option is missing.\n *\n * **Example** (Creating missing option errors)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError } from \"effect/unstable/cli\"\n *\n * const missingOptionError = new CliError.MissingOption({\n * option: \"api-key\"\n * })\n *\n * console.log(missingOptionError.message)\n * // \"Missing required flag: --api-key\"\n *\n * // In validation context\n * const validateRequiredOptions = (options: Record<string, string | undefined>) =>\n * Effect.gen(function*() {\n * const apiKey = options[\"api-key\"]\n * if (!apiKey) {\n * return yield* missingOptionError\n * }\n * return apiKey\n * })\n * ```\n *\n * @category models\n * @since 4.0.0\n */\nexport class MissingOption extends /*#__PURE__*/Schema.ErrorClass(`${TypeId}/MissingOption`)({\n _tag: /*#__PURE__*/Schema.tag(\"MissingOption\"),\n option: Schema.String\n}) {\n /**\n * Marks this value as a missing CLI option error for runtime guards.\n *\n * @since 4.0.0\n */\n [TypeId] = TypeId;\n /**\n * Formats the missing required flag for display.\n *\n * @since 4.0.0\n */\n get message() {\n return `Missing required flag: --${this.option}`;\n }\n}\n/**\n * Error thrown when a required positional argument is missing.\n *\n * **Example** (Creating missing argument errors)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError } from \"effect/unstable/cli\"\n *\n * const missingArgError = new CliError.MissingArgument({\n * argument: \"target\"\n * })\n *\n * console.log(missingArgError.message)\n * // \"Missing required argument: target\"\n *\n * // In argument parsing\n * const parseArguments = (args: Array<string>) =>\n * Effect.gen(function*() {\n * if (args.length === 0) {\n * return yield* missingArgError\n * }\n * return args[0]\n * })\n * ```\n *\n * @category models\n * @since 4.0.0\n */\nexport class MissingArgument extends /*#__PURE__*/Schema.ErrorClass(`${TypeId}/MissingArgument`)({\n _tag: /*#__PURE__*/Schema.tag(\"MissingArgument\"),\n argument: Schema.String\n}) {\n /**\n * Marks this value as a missing CLI argument error for runtime guards.\n *\n * @since 4.0.0\n */\n [TypeId] = TypeId;\n /**\n * Formats the missing required positional argument for display.\n *\n * @since 4.0.0\n */\n get message() {\n return `Missing required argument: ${this.argument}`;\n }\n}\n/**\n * Error thrown when an option or argument value is invalid.\n *\n * **Example** (Creating invalid value errors)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError } from \"effect/unstable/cli\"\n *\n * const invalidValueError = new CliError.InvalidValue({\n * option: \"port\",\n * value: \"abc123\",\n * expected: \"integer between 1 and 65535\",\n * kind: \"flag\"\n * })\n *\n * console.log(invalidValueError.message)\n * // \"Invalid value for flag --port: \"abc123\". Expected: integer between 1 and 65535\"\n *\n * // For positional arguments\n * const invalidArgError = new CliError.InvalidValue({\n * option: \"count\",\n * value: \"abc\",\n * expected: \"integer\",\n * kind: \"argument\"\n * })\n *\n * console.log(invalidArgError.message)\n * // \"Invalid value for argument <count>: \"abc\". Expected: integer\"\n * ```\n *\n * @category models\n * @since 4.0.0\n */\nexport class InvalidValue extends /*#__PURE__*/Schema.ErrorClass(`${TypeId}/InvalidValue`)({\n _tag: /*#__PURE__*/Schema.tag(\"InvalidValue\"),\n option: Schema.String,\n value: Schema.String,\n expected: Schema.String,\n kind: /*#__PURE__*/Schema.Union([/*#__PURE__*/Schema.Literal(\"flag\"), /*#__PURE__*/Schema.Literal(\"argument\")])\n}) {\n /**\n * Marks this value as an invalid CLI value error for runtime guards.\n *\n * @since 4.0.0\n */\n [TypeId] = TypeId;\n /**\n * Formats the invalid flag or argument value with the expected input.\n *\n * @since 4.0.0\n */\n get message() {\n if (this.kind === \"argument\") {\n return `Invalid value for argument <${this.option}>: \"${this.value}\". Expected: ${this.expected}`;\n }\n return `Invalid value for flag --${this.option}: \"${this.value}\". Expected: ${this.expected}`;\n }\n}\n/**\n * Error thrown when an unknown subcommand is encountered.\n *\n * **Example** (Creating unknown subcommand errors)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError } from \"effect/unstable/cli\"\n *\n * const unknownSubcommandError = new CliError.UnknownSubcommand({\n * subcommand: \"deplyo\", // typo\n * parent: [\"myapp\"],\n * suggestions: [\"deploy\", \"destroy\"]\n * })\n *\n * console.log(unknownSubcommandError.message)\n * // \"Unknown subcommand \"deplyo\" for \"myapp\"\n * //\n * // Did you mean this?\n * // deploy\n * // destroy\"\n *\n * // In subcommand parsing\n * const parseSubcommand = (subcommand: string) =>\n * Effect.gen(function*() {\n * const validCommands = [\"deploy\", \"destroy\", \"status\"]\n * if (!validCommands.includes(subcommand)) {\n * return yield* unknownSubcommandError\n * }\n * return subcommand\n * })\n * ```\n *\n * @category models\n * @since 4.0.0\n */\nexport class UnknownSubcommand extends /*#__PURE__*/Schema.ErrorClass(`${TypeId}/UnknownSubcommand`)({\n _tag: /*#__PURE__*/Schema.tag(\"UnknownSubcommand\"),\n subcommand: Schema.String,\n parent: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(Schema.String)),\n suggestions: /*#__PURE__*/Schema.Array(Schema.String)\n}) {\n /**\n * Marks this value as an unknown CLI subcommand error for runtime guards.\n *\n * @since 4.0.0\n */\n [TypeId] = TypeId;\n /**\n * Formats the unknown subcommand with parent command context and suggestions.\n *\n * @since 4.0.0\n */\n get message() {\n const suggestionText = this.suggestions.length > 0 ? `\\n\\n Did you mean this?\\n ${this.suggestions.join(\"\\n \")}` : \"\";\n return this.parent ? `Unknown subcommand \"${this.subcommand}\" for \"${this.parent.join(\" \")}\"${suggestionText}` : `Unknown subcommand \"${this.subcommand}\"${suggestionText}`;\n }\n}\n/**\n * Error wrapper for user handler failures in the CLI error channel.\n *\n * **Example** (Wrapping user errors)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError } from \"effect/unstable/cli\"\n *\n * // Wrapping user errors\n * const userError = new CliError.UserError({\n * cause: new Error(\"Database connection failed\")\n * })\n *\n * // In command handler\n * const deployCommand = Effect.gen(function*() {\n * const result = yield* Effect.try({\n * try: () => ({ deployed: true }),\n * catch: (error) => new CliError.UserError({ cause: error })\n * })\n * return result\n * })\n *\n * // In error handling\n * const handleError = (error: CliError.CliError): Effect.Effect<number> => {\n * if (error._tag === \"UserError\") {\n * console.log(\"Command failed:\", error.cause)\n * return Effect.succeed(1) // Exit code 1\n * }\n * return Effect.succeed(0)\n * }\n * ```\n *\n * @category models\n * @since 4.0.0\n */\nexport class UserError extends /*#__PURE__*/Schema.ErrorClass(`${TypeId}/UserError`)({\n _tag: /*#__PURE__*/Schema.tag(\"UserError\"),\n cause: /*#__PURE__*/Schema.Defect()\n}) {\n /**\n * Marks this value as a user handler error for runtime guards.\n *\n * @since 4.0.0\n */\n [TypeId] = TypeId;\n}\n/**\n * Schema for concrete CLI errors that can be reported together with help output.\n *\n * **Details**\n *\n * This excludes `ShowHelp` itself, allowing parse and validation errors to be\n * stored in `ShowHelp.errors` without nesting another help-control value.\n *\n * @category models\n * @since 4.0.0\n */\nexport const NonShowHelpErrors = /*#__PURE__*/Schema.Union([UnrecognizedOption, DuplicateOption, MissingOption, MissingArgument, InvalidValue, UnknownSubcommand, UserError]);\n/**\n * Error data requesting CLI help rendering for a command path.\n *\n * **Details**\n *\n * It is used for explicit help requests and for parse or validation failures\n * that should be shown with help text. When `errors` is non-empty, the runtime\n * exit code is `1`; otherwise it is `0`.\n *\n * @category models\n * @since 4.0.0\n */\nexport class ShowHelp extends /*#__PURE__*/Schema.ErrorClass(`${TypeId}/ShowHelp`)({\n _tag: /*#__PURE__*/Schema.tag(\"ShowHelp\"),\n commandPath: /*#__PURE__*/Schema.Array(Schema.String),\n errors: /*#__PURE__*/Schema.Array(NonShowHelpErrors)\n}) {\n [TypeId] = TypeId;\n [Runtime.errorExitCode] = this.errors.length ? 1 : 0;\n [Runtime.errorReported] = false;\n get message() {\n return \"Help requested\";\n }\n}\n//# sourceMappingURL=CliError.js.map","const { hasOwnProperty } = Object.prototype\n\nconst encode = (obj, opt = {}) => {\n if (typeof opt === 'string') {\n opt = { section: opt }\n }\n opt.align = opt.align === true\n opt.newline = opt.newline === true\n opt.sort = opt.sort === true\n opt.whitespace = opt.whitespace === true || opt.align === true\n // The `typeof` check is required because accessing the `process` directly fails on browsers.\n /* istanbul ignore next */\n opt.platform = opt.platform || (typeof process !== 'undefined' && process.platform)\n opt.bracketedArray = opt.bracketedArray !== false\n\n /* istanbul ignore next */\n const eol = opt.platform === 'win32' ? '\\r\\n' : '\\n'\n const separator = opt.whitespace ? ' = ' : '='\n const children = []\n\n const keys = opt.sort ? Object.keys(obj).sort() : Object.keys(obj)\n\n let padToChars = 0\n // If aligning on the separator, then padToChars is determined as follows:\n // 1. Get the keys\n // 2. Exclude keys pointing to objects unless the value is null or an array\n // 3. Add `[]` to array keys\n // 4. Ensure non empty set of keys\n // 5. Reduce the set to the longest `safe` key\n // 6. Get the `safe` length\n if (opt.align) {\n padToChars = safe(\n (\n keys\n .filter(k => obj[k] === null || Array.isArray(obj[k]) || typeof obj[k] !== 'object')\n .map(k => Array.isArray(obj[k]) ? `${k}[]` : k)\n )\n .concat([''])\n .reduce((a, b) => safe(a).length >= safe(b).length ? a : b)\n ).length\n }\n\n let out = ''\n const arraySuffix = opt.bracketedArray ? '[]' : ''\n\n for (const k of keys) {\n const val = obj[k]\n if (val && Array.isArray(val)) {\n for (const item of val) {\n out += safe(`${k}${arraySuffix}`).padEnd(padToChars, ' ') + separator + safe(item) + eol\n }\n } else if (val && typeof val === 'object') {\n children.push(k)\n } else {\n out += safe(k).padEnd(padToChars, ' ') + separator + safe(val) + eol\n }\n }\n\n if (opt.section && out.length) {\n out = '[' + safe(opt.section) + ']' + (opt.newline ? eol + eol : eol) + out\n }\n\n for (const k of children) {\n const nk = splitSections(k, '.').join('\\\\.')\n const section = (opt.section ? opt.section + '.' : '') + nk\n const child = encode(obj[k], {\n ...opt,\n section,\n })\n if (out.length && child.length) {\n out += eol\n }\n\n out += child\n }\n\n return out\n}\n\nfunction splitSections (str, separator) {\n var lastMatchIndex = 0\n var lastSeparatorIndex = 0\n var nextIndex = 0\n var sections = []\n\n do {\n nextIndex = str.indexOf(separator, lastMatchIndex)\n\n if (nextIndex !== -1) {\n lastMatchIndex = nextIndex + separator.length\n\n if (nextIndex > 0 && str[nextIndex - 1] === '\\\\') {\n continue\n }\n\n sections.push(str.slice(lastSeparatorIndex, nextIndex))\n lastSeparatorIndex = nextIndex + separator.length\n }\n } while (nextIndex !== -1)\n\n sections.push(str.slice(lastSeparatorIndex))\n\n return sections\n}\n\nconst decode = (str, opt = {}) => {\n opt.bracketedArray = opt.bracketedArray !== false\n const out = Object.create(null)\n let p = out\n let section = null\n // section |key = value\n const re = /^\\[([^\\]]*)\\]\\s*$|^([^=]+)(=(.*))?$/i\n const lines = str.split(/[\\r\\n]+/g)\n const duplicates = {}\n\n for (const line of lines) {\n if (!line || line.match(/^\\s*[;#]/) || line.match(/^\\s*$/)) {\n continue\n }\n const match = line.match(re)\n if (!match) {\n continue\n }\n if (match[1] !== undefined) {\n section = unsafe(match[1])\n if (section === '__proto__') {\n // not allowed\n // keep parsing the section, but don't attach it.\n p = Object.create(null)\n continue\n }\n p = out[section] = out[section] || Object.create(null)\n continue\n }\n const keyRaw = unsafe(match[2])\n let isArray\n if (opt.bracketedArray) {\n isArray = keyRaw.length > 2 && keyRaw.slice(-2) === '[]'\n } else {\n duplicates[keyRaw] = (duplicates?.[keyRaw] || 0) + 1\n isArray = duplicates[keyRaw] > 1\n }\n const key = isArray && keyRaw.endsWith('[]')\n ? keyRaw.slice(0, -2) : keyRaw\n\n if (key === '__proto__') {\n continue\n }\n const valueRaw = match[3] ? unsafe(match[4]) : true\n const value = valueRaw === 'true' ||\n valueRaw === 'false' ||\n valueRaw === 'null' ? JSON.parse(valueRaw)\n : valueRaw\n\n // Convert keys with '[]' suffix to an array\n if (isArray) {\n if (!hasOwnProperty.call(p, key)) {\n p[key] = []\n } else if (!Array.isArray(p[key])) {\n p[key] = [p[key]]\n }\n }\n\n // safeguard against resetting a previously defined\n // array by accidentally forgetting the brackets\n if (Array.isArray(p[key])) {\n p[key].push(value)\n } else {\n p[key] = value\n }\n }\n\n // {a:{y:1},\"a.b\":{x:2}} --> {a:{y:1,b:{x:2}}}\n // use a filter to return the keys that have to be deleted.\n const remove = []\n for (const k of Object.keys(out)) {\n if (!hasOwnProperty.call(out, k) ||\n typeof out[k] !== 'object' ||\n Array.isArray(out[k])) {\n continue\n }\n\n // see if the parent section is also an object.\n // if so, add it to that, and mark this one for deletion\n const parts = splitSections(k, '.')\n p = out\n const l = parts.pop()\n const nl = l.replace(/\\\\\\./g, '.')\n for (const part of parts) {\n if (part === '__proto__') {\n continue\n }\n if (!hasOwnProperty.call(p, part) || typeof p[part] !== 'object') {\n p[part] = Object.create(null)\n }\n p = p[part]\n }\n if (p === out && nl === l) {\n continue\n }\n\n p[nl] = out[k]\n remove.push(k)\n }\n for (const del of remove) {\n delete out[del]\n }\n\n return out\n}\n\nconst isQuoted = val => {\n return (val.startsWith('\"') && val.endsWith('\"')) ||\n (val.startsWith(\"'\") && val.endsWith(\"'\"))\n}\n\nconst safe = val => {\n if (\n typeof val !== 'string' ||\n val.match(/[=\\r\\n]/) ||\n val.match(/^\\[/) ||\n (val.length > 1 && isQuoted(val)) ||\n val !== val.trim()\n ) {\n return JSON.stringify(val)\n }\n return val.split(';').join('\\\\;').split('#').join('\\\\#')\n}\n\nconst unsafe = val => {\n val = (val || '').trim()\n if (isQuoted(val)) {\n // remove the single quotes before calling JSON.parse\n if (val.charAt(0) === \"'\") {\n val = val.slice(1, -1)\n }\n try {\n val = JSON.parse(val)\n } catch {\n // ignore errors\n }\n } else {\n // walk the val to find the first not-escaped ; character\n let esc = false\n let unesc = ''\n for (let i = 0, l = val.length; i < l; i++) {\n const c = val.charAt(i)\n if (esc) {\n if ('\\\\;#'.indexOf(c) !== -1) {\n unesc += c\n } else {\n unesc += '\\\\' + c\n }\n\n esc = false\n } else if (';#'.indexOf(c) !== -1) {\n break\n } else if (c === '\\\\') {\n esc = true\n } else {\n unesc += c\n }\n }\n if (esc) {\n unesc += '\\\\'\n }\n\n return unesc.trim()\n }\n return val\n}\n\nmodule.exports = {\n parse: decode,\n decode,\n stringify: encode,\n encode,\n safe,\n unsafe,\n}\n","// @generated by Peggy 5.1.0.\n//\n// https://peggyjs.org/\n\n\"use strict\";\n\nclass peg$SyntaxError extends SyntaxError {\n constructor(message, expected, found, location) {\n super(message);\n this.expected = expected;\n this.found = found;\n this.location = location;\n this.name = \"SyntaxError\";\n }\n\n format(sources) {\n let str = \"Error: \" + this.message;\n if (this.location) {\n let src = null;\n const st = sources.find(s => s.source === this.location.source);\n if (st) {\n src = st.text.split(/\\r\\n|\\n|\\r/g);\n }\n const s = this.location.start;\n const offset_s = (this.location.source && (typeof this.location.source.offset === \"function\"))\n ? this.location.source.offset(s)\n : s;\n const loc = this.location.source + \":\" + offset_s.line + \":\" + offset_s.column;\n if (src) {\n const e = this.location.end;\n const filler = \"\".padEnd(offset_s.line.toString().length, \" \");\n const line = src[s.line - 1];\n const last = s.line === e.line ? e.column : line.length + 1;\n const hatLen = (last - s.column) || 1;\n str += \"\\n --> \" + loc + \"\\n\"\n + filler + \" |\\n\"\n + offset_s.line + \" | \" + line + \"\\n\"\n + filler + \" | \" + \"\".padEnd(s.column - 1, \" \")\n + \"\".padEnd(hatLen, \"^\");\n } else {\n str += \"\\n at \" + loc;\n }\n }\n return str;\n }\n\n static buildMessage(expected, found) {\n function hex(ch) {\n return ch.codePointAt(0).toString(16).toUpperCase();\n }\n\n const nonPrintable = Object.prototype.hasOwnProperty.call(RegExp.prototype, \"unicode\")\n ? new RegExp(\"[\\\\p{C}\\\\p{Mn}\\\\p{Mc}]\", \"gu\")\n : null;\n function unicodeEscape(s) {\n if (nonPrintable) {\n return s.replace(nonPrintable, ch => \"\\\\u{\" + hex(ch) + \"}\");\n }\n return s;\n }\n\n function literalEscape(s) {\n return unicodeEscape(s\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\"/g, \"\\\\\\\"\")\n .replace(/\\0/g, \"\\\\0\")\n .replace(/\\t/g, \"\\\\t\")\n .replace(/\\n/g, \"\\\\n\")\n .replace(/\\r/g, \"\\\\r\")\n .replace(/[\\x00-\\x0F]/g, ch => \"\\\\x0\" + hex(ch))\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, ch => \"\\\\x\" + hex(ch)));\n }\n\n function classEscape(s) {\n return unicodeEscape(s\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\\]/g, \"\\\\]\")\n .replace(/\\^/g, \"\\\\^\")\n .replace(/-/g, \"\\\\-\")\n .replace(/\\0/g, \"\\\\0\")\n .replace(/\\t/g, \"\\\\t\")\n .replace(/\\n/g, \"\\\\n\")\n .replace(/\\r/g, \"\\\\r\")\n .replace(/[\\x00-\\x0F]/g, ch => \"\\\\x0\" + hex(ch))\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, ch => \"\\\\x\" + hex(ch)));\n }\n\n const DESCRIBE_EXPECTATION_FNS = {\n literal(expectation) {\n return \"\\\"\" + literalEscape(expectation.text) + \"\\\"\";\n },\n\n class(expectation) {\n const escapedParts = expectation.parts.map(\n part => (Array.isArray(part)\n ? classEscape(part[0]) + \"-\" + classEscape(part[1])\n : classEscape(part))\n );\n\n return \"[\" + (expectation.inverted ? \"^\" : \"\") + escapedParts.join(\"\") + \"]\" + (expectation.unicode ? \"u\" : \"\");\n },\n\n any() {\n return \"any character\";\n },\n\n end() {\n return \"end of input\";\n },\n\n other(expectation) {\n return expectation.description;\n },\n };\n\n function describeExpectation(expectation) {\n return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);\n }\n\n function describeExpected(expected) {\n const descriptions = expected.map(describeExpectation);\n descriptions.sort();\n\n if (descriptions.length > 0) {\n let j = 1;\n for (let i = 1; i < descriptions.length; i++) {\n if (descriptions[i - 1] !== descriptions[i]) {\n descriptions[j] = descriptions[i];\n j++;\n }\n }\n descriptions.length = j;\n }\n\n switch (descriptions.length) {\n case 1:\n return descriptions[0];\n\n case 2:\n return descriptions[0] + \" or \" + descriptions[1];\n\n default:\n return descriptions.slice(0, -1).join(\", \")\n + \", or \"\n + descriptions[descriptions.length - 1];\n }\n }\n\n function describeFound(found) {\n return found ? \"\\\"\" + literalEscape(found) + \"\\\"\" : \"end of input\";\n }\n\n return \"Expected \" + describeExpected(expected) + \" but \" + describeFound(found) + \" found.\";\n }\n}\n\nfunction peg$parse(input, options) {\n options = options !== undefined ? options : {};\n\n const peg$FAILED = {};\n const peg$source = options.grammarSource;\n\n const peg$startRuleFunctions = {\n start: peg$parsestart,\n };\n let peg$startRuleFunction = peg$parsestart;\n\n const peg$c0 = \"#\";\n const peg$c1 = \"[\";\n const peg$c2 = \"]\";\n const peg$c3 = \".\";\n const peg$c4 = \"=\";\n const peg$c5 = \"inf\";\n const peg$c6 = \"nan\";\n const peg$c7 = \"\\\"\\\"\\\"\";\n const peg$c8 = \"\\\"\";\n const peg$c9 = \"'''\";\n const peg$c10 = \"'\";\n const peg$c11 = \"\\\\\";\n const peg$c12 = \"\\r\\n\";\n const peg$c13 = \"\\\"\\\"\";\n const peg$c14 = \"''\";\n const peg$c15 = \"0\";\n const peg$c16 = \"0x\";\n const peg$c17 = \"0o\";\n const peg$c18 = \"0b\";\n const peg$c19 = \"true\";\n const peg$c20 = \"false\";\n const peg$c21 = \",\";\n const peg$c22 = \"{\";\n const peg$c23 = \"}\";\n const peg$c24 = \"-\";\n const peg$c25 = \":\";\n const peg$c26 = \"z\";\n const peg$c27 = \"t\";\n const peg$c28 = \" \";\n const peg$c29 = \"\\n\";\n const peg$c30 = \"\\r\";\n const peg$c31 = \"\\\\U\";\n const peg$c32 = \"\\\\u\";\n const peg$c33 = \"\\\\x\";\n\n const peg$r0 = /^[\\t -~\\x80-\\uFFFF]/;\n const peg$r1 = /^[+\\-]/;\n const peg$r2 = /^[^\"\\\\\\0-\\b\\v-\\x1F\\x7F\\r]/;\n const peg$r3 = /^[^'\\0-\\b\\v-\\x1F\\x7F\\r]/;\n const peg$r4 = /^[^\"\\\\\\0-\\b\\n-\\x1F\\x7F]/;\n const peg$r5 = /^[^'\\0-\\b\\n-\\x1F\\x7F]/;\n const peg$r6 = /^[eE]/;\n const peg$r7 = /^[0-9_]/;\n const peg$r8 = /^[1-9]/;\n const peg$r9 = /^[_]/;\n const peg$r10 = /^[0-9]/;\n const peg$r11 = /^[0-9a-fA-F]/;\n const peg$r12 = /^[0-7]/;\n const peg$r13 = /^[01]/;\n const peg$r14 = /^[ \\t]/;\n const peg$r15 = /^[A-Za-z0-9_\\-]/;\n const peg$r16 = /^[\"\\\\btnfre]/;\n\n const peg$e0 = peg$literalExpectation(\"#\", false);\n const peg$e1 = peg$classExpectation([\"\\t\", [\" \", \"~\"], [\"\\x80\", \"\\uFFFF\"]], false, false, false);\n const peg$e2 = peg$literalExpectation(\"[\", false);\n const peg$e3 = peg$literalExpectation(\"]\", false);\n const peg$e4 = peg$literalExpectation(\".\", false);\n const peg$e5 = peg$literalExpectation(\"=\", false);\n const peg$e6 = peg$classExpectation([\"+\", \"-\"], false, false, false);\n const peg$e7 = peg$literalExpectation(\"inf\", false);\n const peg$e8 = peg$literalExpectation(\"nan\", false);\n const peg$e9 = peg$literalExpectation(\"\\\"\\\"\\\"\", false);\n const peg$e10 = peg$literalExpectation(\"\\\"\", false);\n const peg$e11 = peg$literalExpectation(\"'''\", false);\n const peg$e12 = peg$literalExpectation(\"'\", false);\n const peg$e13 = peg$literalExpectation(\"\\\\\", false);\n const peg$e14 = peg$anyExpectation();\n const peg$e15 = peg$literalExpectation(\"\\r\\n\", false);\n const peg$e16 = peg$classExpectation([\"\\\"\", \"\\\\\", [\"\\0\", \"\\b\"], [\"\\v\", \"\\x1F\"], \"\\x7F\", \"\\r\"], true, false, false);\n const peg$e17 = peg$literalExpectation(\"\\\"\\\"\", false);\n const peg$e18 = peg$classExpectation([\"'\", [\"\\0\", \"\\b\"], [\"\\v\", \"\\x1F\"], \"\\x7F\", \"\\r\"], true, false, false);\n const peg$e19 = peg$literalExpectation(\"''\", false);\n const peg$e20 = peg$classExpectation([\"\\\"\", \"\\\\\", [\"\\0\", \"\\b\"], [\"\\n\", \"\\x1F\"], \"\\x7F\"], true, false, false);\n const peg$e21 = peg$classExpectation([\"'\", [\"\\0\", \"\\b\"], [\"\\n\", \"\\x1F\"], \"\\x7F\"], true, false, false);\n const peg$e22 = peg$classExpectation([\"e\", \"E\"], false, false, false);\n const peg$e23 = peg$literalExpectation(\"0\", false);\n const peg$e24 = peg$literalExpectation(\"0x\", false);\n const peg$e25 = peg$literalExpectation(\"0o\", false);\n const peg$e26 = peg$literalExpectation(\"0b\", false);\n const peg$e27 = peg$classExpectation([[\"0\", \"9\"], \"_\"], false, false, false);\n const peg$e28 = peg$classExpectation([[\"1\", \"9\"]], false, false, false);\n const peg$e29 = peg$classExpectation([\"_\"], false, false, false);\n const peg$e30 = peg$classExpectation([[\"0\", \"9\"]], false, false, false);\n const peg$e31 = peg$classExpectation([[\"0\", \"9\"], [\"a\", \"f\"], [\"A\", \"F\"]], false, false, false);\n const peg$e32 = peg$classExpectation([[\"0\", \"7\"]], false, false, false);\n const peg$e33 = peg$classExpectation([\"0\", \"1\"], false, false, false);\n const peg$e34 = peg$literalExpectation(\"true\", false);\n const peg$e35 = peg$literalExpectation(\"false\", false);\n const peg$e36 = peg$literalExpectation(\",\", false);\n const peg$e37 = peg$literalExpectation(\"{\", false);\n const peg$e38 = peg$literalExpectation(\"}\", false);\n const peg$e39 = peg$literalExpectation(\"-\", false);\n const peg$e40 = peg$literalExpectation(\":\", false);\n const peg$e41 = peg$literalExpectation(\"Z\", true);\n const peg$e42 = peg$literalExpectation(\"T\", true);\n const peg$e43 = peg$literalExpectation(\" \", false);\n const peg$e44 = peg$classExpectation([\" \", \"\\t\"], false, false, false);\n const peg$e45 = peg$literalExpectation(\"\\n\", false);\n const peg$e46 = peg$literalExpectation(\"\\r\", false);\n const peg$e47 = peg$classExpectation([[\"A\", \"Z\"], [\"a\", \"z\"], [\"0\", \"9\"], \"_\", \"-\"], false, false, false);\n const peg$e48 = peg$classExpectation([\"\\\"\", \"\\\\\", \"b\", \"t\", \"n\", \"f\", \"r\", \"e\"], false, false, false);\n const peg$e49 = peg$literalExpectation(\"\\\\U\", false);\n const peg$e50 = peg$literalExpectation(\"\\\\u\", false);\n const peg$e51 = peg$literalExpectation(\"\\\\x\", false);\n\n function peg$f0() { return nodes }\n function peg$f1(name) { addNode(node('ArrayPath', name, offset())) }\n function peg$f2(name) { addNode(node('ObjectPath', name, offset())) }\n function peg$f3(parts, name) { return parts.concat(name) }\n function peg$f4(name) { return [name] }\n function peg$f5(name) { return name }\n function peg$f6(name) { return name }\n function peg$f7(keys, value) { addNode(node('Assign', value, offset(), keys)) }\n function peg$f8(node) { return node.value }\n function peg$f9(node) { return node.value }\n function peg$f10(sign) { return node('Float', sign === '-' ? -Infinity : Infinity, offset()) }\n function peg$f11(sign) { return node('Float', NaN, offset()) }\n function peg$f12(body) { return node('String', body, offset()) }\n function peg$f13(chars) { return node('String', chars.join(''), offset()) }\n function peg$f14(body) { return node('String', body, offset()) }\n function peg$f15(chars) { return node('String', chars.join(''), offset()) }\n function peg$f16(head, parts, tail) {\n var result = head.join('');\n for (var i = 0; i < parts.length; i++) { result += parts[i][0] + parts[i][1].join(''); }\n return result + (tail || '');\n }\n function peg$f17() { genError(\"Invalid escape sequence\", offset()) }\n function peg$f18() { return \"\\n\" }\n function peg$f19() { return '' }\n function peg$f20() { return '\"\"' }\n function peg$f21() { return '\"' }\n function peg$f22() { return '\"\"' }\n function peg$f23() { return '\"' }\n function peg$f24(head, parts, tail) {\n var result = head.join('');\n for (var i = 0; i < parts.length; i++) { result += parts[i][0] + parts[i][1].join(''); }\n return result + (tail || '');\n }\n function peg$f25() { return \"\\n\" }\n function peg$f26() { return \"''\" }\n function peg$f27() { return \"'\" }\n function peg$f28() { return \"''\" }\n function peg$f29() { return \"'\" }\n function peg$f30() { genError(\"Invalid escape sequence\", offset()) }\n function peg$f31(left, right) { return node('Float', parseFloat(stripUnderscores(left + 'e' + right)), offset()) }\n function peg$f32(text) { return node('Float', parseFloat(stripUnderscores(text)), offset()) }\n function peg$f33(sign, digits, frac) { return (sign === '-' ? '-' : '') + digits + '.' + frac }\n function peg$f34(sign, digits, frac) { return (sign === '-' ? '-' : '') + digits + '.' + frac }\n function peg$f35(sign, digits) { return (sign === '-' ? '-' : '') + digits }\n function peg$f36() { return '0' }\n function peg$f37(sign, digits) { return (sign || '') + digits }\n function peg$f38(digits) { return node('Integer', parseInt(stripUnderscores(digits), 16), offset()) }\n function peg$f39(digits) { return node('Integer', parseInt(stripUnderscores(digits), 8), offset()) }\n function peg$f40(digits) { return node('Integer', parseInt(stripUnderscores(digits), 2), offset()) }\n function peg$f41(text) { return node('Integer', parseInt(stripUnderscores(text), 10), offset()) }\n function peg$f42(sign) { return (sign || '') + '0' }\n function peg$f43(sign, digits) { return (sign || '') + digits }\n function peg$f44() { return node('Boolean', true, offset()) }\n function peg$f45() { return node('Boolean', false, offset()) }\n function peg$f46() { return node('Array', [], offset()) }\n function peg$f47(head, v) { return v }\n function peg$f48(head, tail) {\n tail.unshift(head); return node('Array', tail, offset())\n }\n function peg$f49() { return node('InlineTable', [], offset()) }\n function peg$f50(head, e) { return e }\n function peg$f51(head, tail) {\n tail.unshift(head); return node('InlineTable', tail, offset())\n }\n function peg$f52(keys, value) { return node('InlineTableValue', value, offset(), keys) }\n function peg$f53(parts, last) { return parts.concat(last) }\n function peg$f54(k) { return [k] }\n function peg$f55(k) { return k }\n function peg$f56(t, frac) { return frac ? t + frac : t }\n function peg$f57(t) { return t + ':00' }\n function peg$f58() { return \"Z\" }\n function peg$f59(d, t, o) { var off = offset(); validateDate(d, off); validateTime(t, off); validateOffset(o, off); return node('Date', new Date(d + \"T\" + t + o), off) }\n function peg$f60(d, t) { var off = offset(); validateDate(d, off); validateTime(t, off); return node('LocalDateTime', d + \"T\" + t, off) }\n function peg$f61(d) { var off = offset(); validateDate(d, off); return node('LocalDate', d, off) }\n function peg$f62(t) { var off = offset(); validateTime(t, off); return node('LocalTime', t, off) }\n function peg$f63(ch) { return ch === 'n' ? '\\n' : ch === 't' ? '\\t' : ch === 'r' ? '\\r' : ch === '\\\\' ? '\\\\' : ch === '\"' ? '\"' : ch === 'b' ? '\\b' : ch === 'f' ? '\\f' : '\\x1B' }\n function peg$f64(digits) { return convertCodePoint(digits) }\n function peg$f65(digits) { return convertCodePoint(digits) }\n function peg$f66(digits) { return convertCodePoint(digits) }\n let peg$currPos = options.peg$currPos | 0;\n let peg$savedPos = peg$currPos;\n const peg$posDetailsCache = [{ line: 1, column: 1 }];\n let peg$maxFailPos = peg$currPos;\n let peg$maxFailExpected = options.peg$maxFailExpected || [];\n let peg$silentFails = options.peg$silentFails | 0;\n\n let peg$result;\n\n if (options.startRule) {\n if (!(options.startRule in peg$startRuleFunctions)) {\n throw new Error(\"Can't start parsing from rule \\\"\" + options.startRule + \"\\\".\");\n }\n\n peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\n }\n\n function text() {\n return input.substring(peg$savedPos, peg$currPos);\n }\n\n function offset() {\n return peg$savedPos;\n }\n\n function range() {\n return {\n source: peg$source,\n start: peg$savedPos,\n end: peg$currPos,\n };\n }\n\n function location() {\n return peg$computeLocation(peg$savedPos, peg$currPos);\n }\n\n function expected(description, location) {\n location = location !== undefined\n ? location\n : peg$computeLocation(peg$savedPos, peg$currPos);\n\n throw peg$buildStructuredError(\n [peg$otherExpectation(description)],\n input.substring(peg$savedPos, peg$currPos),\n location\n );\n }\n\n function error(message, location) {\n location = location !== undefined\n ? location\n : peg$computeLocation(peg$savedPos, peg$currPos);\n\n throw peg$buildSimpleError(message, location);\n }\n\n function peg$getUnicode(pos = peg$currPos) {\n const cp = input.codePointAt(pos);\n if (cp === undefined) {\n return \"\";\n }\n return String.fromCodePoint(cp);\n }\n\n function peg$literalExpectation(text, ignoreCase) {\n return { type: \"literal\", text, ignoreCase };\n }\n\n function peg$classExpectation(parts, inverted, ignoreCase, unicode) {\n return { type: \"class\", parts, inverted, ignoreCase, unicode };\n }\n\n function peg$anyExpectation() {\n return { type: \"any\" };\n }\n\n function peg$endExpectation() {\n return { type: \"end\" };\n }\n\n function peg$otherExpectation(description) {\n return { type: \"other\", description };\n }\n\n function peg$computePosDetails(pos) {\n let details = peg$posDetailsCache[pos];\n let p;\n\n if (details) {\n return details;\n } else {\n if (pos >= peg$posDetailsCache.length) {\n p = peg$posDetailsCache.length - 1;\n } else {\n p = pos;\n while (!peg$posDetailsCache[--p]) {}\n }\n\n details = peg$posDetailsCache[p];\n details = {\n line: details.line,\n column: details.column,\n };\n\n while (p < pos) {\n if (input.charCodeAt(p) === 10) {\n details.line++;\n details.column = 1;\n } else {\n details.column++;\n }\n\n p++;\n }\n\n peg$posDetailsCache[pos] = details;\n\n return details;\n }\n }\n\n function peg$computeLocation(startPos, endPos, offset) {\n const startPosDetails = peg$computePosDetails(startPos);\n const endPosDetails = peg$computePosDetails(endPos);\n\n const res = {\n source: peg$source,\n start: {\n offset: startPos,\n line: startPosDetails.line,\n column: startPosDetails.column,\n },\n end: {\n offset: endPos,\n line: endPosDetails.line,\n column: endPosDetails.column,\n },\n };\n if (offset && peg$source && (typeof peg$source.offset === \"function\")) {\n res.start = peg$source.offset(res.start);\n res.end = peg$source.offset(res.end);\n }\n return res;\n }\n\n function peg$fail(expected) {\n if (peg$currPos < peg$maxFailPos) { return; }\n\n if (peg$currPos > peg$maxFailPos) {\n peg$maxFailPos = peg$currPos;\n peg$maxFailExpected = [];\n }\n\n peg$maxFailExpected.push(expected);\n }\n\n function peg$buildSimpleError(message, location) {\n return new peg$SyntaxError(message, null, null, location);\n }\n\n function peg$buildStructuredError(expected, found, location) {\n return new peg$SyntaxError(\n peg$SyntaxError.buildMessage(expected, found),\n expected,\n found,\n location\n );\n }\n\n function peg$parsestart() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseline();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseline();\n }\n peg$savedPos = s0;\n s1 = peg$f0();\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseline() {\n let s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseS();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseS();\n }\n s2 = peg$parseexpression();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseS();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseS();\n }\n s4 = peg$parsecomment();\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = [];\n s6 = peg$parseNL();\n if (s6 !== peg$FAILED) {\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parseNL();\n }\n } else {\n s5 = peg$FAILED;\n }\n if (s5 === peg$FAILED) {\n s5 = peg$parseEOF();\n }\n if (s5 !== peg$FAILED) {\n s1 = [s1, s2, s3, s4, s5];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseS();\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseS();\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseNL();\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseNL();\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 === peg$FAILED) {\n s2 = peg$parseEOF();\n }\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$parseNL();\n }\n }\n\n return s0;\n }\n\n function peg$parseexpression() {\n let s0;\n\n s0 = peg$parsecomment();\n if (s0 === peg$FAILED) {\n s0 = peg$parsetable_or_array_path();\n if (s0 === peg$FAILED) {\n s0 = peg$parseassignment();\n }\n }\n\n return s0;\n }\n\n function peg$parsecomment() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 35) {\n s1 = peg$c0;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e0); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = input.charAt(peg$currPos);\n if (peg$r0.test(s3)) {\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e1); }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = input.charAt(peg$currPos);\n if (peg$r0.test(s3)) {\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e1); }\n }\n }\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsetable_or_array_path() {\n let s0, s1, s2, s3, s4, s5, s6, s7;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c1;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e2); }\n }\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 91) {\n s2 = peg$c1;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e2); }\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseS();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseS();\n }\n s4 = peg$parsetable_key();\n if (s4 !== peg$FAILED) {\n s5 = [];\n s6 = peg$parseS();\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parseS();\n }\n if (input.charCodeAt(peg$currPos) === 93) {\n s6 = peg$c2;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e3); }\n }\n if (s6 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 93) {\n s7 = peg$c2;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e3); }\n }\n if (s7 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f1(s4);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c1;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e2); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseS();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseS();\n }\n s3 = peg$parsetable_key();\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$parseS();\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseS();\n }\n if (input.charCodeAt(peg$currPos) === 93) {\n s5 = peg$c2;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e3); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f2(s3);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parsetable_key() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parsedot_ended_table_key_part();\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parsedot_ended_table_key_part();\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parsetable_key_part();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f3(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsetable_key_part();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f4(s1);\n }\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parsetable_key_part() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseS();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseS();\n }\n s2 = peg$parsesimple_key();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseS();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseS();\n }\n peg$savedPos = s0;\n s0 = peg$f5(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsedot_ended_table_key_part() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseS();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseS();\n }\n s2 = peg$parsesimple_key();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseS();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseS();\n }\n if (input.charCodeAt(peg$currPos) === 46) {\n s4 = peg$c3;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e4); }\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f6(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseassignment() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = peg$parseinline_key();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseS();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseS();\n }\n if (input.charCodeAt(peg$currPos) === 61) {\n s3 = peg$c4;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e5); }\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$parseS();\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseS();\n }\n s5 = peg$parsevalue();\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f7(s1, s5);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsekey() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseASCII_BASIC();\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseASCII_BASIC();\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parsequoted_key() {\n let s0, s1;\n\n s0 = peg$currPos;\n s1 = peg$parsedouble_quoted_single_line_string();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f8(s1);\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsesingle_quoted_single_line_string();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f9(s1);\n }\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parsevalue() {\n let s0;\n\n s0 = peg$parsestring();\n if (s0 === peg$FAILED) {\n s0 = peg$parsenumber_or_date();\n if (s0 === peg$FAILED) {\n s0 = peg$parseboolean();\n if (s0 === peg$FAILED) {\n s0 = peg$parsearray();\n if (s0 === peg$FAILED) {\n s0 = peg$parseinline_table();\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parsenumber_or_date() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r1.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (input.substr(peg$currPos, 3) === peg$c5) {\n s2 = peg$c5;\n peg$currPos += 3;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e7); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f10(s1);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r1.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (input.substr(peg$currPos, 3) === peg$c6) {\n s2 = peg$c6;\n peg$currPos += 3;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e8); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f11(s1);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$parsedatetime();\n if (s0 === peg$FAILED) {\n s0 = peg$parsefloat();\n if (s0 === peg$FAILED) {\n s0 = peg$parseinteger();\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parsestring() {\n let s0;\n\n s0 = peg$parsedouble_quoted_multiline_string();\n if (s0 === peg$FAILED) {\n s0 = peg$parsedouble_quoted_single_line_string();\n if (s0 === peg$FAILED) {\n s0 = peg$parsesingle_quoted_multiline_string();\n if (s0 === peg$FAILED) {\n s0 = peg$parsesingle_quoted_single_line_string();\n }\n }\n }\n\n return s0;\n }\n\n function peg$parsedouble_quoted_multiline_string() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 3) === peg$c7) {\n s1 = peg$c7;\n peg$currPos += 3;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e9); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseNL();\n if (s2 === peg$FAILED) {\n s2 = null;\n }\n s3 = peg$parsemlb_body();\n if (input.substr(peg$currPos, 3) === peg$c7) {\n s4 = peg$c7;\n peg$currPos += 3;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e9); }\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f12(s3);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsedouble_quoted_single_line_string() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 34) {\n s1 = peg$c8;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e10); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parsestring_char();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parsestring_char();\n }\n if (input.charCodeAt(peg$currPos) === 34) {\n s3 = peg$c8;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e10); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f13(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsesingle_quoted_multiline_string() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 3) === peg$c9) {\n s1 = peg$c9;\n peg$currPos += 3;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e11); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseNL();\n if (s2 === peg$FAILED) {\n s2 = null;\n }\n s3 = peg$parsemll_body();\n if (input.substr(peg$currPos, 3) === peg$c9) {\n s4 = peg$c9;\n peg$currPos += 3;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e11); }\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f14(s3);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsesingle_quoted_single_line_string() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 39) {\n s1 = peg$c10;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e12); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseliteral_char();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseliteral_char();\n }\n if (input.charCodeAt(peg$currPos) === 39) {\n s3 = peg$c10;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e12); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f15(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsemlb_body() {\n let s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parsemlb_content();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parsemlb_content();\n }\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parsemlb_quotes();\n if (s4 !== peg$FAILED) {\n s5 = [];\n s6 = peg$parsemlb_content();\n if (s6 !== peg$FAILED) {\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parsemlb_content();\n }\n } else {\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parsemlb_quotes();\n if (s4 !== peg$FAILED) {\n s5 = [];\n s6 = peg$parsemlb_content();\n if (s6 !== peg$FAILED) {\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parsemlb_content();\n }\n } else {\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n s3 = peg$parsemlb_trailing();\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f16(s1, s2, s3);\n\n return s0;\n }\n\n function peg$parsemlb_content() {\n let s0, s1, s2;\n\n s0 = peg$parseESCAPED();\n if (s0 === peg$FAILED) {\n s0 = peg$parsemlb_escaped_newline();\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s1 = peg$c11;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e13); }\n }\n if (s1 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e14); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f17();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c12) {\n s1 = peg$c12;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f18();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = [];\n s2 = input.charAt(peg$currPos);\n if (peg$r2.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = input.charAt(peg$currPos);\n if (peg$r2.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e16); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parsemlb_escaped_newline() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s1 = peg$c11;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e13); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseS();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseS();\n }\n s3 = peg$parseNL();\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$parseNLS();\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseNLS();\n }\n peg$savedPos = s0;\n s0 = peg$f19();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsemlb_quotes() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c13) {\n s1 = peg$c13;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e17); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.charCodeAt(peg$currPos) === 34) {\n s3 = peg$c8;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e10); }\n }\n peg$silentFails--;\n if (s3 === peg$FAILED) {\n s2 = undefined;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f20();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 34) {\n s1 = peg$c8;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e10); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.charCodeAt(peg$currPos) === 34) {\n s3 = peg$c8;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e10); }\n }\n peg$silentFails--;\n if (s3 === peg$FAILED) {\n s2 = undefined;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f21();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parsemlb_trailing() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c13) {\n s1 = peg$c13;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e17); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.substr(peg$currPos, 3) === peg$c7) {\n s3 = peg$c7;\n peg$currPos += 3;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e9); }\n }\n peg$silentFails--;\n if (s3 !== peg$FAILED) {\n peg$currPos = s2;\n s2 = undefined;\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f22();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 34) {\n s1 = peg$c8;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e10); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.substr(peg$currPos, 3) === peg$c7) {\n s3 = peg$c7;\n peg$currPos += 3;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e9); }\n }\n peg$silentFails--;\n if (s3 !== peg$FAILED) {\n peg$currPos = s2;\n s2 = undefined;\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f23();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parsemll_body() {\n let s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parsemll_content();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parsemll_content();\n }\n s2 = [];\n s3 = peg$currPos;\n s4 = peg$parsemll_quotes();\n if (s4 !== peg$FAILED) {\n s5 = [];\n s6 = peg$parsemll_content();\n if (s6 !== peg$FAILED) {\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parsemll_content();\n }\n } else {\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = peg$parsemll_quotes();\n if (s4 !== peg$FAILED) {\n s5 = [];\n s6 = peg$parsemll_content();\n if (s6 !== peg$FAILED) {\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parsemll_content();\n }\n } else {\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n s3 = peg$parsemll_trailing();\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f24(s1, s2, s3);\n\n return s0;\n }\n\n function peg$parsemll_content() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c12) {\n s1 = peg$c12;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e15); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f25();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = [];\n s2 = input.charAt(peg$currPos);\n if (peg$r3.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e18); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = input.charAt(peg$currPos);\n if (peg$r3.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e18); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n }\n\n return s0;\n }\n\n function peg$parsemll_quotes() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c14) {\n s1 = peg$c14;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e19); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.charCodeAt(peg$currPos) === 39) {\n s3 = peg$c10;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e12); }\n }\n peg$silentFails--;\n if (s3 === peg$FAILED) {\n s2 = undefined;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f26();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 39) {\n s1 = peg$c10;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e12); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.charCodeAt(peg$currPos) === 39) {\n s3 = peg$c10;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e12); }\n }\n peg$silentFails--;\n if (s3 === peg$FAILED) {\n s2 = undefined;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f27();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parsemll_trailing() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c14) {\n s1 = peg$c14;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e19); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.substr(peg$currPos, 3) === peg$c9) {\n s3 = peg$c9;\n peg$currPos += 3;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e11); }\n }\n peg$silentFails--;\n if (s3 !== peg$FAILED) {\n peg$currPos = s2;\n s2 = undefined;\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f28();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 39) {\n s1 = peg$c10;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e12); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.substr(peg$currPos, 3) === peg$c9) {\n s3 = peg$c9;\n peg$currPos += 3;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e11); }\n }\n peg$silentFails--;\n if (s3 !== peg$FAILED) {\n peg$currPos = s2;\n s2 = undefined;\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f29();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parsestring_char() {\n let s0, s1, s2;\n\n s0 = peg$parseESCAPED();\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s1 = peg$c11;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e13); }\n }\n if (s1 !== peg$FAILED) {\n if (input.length > peg$currPos) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e14); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f30();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = [];\n s2 = input.charAt(peg$currPos);\n if (peg$r4.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e20); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = input.charAt(peg$currPos);\n if (peg$r4.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e20); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseliteral_char() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = input.charAt(peg$currPos);\n if (peg$r5.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e21); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = input.charAt(peg$currPos);\n if (peg$r5.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e21); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parsefloat() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n s1 = peg$parsefloat_or_int_text();\n if (s1 !== peg$FAILED) {\n s2 = input.charAt(peg$currPos);\n if (peg$r6.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e22); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parsefloat_exp_text();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f31(s1, s3);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsefloat_text();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f32(s1);\n }\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parsefloat_text() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r1.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$parseFLOAT_DEC_INT();\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 46) {\n s3 = peg$c3;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e4); }\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$currPos;\n s5 = peg$parseDEC_DIGIT_SEQ();\n if (s5 !== peg$FAILED) {\n s4 = input.substring(s4, peg$currPos);\n } else {\n s4 = s5;\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f33(s1, s2, s4);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsefloat_or_int_text() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r1.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$parseFLOAT_DEC_INT();\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 46) {\n s3 = peg$c3;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e4); }\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$currPos;\n s5 = peg$parseDEC_DIGIT_SEQ();\n if (s5 !== peg$FAILED) {\n s4 = input.substring(s4, peg$currPos);\n } else {\n s4 = s5;\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f34(s1, s2, s4);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r1.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$parseFLOAT_DEC_INT();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f35(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseFLOAT_DEC_INT() {\n let s0, s1;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 48) {\n s1 = peg$c15;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e23); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f36();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseDEC_INT_NOZERO_SEQ();\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n }\n\n return s0;\n }\n\n function peg$parsefloat_exp_text() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r1.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$currPos;\n s3 = peg$parseDEC_DIGIT_SEQ();\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f37(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseinteger() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c16) {\n s1 = peg$c16;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e24); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$parseHEX_DIGIT_SEQ();\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f38(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c17) {\n s1 = peg$c17;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e25); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$parseOCT_DIGIT_SEQ();\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f39(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c18) {\n s1 = peg$c18;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e26); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$parseBIN_DIGIT_SEQ();\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f40(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsedec_integer_text();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f41(s1);\n }\n s0 = s1;\n }\n }\n }\n\n return s0;\n }\n\n function peg$parsedec_integer_text() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r1.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (input.charCodeAt(peg$currPos) === 48) {\n s2 = peg$c15;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e23); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$currPos;\n peg$silentFails++;\n s4 = input.charAt(peg$currPos);\n if (peg$r7.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e27); }\n }\n peg$silentFails--;\n if (s4 === peg$FAILED) {\n s3 = undefined;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$currPos;\n peg$silentFails++;\n if (input.charCodeAt(peg$currPos) === 46) {\n s5 = peg$c3;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e4); }\n }\n peg$silentFails--;\n if (s5 === peg$FAILED) {\n s4 = undefined;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f42(s1);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r1.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n s2 = peg$currPos;\n s3 = peg$parseDEC_INT_NOZERO_SEQ();\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$currPos;\n peg$silentFails++;\n if (input.charCodeAt(peg$currPos) === 46) {\n s4 = peg$c3;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e4); }\n }\n peg$silentFails--;\n if (s4 === peg$FAILED) {\n s3 = undefined;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f43(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseDEC_INT_NOZERO_SEQ() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r8.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e28); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r10.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e30); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r10.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e30); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseDEC_DIGIT_SEQ() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r10.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e30); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r10.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e30); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r10.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e30); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseHEX_DIGIT_SEQ() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r11.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e31); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r11.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e31); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r11.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e31); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseOCT_DIGIT_SEQ() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r12.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e32); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r12.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e32); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r12.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e32); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseBIN_DIGIT_SEQ() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (peg$r13.test(s1)) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e33); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r13.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e33); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = input.charAt(peg$currPos);\n if (peg$r9.test(s4)) {\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e29); }\n }\n if (s4 === peg$FAILED) {\n s4 = null;\n }\n s5 = input.charAt(peg$currPos);\n if (peg$r13.test(s5)) {\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e33); }\n }\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseboolean() {\n let s0, s1;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 4) === peg$c19) {\n s1 = peg$c19;\n peg$currPos += 4;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e34); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f44();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 5) === peg$c20) {\n s1 = peg$c20;\n peg$currPos += 5;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e35); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f45();\n }\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parsearray() {\n let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c1;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e2); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parsearray_sep();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parsearray_sep();\n }\n if (input.charCodeAt(peg$currPos) === 93) {\n s3 = peg$c2;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e3); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f46();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c1;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e2); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parsearray_sep();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parsearray_sep();\n }\n s3 = peg$parsevalue();\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$currPos;\n s6 = [];\n s7 = peg$parsearray_sep();\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$parsearray_sep();\n }\n if (input.charCodeAt(peg$currPos) === 44) {\n s7 = peg$c21;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e36); }\n }\n if (s7 !== peg$FAILED) {\n s8 = [];\n s9 = peg$parsearray_sep();\n while (s9 !== peg$FAILED) {\n s8.push(s9);\n s9 = peg$parsearray_sep();\n }\n s9 = peg$parsevalue();\n if (s9 !== peg$FAILED) {\n peg$savedPos = s5;\n s5 = peg$f47(s3, s9);\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$currPos;\n s6 = [];\n s7 = peg$parsearray_sep();\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$parsearray_sep();\n }\n if (input.charCodeAt(peg$currPos) === 44) {\n s7 = peg$c21;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e36); }\n }\n if (s7 !== peg$FAILED) {\n s8 = [];\n s9 = peg$parsearray_sep();\n while (s9 !== peg$FAILED) {\n s8.push(s9);\n s9 = peg$parsearray_sep();\n }\n s9 = peg$parsevalue();\n if (s9 !== peg$FAILED) {\n peg$savedPos = s5;\n s5 = peg$f47(s3, s9);\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n }\n s5 = [];\n s6 = peg$parsearray_sep();\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parsearray_sep();\n }\n if (input.charCodeAt(peg$currPos) === 44) {\n s6 = peg$c21;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e36); }\n }\n if (s6 === peg$FAILED) {\n s6 = null;\n }\n s7 = [];\n s8 = peg$parsearray_sep();\n while (s8 !== peg$FAILED) {\n s7.push(s8);\n s8 = peg$parsearray_sep();\n }\n if (input.charCodeAt(peg$currPos) === 93) {\n s8 = peg$c2;\n peg$currPos++;\n } else {\n s8 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e3); }\n }\n if (s8 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f48(s3, s4);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parsearray_sep() {\n let s0;\n\n s0 = peg$parseS();\n if (s0 === peg$FAILED) {\n s0 = peg$parseNL();\n if (s0 === peg$FAILED) {\n s0 = peg$parsecomment();\n }\n }\n\n return s0;\n }\n\n function peg$parseinline_table() {\n let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 123) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e37); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseinline_sep();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseinline_sep();\n }\n if (input.charCodeAt(peg$currPos) === 125) {\n s3 = peg$c23;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e38); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f49();\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 123) {\n s1 = peg$c22;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e37); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseinline_sep();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseinline_sep();\n }\n s3 = peg$parseinline_table_entry();\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$currPos;\n s6 = [];\n s7 = peg$parseinline_sep();\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$parseinline_sep();\n }\n if (input.charCodeAt(peg$currPos) === 44) {\n s7 = peg$c21;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e36); }\n }\n if (s7 !== peg$FAILED) {\n s8 = [];\n s9 = peg$parseinline_sep();\n while (s9 !== peg$FAILED) {\n s8.push(s9);\n s9 = peg$parseinline_sep();\n }\n s9 = peg$parseinline_table_entry();\n if (s9 !== peg$FAILED) {\n peg$savedPos = s5;\n s5 = peg$f50(s3, s9);\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$currPos;\n s6 = [];\n s7 = peg$parseinline_sep();\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$parseinline_sep();\n }\n if (input.charCodeAt(peg$currPos) === 44) {\n s7 = peg$c21;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e36); }\n }\n if (s7 !== peg$FAILED) {\n s8 = [];\n s9 = peg$parseinline_sep();\n while (s9 !== peg$FAILED) {\n s8.push(s9);\n s9 = peg$parseinline_sep();\n }\n s9 = peg$parseinline_table_entry();\n if (s9 !== peg$FAILED) {\n peg$savedPos = s5;\n s5 = peg$f50(s3, s9);\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n }\n s5 = [];\n s6 = peg$parseinline_sep();\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parseinline_sep();\n }\n if (input.charCodeAt(peg$currPos) === 44) {\n s6 = peg$c21;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e36); }\n }\n if (s6 === peg$FAILED) {\n s6 = null;\n }\n s7 = [];\n s8 = peg$parseinline_sep();\n while (s8 !== peg$FAILED) {\n s7.push(s8);\n s8 = peg$parseinline_sep();\n }\n if (input.charCodeAt(peg$currPos) === 125) {\n s8 = peg$c23;\n peg$currPos++;\n } else {\n s8 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e38); }\n }\n if (s8 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f51(s3, s4);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseinline_table_entry() {\n let s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = peg$parseinline_key();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseS();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseS();\n }\n if (input.charCodeAt(peg$currPos) === 61) {\n s3 = peg$c4;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e5); }\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$parseS();\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseS();\n }\n s5 = peg$parsevalue();\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f52(s1, s5);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseinline_sep() {\n let s0;\n\n s0 = peg$parseS();\n if (s0 === peg$FAILED) {\n s0 = peg$parseNL();\n if (s0 === peg$FAILED) {\n s0 = peg$parsecomment();\n }\n }\n\n return s0;\n }\n\n function peg$parseinline_key() {\n let s0, s1, s2, s3;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseinline_dot_key_part();\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseinline_dot_key_part();\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseS();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseS();\n }\n s3 = peg$parsesimple_key();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f53(s1, s3);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsesimple_key();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f54(s1);\n }\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parseinline_dot_key_part() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseS();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseS();\n }\n s2 = peg$parsesimple_key();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseS();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseS();\n }\n if (input.charCodeAt(peg$currPos) === 46) {\n s4 = peg$c3;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e4); }\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f55(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsesimple_key() {\n let s0;\n\n s0 = peg$parsekey();\n if (s0 === peg$FAILED) {\n s0 = peg$parsequoted_key();\n }\n\n return s0;\n }\n\n function peg$parsesecfragment() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s2 = peg$c3;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e4); }\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseDIGIT();\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseDIGIT();\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = [s2, s3];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parsedate_part() {\n let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$parseDIGIT();\n if (s2 !== peg$FAILED) {\n s3 = peg$parseDIGIT();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseDIGIT();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseDIGIT();\n if (s5 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 45) {\n s6 = peg$c24;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e39); }\n }\n if (s6 !== peg$FAILED) {\n s7 = peg$parseDIGIT();\n if (s7 !== peg$FAILED) {\n s8 = peg$parseDIGIT();\n if (s8 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 45) {\n s9 = peg$c24;\n peg$currPos++;\n } else {\n s9 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e39); }\n }\n if (s9 !== peg$FAILED) {\n s10 = peg$parseDIGIT();\n if (s10 !== peg$FAILED) {\n s11 = peg$parseDIGIT();\n if (s11 !== peg$FAILED) {\n s2 = [s2, s3, s4, s5, s6, s7, s8, s9, s10, s11];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parsetime_part() {\n let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$currPos;\n s3 = peg$parseDIGIT();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseDIGIT();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s5 = peg$c25;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e40); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseDIGIT();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseDIGIT();\n if (s7 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s8 = peg$c25;\n peg$currPos++;\n } else {\n s8 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e40); }\n }\n if (s8 !== peg$FAILED) {\n s9 = peg$parseDIGIT();\n if (s9 !== peg$FAILED) {\n s10 = peg$parseDIGIT();\n if (s10 !== peg$FAILED) {\n s3 = [s3, s4, s5, s6, s7, s8, s9, s10];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s1 = input.substring(s1, peg$currPos);\n } else {\n s1 = s2;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parsesecfragment();\n if (s2 === peg$FAILED) {\n s2 = null;\n }\n peg$savedPos = s0;\n s0 = peg$f56(s1, s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$currPos;\n s3 = peg$parseDIGIT();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseDIGIT();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s5 = peg$c25;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e40); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseDIGIT();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseDIGIT();\n if (s7 !== peg$FAILED) {\n s3 = [s3, s4, s5, s6, s7];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s1 = input.substring(s1, peg$currPos);\n } else {\n s1 = s2;\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n if (input.charCodeAt(peg$currPos) === 58) {\n s3 = peg$c25;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e40); }\n }\n peg$silentFails--;\n if (s3 === peg$FAILED) {\n s2 = undefined;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f57(s1);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseoffset() {\n let s0, s1, s2, s3, s4, s5, s6, s7;\n\n s0 = peg$currPos;\n s1 = input.charAt(peg$currPos);\n if (s1.toLowerCase() === peg$c26) {\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e41); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f58();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = input.charAt(peg$currPos);\n if (peg$r1.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e6); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseDIGIT();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseDIGIT();\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s5 = peg$c25;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e40); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseDIGIT();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseDIGIT();\n if (s7 !== peg$FAILED) {\n s2 = [s2, s3, s4, s5, s6, s7];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n }\n\n return s0;\n }\n\n function peg$parsedatetime() {\n let s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$parsedate_part();\n if (s1 !== peg$FAILED) {\n s2 = peg$parsedatetime_delim();\n if (s2 !== peg$FAILED) {\n s3 = peg$parsetime_part();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseoffset();\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f59(s1, s3, s4);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsedate_part();\n if (s1 !== peg$FAILED) {\n s2 = peg$parsedatetime_delim();\n if (s2 !== peg$FAILED) {\n s3 = peg$parsetime_part();\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f60(s1, s3);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsedate_part();\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n s3 = peg$parsedatetime_delim();\n peg$silentFails--;\n if (s3 === peg$FAILED) {\n s2 = undefined;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f61(s1);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsetime_part();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$f62(s1);\n }\n s0 = s1;\n }\n }\n }\n\n return s0;\n }\n\n function peg$parsedatetime_delim() {\n let s0, s1, s2, s3;\n\n s0 = input.charAt(peg$currPos);\n if (s0.toLowerCase() === peg$c27) {\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e42); }\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 32) {\n s1 = peg$c28;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e43); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n peg$silentFails++;\n s3 = peg$parseDIGIT();\n peg$silentFails--;\n if (s3 !== peg$FAILED) {\n peg$currPos = s2;\n s2 = undefined;\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseS() {\n let s0;\n\n s0 = input.charAt(peg$currPos);\n if (peg$r14.test(s0)) {\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e44); }\n }\n\n return s0;\n }\n\n function peg$parseNL() {\n let s0, s1, s2;\n\n if (input.charCodeAt(peg$currPos) === 10) {\n s0 = peg$c29;\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e45); }\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 13) {\n s1 = peg$c30;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e46); }\n }\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 10) {\n s2 = peg$c29;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e45); }\n }\n if (s2 !== peg$FAILED) {\n s1 = [s1, s2];\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseNLS() {\n let s0;\n\n s0 = peg$parseNL();\n if (s0 === peg$FAILED) {\n s0 = peg$parseS();\n }\n\n return s0;\n }\n\n function peg$parseEOF() {\n let s0, s1;\n\n s0 = peg$currPos;\n peg$silentFails++;\n if (input.length > peg$currPos) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e14); }\n }\n peg$silentFails--;\n if (s1 === peg$FAILED) {\n s0 = undefined;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseDIGIT() {\n let s0;\n\n s0 = input.charAt(peg$currPos);\n if (peg$r10.test(s0)) {\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e30); }\n }\n\n return s0;\n }\n\n function peg$parseHEX() {\n let s0;\n\n s0 = input.charAt(peg$currPos);\n if (peg$r11.test(s0)) {\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e31); }\n }\n\n return s0;\n }\n\n function peg$parseASCII_BASIC() {\n let s0;\n\n s0 = input.charAt(peg$currPos);\n if (peg$r15.test(s0)) {\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e47); }\n }\n\n return s0;\n }\n\n function peg$parseESCAPED() {\n let s0, s1, s2;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s1 = peg$c11;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e13); }\n }\n if (s1 !== peg$FAILED) {\n s2 = input.charAt(peg$currPos);\n if (peg$r16.test(s2)) {\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e48); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f63(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$parseESCAPED_UNICODE();\n }\n\n return s0;\n }\n\n function peg$parseESCAPED_UNICODE() {\n let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c31) {\n s1 = peg$c31;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e49); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$currPos;\n s4 = peg$parseHEX();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseHEX();\n if (s5 !== peg$FAILED) {\n s6 = peg$parseHEX();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseHEX();\n if (s7 !== peg$FAILED) {\n s8 = peg$parseHEX();\n if (s8 !== peg$FAILED) {\n s9 = peg$parseHEX();\n if (s9 !== peg$FAILED) {\n s10 = peg$parseHEX();\n if (s10 !== peg$FAILED) {\n s11 = peg$parseHEX();\n if (s11 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7, s8, s9, s10, s11];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f64(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c32) {\n s1 = peg$c32;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e50); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$currPos;\n s4 = peg$parseHEX();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseHEX();\n if (s5 !== peg$FAILED) {\n s6 = peg$parseHEX();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseHEX();\n if (s7 !== peg$FAILED) {\n s4 = [s4, s5, s6, s7];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f65(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c33) {\n s1 = peg$c33;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$e51); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$currPos;\n s4 = peg$parseHEX();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseHEX();\n if (s5 !== peg$FAILED) {\n s4 = [s4, s5];\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n s2 = input.substring(s2, peg$currPos);\n } else {\n s2 = s3;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s0 = peg$f66(s2);\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n }\n\n return s0;\n }\n\n\n var nodes = [];\n var inputText = input;\n\n function resolveLineCol(off) {\n var line = 1, col = 1;\n for (var i = 0; i < off; i++) {\n if (inputText.charCodeAt(i) === 10) { line++; col = 1; }\n else { col++; }\n }\n return { line: line, column: col };\n }\n\n function genError(err, off) {\n var pos = resolveLineCol(off);\n var ex = new Error(err);\n ex.line = pos.line;\n ex.column = pos.column;\n throw ex;\n }\n\n function addNode(node) {\n nodes.push(node);\n }\n\n function node(type, value, off, key) {\n var obj = { type: type, value: value, offset: off };\n if (key) obj.key = key;\n return obj;\n }\n\n function validateDate(dateStr, off) {\n var year = dateStr.charCodeAt(0) * 1000 + dateStr.charCodeAt(1) * 100 + dateStr.charCodeAt(2) * 10 + dateStr.charCodeAt(3) - 53328;\n var month = (dateStr.charCodeAt(5) - 48) * 10 + dateStr.charCodeAt(6) - 48;\n var day = (dateStr.charCodeAt(8) - 48) * 10 + dateStr.charCodeAt(9) - 48;\n if (month < 1 || month > 12) {\n genError(\"Invalid date: month \" + month + \" out of range.\", off);\n }\n var maxDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) {\n maxDays[1] = 29;\n }\n if (day < 1 || day > maxDays[month - 1]) {\n genError(\"Invalid date: day \" + day + \" out of range for month \" + month + \".\", off);\n }\n }\n\n function validateTime(timeStr, off) {\n var hour = (timeStr.charCodeAt(0) - 48) * 10 + timeStr.charCodeAt(1) - 48;\n var minute = (timeStr.charCodeAt(3) - 48) * 10 + timeStr.charCodeAt(4) - 48;\n var second = (timeStr.charCodeAt(6) - 48) * 10 + timeStr.charCodeAt(7) - 48;\n if (hour > 23) {\n genError(\"Invalid time: hour \" + hour + \" out of range.\", off);\n }\n if (minute > 59) {\n genError(\"Invalid time: minute \" + minute + \" out of range.\", off);\n }\n if (second > 59) {\n genError(\"Invalid time: second \" + second + \" out of range.\", off);\n }\n }\n\n function validateOffset(offsetStr, off) {\n if (offsetStr === \"Z\" || offsetStr === \"z\") return;\n var hour = (offsetStr.charCodeAt(1) - 48) * 10 + offsetStr.charCodeAt(2) - 48;\n var minute = (offsetStr.charCodeAt(4) - 48) * 10 + offsetStr.charCodeAt(5) - 48;\n if (hour > 23) {\n genError(\"Invalid offset: hour \" + hour + \" out of range.\", off);\n }\n if (minute > 59) {\n genError(\"Invalid offset: minute \" + minute + \" out of range.\", off);\n }\n }\n\n function stripUnderscores(str) {\n return str.indexOf('_') === -1 ? str : str.replace(/_/g, '');\n }\n\n function convertCodePoint(str) {\n var num = parseInt(str, 16);\n\n if (\n num !== num ||\n num < 0 ||\n num > 0x10FFFF ||\n (num > 0xD7FF && num < 0xE000)\n ) {\n genError(\"Invalid Unicode escape code: \" + str, offset());\n } else {\n return String.fromCodePoint(num);\n }\n }\n\n peg$result = peg$startRuleFunction();\n\n const peg$success = (peg$result !== peg$FAILED && peg$currPos === input.length);\n function peg$throw() {\n if (peg$result !== peg$FAILED && peg$currPos < input.length) {\n peg$fail(peg$endExpectation());\n }\n\n throw peg$buildStructuredError(\n peg$maxFailExpected,\n peg$maxFailPos < input.length ? peg$getUnicode(peg$maxFailPos) : null,\n peg$maxFailPos < input.length\n ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)\n : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)\n );\n }\n if (options.peg$library) {\n return /** @type {any} */ ({\n peg$result,\n peg$currPos,\n peg$FAILED,\n peg$maxFailExpected,\n peg$maxFailPos,\n peg$success,\n peg$throw: peg$success ? undefined : peg$throw,\n });\n }\n if (peg$success) {\n return peg$result;\n } else {\n peg$throw();\n }\n}\n\nmodule.exports = {\n StartRules: [\"start\"],\n SyntaxError: peg$SyntaxError,\n parse: peg$parse,\n};\n","\"use strict\";\nfunction compile(nodes, inputText) {\n var assignedPaths = new Set();\n var valueAssignments = new Set();\n var explicitTablePaths = new Set();\n var currentPath = [];\n var ownedContainers = new WeakSet();\n var data = createTable();\n var context = data;\n\n return reduce(nodes);\n\n function reduce(nodes) {\n var node;\n for (var i = 0; i < nodes.length; i++) {\n node = nodes[i];\n switch (node.type) {\n case \"Assign\":\n assign(node);\n break;\n case \"ObjectPath\":\n setPath(node);\n break;\n case \"ArrayPath\":\n addTableArray(node);\n break;\n }\n }\n\n return data;\n }\n\n function resolveLineCol(off) {\n var line = 1, col = 1;\n for (var i = 0; i < off; i++) {\n if (inputText.charCodeAt(i) === 10) { line++; col = 1; }\n else { col++; }\n }\n return { line: line, column: col };\n }\n\n function genError(err, off) {\n var pos = resolveLineCol(off);\n var ex = new Error(err);\n ex.line = pos.line;\n ex.column = pos.column;\n throw ex;\n }\n\n function assign(node) {\n var keys = node.key;\n var value = node.value;\n var off = node.offset;\n\n if (!Array.isArray(keys)) keys = [keys];\n\n var reduced = reduceValueNode(value);\n\n var target = context;\n for (var i = 0; i < keys.length - 1; i++) {\n var k = keys[i];\n var intermediatePath = makeFullPath(keys.slice(0, i + 1));\n\n if (typeof target[k] === \"undefined\") {\n target[k] = createTable();\n assignedPaths.add(intermediatePath);\n } else if (typeof target[k] !== \"object\" || target[k] === null || Array.isArray(target[k])) {\n genError(\"Cannot redefine existing key '\" + intermediatePath + \"'.\", off);\n } else if (valueAssignments.has(intermediatePath)) {\n genError(\"Cannot redefine existing key '\" + intermediatePath + \"'.\", off);\n } else if (explicitTablePaths.has(intermediatePath) && intermediatePath !== pathKey(currentPath)) {\n genError(\"Cannot use dotted keys to extend table '\" + intermediatePath + \"' defined elsewhere.\", off);\n }\n target = target[k];\n }\n\n var lastKey = keys[keys.length - 1];\n var fullPath = makeFullPath(keys);\n\n if (typeof target[lastKey] !== \"undefined\") {\n genError(\"Cannot redefine existing key '\" + fullPath + \"'.\", off);\n }\n\n target[lastKey] = reduced;\n\n assignedPaths.add(fullPath);\n valueAssignments.add(fullPath);\n }\n\n\n function reduceValueNode(node) {\n if (node.type === \"Array\") {\n return reduceArray(node.value);\n } else if (node.type === \"InlineTable\") {\n return reduceInlineTableNode(node.value);\n } else {\n return node.value;\n }\n }\n\n function reduceInlineTableNode(values) {\n var obj = createTable();\n var definedKeys = new Set();\n\n for (var i = 0; i < values.length; i++) {\n var val = values[i];\n if (val.type !== \"InlineTableValue\") continue;\n\n var keys = val.key;\n if (!Array.isArray(keys)) keys = [keys];\n\n var reduced = reduceValueNode(val.value);\n setNestedKey(obj, keys, reduced, val.offset, definedKeys);\n\n definedKeys.add(pathKey(keys));\n }\n\n return obj;\n }\n\n function setNestedKey(obj, keys, value, off, definedKeys) {\n for (var i = 0; i < keys.length - 1; i++) {\n var k = keys[i];\n var intermediatePath = pathKey(keys.slice(0, i + 1));\n if (typeof obj[k] === \"undefined\") {\n obj[k] = createTable();\n } else if (typeof obj[k] !== \"object\" || obj[k] === null || Array.isArray(obj[k])) {\n genError(\"Cannot redefine existing key '\" + intermediatePath + \"'.\", off);\n } else if (definedKeys && definedKeys.has(intermediatePath)) {\n genError(\"Cannot extend inline table '\" + intermediatePath + \"'.\", off);\n }\n obj = obj[k];\n }\n var lastKey = keys[keys.length - 1];\n if (typeof obj[lastKey] !== \"undefined\") {\n genError(\"Cannot redefine existing key '\" + pathKey(keys) + \"'.\", off);\n }\n obj[lastKey] = value;\n }\n\n function setPath(node) {\n var path = node.value;\n var quotedPath = path.map(quoteDottedString).join(\".\");\n var off = node.offset;\n\n if (assignedPaths.has(quotedPath)) {\n genError(\"Cannot redefine existing key '\" + path + \"'.\", off);\n }\n assignedPaths.add(quotedPath);\n explicitTablePaths.add(quotedPath);\n context = deepRef(data, path, createTable(), off);\n currentPath = path;\n }\n\n function addTableArray(node) {\n var path = node.value;\n var quotedPath = path.map(quoteDottedString).join(\".\");\n var off = node.offset;\n\n if (valueAssignments.has(quotedPath)) {\n genError(\"Cannot append to statically defined array '\" + quotedPath + \"'.\", off);\n }\n\n // Clear this table array path and paths nested under it.\n assignedPaths.forEach(function(p) {\n if (isSameOrSubPath(p, quotedPath)) assignedPaths.delete(p);\n });\n valueAssignments.forEach(function(p) {\n if (isSameOrSubPath(p, quotedPath)) valueAssignments.delete(p);\n });\n assignedPaths.add(quotedPath);\n context = deepRef(data, path, createTableArray(), off);\n currentPath = path;\n\n if (context instanceof Array) {\n var newObj = createTable();\n context.push(newObj);\n context = newObj;\n } else {\n genError(\"Cannot redefine existing key '\" + path + \"'.\", off);\n }\n }\n\n function deepRef(start, keys, value, off) {\n var ctx = start;\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var traversedPath = pathKey(keys.slice(0, i + 1));\n if (typeof ctx[key] === \"undefined\") {\n if (i === keys.length - 1) {\n ctx[key] = value;\n } else {\n ctx[key] = createTable();\n }\n } else if (i !== keys.length - 1 && valueAssignments.has(traversedPath)) {\n genError(\"Cannot redefine existing key '\" + traversedPath + \"'.\", off);\n }\n\n ctx = ctx[key];\n if (i < keys.length - 1) {\n if (!isOwnedContainer(ctx)) {\n genError(\"Cannot redefine existing key '\" + traversedPath + \"'.\", off);\n }\n if (ctx instanceof Array) {\n if (!ctx.length) {\n genError(\"Cannot redefine existing key '\" + traversedPath + \"'.\", off);\n }\n ctx = ctx[ctx.length - 1];\n if (!isOwnedContainer(ctx)) {\n genError(\"Cannot redefine existing key '\" + traversedPath + \"'.\", off);\n }\n }\n }\n }\n\n return ctx;\n }\n\n function reduceArray(array) {\n return array.map(reduceValueNode);\n }\n\n function quoteDottedString(str) {\n if (str.indexOf(\".\") > -1) {\n return \"\\\"\" + str + \"\\\"\";\n } else {\n return str;\n }\n }\n\n function createTable() {\n var table = Object.create(null);\n ownedContainers.add(table);\n return table;\n }\n\n function createTableArray() {\n var tableArray = [];\n ownedContainers.add(tableArray);\n return tableArray;\n }\n\n function isOwnedContainer(value) {\n return value !== null && typeof value === \"object\" && ownedContainers.has(value);\n }\n\n function pathKey(keys) {\n return keys.map(quoteDottedString).join(\".\");\n }\n\n function makeFullPath(keys) {\n return pathKey(currentPath.concat(keys));\n }\n\n function isSameOrSubPath(path, prefix) {\n return path === prefix || path.indexOf(prefix + \".\") === 0;\n }\n}\n\nmodule.exports = {\n compile: compile\n};\n","var parser = require('./lib/parser');\nvar compiler = require('./lib/compiler');\n\nmodule.exports = {\n parse: function(input) {\n var str = input.toString();\n var nodes = parser.parse(str);\n return compiler.compile(nodes, str);\n }\n};\n","/**\n * Parses raw command-line strings into typed values.\n *\n * A `Primitive<A>` receives one string and returns an `Effect` that either\n * produces an `A` or fails with a parser message. `Argument` and `Flag` build\n * on these primitives to add names, aliases, defaults, prompts, configuration\n * fallbacks, repetition, and help metadata. Primitive parsers cover common\n * scalar values, paths, files, structured config files, schema-decoded input,\n * redacted values, and key-value pairs.\n *\n * @since 4.0.0\n */\nimport * as Ini from \"ini\";\nimport * as Toml from \"toml\";\nimport * as Yaml from \"yaml\";\nimport * as Config from \"../../Config.js\";\nimport * as Effect from \"../../Effect.js\";\nimport * as FileSystem from \"../../FileSystem.js\";\nimport { format } from \"../../Formatter.js\";\nimport { identity } from \"../../Function.js\";\nimport * as Path from \"../../Path.js\";\nimport * as Redacted from \"../../Redacted.js\";\nimport * as Schema from \"../../Schema.js\";\nconst TypeId = \"~effect/cli/Primitive\";\nconst Proto = {\n [TypeId]: {\n _A: identity\n }\n};\n/** @internal */\nexport const isTrueValue = /*#__PURE__*/Schema.is(Config.TrueValues);\n/** @internal */\nexport const isFalseValue = /*#__PURE__*/Schema.is(Config.FalseValues);\n/** @internal */\nexport const isBoolean = p => p._tag === \"Boolean\";\nconst makePrimitive = (tag, parse) => Object.assign(Object.create(Proto), {\n _tag: tag,\n parse\n});\nconst makeSchemaPrimitive = (tag, schema) => {\n const toCodecStringTree = Schema.toCodecStringTree(schema);\n const decode = Schema.decodeUnknownEffect(toCodecStringTree);\n return makePrimitive(tag, value => Effect.mapError(decode(value), error => error.message));\n};\n/**\n * Creates a primitive that parses boolean values from string input.\n *\n * **Details**\n *\n * Recognizes various forms of true/false values:\n * - True values: \"true\", \"1\", \"y\", \"yes\", \"on\"\n * - False values: \"false\", \"0\", \"n\", \"no\", \"off\"\n *\n * **Example** (Parsing boolean values)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const parseBoolean = Effect.gen(function*() {\n * const result1 = yield* Primitive.boolean.parse(\"true\")\n * console.log(result1) // true\n *\n * const result2 = yield* Primitive.boolean.parse(\"yes\")\n * console.log(result2) // true\n *\n * const result3 = yield* Primitive.boolean.parse(\"false\")\n * console.log(result3) // false\n *\n * const result4 = yield* Primitive.boolean.parse(\"0\")\n * console.log(result4) // false\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const boolean = /*#__PURE__*/makeSchemaPrimitive(\"Boolean\", Config.Boolean);\n/**\n * Creates a primitive that parses floating-point numbers from string input.\n *\n * **Example** (Parsing floating-point numbers)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const parseFloat = Effect.gen(function*() {\n * const result1 = yield* Primitive.float.parse(\"3.14\")\n * console.log(result1) // 3.14\n *\n * const result2 = yield* Primitive.float.parse(\"-42.5\")\n * console.log(result2) // -42.5\n *\n * const result3 = yield* Primitive.float.parse(\"0\")\n * console.log(result3) // 0\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const float = /*#__PURE__*/makeSchemaPrimitive(\"Float\", Schema.Finite);\n/**\n * Creates a primitive that parses integer numbers from string input.\n *\n * **Example** (Parsing integer values)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const parseInteger = Effect.gen(function*() {\n * const result1 = yield* Primitive.integer.parse(\"42\")\n * console.log(result1) // 42\n *\n * const result2 = yield* Primitive.integer.parse(\"-123\")\n * console.log(result2) // -123\n *\n * const result3 = yield* Primitive.integer.parse(\"0\")\n * console.log(result3) // 0\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const integer = /*#__PURE__*/makeSchemaPrimitive(\"Integer\", Schema.Int);\n/**\n * Creates a primitive that parses Date objects from string input.\n *\n * **Example** (Parsing date values)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const parseDate = Effect.gen(function*() {\n * const result1 = yield* Primitive.date.parse(\"2023-12-25\")\n * console.log(result1) // Date object for December 25, 2023\n *\n * const result2 = yield* Primitive.date.parse(\"2023-12-25T10:30:00Z\")\n * console.log(result2) // Date object with time\n *\n * const result3 = yield* Primitive.date.parse(\"Dec 25, 2023\")\n * console.log(result3) // Date object parsed from natural format\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const date = /*#__PURE__*/makeSchemaPrimitive(\"Date\", Schema.DateValid);\n/**\n * Creates a primitive that accepts any string value without validation.\n *\n * **Example** (Parsing string values)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const parseString = Effect.gen(function*() {\n * const result1 = yield* Primitive.string.parse(\"hello world\")\n * console.log(result1) // \"hello world\"\n *\n * const result2 = yield* Primitive.string.parse(\"\")\n * console.log(result2) // \"\"\n *\n * const result3 = yield* Primitive.string.parse(\"123\")\n * console.log(result3) // \"123\"\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const string = /*#__PURE__*/makePrimitive(\"String\", value => Effect.succeed(value));\n/**\n * Creates a primitive that accepts only specific choice values mapped to custom types.\n *\n * **Example** (Parsing choices)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * type LogLevel = \"debug\" | \"info\" | \"warn\" | \"error\"\n *\n * const logLevelPrimitive = Primitive.choice<LogLevel>([\n * [\"debug\", \"debug\"],\n * [\"info\", \"info\"],\n * [\"warn\", \"warn\"],\n * [\"error\", \"error\"]\n * ])\n *\n * const parseLogLevel = Effect.gen(function*() {\n * const result1 = yield* logLevelPrimitive.parse(\"info\")\n * console.log(result1) // \"info\"\n *\n * const result2 = yield* logLevelPrimitive.parse(\"debug\")\n * console.log(result2) // \"debug\"\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const choice = choices => {\n const choiceMap = new Map(choices);\n const validChoices = choices.map(([key]) => format(key)).join(\" | \");\n const primitive = makePrimitive(\"Choice\", value => {\n if (choiceMap.has(value)) {\n return Effect.succeed(choiceMap.get(value));\n }\n return Effect.fail(`Expected ${validChoices}, got ${format(value)}`);\n });\n return Object.assign(primitive, {\n choiceKeys: choices.map(([key]) => key)\n });\n};\n/**\n * Creates a primitive that validates and resolves file system paths.\n *\n * **Example** (Parsing file system paths)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const program = Effect.gen(function*() {\n * // Parse a file path that must exist\n * const filePrimitive = Primitive.path(\"file\", true)\n * const filePath = yield* filePrimitive.parse(\"./package.json\")\n * console.log(filePath) // Absolute path to package.json\n *\n * // Parse a directory path\n * const dirPrimitive = Primitive.path(\"directory\", false)\n * const dirPath = yield* dirPrimitive.parse(\"./src\")\n * console.log(dirPath) // Absolute path to src directory\n *\n * // Parse any path type\n * const anyPrimitive = Primitive.path(\"either\", false)\n * const anyPath = yield* anyPrimitive.parse(\"./some/path\")\n * console.log(anyPath) // Absolute path\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const path = (pathType, mustExist) => makePrimitive(\"Path\", Effect.fnUntraced(function* (value) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n // Resolve the path to absolute\n const absolutePath = path.isAbsolute(value) ? value : path.resolve(value);\n // Check if path exists\n const exists = yield* Effect.mapError(fs.exists(absolutePath), error => `Failed to check path existence: ${error.message}`);\n // Validate existence requirements\n if (mustExist === true && !exists) {\n return yield* Effect.fail(`Path does not exist: ${absolutePath}`);\n }\n // Validate path type if it exists\n if (exists && pathType !== \"either\") {\n const stat = yield* Effect.mapError(fs.stat(absolutePath), error => `Failed to stat path: ${error.message}`);\n if (pathType === \"file\" && stat.type !== \"File\") {\n return yield* Effect.fail(`Path is not a file: ${absolutePath}`);\n }\n if (pathType === \"directory\" && stat.type !== \"Directory\") {\n return yield* Effect.fail(`Path is not a directory: ${absolutePath}`);\n }\n }\n return absolutePath;\n}));\n/**\n * Creates a primitive that wraps string input in `Redacted`.\n *\n * **Details**\n *\n * The wrapped value is hidden when formatted or inspected, while the original\n * string remains available through the `Redacted` API when explicitly needed.\n *\n * **Example** (Parsing redacted values)\n *\n * ```ts\n * import { Effect, Redacted } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const parseRedacted = Effect.gen(function*() {\n * const result = yield* Primitive.redacted.parse(\"secret-password\")\n * console.log(Redacted.value(result)) // \"secret-password\"\n * console.log(String(result)) // \"<redacted>\"\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const redacted = /*#__PURE__*/makePrimitive(\"Redacted\", value => Effect.succeed(Redacted.make(value)));\n/**\n * Creates a primitive that reads and returns the contents of a file as a string.\n *\n * **Example** (Reading file text)\n *\n * ```ts\n * import { Effect, Schema } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const ConfigSchema = Schema.Struct({\n * name: Schema.String,\n * version: Schema.String,\n * port: Schema.Number\n * })\n * const decodeConfig = Schema.decodeUnknownEffect(\n * Schema.fromJsonString(ConfigSchema)\n * )\n *\n * const readConfigFile = Effect.gen(function*() {\n * const content = yield* Primitive.fileText.parse(\"./config.json\")\n * console.log(content) // {\"name\":\"my-app\",\"version\":\"1.0.0\",\"port\":3000}\n *\n * const config = yield* decodeConfig(content)\n * console.log(config) // { name: \"my-app\", version: \"1.0.0\", port: 3000 }\n * return config\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileText = /*#__PURE__*/makePrimitive(\"FileText\", /*#__PURE__*/Effect.fnUntraced(function* (filePath) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n // Resolve to absolute path\n const absolutePath = path.isAbsolute(filePath) ? filePath : path.resolve(filePath);\n // Check if file exists\n const exists = yield* Effect.mapError(fs.exists(absolutePath), error => `Failed to check file existence: ${error.message}`);\n if (!exists) {\n return yield* Effect.fail(`File does not exist: ${absolutePath}`);\n }\n // Check if it's actually a file\n const stat = yield* Effect.mapError(fs.stat(absolutePath), error => `Failed to stat file: ${error.message}`);\n if (stat.type !== \"File\") {\n return yield* Effect.fail(`Path is not a file: ${absolutePath}`);\n }\n // Read file content\n const content = yield* Effect.mapError(fs.readFileString(absolutePath), error => `Failed to read file: ${error.message}`);\n return content;\n}));\nconst fileParsers = {\n ini: content => Ini.parse(content),\n json: content => JSON.parse(content),\n toml: content => Toml.parse(content),\n yml: content => Yaml.parse(content),\n yaml: content => Yaml.parse(content)\n};\n/**\n * Creates a primitive that reads a file and parses its content as structured\n * data.\n *\n * **Details**\n *\n * The parser is selected from `options.format` when provided, otherwise from\n * the file extension. Supported formats include INI, JSON, TOML, YAML, and YML.\n *\n * **Example** (Parsing file content)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const tomlFilePrimitive = Primitive.fileParse({ format: \"toml\" })\n *\n * const loadConfig = Effect.gen(function*() {\n * const config = yield* tomlFilePrimitive.parse(\"./config.toml\")\n * console.log(config) // { name: \"my-app\", version: \"1.0.0\", port: 3000 }\n * return config\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileParse = options => {\n return makePrimitive(\"FileParse\", Effect.fnUntraced(function* (filePath) {\n const fileFormat = options?.format ?? filePath.split(\".\").pop();\n const parser = fileParsers[fileFormat];\n if (parser === undefined) {\n return yield* Effect.fail(`Unsupported file format: ${fileFormat}`);\n }\n const content = yield* fileText.parse(filePath);\n return yield* Effect.try({\n try: () => parser(content),\n catch: error => `Failed to parse '.${fileFormat}' file content: ${error}`\n });\n }));\n};\n/**\n * Reads and parses file content using the specified schema.\n *\n * **Example** (Parsing file content with a schema)\n *\n * ```ts\n * import { Effect, Schema } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const ConfigSchema = Schema.Struct({\n * name: Schema.String,\n * version: Schema.String,\n * port: Schema.Number\n * })\n *\n * const jsonConfigPrimitive = Primitive.fileSchema(ConfigSchema, {\n * format: \"json\"\n * })\n *\n * const loadConfig = Effect.gen(function*() {\n * const config = yield* jsonConfigPrimitive.parse(\"./config.json\")\n * console.log(config) // { name: \"my-app\", version: \"1.0.0\", port: 3000 }\n * return config\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileSchema = (schema, options) => {\n const decode = Schema.decodeUnknownEffect(schema);\n return makePrimitive(\"FileSchema\", Effect.fnUntraced(function* (filePath) {\n const content = yield* fileParse(options).parse(filePath);\n return yield* Effect.mapError(decode(content), error => options?.errorFormatter?.(error.issue) ?? error.toString());\n }));\n};\n/**\n * Parses a single `key=value` pair into a record object.\n *\n * **Example** (Parsing key-value pairs)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const parseKeyValue = Effect.gen(function*() {\n * const result1 = yield* Primitive.keyValuePair.parse(\"name=john\")\n * console.log(result1) // { name: \"john\" }\n *\n * const result2 = yield* Primitive.keyValuePair.parse(\"port=3000\")\n * console.log(result2) // { port: \"3000\" }\n *\n * const result3 = yield* Primitive.keyValuePair.parse(\"debug=true\")\n * console.log(result3) // { debug: \"true\" }\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const keyValuePair = /*#__PURE__*/makePrimitive(\"KeyValuePair\", /*#__PURE__*/Effect.fnUntraced(function* (value) {\n const parts = value.split(\"=\");\n if (parts.length !== 2) {\n return yield* Effect.fail(`Invalid key=value format. Expected format: key=value, got: ${value}`);\n }\n const [key, val] = parts;\n if (!key || !val) {\n return yield* Effect.fail(`Invalid key=value format. Both key and value must be non-empty. Got: ${value}`);\n }\n return {\n [key]: val\n };\n}));\n/**\n * Creates a sentinel primitive that always fails to parse a value.\n *\n * **When to use**\n *\n * Use when you need a CLI primitive for flags that do not accept values.\n *\n * **Example** (Rejecting option values)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * const program = Effect.gen(function*() {\n * // This will always fail - useful for boolean flags\n * return yield* Primitive.none.parse(\"any-value\")\n * })\n *\n * // The above effect will fail with \"This option does not accept values\"\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const none = /*#__PURE__*/makePrimitive(\"None\", () => Effect.fail(\"This option does not accept values\"));\n/**\n * Gets a human-readable type name for a primitive.\n *\n * **When to use**\n *\n * Use when you need the display type name for a `Primitive`, such as when\n * generating CLI help documentation.\n *\n * **Example** (Getting primitive type names)\n *\n * ```ts\n * import { Primitive } from \"effect/unstable/cli\"\n *\n * console.log(Primitive.getTypeName(Primitive.string)) // \"string\"\n * console.log(Primitive.getTypeName(Primitive.integer)) // \"integer\"\n * console.log(Primitive.getTypeName(Primitive.boolean)) // \"boolean\"\n * console.log(Primitive.getTypeName(Primitive.date)) // \"date\"\n * console.log(Primitive.getTypeName(Primitive.keyValuePair)) // \"key=value\"\n *\n * const logLevelChoice = Primitive.choice([\n * [\"debug\", \"debug\"],\n * [\"info\", \"info\"]\n * ])\n * console.log(Primitive.getTypeName(logLevelChoice)) // \"choice\"\n * ```\n *\n * @category getters\n * @since 4.0.0\n */\nexport const getTypeName = primitive => {\n switch (primitive._tag) {\n case \"Boolean\":\n return \"boolean\";\n case \"String\":\n return \"string\";\n case \"Integer\":\n return \"integer\";\n case \"Float\":\n return \"number\";\n case \"Date\":\n return \"date\";\n case \"Path\":\n return \"path\";\n case \"Choice\":\n return \"choice\";\n case \"Redacted\":\n return \"string\";\n case \"FileText\":\n return \"file\";\n case \"FileParse\":\n return \"file\";\n case \"FileSchema\":\n return \"file\";\n case \"KeyValuePair\":\n return \"key=value\";\n case \"None\":\n return \"none\";\n default:\n return \"value\";\n }\n};\n/** @internal */\nexport const getChoiceKeys = primitive => primitive._tag === \"Choice\" ? primitive.choiceKeys : undefined;\n//# sourceMappingURL=Primitive.js.map","/**\n * Internal ANSI escape sequence helpers used by the unstable CLI rendering\n * implementation. This module centralizes the control codes for text styling,\n * cursor movement, line erasing, and terminal notifications so renderers can\n * compose terminal output without scattering raw escape sequences throughout\n * the CLI internals.\n *\n * The helpers deliberately work with plain strings because terminal rendering\n * is sensitive to ordering: style codes must be reset after annotated text,\n * cursor operations must account for one-based terminal coordinates, and line\n * clearing usually needs to preserve the cursor position expected by the next\n * frame.\n */\nconst ESC = \"\\x1B[\";\nconst BEL = \"\\x07\";\nconst SEP = \";\";\n/** @internal */\nexport const reset = `${ESC}0m`;\n/** @internal */\nexport const bold = `${ESC}1m`;\n/** @internal */\nexport const italicized = `${ESC}3m`;\n/** @internal */\nexport const underlined = `${ESC}4m`;\n/** @internal */\nexport const strikethrough = `${ESC}9m`;\n/** @internal */\nexport const cursorShow = `${ESC}?25h`;\n/** @internal */\nexport const cursorHide = `${ESC}?25l`;\n/** @internal */\nexport const cursorLeft = `${ESC}G`;\n/** @internal */\nexport const cursorSavePosition = `${ESC}s`;\n/** @internal */\nexport const cursorRestorePosition = `${ESC}u`;\n/** @internal */\nexport const eraseLine = `${ESC}2K`;\n/** @internal */\nexport const beep = BEL;\n/** @internal */\nexport const red = `${ESC}31m`;\n/** @internal */\nexport const green = `${ESC}32m`;\n/** @internal */\nexport const white = `${ESC}37m`;\n/** @internal */\nexport const blackBright = `${ESC}90m`;\n/** @internal */\nexport const cyanBright = `${ESC}96m`;\nexport const annotate = (text, ...styles) => {\n const flat = styles.flat();\n return `${flat.join(\"\")}${text}${reset}`;\n};\nexport const combine = (...styles) => styles;\n/** @internal */\nexport const cursorTo = (column, row) => {\n if (row === undefined) {\n return `\\x1b${Math.max(column + 1, 0)} G`;\n }\n return `\\x1b${row + 1}${SEP}${Math.max(column + 1, 0)} H`;\n};\n/** @internal */\nexport const cursorDown = (lines = 1) => {\n return `${ESC}${lines}B`;\n};\n/** @internal */\nexport const cursorMove = (column, row = 0) => {\n let command = \"\";\n if (row < 0) {\n command += `${ESC}${-row}A`;\n }\n if (row > 0) {\n command += `${ESC}${row}B`;\n }\n if (column > 0) {\n command += `${ESC}${column}C`;\n }\n if (column < 0) {\n command += `${ESC}${-column}D`;\n }\n return command;\n};\n/** @internal */\nexport const eraseLines = rows => {\n let command = \"\";\n for (let i = 0; i < rows; i++) {\n command += `${ESC}2K` + (i < rows - 1 ? `${ESC}1A` : \"\");\n }\n if (rows > 0) {\n command += `${ESC}G`;\n }\n return command;\n};\n//# sourceMappingURL=ansi.js.map","/**\n * Builds interactive terminal prompts for CLI applications.\n *\n * A `Prompt<A>` describes a small terminal UI that renders frames, reads\n * keyboard input, validates responses, and eventually produces an `A`. Prompts\n * can ask for simple values, selections, lists, files, hidden text, or custom\n * interactions. This module includes prompt constructors, tools for combining\n * and transforming prompt output, and support for running prompts through the\n * `Terminal` service.\n *\n * @since 4.0.0\n */\nimport * as Arr from \"../../Array.js\";\nimport * as Data from \"../../Data.js\";\nimport * as Effect from \"../../Effect.js\";\nimport * as Effectable from \"../../Effectable.js\";\nimport * as FileSystem from \"../../FileSystem.js\";\nimport { dual, pipe } from \"../../Function.js\";\nimport * as EffectNumber from \"../../Number.js\";\nimport * as Option from \"../../Option.js\";\nimport * as Path from \"../../Path.js\";\nimport * as Predicate from \"../../Predicate.js\";\nimport * as Queue from \"../../Queue.js\";\nimport * as Redacted from \"../../Redacted.js\";\nimport * as Terminal from \"../../Terminal.js\";\nimport * as Ansi from \"./internal/ansi.js\";\nconst TypeId = \"~effect/cli/Prompt\";\n/**\n * Returns `true` if the provided value is a `Prompt`.\n *\n * @category guards\n * @since 4.0.0\n */\nexport const isPrompt = u => Predicate.hasProperty(u, TypeId);\nconst defaultFigures = {\n arrowUp: \"↑\",\n arrowDown: \"↓\",\n arrowLeft: \"←\",\n arrowRight: \"→\",\n radioOn: \"◉\",\n radioOff: \"◯\",\n checkboxOn: \"☒\",\n checkboxOff: \"☐\",\n tick: \"✔\",\n cross: \"✖\",\n ellipsis: \"…\",\n pointerSmall: \"›\",\n line: \"─\",\n pointer: \"❯\"\n};\nconst windowsFigures = {\n arrowUp: defaultFigures.arrowUp,\n arrowDown: defaultFigures.arrowDown,\n arrowLeft: defaultFigures.arrowLeft,\n arrowRight: defaultFigures.arrowRight,\n radioOn: \"(*)\",\n radioOff: \"( )\",\n checkboxOn: \"[*]\",\n checkboxOff: \"[ ]\",\n tick: \"√\",\n cross: \"×\",\n ellipsis: \"...\",\n pointerSmall: \"»\",\n line: \"─\",\n pointer: \">\"\n};\n/** @internal */\nexport const platformFigures = /*#__PURE__*/Effect.map(/*#__PURE__*/Effect.sync(() => process.platform === \"win32\"), isWindows => isWindows ? windowsFigures : defaultFigures);\n/**\n * Runs all the provided prompts in sequence respecting the structure provided\n * in input.\n *\n * **Details**\n *\n * Supports either a tuple / iterable of prompts or a record / struct of prompts\n * as an argument.\n *\n * **Example** (Collecting prompt results)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Prompt } from \"effect/unstable/cli\"\n *\n * const username = Prompt.text({\n * message: \"Enter your username: \"\n * })\n *\n * const password = Prompt.password({\n * message: \"Enter your password: \",\n * validate: (value) =>\n * value.length === 0\n * ? Effect.fail(\"Password cannot be empty\")\n * : Effect.succeed(value)\n * })\n *\n * const allWithTuple = Prompt.all([username, password])\n *\n * const allWithRecord = Prompt.all({ username, password })\n * ```\n *\n * @category collecting & elements\n * @since 4.0.0\n */\nexport const all = function () {\n if (arguments.length === 1) {\n if (isPrompt(arguments[0])) {\n return map(arguments[0], x => [x]);\n } else if (Array.isArray(arguments[0])) {\n return allTupled(arguments[0]);\n } else {\n const entries = Object.entries(arguments[0]);\n let result = map(entries[0][1], value => ({\n [entries[0][0]]: value\n }));\n if (entries.length === 1) {\n return result;\n }\n const rest = entries.slice(1);\n for (const [key, prompt] of rest) {\n result = result.pipe(flatMap(record => prompt.pipe(map(value => ({\n ...record,\n [key]: value\n })))));\n }\n return result;\n }\n }\n return allTupled(arguments[0]);\n};\nconst annotateLine = line => Ansi.annotate(line, Ansi.bold);\nconst annotateErrorLine = line => Ansi.annotate(line, Ansi.combine(Ansi.italicized, Ansi.red));\n/**\n * Creates a confirmation prompt that asks the user to choose a boolean yes/no\n * value.\n *\n * **When to use**\n *\n * Use to ask for a yes/no answer that can be submitted directly.\n *\n * **Details**\n *\n * `initial` defaults to `false`. Enter submits the current default, yes-style\n * input submits `true`, no-style input submits `false`, and other input beeps.\n *\n * @see {@link toggle} for an interactive switch-before-submit boolean prompt\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const confirm = options => {\n const opts = {\n initial: false,\n ...options,\n label: {\n confirm: \"yes\",\n deny: \"no\",\n ...options.label\n },\n placeholder: {\n defaultConfirm: \"(Y/n)\",\n defaultDeny: \"(y/N)\",\n ...options.placeholder\n }\n };\n const initialState = {\n value: opts.initial\n };\n return custom(initialState, {\n render: handleConfirmRender(opts),\n process: input => handleConfirmProcess(input, opts.initial),\n clear: handleConfirmClear(opts)\n });\n};\n/**\n * Creates a custom `Prompt` from the specified initial state and handlers.\n *\n * **Details**\n *\n * The initial state can either be a pure value or an `Effect`. This is\n * particularly useful when the initial state of the `Prompt` must be computed\n * by performing an effectful computation, such as reading data from the file\n * system. A `Prompt` runs as a render loop: `render` returns ANSI output for\n * the current frame, the `Terminal` obtains user input, `process` returns the\n * next prompt action, and `clear` returns ANSI output used to clear the previous\n * frame.\n *\n * Optionally, an external `events` dequeue can be provided as the third\n * argument. When present, the render loop will race user input against events\n * from the dequeue, allowing background events to trigger re-renders without\n * waiting for a keypress. When an event is received from the dequeue, the\n * `receive` handler is called instead of `process`.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const custom = (initialState, ...args) => {\n const [events, handlers] = args.length === 1 ? [undefined, args[0]] : [args[0], args[1]];\n const op = Object.create(proto);\n op._tag = \"Loop\";\n op.initialState = initialState;\n op.render = handlers.render;\n op.process = handlers.process;\n op.clear = handlers.clear;\n op.events = events;\n return op;\n};\n/**\n * Creates a date prompt that lets the user edit a formatted date value and\n * validates the final `Date` before submission.\n *\n * **Details**\n *\n * `initial` defaults to the current `Date`, `dateMask` defaults to\n * `YYYY-MM-DD HH:mm:ss`, mask parsing creates editable date parts plus literal\n * tokens, `locales` customizes month and weekday labels, and `validate` runs on\n * submission.\n *\n * **Gotchas**\n *\n * A supplied `initial` `Date` is edited in place during prompt interaction.\n * Date edits use JavaScript `Date` setters, so out-of-range typed values can\n * normalize before validation. If the prompt is meant to be editable,\n * `dateMask` should contain at least one editable date token.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const date = options => {\n const opts = {\n initial: new Date(),\n dateMask: \"YYYY-MM-DD HH:mm:ss\",\n validate: Effect.succeed,\n ...options,\n locales: {\n ...defaultLocales,\n ...options.locales\n }\n };\n const dateParts = makeDateParts(opts.dateMask, opts.initial, opts.locales);\n const initialCursorPosition = dateParts.findIndex(part => !part.isToken());\n const initialState = {\n dateParts,\n typed: \"\",\n cursor: initialCursorPosition,\n value: opts.initial,\n error: Option.none()\n };\n return custom(initialState, {\n render: handleDateRender(opts),\n process: handleDateProcess(opts),\n clear: handleDateClear(opts)\n });\n};\n/**\n * Creates a file-system selection prompt and returns the selected path.\n *\n * **Details**\n *\n * The prompt can be configured to select files, directories, or either path\n * type.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const file = (options = {}) => {\n const opts = {\n type: options.type ?? \"file\",\n message: options.message ?? `Choose a file`,\n startingPath: Option.fromUndefinedOr(options.startingPath),\n default: Option.fromUndefinedOr(options.default),\n maxPerPage: options.maxPerPage ?? 10,\n filter: options.filter ?? (() => Effect.succeed(true))\n };\n const initialState = Effect.gen(function* () {\n const currentPath = yield* resolveCurrentPath(Option.none(), opts);\n const path = yield* Path.Path;\n const defaultPath = Option.map(opts.default, defaultValue => path.resolve(currentPath, defaultValue));\n const initialPath = Option.match(defaultPath, {\n onNone: () => currentPath,\n onSome: defaultPath => path.dirname(defaultPath)\n });\n const files = yield* getFileList(initialPath, opts);\n const cursor = Option.match(defaultPath, {\n onNone: () => 0,\n onSome: defaultPath => {\n const index = files.indexOf(path.basename(defaultPath));\n return index === -1 ? 0 : index;\n }\n });\n const confirm = Confirm.Hide();\n return {\n cursor,\n files,\n allFiles: files,\n query: \"\",\n path: Option.map(defaultPath, path.dirname),\n confirm\n };\n });\n return custom(initialState, {\n render: handleFileRender(opts),\n process: handleFileProcess(opts),\n clear: handleFileClear(opts)\n });\n};\n/**\n * Composes prompts by using the output of this prompt to create the next prompt.\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const flatMap = /*#__PURE__*/dual(2, (self, f) => {\n const op = Object.create(proto);\n op._tag = \"OnSuccess\";\n op.prompt = self;\n op.onSuccess = f;\n return op;\n});\n/**\n * Creates a floating-point number prompt.\n *\n * **Details**\n *\n * The prompt supports minimum and maximum bounds, keyboard step sizes, display\n * precision, and additional validation before submission.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const float = options => {\n const opts = {\n default: 0,\n min: Number.NEGATIVE_INFINITY,\n max: Number.POSITIVE_INFINITY,\n incrementBy: 1,\n decrementBy: 1,\n precision: 2,\n validate: n => {\n if (n < opts.min) {\n return Effect.fail(`${n} must be greater than or equal to ${opts.min}`);\n }\n if (n > opts.max) {\n return Effect.fail(`${n} must be less than or equal to ${opts.max}`);\n }\n return Effect.succeed(n);\n },\n ...options\n };\n const initialValue = options.default === undefined ? \"\" : `${opts.default}`;\n const initialState = {\n cursor: initialValue.length,\n value: initialValue,\n error: Option.none()\n };\n return custom(initialState, {\n render: handleRenderFloat(opts),\n process: handleProcessFloat(opts),\n clear: handleNumberClear(opts)\n });\n};\n/**\n * Creates a text prompt that does not echo typed input and returns the\n * submitted value wrapped in `Redacted`.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const hidden = options => basePrompt(options, \"hidden\").pipe(map(Redacted.make));\n/**\n * Creates an integer prompt.\n *\n * **Details**\n *\n * The prompt supports minimum and maximum bounds, keyboard step sizes, and\n * additional validation before submission.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const integer = options => {\n const opts = {\n default: 0,\n min: Number.NEGATIVE_INFINITY,\n max: Number.POSITIVE_INFINITY,\n incrementBy: 1,\n decrementBy: 1,\n validate: n => {\n if (n < opts.min) {\n return Effect.fail(`${n} must be greater than or equal to ${opts.min}`);\n }\n if (n > opts.max) {\n return Effect.fail(`${n} must be less than or equal to ${opts.max}`);\n }\n return Effect.succeed(n);\n },\n ...options\n };\n const initialValue = options.default === undefined ? \"\" : `${opts.default}`;\n const initialState = {\n cursor: initialValue.length,\n value: initialValue,\n error: Option.none()\n };\n return custom(initialState, {\n render: handleRenderInteger(opts),\n process: handleProcessInteger(opts),\n clear: handleNumberClear(opts)\n });\n};\n/**\n * Creates a text prompt that returns an array of strings by splitting the\n * submitted input on the configured delimiter.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const list = options => text(options).pipe(map(output => output.split(options.delimiter || \",\")));\n/**\n * Transforms the output value produced by a prompt.\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const map = /*#__PURE__*/dual(2, (self, f) => flatMap(self, a => succeed(f(a))));\n/**\n * Creates a password prompt that masks typed input and returns the submitted\n * value wrapped in `Redacted`.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const password = options => basePrompt(options, \"password\").pipe(map(Redacted.make));\n/**\n * Runs a prompt by reading terminal input and rendering prompt frames until the\n * prompt submits a value.\n *\n * **Gotchas**\n *\n * The returned effect may fail with `Terminal.QuitError` if terminal input ends\n * or the prompt is quit.\n *\n * @category execution\n * @since 4.0.0\n */\nexport const run = /*#__PURE__*/Effect.fnUntraced(function* (self) {\n const terminal = yield* Terminal.Terminal;\n const input = yield* terminal.readInput;\n return yield* runWithInput(self, terminal, input);\n}, /*#__PURE__*/Effect.mapError(() => new Terminal.QuitError({})), Effect.scoped);\nconst getSelectInitialIndex = choices => {\n let initialIndex = 0;\n let seenSelected = -1;\n for (let i = 0; i < choices.length; i++) {\n const choice = choices[i];\n if (choice.selected === true) {\n if (seenSelected !== -1) {\n throw new Error(\"InvalidArgumentException: only a single choice can be selected by default for Prompt.select\");\n }\n seenSelected = i;\n }\n }\n if (seenSelected !== -1) {\n initialIndex = seenSelected;\n }\n return initialIndex;\n};\n/**\n * Creates a prompt that lets the user select a single value from a list of\n * choices.\n *\n * **Gotchas**\n *\n * At most one choice may be marked as selected by default.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const select = options => {\n const opts = {\n maxPerPage: 10,\n ...options\n };\n const initialIndex = getSelectInitialIndex(opts.choices);\n return custom(initialIndex, {\n render: handleSelectRender(opts),\n process: handleSelectProcess(opts),\n clear: handleSelectClear(opts)\n });\n};\n/**\n * Creates a prompt that lets users filter select choices by typing.\n *\n * **Example** (Filtering choices with autocomplete)\n *\n * ```ts\n * import { Prompt } from \"effect/unstable/cli\"\n *\n * const language = Prompt.autoComplete({\n * message: \"Choose a language\",\n * choices: [\n * { title: \"TypeScript\", value: \"ts\" },\n * { title: \"Rust\", value: \"rs\" },\n * { title: \"Kotlin\", value: \"kt\" }\n * ]\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const autoComplete = options => {\n const opts = {\n maxPerPage: 10,\n filterLabel: \"filter\",\n filterPlaceholder: \"type to filter\",\n emptyMessage: \"No matches\",\n ...options\n };\n const initialIndex = getSelectInitialIndex(opts.choices);\n const filtered = filterAutoCompleteChoices(opts.choices, \"\");\n const index = filtered.length === 0 ? 0 : filtered.includes(initialIndex) ? initialIndex : filtered[0];\n const initialState = {\n query: \"\",\n index,\n filtered\n };\n return custom(initialState, {\n render: handleAutoCompleteRender(opts),\n process: handleAutoCompleteProcess(opts),\n clear: handleAutoCompleteClear(opts)\n });\n};\n/**\n * Creates a prompt that lets the user select multiple choices and returns their\n * values as an array.\n *\n * **Details**\n *\n * The prompt supports default selected choices, bulk-selection commands, and\n * minimum or maximum selection counts.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const multiSelect = options => {\n const opts = {\n maxPerPage: 10,\n ...options\n };\n // Seed initial selection from choices marked as selected: true\n const initialSelected = new Set();\n for (let i = 0; i < opts.choices.length; i++) {\n const choice = opts.choices[i];\n if (choice.selected === true) {\n initialSelected.add(i);\n }\n }\n const initialState = {\n index: 0,\n selectedIndices: initialSelected,\n error: Option.none()\n };\n return custom(initialState, {\n render: handleMultiSelectRender(opts),\n process: handleMultiSelectProcess(opts),\n clear: handleMultiSelectClear(opts)\n });\n};\n/**\n * Creates a `Prompt` which immediately succeeds with the specified value.\n *\n * **Details**\n *\n * This prompt does not attempt to obtain user input or render anything to the\n * screen.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const succeed = value => {\n const op = Object.create(proto);\n op._tag = \"Succeed\";\n op.value = value;\n return op;\n};\n/**\n * Creates a text-entry prompt that echoes input and returns the submitted\n * string after validation.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const text = options => basePrompt(options, \"text\");\n/**\n * Creates a toggle prompt that lets the user switch between active and inactive\n * states and returns the selected boolean value.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const toggle = options => {\n const opts = {\n initial: false,\n active: \"on\",\n inactive: \"off\",\n ...options\n };\n return custom(opts.initial, {\n render: handleToggleRender(opts),\n process: handleToggleProcess,\n clear: () => handleToggleClear(opts)\n });\n};\nconst proto = {\n ... /*#__PURE__*/Effectable.Prototype({\n label: \"Prompt\",\n evaluate() {\n return run(this);\n }\n }),\n [TypeId]: {\n _Output: _ => _\n }\n};\nconst allTupled = arg => {\n if (arg.length === 0) {\n return succeed([]);\n }\n if (arg.length === 1) {\n return map(arg[0], x => [x]);\n }\n let result = map(arg[0], x => [x]);\n for (let i = 1; i < arg.length; i++) {\n const curr = arg[i];\n result = flatMap(result, tuple => map(curr, a => [...tuple, a]));\n }\n return result;\n};\nconst runWithInput = (prompt, terminal, input) => Effect.suspend(() => {\n const op = prompt;\n switch (op._tag) {\n case \"Loop\":\n {\n return runLoop(op, terminal, input);\n }\n case \"OnSuccess\":\n {\n return Effect.flatMap(runWithInput(op.prompt, terminal, input), a => runWithInput(op.onSuccess(a), terminal, input));\n }\n case \"Succeed\":\n {\n return Effect.succeed(op.value);\n }\n }\n});\nconst runLoop = /*#__PURE__*/Effect.fnUntraced(function* (loop, terminal, input) {\n let state = Effect.isEffect(loop.initialState) ? yield* loop.initialState : loop.initialState;\n let action = Action.NextFrame({\n state\n });\n while (true) {\n const msg = yield* loop.render(state, action);\n yield* Effect.orDie(terminal.display(msg));\n if (loop.events) {\n const takeInput = Queue.take(input).pipe(Effect.map(input => ({\n _tag: \"Input\",\n input\n })));\n const result = yield* Effect.raceFirst(takeInput, Queue.take(loop.events).pipe(Effect.map(value => ({\n _tag: \"Event\",\n value\n }))));\n action = yield* loop.process(result, state);\n } else {\n const result = yield* Queue.take(input);\n action = yield* loop.process(result, state);\n }\n switch (action._tag) {\n case \"Beep\":\n continue;\n case \"NextFrame\":\n {\n yield* Effect.orDie(terminal.display(yield* loop.clear(state, action)));\n state = action.state;\n continue;\n }\n case \"Submit\":\n {\n yield* Effect.orDie(terminal.display(yield* loop.clear(state, action)));\n const msg = yield* loop.render(state, action);\n yield* Effect.orDie(terminal.display(msg));\n return action.value;\n }\n }\n }\n}, (effect, _, terminal) => Effect.ensuring(effect, Effect.orDie(terminal.display(Ansi.cursorShow))));\nconst Action = /*#__PURE__*/Data.taggedEnum();\n/**\n * Clears all lines taken up by the specified `text`.\n */\nconst eraseText = (text, columns) => {\n if (columns === 0) {\n return Ansi.eraseLine + Ansi.cursorTo(0);\n }\n let rows = 0;\n const lines = text.split(NEWLINE_REGEXP);\n for (const line of lines) {\n rows += 1 + Math.floor(Math.max(line.length - 1, 0) / columns);\n }\n return Ansi.eraseLines(rows);\n};\nconst lines = (prompt, columns) => {\n const lines = prompt.split(NEWLINE_REGEXP);\n return columns === 0 ? lines.length : pipe(Arr.map(lines, line => Math.ceil(line.length / columns)), Arr.reduce(0, (left, right) => left + right));\n};\nconst clearOutputWithError = (outputText, columns, errorText) => {\n if (errorText !== undefined && errorText.length > 0) {\n return Ansi.cursorDown(lines(errorText, columns)) + eraseText(`\\n${errorText}`, columns) + eraseText(outputText, columns);\n }\n return eraseText(outputText, columns);\n};\nconst renderBeep = Ansi.beep;\nconst NEWLINE_REGEXP = /\\r?\\n/;\nconst handleConfirmClear = options => {\n return Effect.fnUntraced(function* (state, _) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* platformFigures;\n const confirmMessage = state.value ? options.placeholder.defaultConfirm : options.placeholder.defaultDeny;\n const promptText = renderConfirmOutput(confirmMessage, \"?\", figures.pointerSmall, options, {\n plain: true\n });\n const clearOutput = eraseText(promptText, columns);\n const resetCurrentLine = Ansi.eraseLine + Ansi.cursorLeft;\n return clearOutput + resetCurrentLine;\n });\n};\nconst renderConfirmOutput = (confirm, leadingSymbol, trailingSymbol, options, renderOptions) => renderPrompt(confirm, options.message, leadingSymbol, trailingSymbol, renderOptions);\nconst renderConfirmNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n // Marking these explicitly as present with `!` because they always will be\n // and there is really no value in adding a `DeepRequired` type helper just\n // for these internal cases\n const confirmMessage = state.value ? options.placeholder.defaultConfirm : options.placeholder.defaultDeny;\n const confirm = Ansi.annotate(confirmMessage, Ansi.blackBright);\n const promptMsg = renderConfirmOutput(confirm, leadingSymbol, trailingSymbol, options);\n return Ansi.cursorHide + promptMsg;\n});\nconst renderConfirmSubmission = /*#__PURE__*/Effect.fnUntraced(function* (value, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const confirmMessage = value ? options.label.confirm : options.label.deny;\n const promptMsg = renderConfirmOutput(confirmMessage, leadingSymbol, trailingSymbol, options);\n return promptMsg + \"\\n\";\n});\nconst handleConfirmRender = options => {\n return (_, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderConfirmNextFrame(state, options),\n Submit: ({\n value\n }) => renderConfirmSubmission(value, options)\n });\n };\n};\nconst TRUE_VALUE_REGEXP = /^y|t$/;\nconst FALSE_VALUE_REGEXP = /^n|f$/;\nconst handleConfirmProcess = (input, defaultValue) => {\n const value = Option.getOrElse(input.input, () => \"\");\n if (input.key.name === \"enter\" || input.key.name === \"return\") {\n return Effect.succeed(Action.Submit({\n value: defaultValue\n }));\n }\n if (TRUE_VALUE_REGEXP.test(value.toLowerCase())) {\n return Effect.succeed(Action.Submit({\n value: true\n }));\n }\n if (FALSE_VALUE_REGEXP.test(value.toLowerCase())) {\n return Effect.succeed(Action.Submit({\n value: false\n }));\n }\n return Effect.succeed(Action.Beep());\n};\nconst handleDateClear = options => {\n return Effect.fnUntraced(function* (state, _) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* platformFigures;\n const resetCurrentLine = Ansi.eraseLine + Ansi.cursorLeft;\n const parts = Arr.reduce(state.dateParts, \"\", (doc, part) => doc + part.toString());\n const promptText = renderDateOutput(\"?\", figures.pointerSmall, parts, options, {\n plain: true\n });\n const errorText = Option.isSome(state.error) ? Arr.match(state.error.value.split(NEWLINE_REGEXP), {\n onEmpty: () => \"\",\n onNonEmpty: errorLines => `${figures.pointerSmall} ${errorLines.join(\"\\n\")}`\n }) : \"\";\n const clearOutput = clearOutputWithError(promptText, columns, errorText);\n return clearOutput + resetCurrentLine;\n });\n};\nconst renderDateError = (state, pointer) => {\n if (Option.isSome(state.error)) {\n const errorLines = state.error.value.split(NEWLINE_REGEXP);\n if (Arr.isReadonlyArrayNonEmpty(errorLines)) {\n const prefix = Ansi.annotate(pointer, Ansi.red) + \" \";\n const lines = Arr.map(errorLines, str => annotateErrorLine(str));\n return Ansi.cursorSavePosition + \"\\n\" + prefix + lines.join(\"\\n\") + Ansi.cursorRestorePosition;\n }\n }\n return \"\";\n};\nconst renderParts = (state, submitted = false) => {\n return Arr.reduce(state.dateParts, \"\", (doc, part, currentIndex) => {\n const partDoc = part.toString();\n if (currentIndex === state.cursor && !submitted) {\n const annotation = Ansi.combine(Ansi.underlined, Ansi.cyanBright);\n return doc + Ansi.annotate(partDoc, annotation);\n }\n return doc + partDoc;\n });\n};\nconst renderDateOutput = (leadingSymbol, trailingSymbol, parts, options, renderOptions) => renderPrompt(parts, options.message, leadingSymbol, trailingSymbol, renderOptions);\nconst renderDateNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n const parts = renderParts(state);\n const promptMsg = renderDateOutput(leadingSymbol, trailingSymbol, parts, options);\n const errorMsg = renderDateError(state, figures.pointerSmall);\n return Ansi.cursorHide + promptMsg + errorMsg;\n});\nconst renderDateSubmission = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const parts = renderParts(state, true);\n const promptMsg = renderDateOutput(leadingSymbol, trailingSymbol, parts, options);\n return promptMsg + \"\\n\";\n});\nconst processUp = state => {\n state.dateParts[state.cursor].increment();\n return Action.NextFrame({\n state: {\n ...state,\n typed: \"\"\n }\n });\n};\nconst processDown = state => {\n state.dateParts[state.cursor].decrement();\n return Action.NextFrame({\n state: {\n ...state,\n typed: \"\"\n }\n });\n};\nconst processDateCursorLeft = state => {\n const previous = state.dateParts[state.cursor].previousPart();\n if (Option.isSome(previous)) {\n return Action.NextFrame({\n state: {\n ...state,\n typed: \"\",\n cursor: state.dateParts.indexOf(previous.value)\n }\n });\n }\n return Action.Beep();\n};\nconst processDateCursorRight = state => {\n const next = state.dateParts[state.cursor].nextPart();\n if (Option.isSome(next)) {\n return Action.NextFrame({\n state: {\n ...state,\n typed: \"\",\n cursor: state.dateParts.indexOf(next.value)\n }\n });\n }\n return Action.Beep();\n};\nconst processDateNext = state => {\n const next = state.dateParts[state.cursor].nextPart();\n const cursor = Option.match(next, {\n onNone: () => state.dateParts.findIndex(part => !part.isToken()),\n onSome: next => state.dateParts.indexOf(next)\n });\n return Action.NextFrame({\n state: {\n ...state,\n cursor\n }\n });\n};\nconst defaultDateProcessor = (value, state) => {\n if (/\\d/.test(value)) {\n const typed = state.typed + value;\n state.dateParts[state.cursor].setValue(typed);\n return Action.NextFrame({\n state: {\n ...state,\n typed\n }\n });\n }\n return Action.Beep();\n};\nconst defaultLocales = {\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n monthsShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n weekdays: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n weekdaysShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"]\n};\nconst handleDateRender = options => {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderDateNextFrame(state, options),\n Submit: () => renderDateSubmission(state, options)\n });\n };\n};\nconst handleDateProcess = options => {\n return (input, state) => {\n switch (input.key.name) {\n case \"left\":\n {\n return Effect.succeed(processDateCursorLeft(state));\n }\n case \"right\":\n {\n return Effect.succeed(processDateCursorRight(state));\n }\n case \"k\":\n case \"up\":\n {\n return Effect.succeed(processUp(state));\n }\n case \"j\":\n case \"down\":\n {\n return Effect.succeed(processDown(state));\n }\n case \"tab\":\n {\n return Effect.succeed(processDateNext(state));\n }\n case \"enter\":\n case \"return\":\n {\n return Effect.match(options.validate(state.value), {\n onFailure: error => Action.NextFrame({\n state: {\n ...state,\n error: Option.some(error)\n }\n }),\n onSuccess: value => Action.Submit({\n value\n })\n });\n }\n default:\n {\n return Effect.succeed(defaultDateProcessor(Option.getOrElse(input.input, () => \"\"), state));\n }\n }\n };\n};\nconst DATE_PART_REGEXP = /\\\\(.)|\"((?:\\\\[\"\\\\]|[^\"])+)\"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;\nconst regExpGroups = {\n 1: ({\n token,\n ...opts\n }) => new Token({\n token: token.replace(/\\\\(.)/g, \"$1\"),\n ...opts\n }),\n 2: opts => new Day(opts),\n 3: opts => new Month(opts),\n 4: opts => new Year(opts),\n 5: opts => new Meridiem(opts),\n 6: opts => new Hours(opts),\n 7: opts => new Minutes(opts),\n 8: opts => new Seconds(opts),\n 9: opts => new Milliseconds(opts)\n};\nconst makeDateParts = (dateMask, date, locales) => {\n const parts = [];\n let result = null;\n // oxlint-disable-next-line no-cond-assign\n while (result = DATE_PART_REGEXP.exec(dateMask)) {\n const match = result.shift();\n const index = result.findIndex(group => group !== undefined);\n if (index in regExpGroups) {\n const token = result[index] || match;\n parts.push(regExpGroups[index]({\n token,\n date,\n parts,\n locales\n }));\n } else {\n parts.push(new Token({\n token: result[index] || match,\n date,\n parts,\n locales\n }));\n }\n }\n const orderedParts = parts.reduce((array, element) => {\n const lastElement = array[array.length - 1];\n if (element.isToken() && lastElement !== undefined && lastElement.isToken()) {\n lastElement.setValue(element.token);\n } else {\n array.push(element);\n }\n return array;\n }, Arr.empty());\n parts.splice(0, parts.length, ...orderedParts);\n return parts;\n};\nclass DatePart {\n token;\n date;\n parts;\n locales;\n constructor(params) {\n this.token = params.token;\n this.locales = params.locales;\n this.date = params.date || new Date();\n this.parts = params.parts || [this];\n }\n /**\n * Returns `true` if this `DatePart` is a `Token`, `false` otherwise.\n */\n isToken() {\n return false;\n }\n /**\n * Retrieves the next date part in the list of parts.\n */\n nextPart() {\n const currentPartIndex = Option.getOrElse(Arr.findFirstIndex(this.parts, part => part === this), () => 0);\n return Arr.findFirst(this.parts.slice(currentPartIndex + 1), part => !part.isToken());\n }\n /**\n * Retrieves the previous date part in the list of parts.\n */\n previousPart() {\n const currentPartIndex = Arr.findFirstIndex(this.parts, part => part === this);\n if (Option.isSome(currentPartIndex)) {\n return Arr.findLast(this.parts.slice(0, currentPartIndex.value), part => !part.isToken());\n }\n return Option.none();\n }\n toString() {\n return String(this.date);\n }\n}\nclass Token extends DatePart {\n increment() {}\n decrement() {}\n setValue(value) {\n this.token = this.token + value;\n }\n isToken() {\n return true;\n }\n toString() {\n return this.token;\n }\n}\nclass Milliseconds extends DatePart {\n increment() {\n this.date.setMilliseconds(this.date.getMilliseconds() + 1);\n }\n decrement() {\n this.date.setMilliseconds(this.date.getMilliseconds() - 1);\n }\n setValue(value) {\n this.date.setMilliseconds(Number.parseInt(value.slice(-this.token.length)));\n }\n toString() {\n const millis = `${this.date.getMilliseconds()}`;\n return millis.padStart(4, \"0\").substring(0, this.token.length);\n }\n}\nclass Seconds extends DatePart {\n increment() {\n this.date.setSeconds(this.date.getSeconds() + 1);\n }\n decrement() {\n this.date.setSeconds(this.date.getSeconds() - 1);\n }\n setValue(value) {\n this.date.setSeconds(Number.parseInt(value.slice(-2)));\n }\n toString() {\n const seconds = `${this.date.getSeconds()}`;\n return this.token.length > 1 ? seconds.padStart(2, \"0\") : seconds;\n }\n}\nclass Minutes extends DatePart {\n increment() {\n this.date.setMinutes(this.date.getMinutes() + 1);\n }\n decrement() {\n this.date.setMinutes(this.date.getMinutes() - 1);\n }\n setValue(value) {\n this.date.setMinutes(Number.parseInt(value.slice(-2)));\n }\n toString() {\n const minutes = `${this.date.getMinutes()}`;\n return this.token.length > 1 ? minutes.padStart(2, \"0\") : minutes;\n }\n}\nclass Hours extends DatePart {\n increment() {\n this.date.setHours(this.date.getHours() + 1);\n }\n decrement() {\n this.date.setHours(this.date.getHours() - 1);\n }\n setValue(value) {\n this.date.setHours(Number.parseInt(value.slice(-2)));\n }\n toString() {\n const hours = /h/.test(this.token) ? this.date.getHours() % 12 || 12 : this.date.getHours();\n return this.token.length > 1 ? `${hours}`.padStart(2, \"0\") : `${hours}`;\n }\n}\nclass Day extends DatePart {\n increment() {\n this.date.setDate(this.date.getDate() + 1);\n }\n decrement() {\n this.date.setDate(this.date.getDate() - 1);\n }\n setValue(value) {\n this.date.setDate(Number.parseInt(value.slice(-2)));\n }\n toString() {\n const date = this.date.getDate();\n const day = this.date.getDay();\n switch (this.token) {\n case \"DD\":\n return `${date}`.padStart(2, \"0\");\n case \"Do\":\n return `${date}${this.ordinalIndicator(date)}`;\n case \"d\":\n return `${day + 1}`;\n case \"ddd\":\n return this.locales.weekdaysShort[day];\n case \"dddd\":\n return this.locales.weekdays[day];\n default:\n return `${date}`;\n }\n }\n ordinalIndicator(day) {\n switch (day % 10) {\n case 1:\n return \"st\";\n case 2:\n return \"nd\";\n case 3:\n return \"rd\";\n default:\n return \"th\";\n }\n }\n}\nclass Month extends DatePart {\n increment() {\n this.date.setMonth(this.date.getMonth() + 1);\n }\n decrement() {\n this.date.setMonth(this.date.getMonth() - 1);\n }\n setValue(value) {\n const month = Number.parseInt(value.slice(-2)) - 1;\n this.date.setMonth(month < 0 ? 0 : month);\n }\n toString() {\n const month = this.date.getMonth();\n switch (this.token.length) {\n case 2:\n return `${month + 1}`.padStart(2, \"0\");\n case 3:\n return this.locales.monthsShort[month];\n case 4:\n return this.locales.months[month];\n default:\n return `${month + 1}`;\n }\n }\n}\nclass Year extends DatePart {\n increment() {\n this.date.setFullYear(this.date.getFullYear() + 1);\n }\n decrement() {\n this.date.setFullYear(this.date.getFullYear() - 1);\n }\n setValue(value) {\n this.date.setFullYear(Number.parseInt(value.slice(-4)));\n }\n toString() {\n const year = `${this.date.getFullYear()}`.padStart(4, \"0\");\n return this.token.length === 2 ? year.substring(-2) : year;\n }\n}\nclass Meridiem extends DatePart {\n increment() {\n this.date.setHours((this.date.getHours() + 12) % 24);\n }\n decrement() {\n this.increment();\n }\n setValue(_value) {}\n toString() {\n const meridiem = this.date.getHours() > 12 ? \"pm\" : \"am\";\n return /A/.test(this.token) ? meridiem.toUpperCase() : meridiem;\n }\n}\nconst CONFIRM_MESSAGE = \"The selected directory contains files. Would you like to traverse the selected directory?\";\nconst FILE_FILTER_LABEL = \"filter\";\nconst FILE_FILTER_PLACEHOLDER = \"type to filter\";\nconst FILE_EMPTY_MESSAGE = \"No matches\";\nconst Confirm = /*#__PURE__*/Data.taggedEnum();\nconst showConfirmation = /*#__PURE__*/Confirm.$is(\"Show\");\nconst resolveCurrentPath = (path, options) => {\n if (Option.isSome(path)) {\n return Effect.succeed(path.value);\n }\n if (Option.isSome(options.startingPath)) {\n const startingPath = options.startingPath.value;\n return Effect.flatMap(FileSystem.FileSystem, fs =>\n // Ensure the user provided starting path exists\n Effect.orDie(fs.exists(startingPath)).pipe(Effect.flatMap(exists => exists ? Effect.void : Effect.die(`The provided starting path '${startingPath}' does not exist`)), Effect.as(startingPath)));\n }\n return Effect.sync(() => process.cwd());\n};\nconst getFileList = /*#__PURE__*/Effect.fnUntraced(function* (directory, options) {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const files = yield* Effect.orDie(fs.readDirectory(directory)).pipe(\n // Always prepend the `\"..\"` option to the file list but allow it\n // to be filtered out if the user so desires\n Effect.map(files => [\"..\", ...files]));\n return yield* Effect.filter(files, file => {\n const result = options.filter(file);\n const userDefinedFilter = Effect.isEffect(result) ? result : Effect.succeed(result);\n const directoryFilter = options.type === \"directory\" ? Effect.map(Effect.orDie(fs.stat(path.join(directory, file))), info => info.type === \"Directory\") : Effect.succeed(true);\n return Effect.zipWith(userDefinedFilter, directoryFilter, (a, b) => a && b);\n }, {\n concurrency: files.length\n });\n});\nconst filterFiles = (files, query) => {\n if (query.length === 0) {\n return files;\n }\n const normalizedQuery = query.toLowerCase();\n const filtered = [];\n for (let index = 0; index < files.length; index++) {\n if (files[index].toLowerCase().includes(normalizedQuery)) {\n filtered.push(files[index]);\n }\n }\n return filtered;\n};\nconst updateFileState = (state, query, allFiles = state.allFiles) => {\n const files = filterFiles(allFiles, query);\n if (files.length === 0) {\n return {\n ...state,\n query,\n allFiles,\n files,\n cursor: 0\n };\n }\n const selected = state.files[state.cursor];\n const cursor = selected === undefined ? 0 : files.indexOf(selected);\n return {\n ...state,\n query,\n allFiles,\n files,\n cursor: cursor === -1 ? 0 : cursor\n };\n};\nconst handleFileClear = options => {\n return Effect.fnUntraced(function* (state, _) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const path = yield* Path.Path;\n const figures = yield* platformFigures;\n const currentPath = yield* resolveCurrentPath(state.path, options);\n const selectedPath = state.files[state.cursor];\n const resolvedPath = selectedPath === undefined ? currentPath : path.resolve(currentPath, selectedPath);\n const resolvedPathText = `${figures.pointerSmall} ${resolvedPath}`;\n const isConfirming = showConfirmation(state.confirm);\n const promptText = isConfirming ? renderPrompt(\"(Y/n)\", CONFIRM_MESSAGE, \"?\", figures.pointerSmall, {\n plain: true\n }) : renderPrompt(renderFileFilter(state, {\n plain: true\n }), options.message, figures.tick, figures.ellipsis, {\n plain: true\n });\n const filesText = isConfirming ? \"\" : renderFiles(state, state.files, figures, options, {\n plain: true\n });\n const outputText = isConfirming ? `${promptText}\\n${resolvedPathText}` : `${promptText}\\n${resolvedPathText}\\n${filesText}`;\n const clearOutput = eraseText(outputText, columns);\n const resetCurrentLine = Ansi.eraseLine + Ansi.cursorLeft;\n return clearOutput + resetCurrentLine;\n });\n};\nconst renderPrompt = (confirm, message, leadingSymbol, trailingSymbol, options) => {\n const prefix = leadingSymbol + \" \";\n const annotate = options?.plain === true ? line => line : annotateLine;\n return Arr.match(message.split(NEWLINE_REGEXP), {\n onEmpty: () => prefix + \" \" + trailingSymbol + \" \" + confirm,\n onNonEmpty: promptLines => {\n const lines = Arr.map(promptLines, line => annotate(line));\n return prefix + lines.join(\"\\n\") + \" \" + trailingSymbol + \" \" + confirm;\n }\n });\n};\nconst renderPrefix = (state, toDisplay, currentIndex, length, figures, renderOptions) => {\n let prefix = \" \";\n if (currentIndex === toDisplay.startIndex && toDisplay.startIndex > 0) {\n prefix = figures.arrowUp;\n } else if (currentIndex === toDisplay.endIndex - 1 && toDisplay.endIndex < length) {\n prefix = figures.arrowDown;\n }\n if (state.cursor === currentIndex) {\n return renderOptions?.plain === true ? figures.pointer + prefix : Ansi.annotate(figures.pointer, Ansi.cyanBright) + prefix;\n }\n return prefix + \" \";\n};\nconst renderFileName = (file, isSelected, renderOptions) => {\n if (renderOptions?.plain === true) {\n return file;\n }\n return isSelected ? Ansi.annotate(file, Ansi.combine(Ansi.underlined, Ansi.cyanBright)) : file;\n};\nconst renderFileFilter = (state, renderOptions) => {\n const filterValue = state.query.length === 0 ? renderOptions?.plain === true ? FILE_FILTER_PLACEHOLDER : Ansi.annotate(FILE_FILTER_PLACEHOLDER, Ansi.blackBright) : renderOptions?.plain === true ? state.query : Ansi.annotate(state.query, Ansi.combine(Ansi.underlined, Ansi.cyanBright));\n return `[${FILE_FILTER_LABEL}: ${filterValue}]`;\n};\nconst renderFiles = (state, files, figures, options, renderOptions) => {\n const length = files.length;\n if (length === 0) {\n return renderOptions?.plain === true ? FILE_EMPTY_MESSAGE : Ansi.annotate(FILE_EMPTY_MESSAGE, Ansi.blackBright);\n }\n const toDisplay = entriesToDisplay(state.cursor, length, options.maxPerPage);\n const documents = [];\n for (let index = toDisplay.startIndex; index < toDisplay.endIndex; index++) {\n const isSelected = state.cursor === index;\n const prefix = renderPrefix(state, toDisplay, index, length, figures, renderOptions);\n const fileName = renderFileName(files[index], isSelected, renderOptions);\n documents.push(prefix + fileName);\n }\n return documents.join(\"\\n\");\n};\nconst renderFileNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const path = yield* Path.Path;\n const figures = yield* platformFigures;\n const currentPath = yield* resolveCurrentPath(state.path, options);\n const selectedPath = state.files[state.cursor];\n const resolvedPath = selectedPath === undefined ? currentPath : path.resolve(currentPath, selectedPath);\n const resolvedPathMsg = Ansi.annotate(figures.pointerSmall + \" \" + resolvedPath, Ansi.blackBright);\n if (showConfirmation(state.confirm)) {\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n const confirm = Ansi.annotate(\"(Y/n)\", Ansi.blackBright);\n const promptMsg = renderPrompt(confirm, CONFIRM_MESSAGE, leadingSymbol, trailingSymbol);\n return Ansi.cursorHide + promptMsg + \"\\n\" + resolvedPathMsg;\n }\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderPrompt(renderFileFilter(state), options.message, leadingSymbol, trailingSymbol);\n const files = renderFiles(state, state.files, figures, options);\n return Ansi.cursorHide + promptMsg + \"\\n\" + resolvedPathMsg + \"\\n\" + files;\n});\nconst renderFileSubmission = /*#__PURE__*/Effect.fnUntraced(function* (state, value, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderPrompt(renderFileFilter(state), options.message, leadingSymbol, trailingSymbol);\n return promptMsg + \" \" + Ansi.annotate(value, Ansi.white) + \"\\n\";\n});\nconst handleFileRender = options => {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderFileNextFrame(state, options),\n Submit: ({\n value\n }) => renderFileSubmission(state, value, options)\n });\n };\n};\nconst processFileCursorUp = state => {\n if (state.files.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n const cursor = state.cursor - 1;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor: cursor < 0 ? state.files.length - 1 : cursor\n }\n }));\n};\nconst processFileCursorDown = state => {\n if (state.files.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor: (state.cursor + 1) % state.files.length\n }\n }));\n};\nconst processFileBackspace = state => {\n if (state.query.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n const query = state.query.slice(0, state.query.length - 1);\n return Effect.succeed(Action.NextFrame({\n state: updateFileState(state, query)\n }));\n};\nconst processFileClear = state => Effect.succeed(Action.NextFrame({\n state: updateFileState(state, \"\")\n}));\nconst processFileInput = (input, state) => {\n if (input.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n const query = state.query + input;\n return Effect.succeed(Action.NextFrame({\n state: updateFileState(state, query)\n }));\n};\nconst processSelection = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n if (state.files.length === 0) {\n return Action.Beep();\n }\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const currentPath = yield* resolveCurrentPath(state.path, options);\n const selectedPath = state.files[state.cursor];\n const resolvedPath = path.resolve(currentPath, selectedPath);\n const info = yield* Effect.orDie(fs.stat(resolvedPath));\n if (info.type === \"Directory\") {\n const files = yield* getFileList(resolvedPath, options);\n const filesWithoutParent = files.filter(file => file !== \"..\");\n // If the user selected a directory AND the prompt type can result with\n // a directory, we must confirm:\n // - If the selected directory has any files\n // - Confirm whether or not the user wants to traverse those files\n if (options.type === \"directory\" || options.type === \"either\") {\n return filesWithoutParent.length === 0\n // Directory is empty so it's safe to select it\n ? Action.Submit({\n value: resolvedPath\n })\n // Directory has contents - show confirmation to user\n : Action.NextFrame({\n state: {\n ...state,\n confirm: Confirm.Show()\n }\n });\n }\n return Action.NextFrame({\n state: {\n cursor: 0,\n files,\n allFiles: files,\n query: \"\",\n path: Option.some(resolvedPath),\n confirm: Confirm.Hide()\n }\n });\n }\n return Action.Submit({\n value: resolvedPath\n });\n});\nconst handleFileProcess = options => {\n return Effect.fnUntraced(function* (input, state) {\n if (input.key.ctrl) {\n if (input.key.name === \"u\") {\n if (showConfirmation(state.confirm)) {\n return Action.Beep();\n }\n return yield* processFileClear(state);\n }\n return Action.Beep();\n }\n switch (input.key.name) {\n case \"k\":\n case \"up\":\n {\n return yield* processFileCursorUp(state);\n }\n case \"j\":\n case \"down\":\n case \"tab\":\n {\n return yield* processFileCursorDown(state);\n }\n case \"backspace\":\n {\n if (showConfirmation(state.confirm)) {\n return Action.Beep();\n }\n return yield* processFileBackspace(state);\n }\n case \"enter\":\n case \"return\":\n {\n return yield* processSelection(state, options);\n }\n case \"y\":\n case \"t\":\n {\n if (showConfirmation(state.confirm)) {\n const path = yield* Path.Path;\n const currentPath = yield* resolveCurrentPath(state.path, options);\n const selectedPath = state.files[state.cursor];\n const resolvedPath = path.resolve(currentPath, selectedPath);\n const files = yield* getFileList(resolvedPath, options);\n return Action.NextFrame({\n state: {\n cursor: 0,\n files,\n allFiles: files,\n query: \"\",\n path: Option.some(resolvedPath),\n confirm: Confirm.Hide()\n }\n });\n }\n return yield* processFileInput(Option.getOrElse(input.input, () => \"\"), state);\n }\n case \"n\":\n case \"f\":\n {\n if (showConfirmation(state.confirm)) {\n const path = yield* Path.Path;\n const currentPath = yield* resolveCurrentPath(state.path, options);\n const selectedPath = state.files[state.cursor];\n const resolvedPath = path.resolve(currentPath, selectedPath);\n return Action.Submit({\n value: resolvedPath\n });\n }\n return yield* processFileInput(Option.getOrElse(input.input, () => \"\"), state);\n }\n default:\n {\n if (showConfirmation(state.confirm)) {\n return Action.Beep();\n }\n return yield* processFileInput(Option.getOrElse(input.input, () => \"\"), state);\n }\n }\n });\n};\nconst renderMultiSelectError = (state, pointer, renderOptions) => {\n if (Option.isSome(state.error)) {\n return Arr.match(state.error.value.split(NEWLINE_REGEXP), {\n onEmpty: () => \"\",\n onNonEmpty: errorLines => {\n if (renderOptions?.plain === true) {\n return `${pointer} ${errorLines.join(\"\\n\")}`;\n }\n const prefix = Ansi.annotate(pointer, Ansi.red) + \" \";\n const lines = Arr.map(errorLines, str => annotateErrorLine(str));\n return Ansi.cursorSavePosition + \"\\n\" + prefix + lines.join(\"\\n\") + Ansi.cursorRestorePosition;\n }\n });\n }\n return \"\";\n};\nconst renderChoiceDescription = (choice, isActive, renderOptions) => {\n if (!choice.disabled && choice.description && isActive) {\n return renderOptions?.plain === true ? \"- \" + choice.description : Ansi.annotate(\"- \" + choice.description, Ansi.blackBright);\n }\n return \"\";\n};\nconst metaOptionsCount = 2;\nconst renderMultiSelectTitle = (title, isHighlighted, renderOptions) => {\n if (renderOptions?.plain === true || !isHighlighted) {\n return title;\n }\n return Ansi.annotate(title, Ansi.combine(Ansi.underlined, Ansi.cyanBright));\n};\nconst renderMultiSelectChoices = (state, options, figures, renderOptions) => {\n const choices = options.choices;\n const totalChoices = choices.length;\n const selectedCount = state.selectedIndices.size;\n const allSelected = selectedCount === totalChoices;\n const selectAllText = allSelected ? options?.selectNone ?? \"Select None\" : options?.selectAll ?? \"Select All\";\n const inverseSelectionText = options?.inverseSelection ?? \"Inverse Selection\";\n const metaOptions = [{\n title: selectAllText\n }, {\n title: inverseSelectionText\n }];\n const allChoices = [...metaOptions, ...choices];\n const toDisplay = entriesToDisplay(state.index, allChoices.length, options.maxPerPage);\n const documents = [];\n for (let index = toDisplay.startIndex; index < toDisplay.endIndex; index++) {\n const choice = allChoices[index];\n const isHighlighted = state.index === index;\n let prefix = \" \";\n if (index === toDisplay.startIndex && toDisplay.startIndex > 0) {\n prefix = figures.arrowUp;\n } else if (index === toDisplay.endIndex - 1 && toDisplay.endIndex < allChoices.length) {\n prefix = figures.arrowDown;\n }\n if (index < metaOptions.length) {\n // Meta options\n const title = renderMultiSelectTitle(choice.title, isHighlighted, renderOptions);\n documents.push(prefix + \" \" + title);\n } else {\n // Regular choices\n const choiceIndex = index - metaOptions.length;\n const isSelected = state.selectedIndices.has(choiceIndex);\n const checkbox = isSelected ? figures.checkboxOn : figures.checkboxOff;\n const annotatedCheckbox = isHighlighted && renderOptions?.plain !== true ? Ansi.annotate(checkbox, Ansi.cyanBright) : checkbox;\n const title = renderMultiSelectTitle(choice.title, isHighlighted, renderOptions);\n const description = renderChoiceDescription(choice, isHighlighted, renderOptions);\n documents.push(prefix + \" \" + annotatedCheckbox + \" \" + title + \" \" + description);\n }\n }\n return documents.join(\"\\n\");\n};\nconst renderMultiSelectNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const choices = renderMultiSelectChoices(state, options, figures);\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n const promptMsg = renderSelectOutput(leadingSymbol, trailingSymbol, options);\n const error = renderMultiSelectError(state, figures.pointer);\n return Ansi.cursorHide + promptMsg + \"\\n\" + choices + error;\n});\nconst renderMultiSelectSubmission = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const selectedChoices = Array.from(state.selectedIndices).sort(EffectNumber.Order).map(index => options.choices[index].title);\n const selectedText = selectedChoices.join(\", \");\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderSelectOutput(leadingSymbol, trailingSymbol, options);\n return promptMsg + \" \" + Ansi.annotate(selectedText, Ansi.white) + \"\\n\";\n});\nconst processMultiSelectCursorUp = (state, totalChoices) => {\n const newIndex = state.index === 0 ? totalChoices - 1 : state.index - 1;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n index: newIndex\n }\n }));\n};\nconst processMultiSelectCursorDown = (state, totalChoices) => {\n const newIndex = (state.index + 1) % totalChoices;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n index: newIndex\n }\n }));\n};\nconst processSpace = (state, options) => {\n const selectedIndices = new Set(state.selectedIndices);\n if (state.index === 0) {\n if (state.selectedIndices.size === options.choices.length) {\n selectedIndices.clear();\n } else {\n for (let i = 0; i < options.choices.length; i++) {\n selectedIndices.add(i);\n }\n }\n } else if (state.index === 1) {\n for (let i = 0; i < options.choices.length; i++) {\n if (state.selectedIndices.has(i)) {\n selectedIndices.delete(i);\n } else {\n selectedIndices.add(i);\n }\n }\n } else {\n const choiceIndex = state.index - metaOptionsCount;\n if (selectedIndices.has(choiceIndex)) {\n selectedIndices.delete(choiceIndex);\n } else {\n selectedIndices.add(choiceIndex);\n }\n }\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n selectedIndices\n }\n }));\n};\nconst handleMultiSelectClear = options => Effect.fnUntraced(function* (state, _) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* platformFigures;\n const clearPrompt = Ansi.eraseLine + Ansi.cursorLeft;\n const promptText = renderSelectOutput(\"?\", figures.pointerSmall, options, {\n plain: true\n });\n const choicesText = renderMultiSelectChoices(state, options, figures, {\n plain: true\n });\n const errorText = renderMultiSelectError(state, figures.pointer, {\n plain: true\n });\n const clearOutput = clearOutputWithError(`${promptText}\\n${choicesText}`, columns, errorText);\n return clearOutput + clearPrompt;\n});\nconst handleMultiSelectProcess = options => {\n return (input, state) => {\n const totalChoices = options.choices.length + metaOptionsCount;\n switch (input.key.name) {\n case \"k\":\n case \"up\":\n {\n return processMultiSelectCursorUp({\n ...state,\n error: Option.none()\n }, totalChoices);\n }\n case \"j\":\n case \"down\":\n case \"tab\":\n {\n return processMultiSelectCursorDown({\n ...state,\n error: Option.none()\n }, totalChoices);\n }\n case \"space\":\n {\n return processSpace(state, options);\n }\n case \"enter\":\n case \"return\":\n {\n const selectedCount = state.selectedIndices.size;\n if (options.min !== undefined && selectedCount < options.min) {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n error: Option.some(`At least ${options.min} are required`)\n }\n }));\n }\n if (options.max !== undefined && selectedCount > options.max) {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n error: Option.some(`At most ${options.max} choices are allowed`)\n }\n }));\n }\n const selectedValues = Array.from(state.selectedIndices).sort(EffectNumber.Order).map(index => options.choices[index].value);\n return Effect.succeed(Action.Submit({\n value: selectedValues\n }));\n }\n default:\n {\n return Effect.succeed(Action.Beep());\n }\n }\n };\n};\nconst handleMultiSelectRender = options => {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderMultiSelectNextFrame(state, options),\n Submit: () => renderMultiSelectSubmission(state, options)\n });\n };\n};\nconst handleNumberClear = options => {\n return Effect.fnUntraced(function* (state, _) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* platformFigures;\n const resetCurrentLine = Ansi.eraseLine + Ansi.cursorLeft;\n const errorText = renderNumberError(state, figures.pointerSmall, {\n plain: true\n });\n const promptText = renderNumberOutput(state, \"?\", figures.pointerSmall, options, {\n plain: true\n });\n const clearOutput = clearOutputWithError(promptText, columns, errorText);\n return clearOutput + resetCurrentLine;\n });\n};\nconst renderNumberInput = (state, submitted, renderOptions) => {\n const value = state.value === \"\" ? \"\" : `${state.value}`;\n if (submitted || renderOptions?.plain === true) {\n return value;\n }\n const annotation = Option.isSome(state.error) ? Ansi.red : Ansi.combine(Ansi.underlined, Ansi.cyanBright);\n return Ansi.annotate(value, annotation);\n};\nconst renderNumberError = (state, pointer, renderOptions) => {\n if (Option.isSome(state.error)) {\n return Arr.match(state.error.value.split(NEWLINE_REGEXP), {\n onEmpty: () => \"\",\n onNonEmpty: errorLines => {\n if (renderOptions?.plain === true) {\n return `${pointer} ${errorLines.join(\"\\n\")}`;\n }\n const prefix = Ansi.annotate(pointer, Ansi.red) + \" \";\n const lines = Arr.map(errorLines, str => annotateErrorLine(str));\n return Ansi.cursorSavePosition + \"\\n\" + prefix + lines.join(\"\\n\") + Ansi.cursorRestorePosition;\n }\n });\n }\n return \"\";\n};\nconst renderNumberOutput = (state, leadingSymbol, trailingSymbol, options, renderOptions, submitted = false) => {\n const value = renderNumberInput(state, submitted, renderOptions);\n return renderPrompt(value, options.message, leadingSymbol, trailingSymbol, renderOptions);\n};\nconst renderNumberNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n const errorMsg = renderNumberError(state, figures.pointerSmall);\n const promptMsg = renderNumberOutput(state, leadingSymbol, trailingSymbol, options);\n return promptMsg + errorMsg;\n});\nconst renderNumberSubmission = /*#__PURE__*/Effect.fnUntraced(function* (nextState, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderNumberOutput(nextState, leadingSymbol, trailingSymbol, options, undefined, true);\n return promptMsg + \"\\n\";\n});\nconst processNumberBackspace = state => {\n if (state.value.length <= 0) {\n return Effect.succeed(Action.Beep());\n }\n const value = state.value.slice(0, state.value.length - 1);\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value,\n error: Option.none()\n }\n }));\n};\nconst processNumberClear = state => Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor: 0,\n value: \"\",\n error: Option.none()\n }\n}));\nconst defaultIntProcessor = (input, state) => {\n if (state.value.length === 0 && input === \"-\") {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value: \"-\",\n error: Option.none()\n }\n }));\n }\n const parsed = Number.parseInt(state.value + input);\n if (Number.isNaN(parsed)) {\n return Effect.succeed(Action.Beep());\n } else {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value: `${parsed}`,\n error: Option.none()\n }\n }));\n }\n};\nconst defaultFloatProcessor = (input, state) => {\n if (input === \".\" && state.value.includes(\".\")) {\n return Effect.succeed(Action.Beep());\n }\n if (state.value.length === 0 && input === \"-\") {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value: \"-\",\n error: Option.none()\n }\n }));\n }\n const parsed = Number.parseFloat(state.value + input);\n if (Number.isNaN(parsed)) {\n return Effect.succeed(Action.Beep());\n } else {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value: input === \".\" ? `${parsed}.` : `${parsed}`,\n error: Option.none()\n }\n }));\n }\n};\nconst handleRenderInteger = options => {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderNumberNextFrame(state, options),\n Submit: () => renderNumberSubmission(state, options)\n });\n };\n};\nconst handleProcessInteger = options => {\n return (input, state) => {\n if (input.key.ctrl && input.key.name === \"u\") {\n return processNumberClear(state);\n }\n switch (input.key.name) {\n case \"backspace\":\n {\n return processNumberBackspace(state);\n }\n case \"k\":\n case \"up\":\n {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value: state.value === \"\" || state.value === \"-\" ? `${options.incrementBy}` : `${Number.parseInt(state.value) + options.incrementBy}`,\n error: Option.none()\n }\n }));\n }\n case \"j\":\n case \"down\":\n {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value: state.value === \"\" || state.value === \"-\" ? `-${options.decrementBy}` : `${Number.parseInt(state.value) - options.decrementBy}`,\n error: Option.none()\n }\n }));\n }\n case \"enter\":\n case \"return\":\n {\n const parsed = Number.parseInt(state.value);\n if (Number.isNaN(parsed)) {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n error: Option.some(\"Must provide an integer value\")\n }\n }));\n } else {\n return Effect.match(options.validate(parsed), {\n onFailure: error => Action.NextFrame({\n state: {\n ...state,\n error: Option.some(error)\n }\n }),\n onSuccess: value => Action.Submit({\n value\n })\n });\n }\n }\n default:\n {\n return defaultIntProcessor(Option.getOrElse(input.input, () => \"\"), state);\n }\n }\n };\n};\nconst handleRenderFloat = options => {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderNumberNextFrame(state, options),\n Submit: () => renderNumberSubmission(state, options)\n });\n };\n};\nconst handleProcessFloat = options => {\n return (input, state) => {\n if (input.key.ctrl && input.key.name === \"u\") {\n return processNumberClear(state);\n }\n switch (input.key.name) {\n case \"backspace\":\n {\n return processNumberBackspace(state);\n }\n case \"k\":\n case \"up\":\n {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value: state.value === \"\" || state.value === \"-\" ? `${options.incrementBy}` : `${Number.parseFloat(state.value) + options.incrementBy}`,\n error: Option.none()\n }\n }));\n }\n case \"j\":\n case \"down\":\n {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value: state.value === \"\" || state.value === \"-\" ? `-${options.decrementBy}` : `${Number.parseFloat(state.value) - options.decrementBy}`,\n error: Option.none()\n }\n }));\n }\n case \"enter\":\n case \"return\":\n {\n const parsed = Number.parseFloat(state.value);\n if (Number.isNaN(parsed)) {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n error: Option.some(\"Must provide a floating point value\")\n }\n }));\n } else {\n return Effect.flatMap(Effect.sync(() => EffectNumber.round(parsed, options.precision)), rounded => Effect.match(options.validate(rounded), {\n onFailure: error => Action.NextFrame({\n state: {\n ...state,\n error: Option.some(error)\n }\n }),\n onSuccess: value => Action.Submit({\n value\n })\n }));\n }\n }\n default:\n {\n return defaultFloatProcessor(Option.getOrElse(input.input, () => \"\"), state);\n }\n }\n };\n};\nconst filterAutoCompleteChoices = (choices, query) => {\n const normalizedQuery = query.toLowerCase();\n const indices = [];\n for (let i = 0; i < choices.length; i++) {\n if (choices[i].title.toLowerCase().includes(normalizedQuery)) {\n indices.push(i);\n }\n }\n return indices;\n};\nconst updateAutoCompleteState = (state, options, query) => {\n const filtered = filterAutoCompleteChoices(options.choices, query);\n if (filtered.length === 0) {\n return {\n ...state,\n query,\n filtered,\n index: 0\n };\n }\n if (filtered.includes(state.index)) {\n return {\n ...state,\n query,\n filtered\n };\n }\n return {\n ...state,\n query,\n filtered,\n index: filtered[0]\n };\n};\nconst autoCompleteCursor = state => Option.getOrElse(Arr.findFirstIndex(state.filtered, index => index === state.index), () => 0);\nconst renderSelectOutput = (leadingSymbol, trailingSymbol, options, renderOptions) => renderPrompt(\"\", options.message, leadingSymbol, trailingSymbol, renderOptions);\nconst renderAutoCompleteFilter = (state, options, renderOptions) => {\n const filterValue = state.query.length === 0 ? renderOptions?.plain === true ? options.filterPlaceholder : Ansi.annotate(options.filterPlaceholder, Ansi.blackBright) : renderOptions?.plain === true ? state.query : Ansi.annotate(state.query, Ansi.combine(Ansi.underlined, Ansi.cyanBright));\n return `[${options.filterLabel}: ${filterValue}]`;\n};\nconst renderAutoCompleteOutput = (state, leadingSymbol, trailingSymbol, options, renderOptions) => {\n const filter = renderAutoCompleteFilter(state, options, renderOptions);\n return renderPrompt(filter, options.message, leadingSymbol, trailingSymbol, renderOptions);\n};\nconst renderChoicePrefix = (state, choices, toDisplay, currentIndex, figures, renderOptions) => {\n let prefix = \" \";\n if (currentIndex === toDisplay.startIndex && toDisplay.startIndex > 0) {\n prefix = figures.arrowUp;\n } else if (currentIndex === toDisplay.endIndex - 1 && toDisplay.endIndex < choices.length) {\n prefix = figures.arrowDown;\n }\n if (renderOptions?.plain === true) {\n return state === currentIndex ? figures.pointer + prefix : prefix + \" \";\n }\n if (choices[currentIndex].disabled) {\n const annotation = Ansi.combine(Ansi.bold, Ansi.blackBright);\n return state === currentIndex ? Ansi.annotate(figures.pointer, annotation) + prefix : prefix + \" \";\n }\n return state === currentIndex ? Ansi.annotate(figures.pointer, Ansi.cyanBright) + prefix : prefix + \" \";\n};\nconst renderAutoCompleteChoicePrefix = (state, options, toDisplay, currentIndex, figures, renderOptions) => {\n let prefix = \" \";\n if (currentIndex === toDisplay.startIndex && toDisplay.startIndex > 0) {\n prefix = figures.arrowUp;\n } else if (currentIndex === toDisplay.endIndex - 1 && toDisplay.endIndex < state.filtered.length) {\n prefix = figures.arrowDown;\n }\n const choiceIndex = state.filtered[currentIndex];\n if (renderOptions?.plain === true) {\n return state.index === choiceIndex ? figures.pointer + prefix : prefix + \" \";\n }\n const choice = options.choices[choiceIndex];\n if (choice.disabled) {\n const annotation = Ansi.combine(Ansi.bold, Ansi.blackBright);\n return state.index === choiceIndex ? Ansi.annotate(figures.pointer, annotation) + prefix : prefix + \" \";\n }\n return state.index === choiceIndex ? Ansi.annotate(figures.pointer, Ansi.cyanBright) + prefix : prefix + \" \";\n};\nconst renderChoiceTitle = (choice, isSelected, renderOptions) => {\n if (renderOptions?.plain === true) {\n return choice.title;\n }\n const title = choice.title;\n if (isSelected) {\n return choice.disabled ? Ansi.annotate(title, Ansi.combine(Ansi.underlined, Ansi.blackBright)) : Ansi.annotate(title, Ansi.combine(Ansi.underlined, Ansi.cyanBright));\n }\n return choice.disabled ? Ansi.annotate(title, Ansi.combine(Ansi.strikethrough, Ansi.blackBright)) : title;\n};\nconst renderSelectChoices = (state, options, figures, renderOptions) => {\n const choices = options.choices;\n const toDisplay = entriesToDisplay(state, choices.length, options.maxPerPage);\n const documents = [];\n for (let index = toDisplay.startIndex; index < toDisplay.endIndex; index++) {\n const choice = choices[index];\n const isSelected = state === index;\n const prefix = renderChoicePrefix(state, choices, toDisplay, index, figures, renderOptions);\n const title = renderChoiceTitle(choice, isSelected, renderOptions);\n const description = renderChoiceDescription(choice, isSelected, renderOptions);\n documents.push(prefix + title + \" \" + description);\n }\n return documents.join(\"\\n\");\n};\nconst renderAutoCompleteChoices = (state, options, figures, renderOptions) => {\n if (state.filtered.length === 0) {\n return renderOptions?.plain === true ? options.emptyMessage : Ansi.annotate(options.emptyMessage, Ansi.blackBright);\n }\n const cursor = autoCompleteCursor(state);\n const toDisplay = entriesToDisplay(cursor, state.filtered.length, options.maxPerPage);\n const documents = [];\n for (let index = toDisplay.startIndex; index < toDisplay.endIndex; index++) {\n const choiceIndex = state.filtered[index];\n const choice = options.choices[choiceIndex];\n const isSelected = state.index === choiceIndex;\n const prefix = renderAutoCompleteChoicePrefix(state, options, toDisplay, index, figures, renderOptions);\n const title = renderChoiceTitle(choice, isSelected, renderOptions);\n const description = renderChoiceDescription(choice, isSelected, renderOptions);\n documents.push(prefix + title + \" \" + description);\n }\n return documents.join(\"\\n\");\n};\nconst renderSelectNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const choices = renderSelectChoices(state, options, figures);\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n const promptMsg = renderSelectOutput(leadingSymbol, trailingSymbol, options);\n return Ansi.cursorHide + promptMsg + \"\\n\" + choices;\n});\nconst renderAutoCompleteNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const choices = renderAutoCompleteChoices(state, options, figures);\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n const promptMsg = renderAutoCompleteOutput(state, leadingSymbol, trailingSymbol, options);\n return Ansi.cursorHide + promptMsg + \"\\n\" + choices;\n});\nconst renderSelectSubmission = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const selected = options.choices[state].title;\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderSelectOutput(leadingSymbol, trailingSymbol, options);\n return promptMsg + \" \" + Ansi.annotate(selected, Ansi.white) + \"\\n\";\n});\nconst renderAutoCompleteSubmission = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const selected = options.choices[state.index].title;\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderAutoCompleteOutput(state, leadingSymbol, trailingSymbol, options);\n return promptMsg + \" \" + Ansi.annotate(selected, Ansi.white) + \"\\n\";\n});\nconst processSelectCursorUp = (state, choices) => {\n if (state === 0) {\n return Effect.succeed(Action.NextFrame({\n state: choices.length - 1\n }));\n }\n return Effect.succeed(Action.NextFrame({\n state: state - 1\n }));\n};\nconst processSelectCursorDown = (state, choices) => {\n if (state === choices.length - 1) {\n return Effect.succeed(Action.NextFrame({\n state: 0\n }));\n }\n return Effect.succeed(Action.NextFrame({\n state: state + 1\n }));\n};\nconst processSelectNext = (state, choices) => {\n return Effect.succeed(Action.NextFrame({\n state: (state + 1) % choices.length\n }));\n};\nconst processAutoCompleteCursorUp = state => {\n if (state.filtered.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n const cursor = autoCompleteCursor(state);\n const nextCursor = cursor === 0 ? state.filtered.length - 1 : cursor - 1;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n index: state.filtered[nextCursor]\n }\n }));\n};\nconst processAutoCompleteCursorDown = state => {\n if (state.filtered.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n const cursor = autoCompleteCursor(state);\n const nextCursor = (cursor + 1) % state.filtered.length;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n index: state.filtered[nextCursor]\n }\n }));\n};\nconst processAutoCompleteNext = state => processAutoCompleteCursorDown(state);\nconst processAutoCompleteBackspace = (state, options) => {\n if (state.query.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n const query = state.query.slice(0, state.query.length - 1);\n return Effect.succeed(Action.NextFrame({\n state: updateAutoCompleteState(state, options, query)\n }));\n};\nconst processAutoCompleteClear = (state, options) => Effect.succeed(Action.NextFrame({\n state: updateAutoCompleteState(state, options, \"\")\n}));\nconst processAutoCompleteInput = (input, state, options) => {\n if (input.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n const query = state.query + input;\n return Effect.succeed(Action.NextFrame({\n state: updateAutoCompleteState(state, options, query)\n }));\n};\nconst handleSelectRender = options => {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderSelectNextFrame(state, options),\n Submit: () => renderSelectSubmission(state, options)\n });\n };\n};\nconst handleAutoCompleteRender = options => {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderAutoCompleteNextFrame(state, options),\n Submit: () => renderAutoCompleteSubmission(state, options)\n });\n };\n};\nconst handleSelectClear = options => Effect.fnUntraced(function* (state, _) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* platformFigures;\n const clearPrompt = Ansi.eraseLine + Ansi.cursorLeft;\n const promptText = renderSelectOutput(\"?\", figures.pointerSmall, options, {\n plain: true\n });\n const choicesText = renderSelectChoices(state, options, figures, {\n plain: true\n });\n const clearOutput = eraseText(`${promptText}\\n${choicesText}`, columns);\n return clearOutput + clearPrompt;\n});\nconst handleAutoCompleteClear = options => Effect.fnUntraced(function* (state, _) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* platformFigures;\n const clearPrompt = Ansi.eraseLine + Ansi.cursorLeft;\n const promptText = renderAutoCompleteOutput(state, \"?\", figures.pointerSmall, options, {\n plain: true\n });\n const choicesText = renderAutoCompleteChoices(state, options, figures, {\n plain: true\n });\n const clearOutput = eraseText(`${promptText}\\n${choicesText}`, columns);\n return clearOutput + clearPrompt;\n});\nconst handleSelectProcess = options => {\n return (input, state) => {\n switch (input.key.name) {\n case \"k\":\n case \"up\":\n {\n return processSelectCursorUp(state, options.choices);\n }\n case \"j\":\n case \"down\":\n {\n return processSelectCursorDown(state, options.choices);\n }\n case \"tab\":\n {\n return processSelectNext(state, options.choices);\n }\n case \"enter\":\n case \"return\":\n {\n const selected = options.choices[state];\n if (selected.disabled) {\n return Effect.succeed(Action.Beep());\n }\n return Effect.succeed(Action.Submit({\n value: selected.value\n }));\n }\n default:\n {\n return Effect.succeed(Action.Beep());\n }\n }\n };\n};\nconst handleAutoCompleteProcess = options => {\n return (input, state) => {\n if (input.key.ctrl) {\n if (input.key.name === \"u\") {\n return processAutoCompleteClear(state, options);\n }\n return Effect.succeed(Action.Beep());\n }\n switch (input.key.name) {\n case \"k\":\n case \"up\":\n {\n return processAutoCompleteCursorUp(state);\n }\n case \"j\":\n case \"down\":\n {\n return processAutoCompleteCursorDown(state);\n }\n case \"tab\":\n {\n return processAutoCompleteNext(state);\n }\n case \"backspace\":\n {\n return processAutoCompleteBackspace(state, options);\n }\n case \"enter\":\n case \"return\":\n {\n if (state.filtered.length === 0) {\n return Effect.succeed(Action.Beep());\n }\n const selected = options.choices[state.index];\n if (selected.disabled) {\n return Effect.succeed(Action.Beep());\n }\n return Effect.succeed(Action.Submit({\n value: selected.value\n }));\n }\n default:\n {\n return processAutoCompleteInput(Option.getOrElse(input.input, () => \"\"), state, options);\n }\n }\n };\n};\nconst renderClearScreen = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* platformFigures;\n const resetCurrentLine = Ansi.eraseLine + Ansi.cursorLeft;\n const errorText = renderTextError(state, figures.pointerSmall, {\n plain: true\n });\n const clearOutput = clearOutputWithError(renderTextOutput(state, \"?\", figures.pointerSmall, options, {\n plain: true\n }), columns, errorText);\n return clearOutput + resetCurrentLine;\n});\nconst renderTextInput = (nextState, options, submitted, renderOptions) => {\n const text = nextState.value;\n if (renderOptions?.plain === true) {\n switch (options.type) {\n case \"hidden\":\n {\n return \"\";\n }\n case \"password\":\n {\n return \"*\".repeat(text.length);\n }\n case \"text\":\n {\n return text;\n }\n }\n }\n const annotation = Option.isSome(nextState.error) ? Ansi.red : submitted ? Ansi.white : nextState.value.length === 0 ? Ansi.blackBright : Ansi.combine(Ansi.underlined, Ansi.cyanBright);\n switch (options.type) {\n case \"hidden\":\n {\n return \"\";\n }\n case \"password\":\n {\n return Ansi.annotate(\"*\".repeat(text.length), annotation);\n }\n case \"text\":\n {\n return Ansi.annotate(text, annotation);\n }\n }\n};\nconst renderTextError = (nextState, pointer, renderOptions) => {\n if (Option.isSome(nextState.error)) {\n return Arr.match(nextState.error.value.split(NEWLINE_REGEXP), {\n onEmpty: () => \"\",\n onNonEmpty: errorLines => {\n if (renderOptions?.plain === true) {\n return `${pointer} ${errorLines.join(\"\\n\")}`;\n }\n const prefix = Ansi.annotate(pointer, Ansi.red) + \" \";\n const lines = Arr.map(errorLines, str => annotateErrorLine(str));\n return Ansi.cursorSavePosition + \"\\n\" + prefix + lines.join(\"\\n\") + Ansi.cursorRestorePosition;\n }\n });\n }\n return \"\";\n};\nconst renderTextOutput = (nextState, leadingSymbol, trailingSymbol, options, renderOptions, submitted = false) => {\n const value = renderTextInput(nextState, options, submitted, renderOptions);\n return renderPrompt(value, options.message, leadingSymbol, trailingSymbol, renderOptions);\n};\nconst renderTextNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n const promptMsg = renderTextOutput(state, leadingSymbol, trailingSymbol, options);\n const errorMsg = renderTextError(state, figures.pointerSmall);\n const offset = state.cursor - state.value.length;\n return promptMsg + errorMsg + Ansi.cursorMove(offset);\n});\nconst renderTextSubmission = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderTextOutput(state, leadingSymbol, trailingSymbol, options, undefined, true);\n return promptMsg + \"\\n\";\n});\nconst processTextBackspace = state => {\n if (state.cursor <= 0) {\n return Effect.succeed(Action.Beep());\n }\n const beforeCursor = state.value.slice(0, state.cursor - 1);\n const afterCursor = state.value.slice(state.cursor);\n const cursor = state.cursor - 1;\n const value = `${beforeCursor}${afterCursor}`;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor,\n value,\n error: Option.none()\n }\n }));\n};\nconst processTextClear = state => Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor: 0,\n value: \"\",\n error: Option.none()\n }\n}));\nconst processTextCursorLeft = state => {\n if (state.cursor <= 0) {\n return Effect.succeed(Action.Beep());\n }\n const cursor = state.cursor - 1;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor,\n error: Option.none()\n }\n }));\n};\nconst processTextCursorRight = state => {\n if (state.cursor >= state.value.length) {\n return Effect.succeed(Action.Beep());\n }\n const cursor = Math.min(state.cursor + 1, state.value.length);\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor,\n error: Option.none()\n }\n }));\n};\nconst processTextCursorStart = state => Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor: 0,\n error: Option.none()\n }\n}));\nconst processTextCursorEnd = state => Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor: state.value.length,\n error: Option.none()\n }\n}));\nconst processTab = (state, options) => {\n if (state.value === options.default) {\n return Effect.succeed(Action.Beep());\n }\n const value = state.value.length === 0 ? options.default : state.value;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value,\n cursor: value.length,\n error: Option.none()\n }\n }));\n};\nconst defaultTextProcessor = (input, state) => {\n const beforeCursor = state.value.slice(0, state.cursor);\n const afterCursor = state.value.slice(state.cursor);\n const value = `${beforeCursor}${input}${afterCursor}`;\n const cursor = state.cursor + input.length;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor,\n value,\n error: Option.none()\n }\n }));\n};\nconst handleTextRender = options => {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderTextNextFrame(state, options),\n Submit: () => renderTextSubmission(state, options)\n });\n };\n};\nconst handleTextProcess = options => {\n return (input, state) => {\n if (input.key.ctrl) {\n switch (input.key.name) {\n case \"u\":\n {\n return processTextClear(state);\n }\n case \"a\":\n {\n return processTextCursorStart(state);\n }\n case \"e\":\n {\n return processTextCursorEnd(state);\n }\n default:\n {\n return Effect.succeed(Action.Beep());\n }\n }\n }\n switch (input.key.name) {\n case \"backspace\":\n {\n return processTextBackspace(state);\n }\n case \"left\":\n {\n return processTextCursorLeft(state);\n }\n case \"right\":\n {\n return processTextCursorRight(state);\n }\n case \"home\":\n {\n return processTextCursorStart(state);\n }\n case \"end\":\n {\n return processTextCursorEnd(state);\n }\n case \"enter\":\n case \"return\":\n {\n const value = state.value;\n return Effect.match(options.validate(value), {\n onFailure: error => Action.NextFrame({\n state: {\n ...state,\n value,\n error: Option.some(error)\n }\n }),\n onSuccess: value => Action.Submit({\n value\n })\n });\n }\n case \"tab\":\n {\n return processTab(state, options);\n }\n default:\n {\n return defaultTextProcessor(Option.getOrElse(input.input, () => \"\"), state);\n }\n }\n };\n};\nconst handleTextClear = options => {\n return (state, _) => {\n return renderClearScreen(state, options);\n };\n};\nconst basePrompt = (options, type) => {\n const opts = {\n default: \"\",\n type,\n validate: Effect.succeed,\n ...options\n };\n const initialState = {\n cursor: opts.default.length,\n value: opts.default,\n error: Option.none()\n };\n return custom(initialState, {\n render: handleTextRender(opts),\n process: handleTextProcess(opts),\n clear: handleTextClear(opts)\n });\n};\nconst handleToggleClear = /*#__PURE__*/Effect.fnUntraced(function* (options) {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* platformFigures;\n const clearPrompt = Ansi.eraseLine + Ansi.cursorLeft;\n const toggleText = `${options.active} / ${options.inactive}`;\n const promptText = renderPrompt(toggleText, options.message, \"?\", figures.pointerSmall, {\n plain: true\n });\n const clearOutput = eraseText(promptText, columns);\n return clearOutput + clearPrompt;\n});\nconst renderToggle = (value, options, submitted = false) => {\n const separator = Ansi.annotate(\"/\", Ansi.blackBright);\n const selectedAnnotation = Ansi.combine(Ansi.underlined, submitted ? Ansi.white : Ansi.cyanBright);\n const inactive = value ? options.inactive : Ansi.annotate(options.inactive, selectedAnnotation);\n const active = value ? Ansi.annotate(options.active, selectedAnnotation) : options.active;\n return active + \" \" + separator + \" \" + inactive;\n};\nconst renderToggleOutput = (toggle, leadingSymbol, trailingSymbol, options) => {\n const promptLines = options.message.split(NEWLINE_REGEXP);\n const prefix = leadingSymbol + \" \";\n if (Arr.isReadonlyArrayNonEmpty(promptLines)) {\n const lines = Arr.map(promptLines, line => annotateLine(line));\n return prefix + lines.join(\"\\n\") + \" \" + trailingSymbol + \" \" + toggle;\n }\n return prefix + \" \" + trailingSymbol + \" \" + toggle;\n};\nconst renderToggleNextFrame = /*#__PURE__*/Effect.fnUntraced(function* (state, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(\"?\", Ansi.cyanBright);\n const trailingSymbol = Ansi.annotate(figures.pointerSmall, Ansi.blackBright);\n const toggle = renderToggle(state, options);\n const promptMsg = renderToggleOutput(toggle, leadingSymbol, trailingSymbol, options);\n return Ansi.cursorHide + promptMsg;\n});\nconst renderToggleSubmission = /*#__PURE__*/Effect.fnUntraced(function* (value, options) {\n const figures = yield* platformFigures;\n const leadingSymbol = Ansi.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Ansi.annotate(figures.ellipsis, Ansi.blackBright);\n const toggle = renderToggle(value, options, true);\n const promptMsg = renderToggleOutput(toggle, leadingSymbol, trailingSymbol, options);\n return promptMsg + \"\\n\";\n});\nconst activate = /*#__PURE__*/Effect.succeed(/*#__PURE__*/Action.NextFrame({\n state: true\n}));\nconst deactivate = /*#__PURE__*/Effect.succeed(/*#__PURE__*/Action.NextFrame({\n state: false\n}));\nconst handleToggleRender = options => {\n return (state, action) => {\n switch (action._tag) {\n case \"Beep\":\n {\n return Effect.succeed(renderBeep);\n }\n case \"NextFrame\":\n {\n return renderToggleNextFrame(state, options);\n }\n case \"Submit\":\n {\n return renderToggleSubmission(state, options);\n }\n }\n };\n};\nconst handleToggleProcess = (input, state) => {\n switch (input.key.name) {\n case \"0\":\n case \"j\":\n case \"delete\":\n case \"right\":\n case \"down\":\n {\n return deactivate;\n }\n case \"1\":\n case \"k\":\n case \"left\":\n case \"up\":\n {\n return activate;\n }\n case \" \":\n case \"tab\":\n {\n return state ? deactivate : activate;\n }\n case \"enter\":\n case \"return\":\n {\n return Effect.succeed(Action.Submit({\n value: state\n }));\n }\n default:\n {\n return Effect.succeed(Action.Beep());\n }\n }\n};\nconst entriesToDisplay = (cursor, total, maxVisible) => {\n const max = maxVisible === undefined ? total : maxVisible;\n let startIndex = Math.min(total - max, cursor - Math.floor(max / 2));\n if (startIndex < 0) {\n startIndex = 0;\n }\n const endIndex = Math.min(startIndex + max, total);\n return {\n startIndex,\n endIndex\n };\n};\n//# sourceMappingURL=Prompt.js.map","/**\n * Defines the shared parameter model for CLI arguments and flags.\n *\n * A `Param<Kind, A>` describes how to consume parsed command-line input and\n * return a typed value. The `Kind` decides whether the parameter reads\n * positional arguments or named flags. `Argument` and `Flag` build on this\n * module to share parsing structure, primitive constructors, help metadata,\n * aliases, defaults, prompts, configuration fallbacks, validation, schema\n * decoding, fallback parameters, and traversal helpers.\n *\n * @since 4.0.0\n */\nimport * as Config from \"../../Config.js\";\nimport * as Effect from \"../../Effect.js\";\nimport { dual, identity } from \"../../Function.js\";\nimport * as Option from \"../../Option.js\";\nimport { pipeArguments } from \"../../Pipeable.js\";\nimport * as Predicate from \"../../Predicate.js\";\nimport * as Result from \"../../Result.js\";\nimport * as Schema from \"../../Schema.js\";\nimport * as CliError from \"./CliError.js\";\nimport * as Primitive from \"./Primitive.js\";\nimport * as Prompt from \"./Prompt.js\";\nconst TypeId = \"~effect/cli/Param\";\n/**\n * Defines the kind discriminator for positional argument parameters.\n *\n * **When to use**\n *\n * Use to build low-level `Param` constructors or type positions for positional\n * argument parameters.\n *\n * @see {@link flagKind} for the named flag parameter discriminator\n * @see {@link ParamKind} for the full parameter kind union\n *\n * @category constants\n * @since 4.0.0\n */\nexport const argumentKind = \"argument\";\n/**\n * Defines the kind discriminator for flag parameters.\n *\n * **When to use**\n *\n * Use to build low-level `Param` constructors or type positions for named flag\n * parameters.\n *\n * @see {@link argumentKind} for the positional argument parameter discriminator\n *\n * @category constants\n * @since 4.0.0\n */\nexport const flagKind = \"flag\";\nconst Proto = {\n [TypeId]: {\n _A: identity\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/**\n * Type guard to check if a value is a Param.\n *\n * **Example** (Checking for params)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const maybeParam = Param.string(Param.flagKind, \"name\")\n *\n * if (Param.isParam(maybeParam)) {\n * console.log(\"This is a Param\")\n * }\n * ```\n *\n * @category refinements\n * @since 4.0.0\n */\nexport const isParam = u => Predicate.hasProperty(u, TypeId);\n/**\n * Type guard to check if a param is a Single param (not composed).\n *\n * **Example** (Checking for single params)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const nameParam = Param.string(Param.flagKind, \"name\")\n * const optionalParam = Param.optional(nameParam)\n *\n * console.log(Param.isSingle(nameParam)) // true\n * console.log(Param.isSingle(optionalParam)) // false\n * ```\n *\n * @category refinements\n * @since 4.0.0\n */\nexport const isSingle = param => Predicate.isTagged(param, \"Single\");\n/**\n * Type guard to check if a Single param is a flag (not an argument).\n *\n * @internal\n */\nexport const isFlagParam = single => single.kind === \"flag\";\n/**\n * Constructs a leaf `Single` parameter from its kind, name, primitive parser,\n * and optional help metadata.\n *\n * **Details**\n *\n * The returned parser reads either one positional argument or the named flag,\n * depending on `kind`.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const makeSingle = params => {\n const parse = args => params.kind === argumentKind ? parsePositional(params.name, params.primitiveType, args) : parseFlag(params.name, params.primitiveType, args);\n return Object.assign(Object.create(Proto), {\n _tag: \"Single\",\n ...params,\n description: params.description ?? Option.none(),\n aliases: params.aliases ?? [],\n hidden: params.hidden ?? false,\n parse\n });\n};\n/**\n * Creates a string parameter.\n *\n * **Example** (Creating string parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Create a string flag\n * const nameFlag = Param.string(Param.flagKind, \"name\")\n *\n * // Create a string argument\n * const fileArg = Param.string(Param.argumentKind, \"file\")\n *\n * // Usage in CLI: --name \"John Doe\" or as positional argument\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const string = (kind, name) => makeSingle({\n name,\n primitiveType: Primitive.string,\n kind\n});\n/**\n * Creates a boolean parameter.\n *\n * **Example** (Creating boolean parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Create a boolean flag\n * const verboseFlag = Param.boolean(Param.flagKind, \"verbose\")\n *\n * // Create a boolean argument\n * const enableArg = Param.boolean(Param.argumentKind, \"enable\")\n *\n * // Usage in CLI: --verbose (defaults to true when present, false when absent)\n * // or as positional: true/false\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const boolean = (kind, name) => makeSingle({\n name,\n primitiveType: Primitive.boolean,\n kind\n});\n/**\n * Creates an integer parameter.\n *\n * **Example** (Creating integer parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Create an integer flag\n * const portFlag = Param.integer(Param.flagKind, \"port\")\n *\n * // Create an integer argument\n * const countArg = Param.integer(Param.argumentKind, \"count\")\n *\n * // Usage in CLI: --port 8080 or as positional argument: 42\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const integer = (kind, name) => makeSingle({\n name,\n primitiveType: Primitive.integer,\n kind\n});\n/**\n * Creates a floating-point number parameter.\n *\n * **Example** (Creating float parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Create a float flag\n * const rateFlag = Param.float(Param.flagKind, \"rate\")\n *\n * // Create a float argument\n * const thresholdArg = Param.float(Param.argumentKind, \"threshold\")\n *\n * // Usage in CLI: --rate 0.95 or as positional argument: 3.14159\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const float = (kind, name) => makeSingle({\n name,\n primitiveType: Primitive.float,\n kind\n});\n/**\n * Creates a date parameter that parses ISO date strings.\n *\n * **Example** (Creating date parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Create a date flag\n * const startFlag = Param.date(Param.flagKind, \"start-date\")\n *\n * // Create a date argument\n * const dueDateArg = Param.date(Param.argumentKind, \"due-date\")\n *\n * // Usage in CLI: --start-date \"2023-12-25\" or as positional: \"2023-01-01\"\n * // Parses to JavaScript Date object\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const date = (kind, name) => makeSingle({\n name,\n primitiveType: Primitive.date,\n kind\n});\n/**\n * Constructs command-line params that represent a choice between several\n * inputs. The input will be mapped to it's associated value during parsing.\n *\n * **Example** (Creating valued choices)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * type Animal = Dog | Cat\n *\n * interface Dog {\n * readonly _tag: \"Dog\"\n * }\n *\n * interface Cat {\n * readonly _tag: \"Cat\"\n * }\n *\n * const animal = Param.choiceWithValue(Param.flagKind, \"animal\", [\n * [\"dog\", { _tag: \"Dog\" }],\n * [\"cat\", { _tag: \"Cat\" }]\n * ])\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const choiceWithValue = (kind, name, choices) => makeSingle({\n name,\n primitiveType: Primitive.choice(choices),\n kind\n});\n/**\n * Constructs command-line params that represent a choice between several\n * string inputs.\n *\n * **Example** (Creating string choices)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const logLevel = Param.choice(Param.flagKind, \"log-level\", [\n * \"debug\",\n * \"info\",\n * \"warn\",\n * \"error\"\n * ])\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const choice = (kind, name, choices) => {\n const mappedChoices = choices.map(value => [value, value]);\n return choiceWithValue(kind, name, mappedChoices);\n};\n/**\n * Creates a path parameter that accepts file or directory paths.\n *\n * **Example** (Creating path parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Basic path parameter\n * const outputPath = Param.path(Param.flagKind, \"output\")\n *\n * // Path that must exist\n * const inputPath = Param.path(Param.flagKind, \"input\", { mustExist: true })\n *\n * // File-only path\n * const configFile = Param.path(Param.flagKind, \"config\", {\n * pathType: \"file\",\n * mustExist: true,\n * typeName: \"config-file\"\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const path = (kind, name, options) => makeSingle({\n name,\n kind,\n primitiveType: Primitive.path(options?.pathType ?? \"either\", options?.mustExist),\n typeName: options?.typeName\n});\n/**\n * Creates a directory path parameter.\n *\n * **Details**\n *\n * This is a convenience function that creates a path parameter with the\n * `pathType` set to `\"directory\"` and a default type name of `\"directory\"`.\n *\n * **Example** (Creating directory parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Basic directory parameter\n * const outputDir = Param.directory(Param.flagKind, \"output-dir\")\n *\n * // Directory that must exist\n * const sourceDir = Param.directory(Param.flagKind, \"source\", { mustExist: true })\n *\n * // Usage: --output-dir /path/to/dir --source /existing/dir\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const directory = (kind, name, options) => path(kind, name, {\n pathType: \"directory\",\n typeName: \"directory\",\n mustExist: options?.mustExist\n});\n/**\n * Creates a file path parameter.\n *\n * **Details**\n *\n * This is a convenience function that creates a path parameter with a\n * `pathType` set to `\"file\"` and a default type name of `\"file\"`.\n *\n * **Example** (Creating file parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Basic file parameter\n * const outputFile = Param.file(Param.flagKind, \"output\")\n *\n * // File that must exist\n * const inputFile = Param.file(Param.flagKind, \"input\", { mustExist: true })\n *\n * // Usage: --output result.txt --input existing-file.txt\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const file = (kind, name, options) => path(kind, name, {\n pathType: \"file\",\n typeName: \"file\",\n mustExist: options?.mustExist\n});\n/**\n * Creates a redacted parameter for sensitive data like passwords.\n * The value is masked in help output and logging.\n *\n * **Example** (Creating redacted parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Create a password parameter\n * const password = Param.redacted(Param.flagKind, \"password\")\n *\n * // Create an API key argument\n * const apiKey = Param.redacted(Param.argumentKind, \"api-key\")\n *\n * // Usage: --password (value will be hidden in help/logs)\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const redacted = (kind, name) => makeSingle({\n name,\n primitiveType: Primitive.redacted,\n kind\n});\n/**\n * Creates a parameter that reads and returns file content as a string.\n *\n * **Example** (Reading file text)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Read a config file as string\n * const configContent = Param.fileText(Param.flagKind, \"config\")\n *\n * // Read a template file as argument\n * const templateContent = Param.fileText(Param.argumentKind, \"template\")\n *\n * // Usage: --config config.txt (reads file content into string)\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileText = (kind, name) => makeSingle({\n name,\n primitiveType: Primitive.fileText,\n kind\n});\n/**\n * Creates a param that reads and parses the content of the specified file.\n *\n * **Details**\n *\n * The parser that is utilized will depend on the specified `format`, or the\n * extension of the file passed on the command-line if no `format` is specified.\n *\n * **Example** (Parsing file contents)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Will use the extension of the file passed on the command line to determine\n * // the parser to use\n * const config = Param.fileParse(Param.flagKind, \"config\")\n *\n * // Will use the JSON parser\n * const jsonConfig = Param.fileParse(Param.flagKind, \"json-config\", {\n * format: \"json\"\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileParse = (kind, name, options) => makeSingle({\n name,\n primitiveType: Primitive.fileParse(options),\n kind\n});\n/**\n * Creates a parameter that reads and validates file content using a schema.\n *\n * **Example** (Validating file contents)\n *\n * ```ts\n * import { Schema } from \"effect\"\n * import { Param } from \"effect/unstable/cli\"\n * // Parse JSON config file\n * const configSchema = Schema.Struct({\n * port: Schema.Number,\n * host: Schema.String\n * })\n *\n * const config = Param.fileSchema(Param.flagKind, \"config\", configSchema, {\n * format: \"json\"\n * })\n *\n * // Parse YAML file\n * const yamlConfig = Param.fileSchema(Param.flagKind, \"config\", configSchema, {\n * format: \"yaml\"\n * })\n *\n * // Usage: --config config.json (reads and validates file content)\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileSchema = (kind, name, schema, options) => makeSingle({\n name,\n primitiveType: Primitive.fileSchema(schema, options),\n kind\n});\n/**\n * Creates a param that parses key=value pairs.\n *\n * **When to use**\n *\n * Use when you need command-line options or arguments that collect `key=value`\n * configuration entries.\n *\n * **Details**\n *\n * Requires at least one key=value pair. The parsed pairs are merged into a\n * single record object.\n *\n * **Example** (Parsing key-value pairs)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const env = Param.keyValuePair(Param.flagKind, \"env\")\n * // --env FOO=bar --env BAZ=qux will parse to { FOO: \"bar\", BAZ: \"qux\" }\n *\n * const props = Param.keyValuePair(Param.flagKind, \"property\")\n * // --property name=value --property debug=true\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const keyValuePair = (kind, name) => map(variadic(makeSingle({\n name,\n primitiveType: Primitive.keyValuePair,\n kind\n}), {\n min: 1\n}), objects => Object.assign({}, ...objects));\n/**\n * Creates an empty sentinel parameter that always fails to parse.\n *\n * **When to use**\n *\n * Use when you need an empty CLI parameter sentinel for optional parameter\n * construction or internal combinators.\n *\n * **Example** (Creating sentinel parameters)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const disabledDebugParam = Param.none(Param.flagKind)\n *\n * const makeDebugParam = (enableDebug: boolean) =>\n * enableDebug ? Param.string(Param.flagKind, \"debug\") : disabledDebugParam\n *\n * console.log(makeDebugParam(true) === disabledDebugParam) // false\n * console.log(makeDebugParam(false) === disabledDebugParam) // true\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const none = kind => makeSingle({\n name: \"__none__\",\n primitiveType: Primitive.none,\n kind\n});\nconst FLAG_DASH_REGEXP = /^-+/;\n/**\n * Adds an alias to an option.\n *\n * **When to use**\n *\n * Use when you need a CLI parameter to accept an alternate name, such as \"-f\"\n * for \"--force\".\n *\n * **Details**\n *\n * This works on any param structure by recursively finding the underlying\n * `Single` node and applying the alias there.\n *\n * **Example** (Adding parameter aliases)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const force = Param.boolean(Param.flagKind, \"force\").pipe(\n * Param.withAlias(\"-f\"),\n * Param.withAlias(\"-F\")\n * )\n *\n * // Also works on composed params:\n * const count = Param.integer(Param.flagKind, \"count\").pipe(\n * Param.optional,\n * Param.withAlias(\"-c\") // finds the underlying Single and adds alias\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withAlias = /*#__PURE__*/dual(2, (self, alias) => {\n return transformSingle(self, single => makeSingle({\n ...single,\n aliases: [...single.aliases, alias.replace(FLAG_DASH_REGEXP, \"\")]\n }));\n});\n/**\n * Adds a description to an option for help text.\n *\n * **Details**\n *\n * Descriptions provide users with information about what the option does\n * when they view help documentation.\n *\n * **Example** (Adding help descriptions)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const verbose = Param.boolean(Param.flagKind, \"verbose\").pipe(\n * Param.withAlias(\"-v\"),\n * Param.withDescription(\"Enable verbose output\")\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withDescription = /*#__PURE__*/dual(2, (self, description) => {\n return transformSingle(self, single => makeSingle({\n ...single,\n description: Option.some(description)\n }));\n});\n/**\n * Hides a parameter from generated help output and completions while keeping\n * it parseable on the command line.\n *\n * **When to use**\n *\n * Use when experimental, internal, or deprecated flags should be accepted but\n * not advertised.\n *\n * **Example** (Hiding a flag from help)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const experimental = Param.boolean(Param.flagKind, \"experimental-foo\").pipe(\n * Param.withHidden\n * )\n * ```\n *\n * @category metadata\n * @since 4.0.0\n */\nexport const withHidden = self => transformSingle(self, single => makeSingle({\n ...single,\n hidden: true\n}));\n/**\n * Transforms the parsed value of an option using a mapping function.\n *\n * **Example** (Mapping parsed values)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const port = Param.integer(Param.flagKind, \"port\").pipe(\n * Param.map((n) => ({ port: n, url: `http://localhost:${n}` }))\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const map = /*#__PURE__*/dual(2, (self, f) => {\n const parse = args => Effect.map(self.parse(args), ([operands, value]) => [operands, f(value)]);\n return Object.assign(Object.create(Proto), {\n _tag: \"Map\",\n kind: self.kind,\n param: self,\n f,\n parse\n });\n});\nconst transform = (self, f) => Object.assign(Object.create(Proto), {\n _tag: \"Transform\",\n kind: self.kind,\n param: self,\n f,\n parse: f(self.parse)\n});\n/**\n * Transforms the parsed value of an option using an effectful mapping function.\n *\n * **Example** (Mapping parsed values effectfully)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError, Param } from \"effect/unstable/cli\"\n *\n * const validatedEmail = Param.string(Param.flagKind, \"email\").pipe(\n * Param.mapEffect((email) =>\n * email.includes(\"@\")\n * ? Effect.succeed(email)\n * : Effect.fail(\n * new CliError.InvalidValue({\n * option: \"email\",\n * value: email,\n * expected: \"valid email format\",\n * kind: \"flag\"\n * })\n * )\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const mapEffect = /*#__PURE__*/dual(2, (self, f) => transform(self, parse => args => Effect.flatMap(parse(args), ([leftover, a]) => f(a).pipe(Effect.map(b => [leftover, b])))));\n/**\n * Transforms the parsed value of an option using a function that may throw,\n * converting any thrown errors into failure messages.\n *\n * **Example** (Mapping thrown errors)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const parsedJson = Param.string(Param.flagKind, \"config\").pipe(\n * Param.mapTryCatch(\n * (str) => JSON.parse(str),\n * (error) =>\n * `Invalid JSON: ${error instanceof Error ? error.message : String(error)}`\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const mapTryCatch = /*#__PURE__*/dual(3, (self, f, onError) => {\n const single = getUnderlyingSingleOrThrow(self);\n return transform(self, parse => args => Effect.flatMap(parse(args), ([leftover, a]) => Effect.try({\n try: () => f(a),\n catch: error => onError(error)\n }).pipe(Effect.mapError(error => new CliError.InvalidValue({\n option: single.name,\n value: String(a),\n expected: error,\n kind: single.kind\n })), Effect.map(b => [leftover, b]))));\n});\n/**\n * Makes a flag or positional argument optional.\n *\n * **Details**\n *\n * When the parameter is absent, parsing succeeds with `Option.none()` instead\n * of failing with a missing option or missing argument error. When present, the\n * parsed value is wrapped in `Option.some()`.\n *\n * **Example** (Making parameters optional)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Create an optional port option\n * // - When not provided: returns Option.none()\n * // - When provided: returns Option.some(parsedValue)\n * const port = Param.optional(Param.integer(Param.flagKind, \"port\"))\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const optional = param => {\n const parse = Effect.fnUntraced(function* (args) {\n const single = getUnderlyingSingleOrThrow(param);\n // Handle boolean params that are explicitly marked as optional (i.e. the\n // end user wants to return `Option.none()` instead of `false` when the\n // flag (or its negated variant) are not present on the command line\n if (isFlagParam(single) && Primitive.isBoolean(single.primitiveType) && ![single.name, ...single.aliases].some(name => (args.flags[name] ?? []).length > 0)) {\n return [args.arguments, Option.none()];\n }\n return yield* param.parse(args).pipe(Effect.map(([leftover, value]) => [leftover, Option.some(value)]),\n // Catch both MissingOption (for flags) and MissingArgument (for positional arguments)\n Effect.catchTags({\n MissingOption: () => Effect.succeed([args.arguments, Option.none()]),\n MissingArgument: () => Effect.succeed([args.arguments, Option.none()])\n }));\n });\n return Object.assign(Object.create(Proto), {\n _tag: \"Optional\",\n kind: param.kind,\n param,\n parse\n });\n};\n/**\n * Makes a flag or positional argument optional by supplying a fallback value.\n *\n * **Details**\n *\n * The fallback may be a pure value or an effect. It is used only when the\n * parameter is absent; provided values are parsed normally.\n *\n * **Example** (Providing default values)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Using the pipe operator to make an option optional\n * const port = Param.integer(Param.flagKind, \"port\").pipe(\n * Param.withDefault(8080)\n * )\n *\n * // Can also be used with other combinators\n * const verbose = Param.boolean(Param.flagKind, \"verbose\").pipe(\n * Param.withAlias(\"-v\"),\n * Param.withDescription(\"Enable verbose output\"),\n * Param.withDefault(false)\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withDefault = /*#__PURE__*/dual(2, (self, defaultValue) => {\n if (!Effect.isEffect(defaultValue)) {\n return map(optional(self), Option.getOrElse(() => defaultValue));\n }\n return mapEffect(optional(self), Option.match({\n onNone: () => defaultValue,\n onSome: Effect.succeed\n }));\n});\n/**\n * Adds a fallback config that is loaded when a required parameter is missing.\n *\n * **When to use**\n *\n * Use when you need config to provide a fallback source for required flags or\n * arguments that are absent from CLI input.\n *\n * **Details**\n *\n * Provided CLI values win. Config is loaded only after a missing option or\n * missing argument error.\n *\n * **Gotchas**\n *\n * Missing config preserves the original missing-parameter error. Config parse\n * failure becomes `CliError.InvalidValue`.\n *\n * @see {@link withDefault} for a pure default value\n * @see {@link withFallbackPrompt} for prompting interactively when input is missing\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withFallbackConfig = /*#__PURE__*/dual(2, (self, config) => {\n const toInvalidValue = (error, configError) => new CliError.InvalidValue({\n option: error._tag === \"MissingOption\" ? error.option : error.argument,\n value: \"config\",\n expected: configError.message,\n kind: error._tag === \"MissingOption\" ? \"flag\" : \"argument\"\n });\n const runConfig = (error, args) => Config.option(config).pipe(Effect.mapError(configError => toInvalidValue(error, configError)), Effect.flatMap(Option.match({\n onNone: () => Effect.fail(error),\n onSome: value => Effect.succeed([args.arguments, value])\n })));\n return transform(self, parse => args => parse(args).pipe(Effect.catchTag([\"MissingOption\", \"MissingArgument\"], error => runConfig(error, args))));\n});\n/**\n * Adds a fallback prompt that is shown when a required parameter is missing.\n *\n * **When to use**\n *\n * Use when a CLI should ask interactively for a missing required flag or\n * argument.\n *\n * **Details**\n *\n * `FallbackPrompt` accepts either a `Prompt` or an effect that builds one.\n * Effectful prompt creation is lazy and runs only when the fallback is needed.\n *\n * **Gotchas**\n *\n * This only handles missing options and missing arguments. Invalid values do not\n * prompt, and prompt cancellation re-fails with the original missing error.\n *\n * @see {@link FallbackPrompt} for accepted fallback prompt forms\n * @see {@link withFallbackConfig} for loading a fallback from config\n * @see {@link withDefault} for a pure default value\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withFallbackPrompt = /*#__PURE__*/dual(2, (self, prompt) => {\n const runPrompt = (error, args) => Effect.flatMap(Prompt.isPrompt(prompt) ? Effect.succeed(prompt) : prompt, Prompt.run).pipe(Effect.map(value => [args.arguments, value]), Effect.catchTag(\"QuitError\", () => Effect.fail(error)));\n return transform(self, parse => args => parse(args).pipe(Effect.catchTag([\"MissingOption\", \"MissingArgument\"], error => runPrompt(error, args))));\n});\n/**\n * Creates a variadic parameter that can be specified multiple times.\n *\n * **Details**\n *\n * This is the base combinator for creating parameters that accept multiple values.\n * The `min` and `max` parameters are optional. When they are not provided, the\n * parameter can be specified any number of times, from 0 to infinity.\n *\n * **Example** (Accepting multiple values)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Basic variadic parameter (0 to infinity)\n * const tags = Param.variadic(Param.string(Param.flagKind, \"tag\"))\n *\n * // Variadic with minimum count\n * const inputs = Param.variadic(\n * Param.string(Param.flagKind, \"input\"),\n * { min: 1 } // at least 1 required\n * )\n *\n * // Variadic with both min and max\n * const limited = Param.variadic(Param.string(Param.flagKind, \"item\"), {\n * min: 2, // at least 2 times\n * max: 2 // at most 2 times\n * })\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const variadic = (self, options) => {\n const single = getUnderlyingSingleOrThrow(self);\n const parse = args => {\n if (single.kind === \"argument\") {\n return parsePositionalVariadic(self, single, args, options);\n } else {\n return parseOptionVariadic(self, single, args, options);\n }\n };\n return Object.assign(Object.create(Proto), {\n _tag: \"Variadic\",\n kind: self.kind,\n param: self,\n min: Option.fromUndefinedOr(options?.min),\n max: Option.fromUndefinedOr(options?.max),\n parse\n });\n};\n/**\n * Wraps an option to allow it to be specified multiple times within a range.\n *\n * **Details**\n *\n * This combinator transforms an option to accept between `min` and `max`\n * occurrences on the command line, returning an array of all provided values.\n *\n * **Example** (Bounding repeated values)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Allow 1-3 file inputs\n * const files = Param.string(Param.flagKind, \"file\").pipe(\n * Param.between(1, 3),\n * Param.withAlias(\"-f\")\n * )\n *\n * // Parse: --file a.txt --file b.txt\n * // Result: [\"a.txt\", \"b.txt\"]\n *\n * // Allow 0 or more tags\n * const tags = Param.string(Param.flagKind, \"tag\").pipe(\n * Param.between(0, Number.MAX_SAFE_INTEGER)\n * )\n *\n * // Parse: --tag dev --tag staging --tag v1.0\n * // Result: [\"dev\", \"staging\", \"v1.0\"]\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const between = /*#__PURE__*/dual(3, (self, min, max) => {\n if (min < 0) {\n throw new Error(\"between: min must be non-negative\");\n }\n if (max < min) {\n throw new Error(\"between: max must be greater than or equal to min\");\n }\n return variadic(self, {\n min,\n max\n });\n});\n/**\n * Wraps an option to allow it to be specified at most `max` times.\n *\n * **Details**\n *\n * This combinator transforms an option to accept between 0 and `max`\n * occurrences on the command line, returning an array of all provided values.\n *\n * **Example** (Limiting repeated values)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Allow at most 3 warning suppressions\n * const suppressions = Param.string(Param.flagKind, \"suppress\").pipe(\n * Param.atMost(3)\n * )\n *\n * // Parse: --suppress warning1 --suppress warning2\n * // Result: [\"warning1\", \"warning2\"]\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const atMost = /*#__PURE__*/dual(2, (self, max) => {\n if (max < 0) {\n throw new Error(\"atMost: max must be non-negative\");\n }\n return variadic(self, {\n max\n });\n});\n/**\n * Wraps an option to require it to be specified at least `min` times.\n *\n * **Details**\n *\n * This combinator transforms an option to accept at least `min`\n * occurrences on the command line, returning an array of all provided values.\n *\n * **Example** (Requiring repeated values)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * // Require at least 2 input files\n * const inputs = Param.string(Param.flagKind, \"input\").pipe(\n * Param.atLeast(2),\n * Param.withAlias(\"-i\")\n * )\n *\n * // Parse: --input file1.txt --input file2.txt --input file3.txt\n * // Result: [\"file1.txt\", \"file2.txt\", \"file3.txt\"]\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const atLeast = /*#__PURE__*/dual(2, (self, min) => {\n if (min < 0) {\n throw new Error(\"atLeast: min must be non-negative\");\n }\n return variadic(self, {\n min\n });\n});\n/**\n * Filters and transforms parsed values, failing with a custom error message\n * if the filter function returns `Option.none()`.\n *\n * **When to use**\n *\n * Use when you need validation and transformation in a single parameter\n * combinator.\n *\n * **Example** (Filtering and transforming values)\n *\n * ```ts\n * import { Option } from \"effect\"\n * import { Param } from \"effect/unstable/cli\"\n * const positiveInt = Param.integer(Param.flagKind, \"count\").pipe(\n * Param.filterMap(\n * (n) => n > 0 ? Option.some(n) : Option.none(),\n * (n) => `Expected positive integer, got ${n}`\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const filterMap = /*#__PURE__*/dual(3, (self, filter, onNone) => mapEffect(self, Effect.fnUntraced(function* (a) {\n const result = filter(a);\n if (Option.isSome(result)) {\n return result.value;\n }\n const single = getUnderlyingSingleOrThrow(self);\n return yield* new CliError.InvalidValue({\n option: single.name,\n value: String(a),\n expected: onNone(a),\n kind: single.kind\n });\n})));\n/**\n * Filters parsed values, failing with a custom error message if the predicate returns false.\n *\n * **Example** (Filtering parsed values)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const evenNumber = Param.integer(Param.flagKind, \"num\").pipe(\n * Param.filter(\n * (n) => n % 2 === 0,\n * (n) => `Expected even number, got ${n}`\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const filter = /*#__PURE__*/dual(3, (self, predicate, onFalse) => filterMap(self, Option.liftPredicate(predicate), onFalse));\n/**\n * Sets a custom metavar (placeholder name) for the param in help documentation.\n *\n * **Details**\n *\n * The metavar is displayed in usage text to indicate what value the user should provide.\n * For example, `--output FILE` shows `FILE` as the metavar.\n *\n * **Example** (Setting metavars)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const port = Param.integer(Param.flagKind, \"port\").pipe(\n * Param.withMetavar(\"PORT\"),\n * Param.filter(\n * (p) => p >= 1 && p <= 65535,\n * () => \"Port must be between 1 and 65535\"\n * )\n * )\n * ```\n *\n * @category metadata\n * @since 4.0.0\n */\nexport const withMetavar = /*#__PURE__*/dual(2, (self, metavar) => transformSingle(self, single => makeSingle({\n ...single,\n typeName: metavar\n})));\n/**\n * Validates parsed values against a Schema, providing detailed error messages.\n *\n * **Example** (Validating with schemas)\n *\n * ```ts\n * import { Schema } from \"effect\"\n * import { Param } from \"effect/unstable/cli\"\n * const isEmail = Schema.isPattern(/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/)\n *\n * const Email = Schema.String.pipe(\n * Schema.check(isEmail)\n * )\n *\n * const email = Param.string(Param.flagKind, \"email\").pipe(\n * Param.withSchema(Email)\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withSchema = /*#__PURE__*/dual(2, (self, schema) => {\n const decodeParam = Schema.decodeUnknownEffect(schema);\n return mapEffect(self, value => Effect.mapError(decodeParam(value), error => {\n const single = getUnderlyingSingleOrThrow(self);\n return new CliError.InvalidValue({\n option: single.name,\n value: String(value),\n expected: `Schema validation failed: ${error.message}`,\n kind: single.kind\n });\n }));\n});\n/**\n * Provides a fallback param to use if this param fails to parse.\n *\n * **Example** (Falling back to another parameter)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const config = Param.file(Param.flagKind, \"config\").pipe(\n * Param.orElse(() => Param.string(Param.flagKind, \"config-url\"))\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const orElse = /*#__PURE__*/dual(2, (self, orElse) => transform(self, parse => args => Effect.catch(parse(args), err => orElse(err).parse(args))));\n/**\n * Provides a fallback param and returns a `Result` indicating which param\n * succeeded.\n *\n * **Details**\n *\n * The original param's value is returned as `Result.succeed`, while the\n * fallback param's value is returned as `Result.fail`.\n *\n * **Example** (Returning fallback results)\n *\n * ```ts\n * import { Param } from \"effect/unstable/cli\"\n *\n * const configSource = Param.file(Param.flagKind, \"config\").pipe(\n * Param.orElseResult(() => Param.string(Param.flagKind, \"config-url\"))\n * )\n * // Returns Result<string, string>\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const orElseResult = /*#__PURE__*/dual(2, (self, orElse) => {\n return transform(self, parse => args => Effect.catch(Effect.map(parse(args), ([leftover, value]) => [leftover, Result.succeed(value)]), err => Effect.map(orElse(err).parse(args), ([leftover, value]) => [leftover, Result.fail(value)])));\n});\n// =============================================================================\n// Parsing Utilities\n// =============================================================================\nconst parsePositional = /*#__PURE__*/Effect.fnUntraced(function* (name, primitiveType, args) {\n if (args.arguments.length === 0) {\n return yield* new CliError.MissingArgument({\n argument: name\n });\n }\n const arg = args.arguments[0];\n const value = yield* Effect.mapError(primitiveType.parse(arg), error => new CliError.InvalidValue({\n option: name,\n value: arg,\n expected: error,\n kind: \"argument\"\n }));\n return [args.arguments.slice(1), value];\n});\nconst parseFlag = /*#__PURE__*/Effect.fnUntraced(function* (name, primitiveType, args) {\n const providedValues = args.flags[name];\n if (providedValues === undefined || providedValues.length === 0) {\n // Option not provided (empty array due to initialization)\n if (Primitive.isBoolean(primitiveType)) {\n // Boolean params default to false when not present\n return [args.arguments, false];\n } else {\n return yield* new CliError.MissingOption({\n option: name\n });\n }\n }\n // Parse the first value (later we can handle multiple)\n const arg = providedValues[0];\n const value = yield* Effect.mapError(primitiveType.parse(arg), error => new CliError.InvalidValue({\n option: name,\n value: arg,\n expected: error,\n kind: \"flag\"\n }));\n return [args.arguments, value];\n});\nconst parsePositionalVariadic = /*#__PURE__*/Effect.fnUntraced(function* (self, single, args, options) {\n const results = [];\n const minValue = options?.min ?? 0;\n const maxValue = options?.max ?? Number.POSITIVE_INFINITY;\n let count = 0;\n let currentArgs = args.arguments;\n while (currentArgs.length > 0 && count < maxValue) {\n const [remainingArgs, value] = yield* self.parse({\n flags: args.flags,\n arguments: currentArgs\n });\n results.push(value);\n currentArgs = remainingArgs;\n count++;\n }\n if (count < minValue) {\n return yield* new CliError.InvalidValue({\n option: single.name,\n value: `${count} values`,\n expected: `at least ${minValue} value${minValue === 1 ? \"\" : \"s\"}`,\n kind: single.kind\n });\n }\n return [currentArgs, results];\n});\nconst parseOptionVariadic = /*#__PURE__*/Effect.fnUntraced(function* (self, single, args, options) {\n const results = [];\n const names = [single.name, ...single.aliases];\n const values = names.flatMap(name => args.flags[name] ?? []);\n const count = values.length;\n // Validate count constraints\n if (Predicate.isNotUndefined(options?.min) && count < options.min) {\n return yield* count === 0 ? new CliError.MissingOption({\n option: single.name\n }) : new CliError.InvalidValue({\n option: single.name,\n value: `${count} occurrences`,\n expected: `at least ${options.min} value${options.min === 1 ? \"\" : \"s\"}`,\n kind: single.kind\n });\n }\n if (Predicate.isNotUndefined(options?.max) && count > options.max) {\n return yield* new CliError.InvalidValue({\n option: single.name,\n value: `${count} occurrences`,\n expected: `at most ${options.max} value${options.max === 1 ? \"\" : \"s\"}`,\n kind: single.kind\n });\n }\n // Parse each value individually\n for (const value of values) {\n const [, parsedValue] = yield* self.parse({\n flags: {\n [single.name]: [value]\n },\n arguments: []\n });\n results.push(parsedValue);\n }\n return [args.arguments, results];\n});\n/**\n * Type-safe param matcher that handles the unsafe casting internally.\n * This provides a clean API for pattern matching on param types while\n * maintaining type safety at the call site.\n */\nconst matchParam = (param, patterns) => {\n const p = param;\n switch (p._tag) {\n case \"Single\":\n return patterns.Single(p);\n case \"Map\":\n return patterns.Map(p);\n case \"Transform\":\n return patterns.Transform(p);\n case \"Optional\":\n return patterns.Optional(p);\n case \"Variadic\":\n return patterns.Variadic(p);\n }\n};\n/**\n * Recursively transforms a param by applying a function to any `Single` nodes.\n * This is used internally by combinators like `withAlias` to traverse the param tree.\n */\nconst transformSingle = (param, f) => {\n return matchParam(param, {\n Single: single => f(single),\n Map: mapped => map(transformSingle(mapped.param, f), mapped.f),\n Transform: mapped => transform(transformSingle(mapped.param, f), mapped.f),\n Optional: p => optional(transformSingle(p.param, f)),\n Variadic: p => variadic(transformSingle(p.param, f), {\n min: Option.getOrUndefined(p.min),\n max: Option.getOrUndefined(p.max)\n })\n });\n};\n/**\n * Extracts all Single params from a potentially nested param structure.\n * This handles all param combinators including Map, Transform, Optional, and Variadic.\n *\n * @internal\n */\nexport const extractSingleParams = param => {\n return matchParam(param, {\n Single: single => [single],\n Map: mapped => extractSingleParams(mapped.param),\n Transform: mapped => extractSingleParams(mapped.param),\n Optional: optional => extractSingleParams(optional.param),\n Variadic: variadic => extractSingleParams(variadic.param)\n });\n};\n/**\n * Gets the underlying Single param from a potentially nested param structure.\n * Throws an error if there are no singles or multiple singles found.\n *\n * @internal\n */\nexport const getUnderlyingSingleOrThrow = param => {\n const singles = extractSingleParams(param);\n if (singles.length === 0) {\n throw new Error(\"No Single param found in param structure\");\n }\n if (singles.length > 1) {\n throw new Error(`Multiple Single params found: ${singles.map(s => s.name).join(\", \")}`);\n }\n return singles[0];\n};\n/**\n * Gets param metadata by traversing the structure.\n *\n * @internal\n */\nexport const getParamMetadata = param => {\n return matchParam(param, {\n Single: () => ({\n isOptional: false,\n isVariadic: false\n }),\n Map: mapped => getParamMetadata(mapped.param),\n Transform: mapped => getParamMetadata(mapped.param),\n Optional: optional => ({\n ...getParamMetadata(optional.param),\n isOptional: true\n }),\n Variadic: variadic => ({\n ...getParamMetadata(variadic.param),\n isVariadic: true\n })\n });\n};\n//# sourceMappingURL=Param.js.map","import { dual } from \"../../Function.js\";\nimport * as Param from \"./Param.js\";\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * Creates a positional string argument.\n *\n * **Example** (Creating a string argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const filename = Argument.string(\"filename\")\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const string = name => Param.string(Param.argumentKind, name);\n/**\n * Creates a positional integer argument.\n *\n * **Example** (Creating an integer argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const count = Argument.integer(\"count\")\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const integer = name => Param.integer(Param.argumentKind, name);\n/**\n * Creates a positional file path argument.\n *\n * **Example** (Creating file path arguments)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const inputFile = Argument.file(\"input\", { mustExist: true }) // Must exist\n * const outputFile = Argument.file(\"output\", { mustExist: false }) // Must not exist\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const file = (name, options) => Param.file(Param.argumentKind, name, options);\n/**\n * Creates a positional directory path argument.\n *\n * **Example** (Creating a directory path argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const workspace = Argument.directory(\"workspace\", { mustExist: true }) // Must exist\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const directory = (name, options) => Param.directory(Param.argumentKind, name, options);\n/**\n * Creates a positional float argument.\n *\n * **Example** (Creating a float argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const ratio = Argument.float(\"ratio\")\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const float = name => Param.float(Param.argumentKind, name);\n/**\n * Creates a positional date argument.\n *\n * **Example** (Creating a date argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const startDate = Argument.date(\"start-date\")\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const date = name => Param.date(Param.argumentKind, name);\n/**\n * Creates a positional choice argument.\n *\n * **Example** (Creating a choice argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const environment = Argument.choice(\"environment\", [\"dev\", \"staging\", \"prod\"])\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const choice = (name, choices) => Param.choice(Param.argumentKind, name, choices);\n/**\n * Creates a positional path argument.\n *\n * **Example** (Creating a path argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const configPath = Argument.path(\"config\")\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const path = (name, options) => Param.path(Param.argumentKind, name, options);\n/**\n * Creates a positional redacted argument that obscures its value.\n *\n * **Example** (Creating a redacted argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const secret = Argument.redacted(\"secret\")\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const redacted = name => Param.redacted(Param.argumentKind, name);\n/**\n * Creates a positional argument that reads file content as a string.\n *\n * **Example** (Reading file text)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const config = Argument.fileText(\"config-file\")\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileText = name => Param.fileText(Param.argumentKind, name);\n/**\n * Creates a positional argument that reads a file and parses its content.\n *\n * **Details**\n *\n * The parser is chosen from the explicit `format` option or, when omitted, the\n * file extension. The parsed value is `unknown`; use `fileSchema` when the\n * parsed content should also be decoded with a Schema.\n *\n * **Example** (Parsing file content)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const config = Argument.fileParse(\"config\", { format: \"json\" })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileParse = (name, options) => Param.fileParse(Param.argumentKind, name, options);\n/**\n * Creates a positional argument that reads and validates file content using a schema.\n *\n * **Example** (Validating file content with a schema)\n *\n * ```ts\n * import { Schema } from \"effect\"\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const ConfigSchema = Schema.Struct({\n * port: Schema.Number,\n * host: Schema.String\n * })\n *\n * const config = Argument.fileSchema(\"config\", ConfigSchema)\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileSchema = (name, schema, options) => Param.fileSchema(Param.argumentKind, name, schema, options);\n/**\n * Creates an empty sentinel argument that always fails to parse.\n *\n * **Example** (Creating a sentinel argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * // Used as a placeholder or default in combinators\n * const noArg = Argument.none\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const none = /*#__PURE__*/Param.none(Param.argumentKind);\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * Makes a positional argument optional.\n *\n * **Example** (Making an argument optional)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const optionalVersion = Argument.string(\"version\").pipe(Argument.optional)\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const optional = arg => Param.optional(arg);\n/**\n * Adds a description to a positional argument.\n *\n * **Example** (Adding an argument description)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const filename = Argument.string(\"filename\").pipe(\n * Argument.withDescription(\"The input file to process\")\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withDescription = /*#__PURE__*/dual(2, (self, description) => Param.withDescription(self, description));\n/**\n * Provides a default value for a positional argument.\n *\n * **Example** (Providing a default value)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const port = Argument.integer(\"port\").pipe(Argument.withDefault(8080))\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withDefault = Param.withDefault;\n/**\n * Adds a fallback config that is loaded when a required argument is missing.\n *\n * **Example** (Loading a fallback config)\n *\n * ```ts\n * import { Config } from \"effect\"\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const repository = Argument.string(\"repository\").pipe(\n * Argument.withFallbackConfig(Config.string(\"REPOSITORY\"))\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withFallbackConfig = /*#__PURE__*/dual(2, (self, config) => Param.withFallbackConfig(self, config));\n/**\n * Adds a fallback prompt that is shown when a required argument is missing.\n *\n * **Example** (Showing a fallback prompt)\n *\n * ```ts\n * import { Argument, Prompt } from \"effect/unstable/cli\"\n *\n * const filename = Argument.string(\"filename\").pipe(\n * Argument.withFallbackPrompt(Prompt.text({ message: \"Filename\" }))\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withFallbackPrompt = /*#__PURE__*/dual(2, (self, prompt) => Param.withFallbackPrompt(self, prompt));\n/**\n * Creates a variadic positional argument that accepts multiple values.\n *\n * **Example** (Accepting multiple values)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * // Accept any number of files\n * const anyFiles = Argument.string(\"files\").pipe(Argument.variadic)\n *\n * // Accept at least 1 file\n * const atLeastOneFile = Argument.string(\"files\").pipe(\n * Argument.variadic({ min: 1 })\n * )\n *\n * // Accept between 1 and 5 files\n * const limitedFiles = Argument.string(\"files\").pipe(\n * Argument.variadic({ min: 1, max: 5 })\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const variadic = /*#__PURE__*/dual(args => Param.isParam(args[0]), (self, options) => Param.variadic(self, options));\n/**\n * Transforms the parsed value of a positional argument.\n *\n * **Example** (Mapping parsed values)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const port = Argument.integer(\"port\").pipe(\n * Argument.map((p) => ({ port: p, url: `http://localhost:${p}` }))\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const map = /*#__PURE__*/dual(2, (self, f) => Param.map(self, f));\n/**\n * Transforms the parsed value of a positional argument using an effectful function.\n *\n * **Example** (Validating values effectfully)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { Argument, CliError } from \"effect/unstable/cli\"\n *\n * const files = Argument.string(\"files\").pipe(\n * Argument.mapEffect((file) =>\n * file.endsWith(\".txt\")\n * ? Effect.succeed(file)\n * : Effect.fail(\n * new CliError.UserError({\n * cause: new Error(\"Only .txt files allowed\")\n * })\n * )\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const mapEffect = /*#__PURE__*/dual(2, (self, f) => Param.mapEffect(self, f));\n/**\n * Transforms the parsed value of a positional argument using a function that may throw.\n *\n * **Example** (Mapping values that may throw)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const json = Argument.string(\"data\").pipe(\n * Argument.mapTryCatch(\n * (str) => JSON.parse(str),\n * (error) =>\n * `Invalid JSON: ${error instanceof Error ? error.message : String(error)}`\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const mapTryCatch = /*#__PURE__*/dual(3, (self, f, onError) => Param.mapTryCatch(self, f, onError));\n/**\n * Creates a variadic argument that requires at least n values.\n *\n * **Example** (Requiring a minimum number of values)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const files = Argument.string(\"files\").pipe(Argument.atLeast(1))\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const atLeast = /*#__PURE__*/dual(2, (self, min) => Param.atLeast(self, min));\n/**\n * Creates a variadic argument that accepts at most n values.\n *\n * **Example** (Limiting the maximum number of values)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const files = Argument.string(\"files\").pipe(Argument.atMost(5))\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const atMost = /*#__PURE__*/dual(2, (self, max) => Param.atMost(self, max));\n/**\n * Creates a variadic argument that accepts between min and max values.\n *\n * **Example** (Requiring a range of values)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const files = Argument.string(\"files\").pipe(Argument.between(1, 5))\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const between = /*#__PURE__*/dual(3, (self, min, max) => Param.between(self, min, max));\n/**\n * Validates parsed values against a Schema.\n *\n * **Example** (Validating parsed values with a schema)\n *\n * ```ts\n * import { Schema } from \"effect\"\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const input = Argument.string(\"input\").pipe(\n * Argument.withSchema(Schema.NonEmptyString)\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withSchema = /*#__PURE__*/dual(2, (self, schema) => Param.withSchema(self, schema));\n/**\n * Creates a positional choice argument with custom value mapping.\n *\n * **Example** (Mapping choices to values)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const logLevel = Argument.choiceWithValue(\"level\", [\n * [\"debug\", 0],\n * [\"info\", 1],\n * [\"warn\", 2],\n * [\"error\", 3]\n * ])\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const choiceWithValue = (name, choices) => Param.choiceWithValue(Param.argumentKind, name, choices);\n// -------------------------------------------------------------------------------------\n// metadata\n// -------------------------------------------------------------------------------------\n/**\n * Sets a custom metavar (placeholder name) for the argument in help documentation.\n *\n * **Details**\n *\n * The metavar is displayed in usage text to indicate what value the user should provide.\n * For example, `<FILE>` shows `FILE` as the metavar.\n *\n * **Example** (Setting a metavar)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const port = Argument.integer(\"port\").pipe(\n * Argument.withMetavar(\"PORT\")\n * )\n * ```\n *\n * @category metadata\n * @since 4.0.0\n */\nexport const withMetavar = /*#__PURE__*/dual(2, (self, metavar) => Param.withMetavar(self, metavar));\n/**\n * Filters parsed values, failing with a custom error message if the predicate returns false.\n *\n * **Example** (Filtering parsed values)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const positiveInt = Argument.integer(\"count\").pipe(\n * Argument.filter(\n * (n) => n > 0,\n * (n) => `Expected positive integer, got ${n}`\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const filter = /*#__PURE__*/dual(3, (self, predicate, onFalse) => Param.filter(self, predicate, onFalse));\n/**\n * Filters and transforms parsed values, failing with a custom error message\n * if the filter function returns None.\n *\n * **Example** (Filtering and mapping parsed values)\n *\n * ```ts\n * import { Option } from \"effect\"\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const positiveInt = Argument.integer(\"count\").pipe(\n * Argument.filterMap(\n * (n) => n > 0 ? Option.some(n) : Option.none(),\n * (n) => `Expected positive integer, got ${n}`\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const filterMap = /*#__PURE__*/dual(3, (self, f, onNone) => Param.filterMap(self, f, onNone));\n/**\n * Provides a fallback argument to use if this argument fails to parse.\n *\n * **Example** (Providing a fallback argument)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const value = Argument.integer(\"value\").pipe(\n * Argument.orElse(() => Argument.string(\"value\"))\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const orElse = /*#__PURE__*/dual(2, (self, that) => Param.orElse(self, that));\n/**\n * Provides a fallback argument, wrapping results in Result to distinguish which succeeded.\n *\n * **Example** (Returning which fallback succeeded)\n *\n * ```ts\n * import { Argument } from \"effect/unstable/cli\"\n *\n * const source = Argument.file(\"source\").pipe(\n * Argument.orElseResult(() => Argument.string(\"url\"))\n * )\n * // Returns Result<string, string>\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const orElseResult = /*#__PURE__*/dual(2, (self, that) => Param.orElseResult(self, that));\n//# sourceMappingURL=Argument.js.map","/**\n * Formats CLI help and errors as text.\n *\n * This module turns help documents, CLI errors, grouped errors, and version\n * information into strings. It does not write those strings to the terminal\n * itself. It includes the `Formatter` interface, the formatter service, a layer\n * for custom formatters, and the default formatter with configurable color\n * support.\n *\n * @since 4.0.0\n */\nimport * as Context from \"../../Context.js\";\nimport * as Layer from \"../../Layer.js\";\nimport * as Option from \"../../Option.js\";\n/**\n * Service reference for the CLI output formatter. Provides a default implementation\n * that can be overridden for custom formatting or testing.\n *\n * **Example** (Accessing the output formatter)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliOutput } from \"effect/unstable/cli\"\n *\n * // Access the formatter service\n * const program = Effect.gen(function*() {\n * const formatter = yield* CliOutput.Formatter\n *\n * // Format version information\n * const versionText = formatter.formatVersion(\"my-cli\", \"2.1.0\")\n * console.log(versionText) // \"my-cli v2.1.0\" (with colors if supported)\n *\n * return versionText\n * })\n *\n * // Run with default formatter\n * const result = Effect.runSync(program)\n * ```\n *\n * @category services\n * @since 4.0.0\n */\nexport const Formatter = /*#__PURE__*/Context.Reference(\"effect/cli/CliOutput\", {\n defaultValue: () => defaultFormatter()\n});\n/**\n * Creates a Layer that provides a custom Formatter implementation.\n *\n * **Example** (Providing a custom formatter)\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n * import { CliOutput } from \"effect/unstable/cli\"\n *\n * // Create a custom formatter without colors\n * const noColorFormatter = CliOutput.defaultFormatter({ colors: false })\n * const NoColorLayer = CliOutput.layer(noColorFormatter)\n *\n * // Create a program that uses the custom formatter\n * const program = Effect.gen(function*() {\n * const formatter = yield* CliOutput.Formatter\n * const versionText = formatter.formatVersion(\"my-cli\", \"1.0.0\")\n * yield* Console.log(`Using custom formatter: ${versionText}`)\n * }).pipe(\n * Effect.provide(NoColorLayer)\n * )\n *\n * // You can also create completely custom formatters\n * const jsonFormatter: CliOutput.Formatter = {\n * formatHelpDoc: (doc) => JSON.stringify(doc, null, 2),\n * formatCliError: (error) => JSON.stringify({ error: error.message }),\n * formatError: (error) =>\n * JSON.stringify({ type: \"error\", message: error.message }),\n * formatVersion: (name, version) => JSON.stringify({ name, version }),\n * formatErrors: (errors) => JSON.stringify(errors.map((error) => error.message))\n * }\n * const JsonLayer = CliOutput.layer(jsonFormatter)\n * ```\n *\n * @category layers\n * @since 4.0.0\n */\nexport const layer = formatter => Layer.succeed(Formatter)(formatter);\n/**\n * Creates a default formatter with configurable options.\n *\n * **Example** (Creating default formatters)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import { CliError, CliOutput } from \"effect/unstable/cli\"\n *\n * // Create a formatter without colors for tests or CI environments\n * const noColorFormatter = CliOutput.defaultFormatter({ colors: false })\n *\n * // Create a formatter with colors forced on\n * const colorFormatter = CliOutput.defaultFormatter({ colors: true })\n *\n * // Auto-detect colors based on terminal support (default behavior)\n * const autoFormatter = CliOutput.defaultFormatter()\n *\n * const program = Effect.gen(function*() {\n * const formatter = colorFormatter\n *\n * // Format an error with proper styling\n * const error = new CliError.InvalidValue({\n * option: \"foo\",\n * value: \"bar\",\n * expected: \"baz\",\n * kind: \"flag\"\n * })\n * const errorText = formatter.formatError(error)\n * console.log(errorText)\n *\n * // Format version information\n * const versionText = formatter.formatVersion(\"my-tool\", \"1.2.3\")\n * console.log(versionText)\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const defaultFormatter = options => {\n const globalProcess = globalThis.process;\n const hasProcess = typeof globalProcess === \"object\" && globalProcess !== null;\n const useColor = options?.colors !== undefined ? options.colors\n // Auto-detect based on environment\n : hasProcess && typeof globalProcess.stdout === \"object\" && globalProcess.stdout !== null && globalProcess.stdout.isTTY === true && globalProcess.env?.NO_COLOR !== \"1\";\n // Color palette using ANSI escape codes\n const colors = useColor ? {\n bold: text => `\\x1b[1m${text}\\x1b[0m`,\n dim: text => `\\x1b[2m${text}\\x1b[0m`,\n cyan: text => `\\x1b[36m${text}\\x1b[0m`,\n green: text => `\\x1b[32m${text}\\x1b[0m`,\n blue: text => `\\x1b[34m${text}\\x1b[0m`,\n yellow: text => `\\x1b[33m${text}\\x1b[0m`,\n magenta: text => `\\x1b[35m${text}\\x1b[0m`\n } : {\n bold: text => text,\n dim: text => text,\n cyan: text => text,\n green: text => text,\n blue: text => text,\n yellow: text => text,\n magenta: text => text\n };\n const reset = useColor ? \"\\x1b[0m\" : \"\";\n const red = useColor ? \"\\x1b[31m\" : \"\";\n const bold = useColor ? \"\\x1b[1m\" : \"\";\n return {\n formatHelpDoc: doc => formatHelpDocImpl(doc, colors),\n formatCliError: error => error.message,\n formatError: error => {\n return `\\n${bold}${red}ERROR${reset}\\n ${error.message}${reset}`;\n },\n formatErrors: errors => {\n if (errors.length === 0) return \"\";\n if (errors.length === 1) {\n return `\\n${bold}${red}ERROR${reset}\\n ${errors[0].message}${reset}`;\n }\n // Group errors by _tag\n const grouped = new Map();\n for (const error of errors) {\n const tag = error._tag ?? \"Error\";\n const group = grouped.get(tag) ?? [];\n group.push(error);\n grouped.set(tag, group);\n }\n const sections = [];\n sections.push(`\\n${bold}${red}ERRORS${reset}`);\n for (const [, group] of grouped) {\n for (const error of group) {\n sections.push(` ${error.message}${reset}`);\n }\n }\n return sections.join(\"\\n\");\n },\n formatVersion: (name, version) => `${colors.bold(name)} ${colors.dim(\"v\")}${colors.bold(version)}`\n };\n};\n/**\n * Strips ANSI escape codes from a string to calculate visual width.\n * @internal\n */\nconst stripAnsi = text => {\n // oxlint-disable-next-line no-control-regex\n return text.replace(/\\u001B\\[[0-9;]*m/g, \"\");\n};\n/**\n * Gets the visual length of a string (excluding ANSI codes).\n * @internal\n */\nconst visualLength = text => stripAnsi(text).length;\n/**\n * Helper function to pad strings to a specified width.\n * @internal\n */\nconst pad = (s, width) => {\n const actualLength = visualLength(s);\n const padding = Math.max(0, width - actualLength);\n return s + \" \".repeat(padding);\n};\n/**\n * Renders a table with aligned columns.\n * @internal\n */\nconst renderTable = (rows, widthCap) => {\n const maxColumn = Math.max(...rows.map(r => visualLength(r.left))) + 4;\n const col = widthCap === undefined ? maxColumn : Math.min(maxColumn, widthCap);\n return rows.map(({\n left,\n right\n }) => ` ${pad(left, col)}${right}`).join(\"\\n\");\n};\nconst formatSubcommandName = (name, alias) => alias ? `${name}, ${alias}` : name;\n/**\n * Internal implementation of help formatting that accepts configurable color functions.\n * @internal\n */\nconst formatHelpDocImpl = (doc, colors) => {\n const sections = [];\n // Description section\n if (doc.description) {\n sections.push(colors.bold(\"DESCRIPTION\"));\n sections.push(` ${doc.description}`);\n sections.push(\"\");\n }\n // Usage section\n sections.push(colors.bold(\"USAGE\"));\n sections.push(` ${colors.cyan(doc.usage)}`);\n sections.push(\"\");\n // Arguments section\n if (doc.args && doc.args.length > 0) {\n sections.push(colors.bold(\"ARGUMENTS\"));\n const argRows = doc.args.map(arg => {\n let name = arg.name;\n if (arg.variadic) {\n name += \"...\";\n }\n const coloredName = colors.green(name);\n const coloredType = colors.dim(arg.type);\n const nameType = `${coloredName} ${coloredType}`;\n const optionalSuffix = arg.required ? \"\" : colors.dim(\" (optional)\");\n const description = Option.getOrElse(arg.description, () => \"\") + optionalSuffix;\n return {\n left: nameType,\n right: description\n };\n });\n sections.push(renderTable(argRows, 25));\n sections.push(\"\");\n }\n // Flags section\n if (doc.flags.length > 0) {\n sections.push(colors.bold(\"FLAGS\"));\n const flagRows = doc.flags.map(flag => {\n const names = [];\n // Add main name with -- prefix first\n names.push(colors.green(`--${flag.name}`));\n // Add aliases after (like -f) to match expected ordering\n for (const alias of flag.aliases) {\n names.push(colors.green(alias));\n }\n const namesPart = names.join(\", \");\n const typePart = flag.type !== \"boolean\" ? ` ${colors.dim(flag.type)}` : \"\";\n return {\n left: namesPart + typePart,\n right: Option.getOrElse(flag.description, () => \"\")\n };\n });\n sections.push(renderTable(flagRows));\n sections.push(\"\");\n }\n // Global Flags section\n if (doc.globalFlags && doc.globalFlags.length > 0) {\n sections.push(colors.bold(\"GLOBAL FLAGS\"));\n const globalFlagRows = doc.globalFlags.map(flag => {\n const names = [];\n // Add main name with -- prefix first\n names.push(colors.green(`--${flag.name}`));\n // Add aliases after (like -f) to match expected ordering\n for (const alias of flag.aliases) {\n names.push(colors.green(alias));\n }\n const namesPart = names.join(\", \");\n const typePart = flag.type !== \"boolean\" ? ` ${colors.dim(flag.type)}` : \"\";\n return {\n left: namesPart + typePart,\n right: Option.getOrElse(flag.description, () => \"\")\n };\n });\n sections.push(renderTable(globalFlagRows));\n sections.push(\"\");\n }\n // Subcommands section\n if (doc.subcommands && doc.subcommands.length > 0) {\n const ungrouped = doc.subcommands.find(group => group.group === undefined);\n if (ungrouped) {\n sections.push(colors.bold(\"SUBCOMMANDS\"));\n sections.push(renderTable(ungrouped.commands.map(sub => ({\n left: colors.cyan(formatSubcommandName(sub.name, sub.alias)),\n right: sub.shortDescription ?? sub.description\n })), 20));\n if (doc.subcommands.length > 1) {\n sections.push(\"\");\n }\n }\n for (const group of doc.subcommands) {\n if (group.group === undefined) continue;\n sections.push(colors.bold(`${group.group}:`));\n sections.push(renderTable(group.commands.map(sub => ({\n left: colors.cyan(formatSubcommandName(sub.name, sub.alias)),\n right: sub.shortDescription ?? sub.description\n })), 20));\n sections.push(\"\");\n }\n }\n // Examples section\n if (doc.examples && doc.examples.length > 0) {\n sections.push(colors.bold(\"EXAMPLES\"));\n let first = true;\n let previousHadDescription = false;\n for (const example of doc.examples) {\n if (example.description) {\n if (!first) sections.push(\"\");\n sections.push(` ${colors.dim(`# ${example.description}`)}`);\n } else if (previousHadDescription) {\n sections.push(\"\");\n }\n sections.push(` ${colors.cyan(example.command)}`);\n first = false;\n previousHadDescription = !!example.description;\n }\n sections.push(\"\");\n }\n // Remove trailing empty line if present\n if (sections[sections.length - 1] === \"\") {\n sections.pop();\n }\n return sections.join(\"\\n\");\n};\n//# sourceMappingURL=CliOutput.js.map","// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\nconst escapeForBash = s => s.replace(/'/g, \"'\\\\''\");\nconst sanitizeFunctionName = s => s.replace(/[^a-zA-Z0-9_]/g, \"_\");\nconst flagNamesForWordlist = flag => {\n const names = [`--${flag.name}`];\n for (const alias of flag.aliases) {\n names.push(alias.length === 1 ? `-${alias}` : `--${alias}`);\n }\n if (flag.type._tag === \"Boolean\") {\n names.push(`--no-${flag.name}`);\n }\n return names;\n};\n/**\n * Build an associative array mapping each flag form to a group index.\n * At completion time, if any form in a group appears in COMP_WORDS,\n * all forms in that group are removed from the candidate list.\n */\nconst buildFlagGroupDeclarations = (flags, lines) => {\n if (flags.length === 0) return;\n lines.push(` # Build used-flag filter`);\n lines.push(` local -A _flag_groups`);\n let groupIdx = 0;\n for (const flag of flags) {\n const forms = flagNamesForWordlist(flag);\n for (const form of forms) {\n lines.push(` _flag_groups[${form}]=${groupIdx}`);\n }\n groupIdx++;\n }\n lines.push(` local -A _used_groups`);\n lines.push(` for ((i = 1; i < cword; i++)); do`);\n lines.push(` local _g=\"\\${_flag_groups[\\${words[i]}]:-}\"`);\n lines.push(` [[ -n \"$_g\" ]] && _used_groups[$_g]=1`);\n lines.push(` done`);\n lines.push(` local _filtered_flags=\"\"`);\n lines.push(` for _f in ${flags.flatMap(flagNamesForWordlist).join(\" \")}; do`);\n lines.push(` local _g=\"\\${_flag_groups[$_f]:-}\"`);\n lines.push(` [[ -z \"$_g\" || -z \"\\${_used_groups[$_g]:-}\" ]] && _filtered_flags+=\" $_f\"`);\n lines.push(` done`);\n lines.push(``);\n};\nconst flagValueCompletion = type => {\n switch (type._tag) {\n case \"Boolean\":\n return undefined;\n case \"Choice\":\n return `COMPREPLY=( $(compgen -W '${type.values.join(\" \")}' -- \"$cur\") )`;\n case \"Path\":\n if (type.pathType === \"directory\") return `COMPREPLY=( $(compgen -d -- \"$cur\") )`;\n return `COMPREPLY=( $(compgen -f -- \"$cur\") )`;\n default:\n return undefined;\n }\n};\nconst argCompletion = type => {\n switch (type._tag) {\n case \"Choice\":\n return `COMPREPLY=( $(compgen -W '${type.values.join(\" \")}' -- \"$cur\") )`;\n case \"Path\":\n if (type.pathType === \"directory\") return `COMPREPLY=( $(compgen -d -- \"$cur\") )`;\n return `COMPREPLY=( $(compgen -f -- \"$cur\") )`;\n default:\n return undefined;\n }\n};\n// ---------------------------------------------------------------------------\n// Generator\n// ---------------------------------------------------------------------------\nconst generateFunction = (descriptor, parentPath, lines) => {\n const currentPath = [...parentPath, descriptor.name];\n const funcName = `_${currentPath.map(sanitizeFunctionName).join(\"_\")}`;\n lines.push(`${funcName}()`);\n lines.push(`{`);\n lines.push(` local cur prev words cword`);\n lines.push(` _init_completion || return`);\n lines.push(``);\n // Build flag-value dispatch\n const flagsWithValues = descriptor.flags.filter(f => f.type._tag !== \"Boolean\");\n if (flagsWithValues.length > 0) {\n lines.push(` # Flag value completions`);\n lines.push(` case \"$prev\" in`);\n for (const flag of flagsWithValues) {\n const longNames = [`--${flag.name}`];\n for (const alias of flag.aliases) {\n longNames.push(alias.length === 1 ? `-${alias}` : `--${alias}`);\n }\n const completion = flagValueCompletion(flag.type);\n if (completion) {\n lines.push(` ${longNames.join(\"|\")})`);\n lines.push(` ${completion}`);\n lines.push(` return`);\n lines.push(` ;;`);\n }\n }\n lines.push(` esac`);\n lines.push(``);\n }\n // Subcommand dispatch\n if (descriptor.subcommands.length > 0) {\n lines.push(` # Subcommand dispatch`);\n lines.push(` local i cmd`);\n lines.push(` for ((i = 1; i < cword; i++)); do`);\n lines.push(` case \"\\${words[i]}\" in`);\n for (const sub of descriptor.subcommands) {\n const subFuncName = `_${[...currentPath, sub.name].map(sanitizeFunctionName).join(\"_\")}`;\n lines.push(` ${sub.name})`);\n lines.push(` ${subFuncName}`);\n lines.push(` return`);\n lines.push(` ;;`);\n }\n lines.push(` esac`);\n lines.push(` done`);\n lines.push(``);\n }\n // Filter already-used flags (entire alias group removed when any form is used)\n buildFlagGroupDeclarations(descriptor.flags, lines);\n if (descriptor.flags.length > 0 || descriptor.subcommands.length > 0) {\n lines.push(` # Complete flags (filtered) and subcommands`);\n lines.push(` if [[ \"$cur\" == -* ]]; then`);\n if (descriptor.flags.length > 0) {\n lines.push(` COMPREPLY=( $(compgen -W \"$_filtered_flags\" -- \"$cur\") )`);\n }\n lines.push(` return`);\n lines.push(` fi`);\n lines.push(``);\n }\n // Positional argument completion\n const argsWithCompletions = descriptor.arguments.filter(a => argCompletion(a.type) !== undefined);\n if (argsWithCompletions.length > 0) {\n lines.push(` # Positional argument completions`);\n for (const arg of argsWithCompletions) {\n const comp = argCompletion(arg.type);\n lines.push(` ${comp}`);\n lines.push(` return`);\n }\n } else if (descriptor.subcommands.length > 0) {\n const subNames = descriptor.subcommands.map(s => s.name);\n lines.push(` COMPREPLY=( $(compgen -W '${subNames.join(\" \")}' -- \"$cur\") )`);\n }\n lines.push(`}`);\n lines.push(``);\n // Recurse into subcommands\n for (const sub of descriptor.subcommands) {\n generateFunction(sub, currentPath, lines);\n }\n};\n/** @internal */\nexport const generate = (executableName, descriptor) => {\n const lines = [];\n const safeName = sanitizeFunctionName(executableName);\n lines.push(`###-begin-${escapeForBash(executableName)}-completions-###`);\n lines.push(`#`);\n lines.push(`# Static completion script for Bash`);\n lines.push(`#`);\n lines.push(`# Installation:`);\n lines.push(`# ${escapeForBash(executableName)} --completions bash >> ~/.bashrc`);\n lines.push(`#`);\n lines.push(``);\n // Inline minimal _init_completion fallback for environments without\n // bash-completion installed. The real _init_completion handles edge cases\n // (= in options, redirections, etc.) but this covers the common path.\n lines.push(`if ! type _init_completion &>/dev/null; then`);\n lines.push(` _init_completion()`);\n lines.push(` {`);\n lines.push(` COMPREPLY=()`);\n lines.push(` cur=\"\\${COMP_WORDS[COMP_CWORD]}\"`);\n lines.push(` prev=\"\\${COMP_WORDS[COMP_CWORD-1]}\"`);\n lines.push(` words=(\"\\${COMP_WORDS[@]}\")`);\n lines.push(` cword=$COMP_CWORD`);\n lines.push(` }`);\n lines.push(`fi`);\n lines.push(``);\n generateFunction(descriptor, [], lines);\n lines.push(`complete -F _${safeName} ${escapeForBash(executableName)}`);\n lines.push(`###-end-${escapeForBash(executableName)}-completions-###`);\n return lines.join(\"\\n\");\n};\n//# sourceMappingURL=bash.js.map","// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\nconst escapeFishString = s => s.replace(/'/g, \"\\\\'\");\n/**\n * Build a Fish condition that checks the current subcommand context.\n *\n * For root-level completions with subcommands: `__fish_use_subcommand`\n * For nested commands: verify the parent subcommand is active AND none of its\n * child subcommands have been entered yet.\n */\nconst subcommandCondition = (parentPath, childSubcommandNames) => {\n if (parentPath.length === 0) {\n if (childSubcommandNames.length > 0) {\n return `__fish_use_subcommand`;\n }\n return ``;\n }\n const parent = parentPath[parentPath.length - 1];\n if (childSubcommandNames.length > 0) {\n // Show only when parent is active but no child subcommand has been entered\n return `__fish_seen_subcommand_from ${parent}; and not __fish_seen_subcommand_from ${childSubcommandNames.join(\" \")}`;\n }\n return `__fish_seen_subcommand_from ${parent}`;\n};\n/**\n * Build a __fish_contains_opt condition that checks whether any form of this\n * flag has already been typed. Returns the condition string without wrapping\n * quotes (the caller adds those).\n */\nconst flagContainsOptCondition = flag => {\n const optArgs = [];\n for (const alias of flag.aliases) {\n if (alias.length === 1) {\n optArgs.push(`-s ${alias}`);\n }\n }\n // Long names (fish __fish_contains_opt uses bare words for long opts)\n optArgs.push(flag.name);\n for (const alias of flag.aliases) {\n if (alias.length > 1) {\n optArgs.push(alias);\n }\n }\n if (flag.type._tag === \"Boolean\") {\n optArgs.push(`no-${flag.name}`);\n }\n return `not __fish_contains_opt ${optArgs.join(\" \")}`;\n};\nconst flagCompletionArgs = flag => {\n const args = [`-l ${flag.name}`];\n for (const alias of flag.aliases) {\n if (alias.length === 1) {\n args.push(`-s ${alias}`);\n } else {\n args.push(`-l ${alias}`);\n }\n }\n if (flag.description) {\n args.push(`-d '${escapeFishString(flag.description)}'`);\n }\n const valueArgs = flagValueArgs(flag.type);\n if (valueArgs) {\n args.push(valueArgs);\n }\n return args;\n};\nconst flagValueArgs = type => {\n switch (type._tag) {\n case \"Boolean\":\n return undefined;\n case \"Choice\":\n return `-r -f -a '${type.values.join(\" \")}'`;\n case \"Path\":\n if (type.pathType === \"directory\") return `-r -F`;\n return `-r -F`;\n default:\n // -r: requires a value, -f: don't fall back to file completion\n return `-r -f`;\n }\n};\nconst argValueArgs = type => {\n switch (type._tag) {\n case \"Choice\":\n return `-r -f -a '${type.values.join(\" \")}'`;\n case \"Path\":\n return `-r -F`;\n default:\n return undefined;\n }\n};\n// ---------------------------------------------------------------------------\n// Generator\n// ---------------------------------------------------------------------------\nconst generateCompletions = (executableName, descriptor, parentPath, lines) => {\n const allSubNames = descriptor.subcommands.map(s => s.name);\n const condition = subcommandCondition(parentPath, allSubNames);\n const conditionArg = condition ? `-n '${condition}'` : ``;\n // Suppress default file completion unless the command has path-type\n // positional arguments. Without this, fish falls back to listing files\n // even when only flags are valid.\n const hasPathArgs = descriptor.arguments.some(a => a.type._tag === \"Path\");\n if (!hasPathArgs) {\n const parts = [`complete -c ${executableName}`];\n if (conditionArg) parts.push(conditionArg);\n parts.push(`-f`);\n lines.push(parts.join(\" \"));\n }\n // Subcommand completions\n for (const sub of descriptor.subcommands) {\n const parts = [`complete -c ${executableName}`];\n if (conditionArg) parts.push(conditionArg);\n parts.push(`-f -a '${escapeFishString(sub.name)}'`);\n if (sub.description) {\n parts.push(`-d '${escapeFishString(sub.description)}'`);\n }\n lines.push(parts.join(\" \"));\n }\n // Flag completions\n for (const flag of descriptor.flags) {\n // Only apply __fish_contains_opt dedup for boolean flags. For value-taking\n // flags, the dedup condition would suppress the entry while fish is waiting\n // for a value (e.g. typing `--env <TAB>` wouldn't show choices).\n const isBoolean = flag.type._tag === \"Boolean\";\n const flagCondition = isBoolean ? condition ? `${condition}; and ${flagContainsOptCondition(flag)}` : flagContainsOptCondition(flag) : condition;\n const flagCondArg = flagCondition ? `-n '${flagCondition}'` : ``;\n const parts = [`complete -c ${executableName}`];\n if (flagCondArg) parts.push(flagCondArg);\n parts.push(...flagCompletionArgs(flag));\n lines.push(parts.join(\" \"));\n // Boolean negation\n if (isBoolean) {\n const negParts = [`complete -c ${executableName}`];\n if (flagCondArg) negParts.push(flagCondArg);\n negParts.push(`-l no-${flag.name}`);\n if (flag.description) {\n negParts.push(`-d '${escapeFishString(`Disable ${flag.name}`)}'`);\n }\n lines.push(negParts.join(\" \"));\n }\n }\n // Flags as -a entries for bare <TAB> visibility.\n // Fish only shows -l/-s entries when the current word starts with -, so\n // without this, flags are invisible on bare <TAB>. Guarded to only show\n // when NOT already typing an option (avoids duplication with -l/-s above)\n // and hidden once a flag has been used (__fish_contains_opt).\n if (descriptor.flags.length > 0) {\n const notDash = `not string match -q -- \"-*\" (commandline -ct)`;\n const bareBase = condition ? `${condition}; and ${notDash}` : notDash;\n for (const flag of descriptor.flags) {\n const bareCondition = `${bareBase}; and ${flagContainsOptCondition(flag)}`;\n const isBoolean = flag.type._tag === \"Boolean\";\n const parts = [`complete -c ${executableName}`];\n parts.push(`-n '${bareCondition}'`);\n parts.push(`-f -a '--${flag.name}'`);\n if (flag.description) {\n parts.push(`-d '${escapeFishString(flag.description)}'`);\n }\n lines.push(parts.join(\" \"));\n if (isBoolean) {\n const negParts = [`complete -c ${executableName}`];\n negParts.push(`-n '${bareCondition}'`);\n negParts.push(`-f -a '--no-${flag.name}'`);\n if (flag.description) {\n negParts.push(`-d '${escapeFishString(`Disable ${flag.name}`)}'`);\n }\n lines.push(negParts.join(\" \"));\n }\n }\n }\n // Argument completions (type hints only)\n for (const arg of descriptor.arguments) {\n const valueArg = argValueArgs(arg.type);\n if (valueArg) {\n const parts = [`complete -c ${executableName}`];\n if (conditionArg) parts.push(conditionArg);\n parts.push(valueArg);\n if (arg.description) {\n parts.push(`-d '${escapeFishString(arg.description)}'`);\n }\n lines.push(parts.join(\" \"));\n }\n }\n // Recurse into subcommands\n for (const sub of descriptor.subcommands) {\n generateCompletions(executableName, sub, [...parentPath, sub.name], lines);\n }\n};\n/** @internal */\nexport const generate = (executableName, descriptor) => {\n const lines = [];\n lines.push(`###-begin-${executableName}-completions-###`);\n lines.push(`#`);\n lines.push(`# Static completion script for Fish`);\n lines.push(`#`);\n lines.push(`# Installation:`);\n lines.push(`# ${executableName} --completions fish > ~/.config/fish/completions/${executableName}.fish`);\n lines.push(`#`);\n lines.push(``);\n generateCompletions(executableName, descriptor, [], lines);\n lines.push(``);\n lines.push(`###-end-${executableName}-completions-###`);\n return lines.join(\"\\n\");\n};\n//# sourceMappingURL=fish.js.map","// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\nconst escapeZsh = s => s.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"'\\\\''\").replace(/:/g, \"\\\\:\");\nconst sanitize = s => s.replace(/[^a-zA-Z0-9_]/g, \"_\");\n/**\n * All forms of a flag (--name, -alias, --no-name) for the exclusion group.\n */\nconst allForms = flag => {\n const forms = [`--${flag.name}`];\n for (const alias of flag.aliases) {\n forms.push(alias.length === 1 ? `-${alias}` : `--${alias}`);\n }\n if (flag.type._tag === \"Boolean\") {\n forms.push(`--no-${flag.name}`);\n }\n return forms;\n};\nconst valueAction = type => {\n switch (type._tag) {\n case \"Boolean\":\n return \"\";\n case \"Choice\":\n return `:value:(${type.values.join(\" \")})`;\n case \"Path\":\n return type.pathType === \"directory\" ? `:directory:_directories` : `:file:_files`;\n case \"Integer\":\n return `:integer:`;\n case \"Float\":\n return `:float:`;\n case \"Date\":\n return `:date:`;\n default:\n return `:value:`;\n }\n};\nconst argAction = type => {\n switch (type._tag) {\n case \"Choice\":\n return `(${type.values.join(\" \")})`;\n case \"Path\":\n return type.pathType === \"directory\" ? `_directories` : `_files`;\n default:\n return ``;\n }\n};\n/**\n * Produce _arguments optspecs for a single flag. Each spec is a complete,\n * single-quoted string — no brace expansion, no line continuations.\n */\nconst flagSpecs = flag => {\n const specs = [];\n const desc = flag.description ? `[${escapeZsh(flag.description)}]` : \"\";\n const action = valueAction(flag.type);\n const excl = `(${allForms(flag).join(\" \")})`;\n // Primary long name\n specs.push(`'${excl}--${flag.name}${desc}${action}'`);\n // Aliases\n for (const alias of flag.aliases) {\n const prefix = alias.length === 1 ? \"-\" : \"--\";\n specs.push(`'${excl}${prefix}${alias}${desc}${action}'`);\n }\n // Boolean negation\n if (flag.type._tag === \"Boolean\") {\n const negDesc = flag.description ? `[${escapeZsh(`Disable ${flag.name}`)}]` : \"\";\n specs.push(`'${excl}--no-${flag.name}${negDesc}'`);\n }\n return specs;\n};\nconst argSpec = arg => {\n const desc = arg.description ? escapeZsh(arg.description) : arg.name;\n const action = argAction(arg.type);\n const prefix = arg.variadic ? \"*\" : \"\";\n return `'${prefix}:${desc}:${action}'`;\n};\n// ---------------------------------------------------------------------------\n// Generator\n// ---------------------------------------------------------------------------\nconst generateFunction = (descriptor, parentPath, lines) => {\n const currentPath = [...parentPath, descriptor.name];\n const funcName = `_${currentPath.map(sanitize).join(\"_\")}`;\n lines.push(`${funcName}() {`);\n if (descriptor.subcommands.length > 0) {\n // _arguments -C requires these locals for the state machine\n lines.push(` local context state state_descr line`);\n lines.push(` typeset -A opt_args`);\n lines.push(``);\n // Subcommand list\n lines.push(` local -a commands`);\n lines.push(` commands=(`);\n for (const sub of descriptor.subcommands) {\n const desc = sub.description ? escapeZsh(sub.description) : \"\";\n lines.push(` '${sub.name}:${desc}'`);\n }\n lines.push(` )`);\n lines.push(``);\n // Build specs array to avoid brace expansion / line continuation issues\n lines.push(` local -a specs`);\n lines.push(` specs=(`);\n for (const flag of descriptor.flags) {\n for (const spec of flagSpecs(flag)) {\n lines.push(` ${spec}`);\n }\n }\n for (const arg of descriptor.arguments) {\n lines.push(` ${argSpec(arg)}`);\n }\n lines.push(` '1:command:->command'`);\n lines.push(` '*::arg:->args'`);\n lines.push(` )`);\n lines.push(``);\n lines.push(` _arguments -C \"\\${specs[@]}\"`);\n lines.push(``);\n // State dispatch\n lines.push(` case \"$state\" in`);\n lines.push(` command)`);\n lines.push(` _describe -t commands 'commands' commands`);\n lines.push(` ;;`);\n lines.push(` args)`);\n lines.push(` case \"$words[1]\" in`);\n for (const sub of descriptor.subcommands) {\n const subFunc = `_${[...currentPath, sub.name].map(sanitize).join(\"_\")}`;\n lines.push(` ${sub.name})`);\n lines.push(` ${subFunc}`);\n lines.push(` ;;`);\n }\n lines.push(` esac`);\n lines.push(` ;;`);\n lines.push(` esac`);\n } else {\n // Leaf command — no subcommands\n const allSpecs = [];\n for (const flag of descriptor.flags) {\n allSpecs.push(...flagSpecs(flag));\n }\n for (const arg of descriptor.arguments) {\n allSpecs.push(argSpec(arg));\n }\n if (allSpecs.length > 0) {\n lines.push(` local -a specs`);\n lines.push(` specs=(`);\n for (const spec of allSpecs) {\n lines.push(` ${spec}`);\n }\n lines.push(` )`);\n lines.push(` _arguments \"\\${specs[@]}\"`);\n }\n }\n lines.push(`}`);\n lines.push(``);\n for (const sub of descriptor.subcommands) {\n generateFunction(sub, currentPath, lines);\n }\n};\n/** @internal */\nexport const generate = (executableName, descriptor) => {\n const lines = [];\n const safeName = sanitize(executableName);\n lines.push(`#compdef ${executableName}`);\n lines.push(`###-begin-${executableName}-completions-###`);\n lines.push(`#`);\n lines.push(`# Static completion script for Zsh`);\n lines.push(`#`);\n lines.push(`# Installation:`);\n lines.push(`# ${executableName} --completions zsh > ~/.zsh/completions/_${executableName}`);\n lines.push(`# then add ~/.zsh/completions to your fpath`);\n lines.push(`#`);\n lines.push(``);\n generateFunction(descriptor, [], lines);\n lines.push(`# Handle both direct invocation and autoload`);\n lines.push(`if [[ \"\\${zsh_eval_context[-1]}\" == \"loadautofunc\" ]]; then`);\n lines.push(` _${safeName} \"$@\"`);\n lines.push(`else`);\n lines.push(` compdef _${safeName} ${executableName}`);\n lines.push(`fi`);\n lines.push(`###-end-${executableName}-completions-###`);\n return lines.join(\"\\n\");\n};\n//# sourceMappingURL=zsh.js.map","/**\n * The `Completions` module turns a plain description of an Effect CLI command\n * tree into shell completion scripts for Bash, Zsh, and Fish. It is the\n * low-level script generation surface used by the unstable CLI package and by\n * the built-in completions global flag.\n *\n * @since 4.0.0\n */\nimport * as Bash from \"./internal/completions/bash.js\";\nimport * as Fish from \"./internal/completions/fish.js\";\nimport * as Zsh from \"./internal/completions/zsh.js\";\n/**\n * Generates a shell completion script for a command descriptor.\n *\n * **When to use**\n *\n * Use when you need an installable completion script from an existing\n * `CommandDescriptor`.\n *\n * **Details**\n *\n * Dispatches by `shell` to Bash, Zsh, or Fish generation and returns a static\n * script string for `executableName`.\n *\n * @see {@link Shell} for supported shell names\n * @see {@link CommandDescriptor} for the command shape used by completion generation\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const generate = (executableName, shell, descriptor) => {\n switch (shell) {\n case \"bash\":\n return Bash.generate(executableName, descriptor);\n case \"zsh\":\n return Zsh.generate(executableName, descriptor);\n case \"fish\":\n return Fish.generate(executableName, descriptor);\n }\n};\n//# sourceMappingURL=Completions.js.map","import { dual } from \"../../Function.js\";\nimport * as Param from \"./Param.js\";\n// -------------------------------------------------------------------------------------\n// constructors\n// -------------------------------------------------------------------------------------\n/**\n * Creates a string flag that accepts text input.\n *\n * **Example** (Creating string flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const nameFlag = Flag.string(\"name\")\n * // Usage: --name \"John Doe\"\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const string = name => Param.string(Param.flagKind, name);\n/**\n * Creates a boolean flag that can be enabled or disabled.\n *\n * **Example** (Creating boolean flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const verboseFlag = Flag.boolean(\"verbose\")\n * // Usage: --verbose (true) or --no-verbose (false)\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const boolean = name => Param.boolean(Param.flagKind, name);\n/**\n * Creates an integer flag that accepts whole number input.\n *\n * **Example** (Creating integer flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const portFlag = Flag.integer(\"port\")\n * // Usage: --port 8080\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const integer = name => Param.integer(Param.flagKind, name);\n/**\n * Creates a float flag that accepts decimal number input.\n *\n * **Example** (Creating float flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const rateFlag = Flag.float(\"rate\")\n * // Usage: --rate 3.14\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const float = name => Param.float(Param.flagKind, name);\n/**\n * Creates a date flag that accepts date input in ISO format.\n *\n * **Example** (Creating date flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const startDateFlag = Flag.date(\"start-date\")\n * // Usage: --start-date 2023-12-25\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const date = name => Param.date(Param.flagKind, name);\n/**\n * Constructs option parameters that represent a choice between several inputs.\n * Each tuple maps a string flag value to an associated typed value.\n *\n * **Example** (Creating flag choices with values)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // simple enum like choice mapping directly to string union\n * const color = Flag.choice(\"color\", [\"red\", \"green\", \"blue\"])\n *\n * // choice with custom value mapping\n * const logLevel = Flag.choiceWithValue(\"log-level\", [\n * [\"debug\", \"Debug\" as const],\n * [\"info\", \"Info\" as const],\n * [\"error\", \"Error\" as const]\n * ])\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const choiceWithValue = (name, choices) => Param.choiceWithValue(Param.flagKind, name, choices);\n/**\n * Creates a flag that accepts one of the provided string choices and returns\n * the selected string.\n *\n * **When to use**\n *\n * Use when you need to define a named CLI flag with fixed string choices and no\n * custom value mapping.\n *\n * **Gotchas**\n *\n * An empty choices array compiles, but no input value can parse successfully.\n *\n * @see {@link choiceWithValue} for mapping accepted strings to different typed values\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const choice = (name, choices) => Param.choice(Param.flagKind, name, choices);\n/**\n * Creates a path flag that accepts file system path input with validation options.\n *\n * **Example** (Creating path flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Basic path flag\n * const pathFlag = Flag.path(\"config-path\")\n *\n * // File-only path that must exist\n * const fileFlag = Flag.path(\"input-file\", {\n * pathType: \"file\",\n * mustExist: true\n * })\n *\n * // Directory path with custom type name\n * const dirFlag = Flag.path(\"output-dir\", {\n * pathType: \"directory\",\n * typeName: \"OUTPUT_DIRECTORY\"\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const path = (name, options) => Param.path(Param.flagKind, name, options);\n/**\n * Creates a file path flag that accepts file paths with optional existence validation.\n *\n * **Example** (Creating file flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Basic file flag\n * const inputFlag = Flag.file(\"input\")\n * // Usage: --input ./data.json\n *\n * // File that must exist\n * const configFlag = Flag.file(\"config\", { mustExist: true })\n * // Usage: --config ./config.yaml (file must exist)\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const file = (name, options) => Param.file(Param.flagKind, name, options);\n/**\n * Creates a directory path flag that accepts directory paths with optional existence validation.\n *\n * **Example** (Creating directory flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Basic directory flag\n * const outputFlag = Flag.directory(\"output\")\n * // Usage: --output ./build\n *\n * // Directory that must exist\n * const sourceFlag = Flag.directory(\"source\", { mustExist: true })\n * // Usage: --source ./src (directory must exist)\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const directory = (name, options) => Param.directory(Param.flagKind, name, options);\n/**\n * Creates a string flag whose parsed value is wrapped in `Redacted.Redacted` so\n * stringification and logging redact the value.\n *\n * **Gotchas**\n *\n * Values supplied on the command line may still be visible to the operating\n * system or shell history.\n *\n * **Example** (Creating redacted flags)\n *\n * ```ts\n * import { Effect, Redacted } from \"effect\"\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const passwordFlag = Flag.redacted(\"password\")\n *\n * const program = Effect.gen(function*() {\n * const [leftover, password] = yield* passwordFlag.parse({\n * arguments: [],\n * flags: { \"password\": [\"abc123\"] }\n * })\n * const value = Redacted.value(password) // Access the underlying value\n * console.log(\"Password length:\", value.length)\n * })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const redacted = name => Param.redacted(Param.flagKind, name);\n/**\n * Creates a flag that reads and returns file content as a string.\n *\n * **Example** (Reading file text)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const config = Flag.fileText(\"config-file\")\n * // --config-file ./app.json will read the file content\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileText = name => Param.fileText(Param.flagKind, name);\n/**\n * Creates a flag that reads and parses the content of the specified file.\n *\n * **Details**\n *\n * The parser that is utilized will depend on the specified `format`, or the\n * extension of the file passed on the command-line if no `format` is specified.\n *\n * **Example** (Parsing file contents)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Will use the extension of the file passed on the command line to determine\n * // the parser to use\n * const config = Flag.fileParse(\"config\")\n *\n * // Will use the JSON parser\n * const jsonConfig = Flag.fileParse(\"json-config\", { format: \"json\" })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileParse = (name, options) => Param.fileParse(Param.flagKind, name, options);\n/**\n * Creates a flag that reads and validates file content using the specified\n * schema.\n *\n * **Example** (Validating file contents)\n *\n * ```ts\n * import { Schema } from \"effect\"\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const ConfigSchema = Schema.Struct({\n * port: Schema.Number,\n * host: Schema.String\n * })\n *\n * const config = Flag.fileSchema(\"config\", ConfigSchema, { format: \"json\" })\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const fileSchema = (name, schema, options) => Param.fileSchema(Param.flagKind, name, schema, options);\n/**\n * Creates a flag that parses key=value pairs.\n *\n * **When to use**\n *\n * Use when you need a CLI flag that accepts one or more `key=value`\n * configuration entries.\n *\n * **Details**\n *\n * Requires at least one key=value pair. Multiple pairs are merged into a single\n * record.\n *\n * **Example** (Parsing key-value pairs)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const env = Flag.keyValuePair(\"env\")\n * // --env FOO=bar --env BAZ=qux will parse to { FOO: \"bar\", BAZ: \"qux\" }\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const keyValuePair = name => Param.keyValuePair(Param.flagKind, name);\n/**\n * Creates an empty sentinel flag that always fails to parse.\n * This is useful for creating placeholder flags or for combinators.\n *\n * **Example** (Creating sentinel flags)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const makeValueFlag = (includeValue: boolean) =>\n * includeValue ? Flag.string(\"value\") : Flag.none\n *\n * console.log(makeValueFlag(true) === Flag.none) // false\n * console.log(makeValueFlag(false) === Flag.none) // true\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const none = /*#__PURE__*/Param.none(Param.flagKind);\n// -------------------------------------------------------------------------------------\n// combinators\n// -------------------------------------------------------------------------------------\n/**\n * Adds an alias to a flag, allowing it to be referenced by multiple names.\n *\n * **Example** (Adding flag aliases)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Flag can be used as both --verbose and -v\n * const verboseFlag = Flag.boolean(\"verbose\").pipe(\n * Flag.withAlias(\"v\")\n * )\n *\n * // Multiple aliases can be chained\n * const helpFlag = Flag.boolean(\"help\").pipe(\n * Flag.withAlias(\"h\"),\n * Flag.withAlias(\"?\")\n * )\n * ```\n *\n * @category aliasing\n * @since 4.0.0\n */\nexport const withAlias = /*#__PURE__*/dual(2, (self, alias) => Param.withAlias(self, alias));\n/**\n * Adds a description to a flag for help documentation.\n *\n * **Example** (Adding help descriptions)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const portFlag = Flag.integer(\"port\").pipe(\n * Flag.withDescription(\"The port number to listen on\")\n * )\n *\n * const configFlag = Flag.file(\"config\").pipe(\n * Flag.withDescription(\"Path to the configuration file\")\n * )\n * ```\n *\n * @category help documentation\n * @since 4.0.0\n */\nexport const withDescription = /*#__PURE__*/dual(2, (self, description) => Param.withDescription(self, description));\n// -------------------------------------------------------------------------------------\n// metadata\n// -------------------------------------------------------------------------------------\n/**\n * Sets a custom metavar (placeholder name) for the flag in help documentation.\n *\n * **Details**\n *\n * The metavar is displayed in usage text to indicate what value the user should\n * provide. For example, `--output FILE` shows `FILE` as the metavar.\n *\n * **Example** (Setting metavars)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const databaseFlag = Flag.string(\"database-url\").pipe(\n * Flag.withMetavar(\"URL\"),\n * Flag.withDescription(\"Database connection URL\")\n * )\n * // In help: --database-url URL\n *\n * const timeoutFlag = Flag.integer(\"timeout\").pipe(\n * Flag.withMetavar(\"SECONDS\")\n * )\n * // In help: --timeout SECONDS\n * ```\n *\n * @category metadata\n * @since 4.0.0\n */\nexport const withMetavar = /*#__PURE__*/dual(2, (self, metavar) => Param.withMetavar(self, metavar));\n/**\n * Hides a flag from generated help output and shell completions while keeping\n * it fully parseable on the command line.\n *\n * **When to use**\n *\n * Use when experimental or internal flags should be accepted but not advertised, such as\n * `--experimental-foo`, debug toggles, or escape hatches that are not yet committed to the\n * public CLI surface.\n *\n * **Example** (Hiding a flag from help)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Flag still parses --experimental-foo, but it does not appear in --help.\n * const experimental = Flag.boolean(\"experimental-foo\").pipe(\n * Flag.withHidden\n * )\n * ```\n *\n * @category metadata\n * @since 4.0.0\n */\nexport const withHidden = self => Param.withHidden(self);\n/**\n * Makes a flag optional, returning an Option type that can be None if not provided.\n *\n * **Example** (Making flags optional)\n *\n * ```ts\n * import { Effect, Option } from \"effect\"\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const optionalPort = Flag.optional(Flag.integer(\"port\"))\n *\n * const program = Effect.gen(function*() {\n * const [leftover, port] = yield* optionalPort.parse({\n * arguments: [],\n * flags: { \"port\": [\"4000\"] }\n * })\n * if (Option.isSome(port)) {\n * console.log(\"Port specified:\", port.value)\n * } else {\n * console.log(\"No port specified, using default\")\n * }\n * })\n * ```\n *\n * @category optionality\n * @since 4.0.0\n */\nexport const optional = param => Param.optional(param);\n/**\n * Provides a default value for a flag when it's not specified.\n *\n * **Example** (Providing default values)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const portFlag = Flag.integer(\"port\").pipe(\n * Flag.withDefault(8080)\n * )\n * // If --port is not provided, defaults to 8080\n *\n * const hostFlag = Flag.string(\"host\").pipe(\n * Flag.withDefault(\"localhost\")\n * )\n * // If --host is not provided, defaults to \"localhost\"\n * ```\n *\n * @category optionality\n * @since 4.0.0\n */\nexport const withDefault = Param.withDefault;\n/**\n * Adds a fallback config that is loaded when a required flag is missing.\n *\n * **Example** (Falling back to config)\n *\n * ```ts\n * import { Config } from \"effect\"\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const verbose = Flag.boolean(\"verbose\").pipe(\n * Flag.withFallbackConfig(Config.boolean(\"VERBOSE\"))\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withFallbackConfig = /*#__PURE__*/dual(2, (self, config) => Param.withFallbackConfig(self, config));\n/**\n * Adds a fallback prompt that is shown when a required flag is missing.\n *\n * **Example** (Falling back to prompts)\n *\n * ```ts\n * import { Flag, Prompt } from \"effect/unstable/cli\"\n *\n * const name = Flag.string(\"name\").pipe(\n * Flag.withFallbackPrompt(Prompt.text({ message: \"Name\" }))\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withFallbackPrompt = /*#__PURE__*/dual(2, (self, prompt) => Param.withFallbackPrompt(self, prompt));\n/**\n * Transforms the parsed value of a flag using a mapping function.\n *\n * **Example** (Mapping parsed values)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Convert string to uppercase\n * const nameFlag = Flag.string(\"name\").pipe(\n * Flag.map((name) => name.toUpperCase())\n * )\n *\n * // Convert port to URL\n * const urlFlag = Flag.integer(\"port\").pipe(\n * Flag.map((port) => `http://localhost:${port}`)\n * )\n * ```\n *\n * @category mapping\n * @since 4.0.0\n */\nexport const map = /*#__PURE__*/dual(2, (self, f) => Param.map(self, f));\n/**\n * Transforms the parsed value using an Effect that can perform IO operations.\n *\n * **Example** (Mapping parsed values effectfully)\n *\n * ```ts\n * import { Effect, FileSystem } from \"effect\"\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Read file size from path flag\n * const fileSizeFlag = Flag.file(\"input\").pipe(\n * Flag.mapEffect(Effect.fnUntraced(function*(path) {\n * const fs = yield* FileSystem.FileSystem\n * const stats = yield* Effect.orDie(fs.stat(path))\n * return stats.size\n * }))\n * )\n * ```\n *\n * @category mapping\n * @since 4.0.0\n */\nexport const mapEffect = /*#__PURE__*/dual(2, (self, f) => Param.mapEffect(self, f));\n/**\n * Transforms the parsed value using a function that might throw, with error handling.\n *\n * **Example** (Mapping thrown errors)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Parse JSON string with error handling\n * const jsonFlag = Flag.string(\"config\").pipe(\n * Flag.mapTryCatch(\n * (json) => JSON.parse(json),\n * (error) => `Invalid JSON: ${error}`\n * )\n * )\n *\n * // Parse URL with error handling\n * const urlFlag = Flag.string(\"url\").pipe(\n * Flag.mapTryCatch(\n * (url) => new URL(url),\n * (error) => `Invalid URL: ${error}`\n * )\n * )\n * ```\n *\n * @category mapping\n * @since 4.0.0\n */\nexport const mapTryCatch = /*#__PURE__*/dual(3, (self, f, onError) => Param.mapTryCatch(self, f, onError));\n/**\n * Ensures a flag is specified at least a minimum number of times.\n *\n * **Example** (Requiring repeated values)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const sourceFlag = Flag.atLeast(Flag.file(\"source\"), 2)\n * // Requires at least 2 source files\n * // Usage: --source file1.ts --source file2.ts\n *\n * const tagFlag = Flag.string(\"tag\").pipe(\n * Flag.atLeast(1)\n * )\n * // Requires at least 1 tag\n * ```\n *\n * @category repetition\n * @since 4.0.0\n */\nexport const atLeast = /*#__PURE__*/dual(2, (self, min) => Param.atLeast(self, min));\n/**\n * Ensures a flag is specified at most a maximum number of times.\n *\n * **Example** (Limiting repeated values)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const warningFlag = Flag.atMost(Flag.string(\"warning\"), 3)\n * // Allows up to 3 warning flags\n * // Usage: --warning w1 --warning w2 --warning w3\n *\n * const debugFlag = Flag.string(\"debug\").pipe(\n * Flag.atMost(1)\n * )\n * // Allows at most 1 debug flag\n * ```\n *\n * @category repetition\n * @since 4.0.0\n */\nexport const atMost = /*#__PURE__*/dual(2, (self, max) => Param.atMost(self, max));\n/**\n * Ensures a flag is specified between a minimum and maximum number of times.\n *\n * **Example** (Bounding repeated values)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const hostFlag = Flag.between(Flag.string(\"host\"), 1, 3)\n * // Requires 1-3 host flags\n * // Usage: --host host1 --host host2\n *\n * const excludeFlag = Flag.string(\"exclude\").pipe(\n * Flag.between(0, 5)\n * )\n * // Allows 0-5 exclude patterns\n * ```\n *\n * @category repetition\n * @since 4.0.0\n */\nexport const between = /*#__PURE__*/dual(3, (self, min, max) => Param.between(self, min, max));\n/**\n * Transforms and filters a flag value, failing with a custom error if the transformation returns None.\n *\n * **Example** (Filtering and transforming values)\n *\n * ```ts\n * import { Option } from \"effect\"\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Parse positive integers only\n * const positiveInt = Flag.integer(\"count\").pipe(\n * Flag.filterMap(\n * (n) => n > 0 ? Option.some(n) : Option.none(),\n * (n) => `Expected positive integer, got ${n}`\n * )\n * )\n *\n * // Parse valid email addresses\n * const emailFlag = Flag.string(\"email\").pipe(\n * Flag.filterMap(\n * (email) => email.includes(\"@\") ? Option.some(email) : Option.none(),\n * (email) => `Invalid email address: ${email}`\n * )\n * )\n * ```\n *\n * @category filtering\n * @since 4.0.0\n */\nexport const filterMap = /*#__PURE__*/dual(3, (self, f, onNone) => Param.filterMap(self, f, onNone));\n/**\n * Filters a flag value based on a predicate, failing with a custom error if the predicate returns false.\n *\n * **Example** (Filtering parsed values)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Ensure port is in valid range\n * const portFlag = Flag.integer(\"port\").pipe(\n * Flag.filter(\n * (port) => port >= 1 && port <= 65535,\n * (port) => `Port ${port} is out of range (1-65535)`\n * )\n * )\n *\n * // Ensure non-empty string\n * const nameFlag = Flag.string(\"name\").pipe(\n * Flag.filter(\n * (name) => name.trim().length > 0,\n * () => \"Name cannot be empty\"\n * )\n * )\n * ```\n *\n * @category filtering\n * @since 4.0.0\n */\nexport const filter = /*#__PURE__*/dual(3, (self, predicate, onFalse) => Param.filter(self, predicate, onFalse));\n/**\n * Provides an alternative flag if the first one fails to parse.\n *\n * **Example** (Falling back to another flag)\n *\n * ```ts\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Try parsing as integer, fallback to string\n * const valueFlag = Flag.orElse(\n * Flag.integer(\"value\"),\n * () => Flag.string(\"value\")\n * )\n *\n * // Multiple input sources with fallback\n * const configFlag = Flag.orElse(\n * Flag.file(\"config\"),\n * () => Flag.string(\"config-url\")\n * )\n * ```\n *\n * @category alternatives\n * @since 4.0.0\n */\nexport const orElse = /*#__PURE__*/dual(2, (self, that) => Param.orElse(self, that));\n/**\n * Tries to parse with the first flag, then the second, returning a Result that indicates which succeeded.\n *\n * **Example** (Returning fallback results)\n *\n * ```ts\n * import { Effect, Result } from \"effect\"\n * import { Flag } from \"effect/unstable/cli\"\n *\n * // Try file path, fallback to URL\n * const sourceFlag = Flag.orElseResult(\n * Flag.file(\"source\"),\n * () => Flag.string(\"source-url\")\n * )\n *\n * const program = Effect.gen(function*() {\n * const [leftover, source] = yield* sourceFlag.parse({\n * arguments: [],\n * flags: { \"source-url\": [\"https://google.com\"] }\n * })\n * if (Result.isSuccess(source)) {\n * console.log(\"Using file:\", source.success)\n * } else {\n * console.log(\"Using URL:\", source.failure)\n * }\n * })\n * ```\n *\n * @category alternatives\n * @since 4.0.0\n */\nexport const orElseResult = /*#__PURE__*/dual(2, (self, that) => Param.orElseResult(self, that));\n/**\n * Validates and transforms a flag value using a Schema codec.\n *\n * **Example** (Validating with schemas)\n *\n * ```ts\n * import { Schema } from \"effect\"\n * import { Flag } from \"effect/unstable/cli\"\n *\n * const isEmail = Schema.isPattern(/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/, {\n * message: \"Must be a valid email address\"\n * })\n *\n * // Parse and validate email with custom schema\n * const EmailSchema = Schema.String.pipe(\n * Schema.check(isEmail)\n * )\n *\n * const emailFlag = Flag.string(\"email\").pipe(\n * Flag.withSchema(EmailSchema)\n * )\n *\n * // Parse JSON configuration with schema validation\n * const ConfigSchema = Schema.Struct({\n * port: Schema.Number,\n * host: Schema.String,\n * ssl: Schema.optional(Schema.Boolean)\n * }).pipe(Schema.fromJsonString)\n *\n * const configFlag = Flag.string(\"config\").pipe(\n * Flag.withSchema(ConfigSchema)\n * )\n * ```\n *\n * @category schemas\n * @since 4.0.0\n */\nexport const withSchema = /*#__PURE__*/dual(2, (self, schema) => Param.withSchema(self, schema));\n//# sourceMappingURL=Flag.js.map","/**\n * Config Internal\n * ================\n *\n * The processed internal representation of a Command.Config declaration.\n * Separates the user's declared config shape from the flat parsing representation.\n *\n * Key concepts:\n * - ConfigInternal: The full processed form (flags, arguments, tree)\n * - ConfigInternal.Tree: Maps declaration keys to nodes\n * - ConfigInternal.Node: Param reference, Array, or Nested subtree\n *\n * Example transformation from Command.Config to Command.Config.Internal:\n *\n * ```ts\n * // User declares:\n * const config = {\n * verbose: Flag.boolean(\"verbose\"),\n * server: {\n * host: Flag.string(\"host\"),\n * port: Flag.integer(\"port\")\n * },\n * files: Argument.string(\"files\").pipe(Argument.variadic)\n * }\n *\n * // Becomes Config.Internal:\n * {\n * arguments: [filesParam], // Flat array of arguments\n * flags: [verboseParam, hostParam, portParam], // Flat array of flags\n * orderedParams: [verboseParam, hostParam, portParam, filesParam],\n * tree: { // Preserves nested structure\n * verbose: { _tag: \"Param\", index: 0 },\n * server: {\n * _tag: \"Nested\",\n * tree: {\n * host: { _tag: \"Param\", index: 1 },\n * port: { _tag: \"Param\", index: 2 }\n * }\n * },\n * files: { _tag: \"Param\", index: 3 }\n * }\n * }\n * ```\n *\n * This separation allows:\n * 1. Flat iteration over all params for parsing/validation\n * 2. Reconstruction of original nested shape for handler input\n */\nimport * as Param from \"../Param.js\";\n/* ========================================================================== */\n/* Type ID */\n/* ========================================================================== */\nconst ConfigInternalTypeId = \"~effect/cli/Command/Config/Internal\";\n/**\n * Parses a Command.Config into a ConfigInternal.\n *\n * Walks the config structure and:\n * 1. Extracts all Params into flat arrays (flags, arguments, orderedParams)\n * 2. Builds a tree that remembers the original nested structure\n * 3. Assigns each Param an index to link parsed values back\n *\n * @internal\n */\nexport const parseConfig = config => {\n const orderedParams = [];\n const flags = [];\n const args = [];\n function parse(config) {\n const tree = {};\n for (const key in config) {\n tree[key] = parseValue(config[key]);\n }\n return tree;\n }\n function parseValue(value) {\n if (Array.isArray(value)) {\n return {\n _tag: \"Array\",\n children: value.map(v => parseValue(v))\n };\n } else if (Param.isParam(value)) {\n const index = orderedParams.length;\n orderedParams.push(value);\n if (value.kind === \"argument\") {\n args.push(value);\n } else {\n flags.push(value);\n }\n return {\n _tag: \"Param\",\n index\n };\n } else {\n return {\n _tag: \"Nested\",\n tree: parse(value)\n };\n }\n }\n return {\n [ConfigInternalTypeId]: ConfigInternalTypeId,\n flags,\n arguments: args,\n orderedParams,\n tree: parse(config)\n };\n};\n/** @internal */\nexport const emptyConfig = /*#__PURE__*/parseConfig({});\nconst shiftNodeIndexes = (node, offset) => {\n switch (node._tag) {\n case \"Param\":\n return {\n _tag: \"Param\",\n index: node.index + offset\n };\n case \"Array\":\n return {\n _tag: \"Array\",\n children: node.children.map(child => shiftNodeIndexes(child, offset))\n };\n case \"Nested\":\n return {\n _tag: \"Nested\",\n tree: shiftTreeIndexes(node.tree, offset)\n };\n }\n};\nconst shiftTreeIndexes = (tree, offset) => {\n const output = {};\n for (const key in tree) {\n output[key] = shiftNodeIndexes(tree[key], offset);\n }\n return output;\n};\n/** @internal */\nexport const mergeConfig = (left, right) => {\n const offset = left.orderedParams.length;\n return {\n [ConfigInternalTypeId]: ConfigInternalTypeId,\n flags: [...left.flags, ...right.flags],\n arguments: [...left.arguments, ...right.arguments],\n orderedParams: [...left.orderedParams, ...right.orderedParams],\n tree: {\n ...left.tree,\n ...shiftTreeIndexes(right.tree, offset)\n }\n };\n};\n/* ========================================================================== */\n/* Reconstruction */\n/* ========================================================================== */\n/**\n * Reconstructs the original nested config shape from parsed values.\n *\n * Uses the tree as a blueprint to place each parsed value back into\n * its original position in the nested structure.\n *\n * @internal\n */\nexport const reconstructTree = (tree, results) => {\n const output = {};\n for (const key in tree) {\n output[key] = nodeValue(tree[key]);\n }\n return output;\n function nodeValue(node) {\n switch (node._tag) {\n case \"Param\":\n return results[node.index];\n case \"Array\":\n return node.children.map(child => nodeValue(child));\n case \"Nested\":\n return reconstructTree(node.tree, results);\n }\n }\n};\n//# sourceMappingURL=config.js.map","/**\n * Command Implementation\n * ======================\n *\n * Internal implementation details for CLI commands.\n * Public API is in ../Command.ts\n */\nimport * as Arr from \"../../../Array.js\";\nimport * as Context from \"../../../Context.js\";\nimport * as Effect from \"../../../Effect.js\";\nimport * as Effectable from \"../../../Effectable.js\";\nimport * as Option from \"../../../Option.js\";\nimport * as Predicate from \"../../../Predicate.js\";\nimport * as CliError from \"../CliError.js\";\nimport * as Param from \"../Param.js\";\nimport * as Primitive from \"../Primitive.js\";\nimport { emptyConfig, reconstructTree } from \"./config.js\";\n/* ========================================================================== */\n/* Type ID */\n/* ========================================================================== */\nexport const TypeId = \"~effect/cli/Command\";\n/* ========================================================================== */\n/* Casting */\n/* ========================================================================== */\n/**\n * Casts a Command to its internal implementation.\n * For use by internal modules that need access to config, parse, handle, etc.\n */\nexport const toImpl = self => self;\n/* ========================================================================== */\n/* Proto */\n/* ========================================================================== */\nexport const Proto = {\n ... /*#__PURE__*/Effectable.Prototype({\n label: \"Command\",\n evaluate() {\n return toImpl(this).service;\n }\n })\n};\n/* ========================================================================== */\n/* Constructor */\n/* ========================================================================== */\n/**\n * Internal command constructor. Only accepts already-parsed ConfigInternal.\n */\nexport const makeCommand = options => {\n const config = options.config;\n const contextConfig = options.contextConfig ?? emptyConfig;\n const service = options.service ?? Context.Service(`${TypeId}/${options.name}`);\n const annotations = options.annotations ?? Context.empty();\n const globalFlags = options.globalFlags ?? [];\n const subcommands = options.subcommands ?? [];\n const handle = (input, commandPath) => Predicate.isNotUndefined(options.handle) ? options.handle(input, commandPath) : Effect.fail(new CliError.ShowHelp({\n commandPath,\n errors: []\n }));\n const parse = options.parse ?? makeParser(config);\n const parseContext = options.parseContext ?? makeParser(contextConfig);\n const buildHelpDoc = commandPath => {\n const args = [];\n const flags = [];\n for (const arg of config.arguments) {\n const singles = Param.extractSingleParams(arg);\n const metadata = Param.getParamMetadata(arg);\n for (const single of singles) {\n args.push({\n name: single.name,\n type: single.typeName ?? Primitive.getTypeName(single.primitiveType),\n description: single.description,\n required: !metadata.isOptional,\n variadic: metadata.isVariadic\n });\n }\n }\n let usage = commandPath.length > 0 ? commandPath.join(\" \") : options.name;\n // Only render `<subcommand>` in usage when at least one visible subcommand\n // exists; an all-hidden subcommand tree should look like a leaf command.\n if (subcommands.some(group => group.commands.some(c => !c.hidden))) {\n usage += \" <subcommand>\";\n }\n usage += \" [flags]\";\n for (const arg of args) {\n const argName = arg.variadic ? `<${arg.name}...>` : `<${arg.name}>`;\n usage += ` ${arg.required ? argName : `[${argName}]`}`;\n }\n for (const option of config.flags) {\n const singles = Param.extractSingleParams(option);\n for (const single of singles) {\n // Hidden flags still parse on the command line but are omitted from\n // generated --help output.\n if (single.hidden) continue;\n flags.push(toFlagDoc(single));\n }\n }\n const subcommandDocs = [];\n for (const group of subcommands) {\n // Hidden subcommands still parse on the command line but are omitted\n // from --help. Drop the whole group when nothing visible remains so we\n // don't render an empty heading.\n const visible = group.commands.filter(c => !c.hidden);\n if (visible.length === 0) continue;\n subcommandDocs.push({\n group: group.group,\n commands: Arr.map(visible, subcommand => ({\n name: subcommand.name,\n alias: subcommand.alias,\n shortDescription: subcommand.shortDescription,\n description: subcommand.description ?? \"\"\n }))\n });\n }\n const examples = options.examples ?? [];\n return {\n description: options.description ?? \"\",\n usage,\n flags,\n annotations,\n ...(args.length > 0 && {\n args\n }),\n ...(subcommandDocs.length > 0 && {\n subcommands: subcommandDocs\n }),\n ...(examples.length > 0 && {\n examples\n })\n };\n };\n return Object.assign(Object.create(Proto), {\n [TypeId]: TypeId,\n name: options.name,\n examples: options.examples ?? [],\n annotations,\n globalFlags,\n subcommands,\n hidden: options.hidden ?? false,\n config,\n contextConfig,\n service,\n parse,\n parseContext,\n handle,\n buildHelpDoc,\n ...(Predicate.isNotUndefined(options.description) ? {\n description: options.description\n } : {}),\n ...(Predicate.isNotUndefined(options.shortDescription) ? {\n shortDescription: options.shortDescription\n } : {}),\n ...(Predicate.isNotUndefined(options.alias) ? {\n alias: options.alias\n } : {})\n });\n};\n/* ========================================================================== */\n/* Helpers */\n/* ========================================================================== */\n/**\n * Converts a single flag param into a FlagDoc for help display.\n */\nexport const toFlagDoc = single => {\n const formattedAliases = single.aliases.map(alias => alias.length === 1 ? `-${alias}` : `--${alias}`);\n return {\n name: single.name,\n aliases: formattedAliases,\n type: single.typeName ?? Primitive.getTypeName(single.primitiveType),\n description: appendChoiceKeys(single.description, Primitive.getChoiceKeys(single.primitiveType)),\n required: single.primitiveType._tag !== \"Boolean\"\n };\n};\nconst appendChoiceKeys = (description, choiceKeys) => {\n if (choiceKeys === undefined || choiceKeys.length === 0) {\n return description;\n }\n const choiceSuffix = `(choices: ${choiceKeys.join(\", \")})`;\n return Option.match(description, {\n onNone: () => Option.some(choiceSuffix),\n onSome: value => Option.some(`${value} ${choiceSuffix}`)\n });\n};\n/**\n * Creates a parser for a given config. Used as the default for both `parse`\n * and `parseContext`, and also by `withSharedFlags` to avoid constructing a\n * full throwaway command.\n */\nexport const makeParser = cfg => Effect.fnUntraced(function* (input) {\n const parsedArgs = {\n flags: input.flags,\n arguments: input.arguments\n };\n const values = yield* parseParams(parsedArgs, cfg.orderedParams);\n return reconstructTree(cfg.tree, values);\n});\n/**\n * Parses param values from parsed command arguments into their typed\n * representations.\n */\nconst parseParams = /*#__PURE__*/Effect.fnUntraced(function* (parsedArgs, params) {\n const results = [];\n let currentArguments = parsedArgs.arguments;\n for (const option of params) {\n const [remainingArguments, parsed] = yield* option.parse({\n flags: parsedArgs.flags,\n arguments: currentArguments\n });\n results.push(parsed);\n currentArguments = remainingArguments;\n }\n return results;\n});\n/**\n * Checks that inherited parent context flags do not reuse names declared by\n * child command flags.\n *\n * When `contextConfig` is supplied, it is used as the inherited flag set;\n * otherwise the parent's current context config is checked.\n */\nexport const checkForDuplicateFlags = (parent, subcommands, options) => {\n const parentImpl = toImpl(parent);\n const parentOptionNames = new Set();\n const extractNames = flags => {\n for (const option of flags) {\n const singles = Param.extractSingleParams(option);\n for (const single of singles) {\n parentOptionNames.add(single.name);\n }\n }\n };\n extractNames((options?.contextConfig ?? parentImpl.contextConfig).flags);\n for (const subcommand of subcommands) {\n const subImpl = toImpl(subcommand);\n for (const option of subImpl.config.flags) {\n const singles = Param.extractSingleParams(option);\n for (const single of singles) {\n if (parentOptionNames.has(single.name)) {\n throw new CliError.DuplicateOption({\n option: single.name,\n parentCommand: parent.name,\n childCommand: subcommand.name\n });\n }\n }\n }\n }\n};\n//# sourceMappingURL=command.js.map","/**\n * CommandDescriptor — pure-data representation of a command tree for\n * shell completion generation.\n *\n * @internal\n */\nimport * as Option from \"../../../../Option.js\";\nimport * as Param from \"../../Param.js\";\nimport * as Primitive from \"../../Primitive.js\";\nimport { toImpl } from \"../command.js\";\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\nconst toFlagType = single => {\n const tag = single.primitiveType._tag;\n switch (tag) {\n case \"Boolean\":\n return {\n _tag: \"Boolean\"\n };\n case \"Integer\":\n return {\n _tag: \"Integer\"\n };\n case \"Float\":\n return {\n _tag: \"Float\"\n };\n case \"Date\":\n return {\n _tag: \"Date\"\n };\n case \"Choice\":\n {\n const keys = Primitive.getChoiceKeys(single.primitiveType);\n return {\n _tag: \"Choice\",\n values: keys ?? []\n };\n }\n case \"Path\":\n {\n const typeName = single.typeName;\n const pathType = typeName === \"file\" ? \"file\" : typeName === \"directory\" ? \"directory\" : \"either\";\n return {\n _tag: \"Path\",\n pathType\n };\n }\n default:\n return {\n _tag: \"String\"\n };\n }\n};\nconst toArgumentType = single => {\n const tag = single.primitiveType._tag;\n switch (tag) {\n case \"Integer\":\n return {\n _tag: \"Integer\"\n };\n case \"Float\":\n return {\n _tag: \"Float\"\n };\n case \"Date\":\n return {\n _tag: \"Date\"\n };\n case \"Choice\":\n {\n const keys = Primitive.getChoiceKeys(single.primitiveType);\n return {\n _tag: \"Choice\",\n values: keys ?? []\n };\n }\n case \"Path\":\n {\n const typeName = single.typeName;\n const pathType = typeName === \"file\" ? \"file\" : typeName === \"directory\" ? \"directory\" : \"either\";\n return {\n _tag: \"Path\",\n pathType\n };\n }\n default:\n return {\n _tag: \"String\"\n };\n }\n};\n// ---------------------------------------------------------------------------\n// Extraction\n// ---------------------------------------------------------------------------\n/** @internal */\nexport const fromCommand = cmd => {\n const impl = toImpl(cmd);\n const config = impl.config;\n const flags = [];\n for (const flag of config.flags) {\n const singles = Param.extractSingleParams(flag);\n for (const single of singles) {\n if (single.kind !== \"flag\") continue;\n // Omit hidden flags from completion scripts so tab-completion in the\n // shell does not advertise flags that are absent from --help.\n if (single.hidden) continue;\n flags.push({\n name: single.name,\n aliases: single.aliases,\n description: Option.getOrUndefined(single.description),\n type: toFlagType(single)\n });\n }\n }\n const args = [];\n for (const arg of config.arguments) {\n const singles = Param.extractSingleParams(arg);\n const metadata = Param.getParamMetadata(arg);\n for (const single of singles) {\n if (single.kind !== \"argument\") continue;\n args.push({\n name: single.name,\n description: Option.getOrUndefined(single.description),\n required: !metadata.isOptional,\n variadic: metadata.isVariadic,\n type: toArgumentType(single)\n });\n }\n }\n const subcommands = [];\n for (const group of cmd.subcommands) {\n for (const subcommand of group.commands) {\n // Omit hidden subcommands from completion scripts so tab-completion in\n // the shell does not advertise commands that are absent from --help.\n if (subcommand.hidden) continue;\n subcommands.push(fromCommand(subcommand));\n }\n }\n return {\n name: cmd.name,\n description: cmd.shortDescription ?? cmd.description,\n flags,\n arguments: args,\n subcommands\n };\n};\n//# sourceMappingURL=descriptor.js.map","/**\n * Help Documentation\n * ================\n *\n * Internal helpers for generating help documentation.\n * Extracted from command.ts to avoid circular dependencies.\n */\nimport * as Effect from \"../../../Effect.js\";\nimport * as Param from \"../Param.js\";\nimport { toFlagDoc, toImpl } from \"./command.js\";\nconst dedupeGlobalFlags = flags => {\n const seen = new Set();\n const deduped = [];\n for (const flag of flags) {\n if (seen.has(flag)) {\n continue;\n }\n seen.add(flag);\n deduped.push(flag);\n }\n return deduped;\n};\n/**\n * Returns the resolved command lineage for the provided path.\n * Includes the root command as the first element.\n */\nexport const getCommandsForCommandPath = (command, commandPath) => {\n const commands = [command];\n let currentCommand = command;\n for (let i = 1; i < commandPath.length; i++) {\n const subcommandName = commandPath[i];\n let subcommand = undefined;\n for (const group of currentCommand.subcommands) {\n subcommand = group.commands.find(sub => sub.name === subcommandName);\n if (subcommand) {\n break;\n }\n }\n if (!subcommand) {\n break;\n }\n commands.push(subcommand);\n currentCommand = subcommand;\n }\n return commands;\n};\n/**\n * Returns active global flags for a command path.\n * Built-ins are prepended and declarations are collected root -> leaf.\n */\nexport const getGlobalFlagsForCommandPath = (command, commandPath, builtIns) => {\n const commands = getCommandsForCommandPath(command, commandPath);\n const declared = commands.flatMap(current => toImpl(current).globalFlags);\n return dedupeGlobalFlags([...builtIns, ...declared]);\n};\nconst collectDeclaredGlobalFlags = command => {\n const collected = [];\n const visit = current => {\n const impl = toImpl(current);\n for (const flag of impl.globalFlags) {\n collected.push(flag);\n }\n for (const group of current.subcommands) {\n for (const subcommand of group.commands) {\n visit(subcommand);\n }\n }\n };\n visit(command);\n return dedupeGlobalFlags(collected);\n};\nconst getSharedFlagsForCommandPath = (commands, currentFlags) => {\n if (commands.length <= 1) {\n return [];\n }\n const seen = new Set(currentFlags.map(flag => flag.name));\n const sharedFlags = [];\n for (const ancestor of commands.slice(0, -1)) {\n const ancestorImpl = toImpl(ancestor);\n for (const flag of ancestorImpl.contextConfig.flags) {\n const singles = Param.extractSingleParams(flag);\n for (const single of singles) {\n if (seen.has(single.name)) {\n continue;\n }\n // Hidden ancestor flags are excluded from the shared-flags section\n // of subcommand help, the same way they're excluded from the owning\n // command's own help output.\n if (single.hidden) {\n continue;\n }\n seen.add(single.name);\n sharedFlags.push(toFlagDoc(single));\n }\n }\n }\n return sharedFlags;\n};\n/**\n * Returns all global flags declared in a command tree.\n * Built-ins are prepended and command declarations are deduplicated by identity.\n */\nexport const getGlobalFlagsForCommandTree = (command, builtIns) => dedupeGlobalFlags([...builtIns, ...collectDeclaredGlobalFlags(command)]);\n/**\n * Helper function to get help documentation for a specific command path.\n * Navigates through the command hierarchy to find the right command.\n * Reads active global flags for the path and includes them in the help doc.\n */\nexport const getHelpForCommandPath = (command, commandPath, builtIns) => Effect.gen(function* () {\n const commands = getCommandsForCommandPath(command, commandPath);\n const currentCommand = commands.length > 0 ? commands[commands.length - 1] : command;\n const baseDoc = toImpl(currentCommand).buildHelpDoc(commandPath);\n const sharedFlags = getSharedFlagsForCommandPath(commands, baseDoc.flags);\n const flags = getGlobalFlagsForCommandPath(command, commandPath, builtIns);\n const globalFlagDocs = [];\n for (const flag of flags) {\n const singles = Param.extractSingleParams(flag.flag);\n for (const single of singles) {\n // Same rule as command-local flags: hidden globals are still parsed\n // and still trigger their handlers, they just don't appear under\n // \"GLOBAL FLAGS\" in --help.\n if (single.hidden) continue;\n globalFlagDocs.push({\n ...toFlagDoc(single),\n required: false\n });\n }\n }\n return {\n ...baseDoc,\n flags: [...sharedFlags, ...baseDoc.flags],\n globalFlags: globalFlagDocs\n };\n});\n//# sourceMappingURL=help.js.map","/**\n * Global flags for Effect CLI command trees. Global flags are parsed outside a\n * single command's local flags and can apply to a command and its descendants.\n *\n * This module defines two kinds of global flags: action flags, which run an\n * effect and stop normal command execution, and setting flags, which provide a\n * parsed value to the command handler through the Effect context. It also\n * defines the built-in help, version, shell-completion, and log-level flags\n * used by `Command.run` and `Command.runWith`.\n *\n * @since 4.0.0\n */\nimport * as Console from \"../../Console.js\";\nimport * as Context from \"../../Context.js\";\nimport * as Effect from \"../../Effect.js\";\nimport * as Option from \"../../Option.js\";\nimport * as CliOutput from \"./CliOutput.js\";\nimport * as Completions_ from \"./Completions.js\";\nimport * as Flag from \"./Flag.js\";\nimport * as CommandDescriptor from \"./internal/completions/descriptor.js\";\nimport * as HelpInternal from \"./internal/help.js\";\n/* ========================================================================== */\n/* Constructors */\n/* ========================================================================== */\n/**\n * Creates an Action flag that performs a side effect and exits.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const action = options => ({\n _tag: \"Action\",\n flag: options.flag,\n run: options.run\n});\n/**\n * Creates a Setting flag that configures the command handler's environment.\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const setting = id => options => {\n settingIdCounter += 1;\n const ref = Context.Service(`effect/unstable/cli/GlobalFlag/${id}/${settingIdCounter}`);\n return Object.assign(ref, {\n _tag: \"Setting\",\n id,\n flag: options.flag\n });\n};\nlet settingIdCounter = 0;\n/* ========================================================================== */\n/* Built-in Flag References */\n/* ========================================================================== */\n/**\n * Defines the `--help` / `-h` global flag, which shows help documentation for the\n * active command path.\n *\n * @see {@link BuiltIns} for the default list containing this flag\n * @see {@link action} for defining custom action global flags\n *\n * @category references\n * @since 4.0.0\n */\nexport const Help = /*#__PURE__*/action({\n flag: /*#__PURE__*/Flag.boolean(\"help\").pipe(/*#__PURE__*/Flag.withAlias(\"h\"), /*#__PURE__*/Flag.withDescription(\"Show help information\")),\n run: (_, {\n command,\n commandPath\n }) => Effect.gen(function* () {\n const formatter = yield* CliOutput.Formatter;\n const helpDoc = yield* HelpInternal.getHelpForCommandPath(command, commandPath, BuiltIns);\n yield* Console.log(formatter.formatHelpDoc(helpDoc));\n })\n});\n/**\n * Defines the global action flag for showing command version information.\n *\n * **When to use**\n *\n * Use to add a built-in `--version / -v` flag to a command runner.\n *\n * @category references\n * @since 4.0.0\n */\nexport const Version = /*#__PURE__*/action({\n flag: /*#__PURE__*/Flag.boolean(\"version\").pipe(/*#__PURE__*/Flag.withAlias(\"v\"), /*#__PURE__*/Flag.withDescription(\"Show version information\")),\n run: (_, {\n command,\n version\n }) => Effect.gen(function* () {\n const formatter = yield* CliOutput.Formatter;\n yield* Console.log(formatter.formatVersion(command.name, version));\n })\n});\n/**\n * Defines the `--completions` global flag, which prints a shell completion script for\n * the given shell.\n *\n * **Details**\n *\n * Accepted values are `bash`, `zsh`, `fish`, and `sh`; `sh` is normalized to\n * `bash`.\n *\n * @category references\n * @since 4.0.0\n */\nexport const Completions = /*#__PURE__*/action({\n flag: /*#__PURE__*/Flag.choice(\"completions\", [\"bash\", \"zsh\", \"fish\", \"sh\"]).pipe(Flag.optional, /*#__PURE__*/Flag.map(v => Option.map(v, s => s === \"sh\" ? \"bash\" : s)), /*#__PURE__*/Flag.withMetavar(\"<bash|zsh|fish|sh>\"), /*#__PURE__*/Flag.withDescription(\"Print shell completion script\")),\n run: (shell, {\n command\n }) => Effect.gen(function* () {\n if (Option.isNone(shell)) return;\n const descriptor = CommandDescriptor.fromCommand(command);\n yield* Console.log(Completions_.generate(command.name, shell.value, descriptor));\n })\n});\n/**\n * Defines the global setting flag for command log level.\n *\n * **When to use**\n *\n * Use to add a built-in `--log-level` option that configures the minimum log\n * level for the command.\n *\n * @category references\n * @since 4.0.0\n */\nexport const LogLevel = /*#__PURE__*/setting(\"log-level\")({\n flag: /*#__PURE__*/Flag.choiceWithValue(\"log-level\", [[\"all\", \"All\"], [\"trace\", \"Trace\"], [\"debug\", \"Debug\"], [\"info\", \"Info\"], [\"warn\", \"Warn\"], [\"warning\", \"Warn\"], [\"error\", \"Error\"], [\"fatal\", \"Fatal\"], [\"none\", \"None\"]]).pipe(Flag.optional, /*#__PURE__*/Flag.withDescription(\"Sets the minimum log level\"), /*#__PURE__*/Flag.withMetavar(\"<all|trace|debug|info|warn|warning|error|fatal|none>\"))\n});\n/* ========================================================================== */\n/* References */\n/* ========================================================================== */\n/**\n * Built-in global flags in default precedence order.\n *\n * **When to use**\n *\n * Use when extending or inspecting the default global-flag set that\n * `Command.runWith` prepends before user-defined global flags.\n *\n * **Details**\n *\n * The built-ins are `Help`, `Version`, `Completions`, and `LogLevel`.\n * `Command.runWith` prepends these built-ins when collecting and parsing global\n * flags.\n *\n * **Gotchas**\n *\n * Action flags are processed in active flag order and the first present action\n * exits, so this array controls built-in action precedence.\n *\n * @see {@link Help} for the help action flag\n * @see {@link Version} for the version action flag\n * @see {@link Completions} for the shell-completions action flag\n * @see {@link LogLevel} for the built-in log-level setting flag\n *\n * @category references\n * @since 4.0.0\n */\nexport const BuiltIns = [Help, Version, Completions, LogLevel];\n//# sourceMappingURL=GlobalFlag.js.map","/** @internal */\nexport function lex(argv) {\n const endIndex = argv.indexOf(\"--\");\n if (endIndex === -1) {\n // No -- delimiter, lex everything normally\n return {\n tokens: lexTokens(argv),\n trailingOperands: []\n };\n }\n // Split at -- delimiter\n return {\n tokens: lexTokens(argv.slice(0, endIndex)),\n trailingOperands: argv.slice(endIndex + 1)\n };\n}\nconst lexTokens = args => {\n const tokens = [];\n for (const arg of args) {\n if (!arg.startsWith(\"-\")) {\n tokens.push({\n _tag: \"Value\",\n value: arg\n });\n } else if (arg.startsWith(\"--\")) {\n const [name, value] = arg.slice(2).split(\"=\", 2);\n tokens.push({\n _tag: \"LongOption\",\n name,\n raw: arg,\n value\n });\n } else if (arg.length > 1) {\n const flags = arg.slice(1);\n const equalIndex = flags.indexOf(\"=\");\n if (equalIndex !== -1) {\n const flag = flags.slice(0, equalIndex);\n const value = flags.slice(equalIndex + 1);\n tokens.push({\n _tag: \"ShortOption\",\n flag,\n raw: `-${flag}`,\n value\n });\n } else {\n for (const ch of flags) {\n tokens.push({\n _tag: \"ShortOption\",\n flag: ch,\n raw: `-${ch}`\n });\n }\n }\n } else {\n tokens.push({\n _tag: \"Value\",\n value: arg\n });\n }\n }\n return tokens;\n};\n//# sourceMappingURL=lexer.js.map","/**\n * Simple Levenshtein distance implementation (small N, no perf worries)\n */\nconst levenshtein = (a, b) => {\n const m = a.length;\n const n = b.length;\n const dp = Array.from({\n length: m + 1\n }, () => new Array(n + 1).fill(0));\n for (let i = 0; i <= m; i++) dp[i][0] = i;\n for (let j = 0; j <= n; j++) dp[0][j] = j;\n for (let i = 1; i <= m; i++) {\n for (let j = 1; j <= n; j++) {\n const cost = a[i - 1] === b[j - 1] ? 0 : 1;\n dp[i][j] = Math.min(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + cost);\n }\n }\n return dp[m][n];\n};\n/**\n * Return suggestions with minimum distance found, up to distance 2.\n *\n * @internal\n */\nexport const suggest = (input, candidates) => {\n const distances = candidates.map(c => [levenshtein(input, c), c]).filter(([d]) => d <= 2) // Stricter threshold\n .sort(([a], [b]) => a - b);\n if (distances.length === 0) return [];\n // Only return suggestions with the minimum distance found\n const minDistance = distances[0][0];\n return distances.filter(([d]) => d === minDistance).map(([, c]) => c);\n};\n//# sourceMappingURL=auto-suggest.js.map","/**\n * Parsing Pipeline for CLI Commands\n * ==================================\n *\n * The parser transforms raw argv tokens into structured command input through\n * three main phases:\n *\n * 1. **Lexer** (external): Converts argv strings into typed tokens\n * - LongOption: --name or --name=value\n * - ShortOption: -n or -n=value (also handles -abc as three flags)\n * - Value: positional arguments\n *\n * 2. **Built-in Extraction**: Peels off built-in flags (help/version/completions)\n * before command-specific parsing begins.\n *\n * 3. **Command Parsing**: Recursively processes command levels:\n * - Collects flags defined at this level\n * - Detects subcommand from first value token\n * - Forwards remaining tokens to child command\n *\n * Key Behaviors\n * -------------\n * - Inherited parent flags may appear before OR after the subcommand name (npm-style)\n * - Only the first Value token can open a subcommand\n * - Errors accumulate rather than throwing exceptions\n */\nimport * as Effect from \"../../../Effect.js\";\nimport * as Option from \"../../../Option.js\";\nimport * as CliError from \"../CliError.js\";\nimport * as Param from \"../Param.js\";\nimport * as Primitive from \"../Primitive.js\";\nimport { suggest } from \"./auto-suggest.js\";\nimport { toImpl } from \"./command.js\";\n/* ========================================================================== */\n/* Public API */\n/* ========================================================================== */\n/** @internal */\nexport const getCommandPath = parsedInput => Option.match(parsedInput.subcommand, {\n onNone: () => [],\n onSome: subcommand => [subcommand.name, ...getCommandPath(subcommand.parsedInput)]\n});\n/** @internal */\nexport const parseArgs = (lexResult, command, commandPath = []) => Effect.gen(function* () {\n const {\n tokens,\n trailingOperands: afterEndOfOptions\n } = lexResult;\n const newCommandPath = [...commandPath, command.name];\n const commandImpl = toImpl(command);\n const singles = commandImpl.config.flags.flatMap(Param.extractSingleParams);\n const flagParams = singles.filter(Param.isFlagParam);\n const flagRegistry = createFlagRegistry(flagParams);\n const inheritedSingles = commandImpl.contextConfig.flags.flatMap(Param.extractSingleParams);\n const inheritedFlagParams = inheritedSingles.filter(Param.isFlagParam);\n const inheritedFlagRegistry = createFlagRegistry(inheritedFlagParams);\n const inheritedNames = new Set(inheritedFlagParams.map(param => param.name));\n const context = {\n command,\n commandPath: newCommandPath,\n flagRegistry,\n inheritedFlagRegistry,\n localFlagNames: flagParams.filter(param => !inheritedNames.has(param.name)).map(param => param.name)\n };\n const result = scanCommandLevel(tokens, context);\n if (result._tag === \"Leaf\") {\n return {\n flags: result.flags,\n arguments: [...result.arguments, ...afterEndOfOptions],\n subcommand: Option.none(),\n ...(result.errors.length > 0 && {\n errors: result.errors\n })\n };\n }\n const subLex = {\n tokens: result.childTokens,\n trailingOperands: []\n };\n const subParsed = yield* parseArgs(subLex, result.sub, newCommandPath);\n const allErrors = [...result.errors, ...(subParsed.errors ?? [])];\n return {\n flags: result.flags,\n arguments: afterEndOfOptions,\n subcommand: Option.some({\n name: result.sub.name,\n parsedInput: subParsed\n }),\n ...(allErrors.length > 0 && {\n errors: allErrors\n })\n };\n});\nconst makeCursor = tokens => {\n let i = 0;\n return {\n peek: () => tokens[i],\n take: () => tokens[i++],\n rest: () => tokens.slice(i)\n };\n};\n/* ========================================================================== */\n/* Flag Registry */\n/* ========================================================================== */\n/**\n * Creates a registry for O(1) flag lookup by name or alias.\n * @internal\n */\nexport const createFlagRegistry = params => {\n const index = new Map();\n for (const param of params) {\n if (index.has(param.name)) {\n throw new Error(`Duplicate flag name \"${param.name}\" in command definition`);\n }\n index.set(param.name, param);\n for (const alias of param.aliases) {\n if (index.has(alias)) {\n throw new Error(`Duplicate flag/alias \"${alias}\" in command definition (conflicts with \"${index.get(alias).name}\")`);\n }\n index.set(alias, param);\n }\n }\n return {\n params,\n index\n };\n};\nconst buildSubcommandIndex = subcommands => {\n const index = new Map();\n const setKey = (key, command) => {\n const existing = index.get(key);\n if (existing && existing !== command) {\n throw new Error(`Duplicate subcommand name/alias \"${key}\" in command definition (conflicts with \"${existing.name}\")`);\n }\n index.set(key, command);\n };\n for (const group of subcommands) {\n for (const subcommand of group.commands) {\n setKey(subcommand.name, subcommand);\n if (subcommand.alias && subcommand.alias !== subcommand.name) {\n setKey(subcommand.alias, subcommand);\n }\n }\n }\n return index;\n};\n/* ========================================================================== */\n/* Flag Accumulator */\n/* ========================================================================== */\n/** Creates an empty flag map with all known flag names initialized to [].\n * @internal\n */\nexport const createEmptyFlagMap = params => Object.fromEntries(params.map(p => [p.name, []]));\n/**\n * Creates a mutable accumulator for collecting flag values.\n * Pre-initializes empty arrays for all known flags.\n */\nconst createFlagAccumulator = params => {\n const map = createEmptyFlagMap(params);\n return {\n add: (name, raw) => {\n if (raw !== undefined) map[name].push(raw);\n },\n merge: from => {\n for (const key in from) {\n const values = from[key];\n if (values?.length) {\n for (let i = 0; i < values.length; i++) {\n map[key].push(values[i]);\n }\n }\n }\n },\n snapshot: () => map\n };\n};\nconst isFlagToken = t => t._tag === \"LongOption\" || t._tag === \"ShortOption\";\nconst getFlagName = t => t._tag === \"LongOption\" ? t.name : t.flag;\nconst resolveFlag = (token, registry) => {\n const tokenName = getFlagName(token);\n const direct = registry.index.get(tokenName);\n if (direct && direct.name === tokenName) {\n return {\n param: direct,\n negated: false\n };\n }\n if (token._tag === \"LongOption\" && token.name.startsWith(\"no-\")) {\n const canonicalName = token.name.slice(3);\n const param = registry.index.get(canonicalName);\n if (param && param.name === canonicalName && Primitive.isBoolean(param.primitiveType)) {\n return {\n param,\n negated: true\n };\n }\n }\n if (direct) {\n return {\n param: direct,\n negated: false\n };\n }\n return undefined;\n};\nconst invalidNegatedFlagValue = (token, spec, value) => new CliError.InvalidValue({\n option: spec.name,\n value,\n expected: `omit the value and use ${token.raw} by itself to set --${spec.name} to false`,\n kind: \"flag\"\n});\n/**\n * Checks whether a token is a boolean literal value.\n * Recognizes: true/false, yes/no, on/off, 1/0\n */\nconst asBooleanLiteral = token => token?._tag === \"Value\" && (Primitive.isTrueValue(token.value) || Primitive.isFalseValue(token.value)) ? token.value : undefined;\n/* ========================================================================== */\n/* Flag Value Consumption */\n/* ========================================================================== */\n/**\n * Reads a flag's value from the token stream.\n *\n * Value resolution order:\n * 1. Inline value: --flag=value or -f=value\n * 2. Boolean special case: implicit \"true\" or explicit boolean literal\n * 3. Next token: consume following Value token if present\n */\nconst consumeFlagValue = (cursor, token, spec, negated = false) => {\n const consumed = consumeFlagValueWithTokens(cursor, token, spec, negated);\n switch (consumed._tag) {\n case \"Value\":\n return {\n _tag: \"Value\",\n value: consumed.value\n };\n case \"Error\":\n return {\n _tag: \"Error\",\n error: consumed.error\n };\n }\n};\nconst consumeFlagValueWithTokens = (cursor, token, spec, negated = false) => {\n // Inline value has highest priority\n if (negated) {\n if (token.value !== undefined) {\n return {\n _tag: \"Error\",\n error: invalidNegatedFlagValue(token, spec, token.value),\n tokens: []\n };\n }\n const literal = asBooleanLiteral(cursor.peek());\n if (literal !== undefined) {\n const literalToken = cursor.take();\n return {\n _tag: \"Error\",\n error: invalidNegatedFlagValue(token, spec, literal),\n tokens: literalToken === undefined ? [] : [literalToken]\n };\n }\n return {\n _tag: \"Value\",\n value: \"false\",\n tokens: []\n };\n }\n if (token.value !== undefined) {\n return {\n _tag: \"Value\",\n value: token.value,\n tokens: []\n };\n }\n // Boolean flags: check for explicit literal or default to \"true\"\n if (Primitive.isBoolean(spec.primitiveType)) {\n const literal = asBooleanLiteral(cursor.peek());\n const literalToken = literal !== undefined ? cursor.take() : undefined;\n return {\n _tag: \"Value\",\n value: literal ?? \"true\",\n tokens: literalToken === undefined ? [] : [literalToken]\n };\n }\n // Non-boolean: try to consume next Value token\n const next = cursor.peek();\n if (next?._tag === \"Value\") {\n const valueToken = cursor.take();\n return {\n _tag: \"Value\",\n value: next.value,\n tokens: valueToken === undefined ? [] : [valueToken]\n };\n }\n return {\n _tag: \"Value\",\n value: undefined,\n tokens: []\n };\n};\n/**\n * Consumes known flags from a token stream.\n * Unrecognized tokens are passed through to remainder.\n * Used for both global flag extraction and npm-style parent flag collection.\n * @internal\n */\nexport const consumeKnownFlags = (tokens, registry) => {\n const flagMap = createEmptyFlagMap(registry.params);\n const remainder = [];\n const errors = [];\n const cursor = makeCursor(tokens);\n for (let t = cursor.take(); t; t = cursor.take()) {\n if (!isFlagToken(t)) {\n remainder.push(t);\n continue;\n }\n const resolved = resolveFlag(t, registry);\n if (!resolved) {\n remainder.push(t);\n continue;\n }\n const consumed = consumeFlagValue(cursor, t, resolved.param, resolved.negated);\n if (consumed._tag === \"Error\") {\n errors.push(consumed.error);\n continue;\n }\n if (consumed.value !== undefined) {\n flagMap[resolved.param.name].push(consumed.value);\n }\n }\n return {\n flagMap,\n remainder,\n errors\n };\n};\nconst extractFlagParams = command => {\n const commandImpl = toImpl(command);\n const singles = commandImpl.config.flags.flatMap(Param.extractSingleParams);\n return singles.filter(Param.isFlagParam);\n};\nconst extractContextFlagParams = command => {\n const commandImpl = toImpl(command);\n const singles = commandImpl.contextConfig.flags.flatMap(Param.extractSingleParams);\n return singles.filter(Param.isFlagParam);\n};\nconst resolveFromRegistries = (token, registries) => {\n for (const registry of registries) {\n const resolved = resolveFlag(token, registry);\n if (resolved !== undefined) {\n return resolved;\n }\n }\n return undefined;\n};\nconst preserveFlag = (remainder, cursor, token, resolved) => {\n remainder.push(token);\n const consumed = consumeFlagValueWithTokens(cursor, token, resolved.param, resolved.negated);\n remainder.push(...consumed.tokens);\n};\nconst localFlagWouldPrecedeSubcommand = (token, remainingTokens, resolved, subIndex, registries) => {\n const cursor = makeCursor(remainingTokens);\n consumeFlagValueWithTokens(cursor, token, resolved.param, resolved.negated);\n for (let token = cursor.take(); token; token = cursor.take()) {\n if (isFlagToken(token)) {\n const known = resolveFromRegistries(token, registries);\n if (known !== undefined) {\n consumeFlagValueWithTokens(cursor, token, known.param, known.negated);\n }\n continue;\n }\n if (token._tag === \"Value\") {\n return subIndex.has(token.value);\n }\n }\n return false;\n};\n/**\n * Consumes global flags while walking the command tree.\n *\n * Command-local flags take precedence over global flags at the selected command\n * level. This lets commands reuse a global flag name, for example a subcommand\n * with its own `--version <value>` flag overriding the built-in global\n * `--version` action.\n * @internal\n */\nexport const consumeGlobalFlags = (tokens, command, registry) => {\n const flagMap = createEmptyFlagMap(registry.params);\n const errors = [];\n const consumeLevel = (tokens, command, ignoredRegistries) => {\n const localRegistry = createFlagRegistry(extractFlagParams(command));\n const inheritedRegistry = createFlagRegistry(extractContextFlagParams(command));\n const subIndex = buildSubcommandIndex(command.subcommands);\n const cursor = makeCursor(tokens);\n const remainder = [];\n let awaitingFirstValue = true;\n for (let token = cursor.take(); token; token = cursor.take()) {\n if (isFlagToken(token)) {\n const ignored = resolveFromRegistries(token, ignoredRegistries);\n if (ignored !== undefined) {\n preserveFlag(remainder, cursor, token, ignored);\n continue;\n }\n const inherited = resolveFlag(token, inheritedRegistry);\n if (inherited !== undefined) {\n preserveFlag(remainder, cursor, token, inherited);\n continue;\n }\n const local = resolveFlag(token, localRegistry);\n const global = resolveFlag(token, registry);\n if (local !== undefined) {\n if (global === undefined || !awaitingFirstValue || !localFlagWouldPrecedeSubcommand(token, cursor.rest(), local, subIndex, [localRegistry, inheritedRegistry, registry])) {\n preserveFlag(remainder, cursor, token, local);\n continue;\n }\n }\n if (global !== undefined) {\n const consumed = consumeFlagValueWithTokens(cursor, token, global.param, global.negated);\n if (consumed._tag === \"Error\") {\n errors.push(consumed.error);\n continue;\n }\n if (consumed.value !== undefined) {\n flagMap[global.param.name].push(consumed.value);\n }\n continue;\n }\n remainder.push(token);\n continue;\n }\n if (token._tag === \"Value\" && awaitingFirstValue) {\n const sub = subIndex.get(token.value);\n if (sub !== undefined) {\n remainder.push(token);\n remainder.push(...consumeLevel(cursor.rest(), sub, [...ignoredRegistries, inheritedRegistry]));\n return remainder;\n }\n awaitingFirstValue = false;\n }\n remainder.push(token);\n }\n return remainder;\n };\n return {\n flagMap,\n remainder: consumeLevel(tokens, command, []),\n errors\n };\n};\n/* ========================================================================== */\n/* Error Creation */\n/* ========================================================================== */\nconst createUnrecognizedFlagError = (token, params, commandPath) => {\n const printable = token._tag === \"LongOption\" ? `--${token.name}` : `-${token.flag}`;\n const validNames = [];\n for (const p of params) {\n // Exclude hidden flags so a near-miss typo cannot reveal a flag name\n // that was intentionally kept out of --help.\n if (p.hidden) continue;\n validNames.push(p.name);\n if (Primitive.isBoolean(p.primitiveType)) {\n validNames.push(`no-${p.name}`);\n }\n for (const alias of p.aliases) {\n validNames.push(alias);\n }\n }\n const suggestions = suggest(getFlagName(token), validNames).map(n => n.length === 1 ? `-${n}` : `--${n}`);\n return new CliError.UnrecognizedOption({\n option: printable,\n suggestions,\n command: commandPath\n });\n};\n/* ========================================================================== */\n/* Parse State */\n/* ========================================================================== */\nconst createParseState = registry => ({\n flags: createFlagAccumulator(registry.params),\n arguments: [],\n errors: [],\n mode: {\n _tag: \"AwaitingFirstValue\"\n }\n});\nconst toLeafResult = state => ({\n _tag: \"Leaf\",\n flags: state.flags.snapshot(),\n arguments: state.arguments,\n errors: state.errors\n});\n/* ========================================================================== */\n/* First Value Resolution */\n/* ========================================================================== */\n/**\n * Determines how to handle the first value token.\n *\n * If it matches a known subcommand:\n * - Collect inherited parent flags from remaining tokens (npm-style)\n * - Return SubcommandResult with child tokens\n *\n * Otherwise:\n * - Return Argument to treat it as a positional argument\n * - Report error if command expects subcommand but got unknown value\n */\nconst resolveFirstValue = (value, cursor, context, state) => {\n const {\n command,\n commandPath,\n inheritedFlagRegistry,\n localFlagNames\n } = context;\n const subIndex = buildSubcommandIndex(command.subcommands);\n const sub = subIndex.get(value);\n if (sub) {\n const selectedPath = [...commandPath, sub.name];\n // Local flags are not inherited by subcommands.\n const parentFlags = state.flags.snapshot();\n for (const localFlagName of localFlagNames) {\n const values = parentFlags[localFlagName];\n if (values !== undefined && values.length > 0) {\n state.errors.push(new CliError.UnrecognizedOption({\n option: `--${localFlagName}`,\n suggestions: [],\n command: selectedPath\n }));\n }\n }\n // npm-style: inherited parent flags can appear after subcommand name\n const tail = consumeKnownFlags(cursor.rest(), inheritedFlagRegistry);\n state.flags.merge(tail.flagMap);\n state.errors.push(...tail.errors);\n return {\n _tag: \"Subcommand\",\n result: {\n _tag: \"Sub\",\n flags: state.flags.snapshot(),\n sub,\n childTokens: tail.remainder,\n errors: state.errors\n }\n };\n }\n // Not a subcommand. Check if this looks like a typo.\n const expectsArgs = toImpl(command).config.arguments.length > 0;\n if (!expectsArgs && subIndex.size > 0) {\n // Exclude hidden subcommands so a typo cannot reveal a subcommand name\n // that was intentionally kept out of --help. Hidden commands still\n // resolve via subIndex when invoked by exact name.\n const visibleKeys = [];\n for (const [key, sub] of subIndex) {\n if (!sub.hidden) visibleKeys.push(key);\n }\n const suggestions = suggest(value, visibleKeys);\n state.errors.push(new CliError.UnknownSubcommand({\n subcommand: value,\n parent: commandPath,\n suggestions\n }));\n }\n return {\n _tag: \"Argument\"\n };\n};\n/* ========================================================================== */\n/* Token Processing */\n/* ========================================================================== */\n/**\n * Processes a flag token: looks up in registry, consumes value, records it.\n * Reports unrecognized flags as errors.\n */\nconst processFlag = (token, cursor, context, state) => {\n const {\n commandPath,\n flagRegistry\n } = context;\n const resolved = resolveFlag(token, flagRegistry);\n if (!resolved) {\n state.errors.push(createUnrecognizedFlagError(token, flagRegistry.params, commandPath));\n return;\n }\n const consumed = consumeFlagValue(cursor, token, resolved.param, resolved.negated);\n if (consumed._tag === \"Error\") {\n state.errors.push(consumed.error);\n return;\n }\n state.flags.add(resolved.param.name, consumed.value);\n};\n/**\n * Processes a value token based on current parsing mode.\n *\n * In AwaitingFirstValue mode:\n * - Check if value is a subcommand\n * - If so, return SubcommandResult to exit scanning\n * - If not, switch to CollectingArguments mode\n *\n * In CollectingArguments mode:\n * - Simply add value to arguments list\n */\nconst processValue = (value, cursor, context, state) => {\n if (state.mode._tag === \"AwaitingFirstValue\") {\n const result = resolveFirstValue(value, cursor, context, state);\n if (result._tag === \"Subcommand\") {\n return result.result;\n }\n state.mode = {\n _tag: \"CollectingArguments\"\n };\n }\n state.arguments.push(value);\n return undefined;\n};\n/* ========================================================================== */\n/* Command Level Scanning */\n/* ========================================================================== */\n/**\n * Scans a single command level, processing all tokens.\n *\n * For each token:\n * - Flags: Look up, consume value, record in accumulator\n * - Values: Check for subcommand (first value only), then collect as arguments\n *\n * Returns LeafResult if no subcommand detected, SubcommandResult otherwise.\n */\nconst scanCommandLevel = (tokens, context) => {\n const cursor = makeCursor(tokens);\n const state = createParseState(context.flagRegistry);\n for (let token = cursor.take(); token; token = cursor.take()) {\n if (isFlagToken(token)) {\n processFlag(token, cursor, context, state);\n continue;\n }\n if (token._tag === \"Value\") {\n const subResult = processValue(token.value, cursor, context, state);\n if (subResult) return subResult;\n }\n }\n return toLeafResult(state);\n};\n//# sourceMappingURL=parser.js.map","import * as Console from \"../../Console.js\";\nimport * as Context from \"../../Context.js\";\nimport * as Effect from \"../../Effect.js\";\nimport { dual } from \"../../Function.js\";\nimport * as Option from \"../../Option.js\";\nimport * as Predicate from \"../../Predicate.js\";\nimport * as References from \"../../References.js\";\nimport * as Result from \"../../Result.js\";\nimport * as Stdio from \"../../Stdio.js\";\nimport * as Terminal from \"../../Terminal.js\";\nimport * as CliError from \"./CliError.js\";\nimport * as CliOutput from \"./CliOutput.js\";\nimport * as GlobalFlag from \"./GlobalFlag.js\";\nimport { checkForDuplicateFlags, makeCommand, makeParser, toImpl, TypeId } from \"./internal/command.js\";\nimport { mergeConfig, parseConfig } from \"./internal/config.js\";\nimport { getGlobalFlagsForCommandPath, getGlobalFlagsForCommandTree, getHelpForCommandPath } from \"./internal/help.js\";\nimport * as Lexer from \"./internal/lexer.js\";\nimport * as Parser from \"./internal/parser.js\";\nimport * as Param from \"./Param.js\";\n/**\n * Returns `true` if the provided value is a `Command`.\n *\n * **Gotchas**\n *\n * This checks for the `Command` type-id property; it does not validate the full\n * command shape.\n *\n * @category guards\n * @since 4.0.0\n */\nexport const isCommand = u => Predicate.hasProperty(u, TypeId);\n/* ========================================================================== */\n/* Constructors */\n/* ========================================================================== */\n/**\n * Creates a `Command` from a name, an optional configuration, and an optional\n * handler.\n *\n * **Details**\n *\n * Use `withDescription` and related metadata combinators to add help text. The\n * overloads support simple commands, configured commands, and commands with\n * effectful handlers.\n *\n * **Example** (Creating commands)\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n * import { Argument, Command, Flag } from \"effect/unstable/cli\"\n *\n * // Simple command with no configuration\n * const version = Command.make(\"version\")\n *\n * // Command with simple flags\n * const greet = Command.make(\"greet\", {\n * name: Flag.string(\"name\"),\n * count: Flag.integer(\"count\").pipe(Flag.withDefault(1))\n * })\n *\n * // Command with nested configuration\n * const deploy = Command.make(\"deploy\", {\n * environment: Flag.string(\"env\").pipe(\n * Flag.withDescription(\"Target environment\")\n * ),\n * server: {\n * host: Flag.string(\"host\").pipe(Flag.withDefault(\"localhost\")),\n * port: Flag.integer(\"port\").pipe(Flag.withDefault(3000))\n * },\n * files: Argument.string(\"files\").pipe(Argument.variadic),\n * force: Flag.boolean(\"force\").pipe(Flag.withDescription(\"Force deployment\"))\n * })\n *\n * // Command with handler\n * const deployWithHandler = Command.make(\"deploy\", {\n * environment: Flag.string(\"env\"),\n * force: Flag.boolean(\"force\")\n * }, (config) =>\n * Effect.gen(function*() {\n * yield* Console.log(`Starting deployment to ${config.environment}`)\n *\n * if (!config.force && config.environment === \"production\") {\n * return yield* Effect.fail(\"Production deployments require --force flag\")\n * }\n *\n * yield* Console.log(\"Deployment completed successfully\")\n * }))\n * ```\n *\n * @category constructors\n * @since 4.0.0\n */\nexport const make = (name, config, handler) => {\n const parsedConfig = parseConfig(config ?? {});\n return makeCommand({\n name,\n config: parsedConfig,\n ...(Predicate.isNotUndefined(handler) ? {\n handle: handler\n } : {})\n });\n};\n/* ========================================================================== */\n/* Combinators */\n/* ========================================================================== */\n/**\n * Adds or replaces the handler for a command.\n *\n * **Example** (Adding command handlers)\n *\n * ```ts\n * import { Console } from \"effect\"\n * import { Command, Flag } from \"effect/unstable/cli\"\n *\n * // Command without initial handler\n * const greet = Command.make(\"greet\", {\n * name: Flag.string(\"name\")\n * })\n *\n * // Add handler later\n * const greetWithHandler = greet.pipe(\n * Command.withHandler((config: { readonly name: string }) =>\n * Console.log(`Hello, ${config.name}!`)\n * )\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withHandler = /*#__PURE__*/dual(2, (self, handler) => makeCommand({\n ...toImpl(self),\n handle: handler\n}));\nconst normalizeSubcommandEntries = entries => {\n const flat = [];\n const grouped = new Map();\n const addToGroup = (group, command) => {\n flat.push(command);\n const existing = grouped.get(group);\n if (existing) {\n existing.push(command);\n } else {\n grouped.set(group, [command]);\n }\n };\n for (const entry of entries) {\n if (isCommand(entry)) {\n addToGroup(undefined, entry);\n continue;\n }\n for (const command of entry.commands) {\n addToGroup(entry.group, command);\n }\n }\n const groups = [];\n const ungroupedCommands = grouped.get(undefined);\n if (ungroupedCommands && ungroupedCommands.length > 0) {\n groups.push({\n group: undefined,\n commands: ungroupedCommands\n });\n }\n for (const [group, commands] of grouped) {\n if (group === undefined) {\n continue;\n }\n groups.push({\n group,\n commands\n });\n }\n return {\n flat,\n groups\n };\n};\n/**\n * Adds subcommands to a command, creating a hierarchical command structure.\n *\n * **Details**\n *\n * Subcommands can access their parent's parsed configuration by yielding the parent\n * command within their handler. This enables shared parent flags that affect\n * all subcommands.\n *\n * **Example** (Adding subcommands)\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n * import { Command, Flag } from \"effect/unstable/cli\"\n *\n * // Parent command with shared flags\n * const git = Command.make(\"git\").pipe(\n * Command.withSharedFlags({\n * verbose: Flag.boolean(\"verbose\")\n * })\n * )\n *\n * // Subcommand that accesses parent config\n * const clone = Command.make(\"clone\", {\n * repository: Flag.string(\"repo\")\n * }, (config) =>\n * Effect.gen(function*() {\n * const parent = yield* git // Access parent's parsed config\n * if (parent.verbose) {\n * yield* Console.log(\"Verbose mode enabled\")\n * }\n * yield* Console.log(`Cloning ${config.repository}`)\n * }))\n *\n * const app = git.pipe(Command.withSubcommands([clone]))\n * // Usage: git --verbose clone --repo github.com/foo/bar\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withSubcommands = /*#__PURE__*/dual(2, (self, subcommands) => {\n const normalized = normalizeSubcommandEntries(subcommands);\n checkForDuplicateFlags(self, normalized.flat);\n const impl = toImpl(self);\n const byName = new Map(normalized.flat.map(s => [s.name, toImpl(s)]));\n const SubcommandStateSymbol = Symbol(\"effect/cli/SubcommandState\");\n const parse = Effect.fnUntraced(function* (raw) {\n if (Option.isNone(raw.subcommand)) {\n return yield* impl.parse(raw);\n }\n const sub = byName.get(raw.subcommand.value.name);\n if (!sub) {\n return yield* impl.parse(raw);\n }\n const context = yield* impl.parseContext(raw);\n const result = yield* sub.parse(raw.subcommand.value.parsedInput);\n return Object.assign({}, context, {\n [SubcommandStateSymbol]: {\n name: sub.name,\n result\n }\n });\n });\n const handle = Effect.fnUntraced(function* (input, path) {\n const internal = input;\n const selectedSubcommand = internal[SubcommandStateSymbol];\n if (selectedSubcommand) {\n const child = byName.get(selectedSubcommand.name);\n if (!child) {\n return yield* new CliError.ShowHelp({\n commandPath: path,\n errors: []\n });\n }\n return yield* child.handle(selectedSubcommand.result, [...path, child.name]).pipe(Effect.provideService(impl.service, input));\n }\n return yield* impl.handle(input, path);\n });\n return makeCommand({\n name: impl.name,\n config: impl.config,\n contextConfig: impl.contextConfig,\n description: impl.description,\n shortDescription: impl.shortDescription,\n alias: impl.alias,\n annotations: impl.annotations,\n globalFlags: impl.globalFlags,\n examples: impl.examples,\n service: impl.service,\n subcommands: normalized.groups,\n parse,\n parseContext: impl.parseContext,\n handle\n });\n});\n/**\n * Adds flags that are inherited by subcommands.\n *\n * **Details**\n *\n * Shared flags are available to this command's handler and to descendant\n * handlers via `yield* parentCommand`. Shared flags are accepted both before\n * and after a selected subcommand name (npm-style).\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withSharedFlags = /*#__PURE__*/dual(2, (self, sharedFlags) => {\n const impl = toImpl(self);\n const sharedConfig = parseConfig(sharedFlags);\n const mergedConfig = mergeConfig(impl.config, sharedConfig);\n const mergedContextConfig = mergeConfig(impl.contextConfig, sharedConfig);\n if (impl.subcommands.length > 0) {\n const flatSubcommands = impl.subcommands.flatMap(group => group.commands);\n checkForDuplicateFlags(self, flatSubcommands, {\n contextConfig: mergedContextConfig\n });\n }\n const parseShared = makeParser(sharedConfig);\n const parse = Effect.fnUntraced(function* (raw) {\n const base = yield* impl.parse(raw);\n const shared = yield* parseShared(raw);\n return Object.assign({}, base, shared);\n });\n const parseContext = Effect.fnUntraced(function* (raw) {\n const base = yield* impl.parseContext(raw);\n const shared = yield* parseShared(raw);\n return Object.assign({}, base, shared);\n });\n const handle = (input, commandPath) => impl.handle(input, commandPath);\n return makeCommand({\n name: impl.name,\n config: mergedConfig,\n contextConfig: mergedContextConfig,\n description: impl.description,\n shortDescription: impl.shortDescription,\n alias: impl.alias,\n annotations: impl.annotations,\n globalFlags: impl.globalFlags,\n examples: impl.examples,\n service: impl.service,\n subcommands: impl.subcommands,\n parse,\n parseContext,\n handle\n });\n});\n/**\n * Adds global flags to a command scope.\n *\n * **Details**\n *\n * Declared global flags apply to the command and all of its descendants.\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withGlobalFlags = /*#__PURE__*/dual(2, (self, globalFlags) => {\n const impl = toImpl(self);\n const next = Array.from(new Set([...impl.globalFlags, ...globalFlags]));\n return makeCommand({\n ...impl,\n globalFlags: next\n });\n});\n/**\n * Sets the description for a command.\n *\n * **Details**\n *\n * Descriptions provide users with information about what the command does\n * when they view help documentation.\n *\n * **Example** (Setting descriptions)\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n * import { Command, Flag } from \"effect/unstable/cli\"\n *\n * const deploy = Command.make(\"deploy\", {\n * environment: Flag.string(\"env\")\n * }, (config) =>\n * Effect.gen(function*() {\n * yield* Console.log(`Deploying to ${config.environment}`)\n * })).pipe(\n * Command.withDescription(\"Deploy the application to a specified environment\")\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withDescription = /*#__PURE__*/dual(2, (self, description) => makeCommand({\n ...toImpl(self),\n description\n}));\n/**\n * Sets a short description for a command.\n *\n * **Details**\n *\n * Short descriptions are used when listing subcommands in help output and\n * shell completions. If no short description is provided, the full\n * `description` is used as a fallback.\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withShortDescription = /*#__PURE__*/dual(2, (self, shortDescription) => makeCommand({\n ...toImpl(self),\n shortDescription\n}));\n/**\n * Sets an alias for a command.\n *\n * **Details**\n *\n * Aliases are accepted as alternate subcommand names during parsing and are\n * shown in help output as `name, alias`.\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withAlias = /*#__PURE__*/dual(2, (self, alias) => makeCommand({\n ...toImpl(self),\n alias\n}));\n/**\n * Hides a subcommand from parent help output, shell completions, and\n * \"did you mean?\" suggestions while keeping it fully invocable by exact name.\n *\n * **When to use**\n *\n * Use when experimental or internal subcommands should be accepted but not advertised on\n * the public CLI surface.\n *\n * **Example** (Hiding a subcommand)\n *\n * ```ts\n * import { Command } from \"effect/unstable/cli\"\n *\n * // `experimental` still runs when invoked as `mycli experimental`,\n * // but it does not appear under SUBCOMMANDS in `mycli --help`.\n * const experimental = Command.make(\"experimental\").pipe(\n * Command.withHidden\n * )\n *\n * const root = Command.make(\"mycli\").pipe(\n * Command.withSubcommands([experimental])\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withHidden = self => makeCommand({\n ...toImpl(self),\n hidden: true\n});\n/**\n * Adds a custom annotation to a command.\n *\n * **When to use**\n *\n * Use to attach one command-scoped metadata value under a `Context.Key`,\n * especially for consumers such as custom help formatters.\n *\n * **Details**\n *\n * Annotations are stored on the command's annotation context and flow into\n * generated help document annotations.\n *\n * **Gotchas**\n *\n * Adding the same `Context.Key` again replaces the earlier value.\n *\n * @see {@link annotateMerge} for merging an existing annotation context\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const annotate = /*#__PURE__*/dual(3, (self, service, value) => {\n const impl = toImpl(self);\n return makeCommand({\n ...impl,\n annotations: Context.add(impl.annotations, service, value)\n });\n});\n/**\n * Merges a Context of annotations into a command.\n *\n * **When to use**\n *\n * Use when you need to attach an already-built `Context.Context` of command\n * annotations.\n *\n * **Details**\n *\n * Merged annotations are stored on the command and exposed through generated\n * help document annotations.\n *\n * **Gotchas**\n *\n * If both contexts contain the same `Context.Key`, the incoming annotations\n * context wins.\n *\n * @see {@link annotate} for adding a single annotation without constructing a `Context`\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const annotateMerge = /*#__PURE__*/dual(2, (self, annotations) => {\n const impl = toImpl(self);\n return makeCommand({\n ...impl,\n annotations: Context.merge(impl.annotations, annotations)\n });\n});\n/**\n * Sets usage examples for a command.\n *\n * **Details**\n *\n * Examples are exposed in structured `HelpDoc` data and rendered by the\n * default formatter in an `EXAMPLES` section.\n *\n * **Example** (Adding usage examples)\n *\n * ```ts\n * import { Command } from \"effect/unstable/cli\"\n *\n * const login = Command.make(\"login\").pipe(\n * Command.withExamples([\n * { command: \"myapp login\", description: \"Log in with browser OAuth\" },\n * { command: \"myapp login --token sbp_abc123\", description: \"Log in with a token\" }\n * ])\n * )\n * ```\n *\n * @category combinators\n * @since 4.0.0\n */\nexport const withExamples = /*#__PURE__*/dual(2, (self, examples) => makeCommand({\n ...toImpl(self),\n examples\n}));\n/* ========================================================================== */\n/* Providing Services */\n/* ========================================================================== */\n// Internal helper: transforms a command's handler while preserving other properties\nconst mapHandler = (self, f) => {\n const impl = toImpl(self);\n return makeCommand({\n ...impl,\n handle: (input, path) => f(impl.handle(input, path), input)\n });\n};\n/**\n * Provides the handler of a command with the services produced by a layer\n * that optionally depends on the command-line input to be created.\n *\n * **Example** (Providing command services)\n *\n * ```ts\n * import { Effect, FileSystem, PlatformError } from \"effect\"\n * import { Command, Flag } from \"effect/unstable/cli\"\n *\n * const deploy = Command.make(\"deploy\", {\n * env: Flag.string(\"env\")\n * }, (config) =>\n * Effect.gen(function*() {\n * const fs = yield* FileSystem.FileSystem\n * // Use fs...\n * })).pipe(\n * // Provide FileSystem based on the --env flag\n * Command.provide((config) =>\n * config.env === \"local\"\n * ? FileSystem.layerNoop({})\n * : FileSystem.layerNoop({\n * access: () =>\n * Effect.fail(\n * PlatformError.badArgument({\n * module: \"FileSystem\",\n * method: \"access\"\n * })\n * )\n * })\n * )\n * )\n * ```\n *\n * @category providing services\n * @since 4.0.0\n */\nexport const provide = /*#__PURE__*/dual(args => isCommand(args[0]), (self, layer, options) => mapHandler(self, (handler, input) => Effect.provide(handler, typeof layer === \"function\" ? layer(input) : layer, options)));\n/**\n * Provides the handler of a command with the implementation of a service that\n * optionally depends on the command-line input to be constructed.\n *\n * **When to use**\n *\n * Use when a command handler needs a pure service implementation, optionally\n * derived from the parsed command input.\n *\n * @category providing services\n * @since 4.0.0\n */\nexport const provideSync = /*#__PURE__*/dual(3, (self, service, implementation) => mapHandler(self, (handler, input) => Effect.provideService(handler, service, typeof implementation === \"function\" ? implementation(input) : implementation)));\n/**\n * Provides the handler of a command with the service produced by an effect\n * that optionally depends on the command-line input to be created.\n *\n * **When to use**\n *\n * Use to acquire a service effectfully for each command run, optionally using\n * parsed command input.\n *\n * @see {@link provideSync} for synchronous service acquisition\n * @see {@link provide} for providing an already-available service\n * @see {@link provideEffectDiscard} for running an effect before the handler without providing a service\n *\n * @category providing services\n * @since 4.0.0\n */\nexport const provideEffect = /*#__PURE__*/dual(3, (self, service, effect) => mapHandler(self, (handler, input) => Effect.provideServiceEffect(handler, service, typeof effect === \"function\" ? effect(input) : effect)));\n/**\n * Allows for execution of an effect, which optionally depends on command-line\n * input to be created, prior to executing the handler of a command.\n *\n * @category providing services\n * @since 4.0.0\n */\nexport const provideEffectDiscard = /*#__PURE__*/dual(2, (self, effect) => mapHandler(self, (handler, input) => Effect.andThen(typeof effect === \"function\" ? effect(input) : effect, handler)));\n/* ========================================================================== */\n/* Execution */\n/* ========================================================================== */\nconst getOutOfScopeGlobalFlagErrors = (allFlags, activeFlags, flagMap, commandPath) => {\n const activeSet = new Set(activeFlags);\n const errors = [];\n const seen = new Set();\n for (const flag of allFlags) {\n if (activeSet.has(flag)) {\n continue;\n }\n const singles = Param.extractSingleParams(flag.flag);\n for (const single of singles) {\n const entries = flagMap[single.name];\n if (!entries || entries.length === 0) {\n continue;\n }\n const option = `--${single.name}`;\n if (seen.has(option)) {\n continue;\n }\n seen.add(option);\n errors.push(new CliError.UnrecognizedOption({\n option,\n suggestions: [],\n command: commandPath\n }));\n }\n }\n return errors;\n};\nconst showHelp = (command, error) => Effect.gen(function* () {\n const formatter = yield* CliOutput.Formatter;\n const helpDoc = yield* getHelpForCommandPath(command, error.commandPath, GlobalFlag.BuiltIns);\n yield* Console.log(formatter.formatHelpDoc(helpDoc));\n if (error.errors.length > 0) {\n yield* Console.error(formatter.formatErrors(error.errors));\n }\n});\n/**\n * Runs a command using the arguments supplied by the `Stdio` service.\n *\n * **When to use**\n *\n * Use when command-line arguments should come from `Stdio` at the application\n * entry point.\n *\n * **Example** (Running commands with standard input)\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n * import { Command, Flag } from \"effect/unstable/cli\"\n *\n * const greetCommand = Command.make(\"greet\", {\n * name: Flag.string(\"name\")\n * }, (config) =>\n * Effect.gen(function*() {\n * yield* Console.log(`Hello, ${config.name}!`)\n * }))\n *\n * // Automatically gets args from the Stdio service\n * const program = Command.run(greetCommand, {\n * version: \"1.0.0\"\n * })\n * ```\n *\n * @see {@link runWith} for running a command with an explicit argument array\n *\n * @category command execution\n * @since 4.0.0\n */\nexport const run = /*#__PURE__*/dual(2, (command, config) => Stdio.Stdio.use(({\n args\n}) => Effect.flatMap(args, args => runWith(command, config)(args))));\n/**\n * Runs a command with explicitly provided arguments instead of using arguments from `Stdio`.\n *\n * **When to use**\n *\n * Use when you need to test CLI applications or programmatically execute\n * commands with specific arguments.\n *\n * **Example** (Running commands with explicit arguments)\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n * import { Command, Flag } from \"effect/unstable/cli\"\n *\n * const greet = Command.make(\"greet\", {\n * name: Flag.string(\"name\"),\n * count: Flag.integer(\"count\").pipe(Flag.withDefault(1))\n * }, (config) =>\n * Effect.gen(function*() {\n * for (let i = 0; i < config.count; i++) {\n * yield* Console.log(`Hello, ${config.name}!`)\n * }\n * }))\n *\n * // Test with specific arguments\n * const testProgram = Effect.gen(function*() {\n * const runCommand = Command.runWith(greet, { version: \"1.0.0\" })\n *\n * // Test normal execution\n * yield* runCommand([\"--name\", \"Alice\", \"--count\", \"2\"])\n *\n * // Test help display\n * yield* runCommand([\"--help\"])\n *\n * // Test version display\n * yield* runCommand([\"--version\"])\n * })\n * ```\n *\n * @category command execution\n * @since 4.0.0\n */\nexport const runWith = (command, config) => {\n const commandImpl = toImpl(command);\n return Effect.fnUntraced(function* (args) {\n const {\n tokens,\n trailingOperands\n } = Lexer.lex(args);\n // 1. Collect known global flags from the command tree\n const allFlags = getGlobalFlagsForCommandTree(command, GlobalFlag.BuiltIns);\n // 2. Extract global flag tokens\n const allFlagParams = allFlags.flatMap(f => Param.extractSingleParams(f.flag));\n const globalRegistry = Parser.createFlagRegistry(allFlagParams.filter(Param.isFlagParam));\n const {\n flagMap,\n remainder,\n errors: globalFlagErrors\n } = Parser.consumeGlobalFlags(tokens, command, globalRegistry);\n const emptyArgs = {\n flags: flagMap,\n arguments: []\n };\n // 3. Parse command arguments from remaining tokens\n const parsedArgs = yield* Parser.parseArgs({\n tokens: remainder,\n trailingOperands\n }, command);\n const commandPath = [command.name, ...Parser.getCommandPath(parsedArgs)];\n const handlerCtx = {\n command,\n commandPath,\n version: config.version\n };\n const activeFlags = getGlobalFlagsForCommandPath(command, commandPath, GlobalFlag.BuiltIns);\n // 4. Reject globals that were passed outside the active command scope\n const outOfScopeErrors = getOutOfScopeGlobalFlagErrors(allFlags, activeFlags, flagMap, commandPath);\n if (outOfScopeErrors.length > 0 || globalFlagErrors.length > 0) {\n const parseErrors = parsedArgs.errors ?? [];\n return yield* new CliError.ShowHelp({\n commandPath,\n errors: [...globalFlagErrors, ...outOfScopeErrors, ...parseErrors]\n });\n }\n // 5. Process action flags — first present action wins, then exit\n for (const flag of activeFlags) {\n if (flag._tag !== \"Action\") continue;\n const singles = Param.extractSingleParams(flag.flag);\n const hasEntry = singles.some(s => {\n const entries = flagMap[s.name];\n return entries !== undefined && entries.length > 0;\n });\n if (!hasEntry) continue;\n const [, value] = yield* flag.flag.parse(emptyArgs);\n yield* flag.run(value, handlerCtx);\n return;\n }\n // 6. Handle parsing errors\n if (parsedArgs.errors && parsedArgs.errors.length > 0) {\n return yield* new CliError.ShowHelp({\n commandPath,\n errors: parsedArgs.errors\n });\n }\n const parseResult = yield* Effect.result(commandImpl.parse(parsedArgs));\n if (parseResult._tag === \"Failure\") {\n return yield* new CliError.ShowHelp({\n commandPath,\n errors: [parseResult.failure]\n });\n }\n // 7. Provide setting values\n let program = commandImpl.handle(parseResult.success, [command.name]);\n for (const flag of activeFlags) {\n if (flag._tag !== \"Setting\") continue;\n const [, value] = yield* flag.flag.parse(emptyArgs);\n program = Effect.provideService(program, flag, value);\n }\n const [, logLevel] = yield* GlobalFlag.LogLevel.flag.parse(emptyArgs);\n program = Effect.provideService(program, GlobalFlag.LogLevel, logLevel);\n // 8. Apply built-in setting behavior\n const services = Option.match(logLevel, {\n onNone: () => Context.empty(),\n onSome: level => Context.make(References.MinimumLogLevel, level)\n });\n // 9. Run command handler with composed context\n yield* Effect.provideContext(program, services);\n }, Effect.catchFilter(error => CliError.isCliError(error) && error._tag === \"ShowHelp\" ? Result.succeed(error) : Result.fail(error), error => Effect.andThen(showHelp(command, error), Effect.fail(error))), Effect.catchFilter(e => Terminal.isQuitError(e) ? Result.succeed(e) : Result.fail(e), _ => Effect.interrupt));\n};\n//# sourceMappingURL=Command.js.map","/**\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","import * as Runtime from \"effect/Runtime\";\n/**\n * Runs an Effect as the Node process main program, interrupting the fiber on\n * `SIGINT` or `SIGTERM` and invoking the configured teardown to determine the\n * process exit code.\n *\n * @category running\n * @since 4.0.0\n */\nexport const runMain = /*#__PURE__*/Runtime.makeRunMain(({\n fiber,\n teardown\n}) => {\n let receivedSignal = false;\n fiber.addObserver(exit => {\n process.removeListener(\"SIGINT\", onSigint);\n process.removeListener(\"SIGTERM\", onSigint);\n teardown(exit, code => {\n if (receivedSignal || code !== 0) {\n process.exit(code);\n }\n });\n });\n function onSigint() {\n receivedSignal = true;\n fiber.interruptUnsafe(fiber.id);\n }\n process.on(\"SIGINT\", onSigint);\n process.on(\"SIGTERM\", onSigint);\n});\n//# sourceMappingURL=NodeRuntime.js.map","/**\n * Node.js process runner for Effect programs.\n *\n * This module exports `runMain`, which runs one Effect as the main process\n * fiber in Node.js. It reuses the shared Node runtime runner, including its\n * error reporting, `SIGINT` / `SIGTERM` interruption, and optional teardown\n * behavior.\n *\n * @since 4.0.0\n */\nimport * as NodeRuntime from \"@effect/platform-node-shared/NodeRuntime\";\n/**\n * Helps you run a main effect with built-in error handling, logging, and signal management.\n *\n * **When to use**\n *\n * Use to run a Node.js application's main Effect with structured error\n * handling, log management, interrupt support, or advanced teardown\n * capabilities.\n *\n * **Details**\n *\n * This function launches an Effect as the main entry point, setting exit codes\n * based on success or failure, handling interrupts (e.g., Ctrl+C), and optionally\n * logging errors. By default, it logs errors and uses a \"pretty\" format, but both\n * behaviors can be turned off. You can also provide custom teardown logic to\n * finalize resources or produce different exit codes.\n *\n * The optional configuration object can include:\n * - `disableErrorReporting`: Turn off automatic error logging.\n * - `teardown`: Provide custom finalization logic.\n *\n * @category running\n * @since 4.0.0\n */\nexport const runMain = NodeRuntime.runMain;\n//# sourceMappingURL=NodeRuntime.js.map","import { Array, Order, Schema, pipe } from 'effect'\n\nexport const LoomLockSchema = Schema.Struct({\n version: Schema.Literal(1),\n tangled: Schema.Array(Schema.String),\n})\n\nexport type LoomLock = typeof LoomLockSchema.Type\n\nexport const emptyLock: LoomLock = { version: 1, tangled: [] }\n\nexport const orphansOf = (\n lock: LoomLock,\n produced: ReadonlySet<string>,\n): ReadonlyArray<string> =>\n Array.filter(lock.tangled, (path) => !produced.has(path))\n\nconst sortedUnique = (paths: ReadonlyArray<string>): ReadonlyArray<string> =>\n pipe(paths, Array.dedupe, Array.sort(Order.String))\n\nexport const recorded = (\n lock: LoomLock,\n produced: ReadonlyArray<string>,\n): LoomLock => ({ version: 1, tangled: sortedUnique([...lock.tangled, ...produced]) })\n\nexport const pruned = (produced: ReadonlyArray<string>): LoomLock => ({\n version: 1,\n tangled: sortedUnique(produced),\n})\n","import { Array, Context, Effect, FileSystem, Layer, Option, Result, Schema, Stream, pipe } from 'effect'\nimport { dirname, relative, resolve as resolvePath } from 'node:path'\nimport { type Path } from '@athrio/loom-ast/LoomCorpusAst'\nimport { workspaceRoot } from '@athrio/loom-lang-services/LoomStore'\nimport { LoomCompiler, ignoredDirs, type TangledFile, type TangleError } from './LoomCompiler'\nimport { PackageConfig } from './PackageConfig'\nimport {\n emptyLock,\n orphansOf,\n pruned,\n recorded,\n LoomLockSchema,\n type LoomLock,\n} from './LoomLock'\n\nconst isStorePath = (name: string): boolean =>\n name.split('/').some((segment) => ignoredDirs.has(segment))\n\nexport class LoomTangler extends Context.Service<LoomTangler>()('LoomTangler', {\n make: Effect.gen(function* () {\n const compiler = yield* LoomCompiler\n const fs = yield* FileSystem.FileSystem\n const config = yield* PackageConfig\n\n const matchesDisk = (file: TangledFile): Effect.Effect<boolean> =>\n fs.readFileString(file.path).pipe(\n Effect.option,\n Effect.map(Option.contains(file.content)),\n )\n\n const writeFile = (file: TangledFile): Effect.Effect<TangledFile> =>\n matchesDisk(file).pipe(\n Effect.flatMap((same) =>\n same\n ? Effect.void\n : fs\n .makeDirectory(dirname(file.path), { recursive: true })\n .pipe(Effect.andThen(fs.writeFileString(file.path, file.content))),\n ),\n Effect.orDie,\n Effect.as(file),\n )\n\n const tangleFile = (\n entry: Path,\n ): Effect.Effect<ReadonlyArray<TangledFile>, TangleError> =>\n compiler\n .tangle(entry)\n .pipe(Effect.flatMap((files) => Effect.forEach(files, writeFile)))\n\n const loomsUnder = (dir: Path): Effect.Effect<ReadonlyArray<Path>> =>\n fs.readDirectory(dir, { recursive: true }).pipe(\n Effect.orDie,\n Effect.map((names) =>\n pipe(\n names,\n Array.filter((name) => name.endsWith('.loom') && !isStorePath(name)),\n Array.map((name) => resolvePath(dir, name)),\n ),\n ),\n )\n\n const loomsOf = (path: Path): Effect.Effect<ReadonlyArray<Path>> =>\n fs.stat(path).pipe(\n Effect.orDie,\n Effect.flatMap((info) =>\n info.type === 'Directory'\n ? loomsUnder(path)\n : Effect.succeed<ReadonlyArray<Path>>([path]),\n ),\n )\n\n const workspaceOf = (path: Path): Effect.Effect<Path> =>\n fs.stat(path).pipe(\n Effect.orDie,\n Effect.map((info) =>\n workspaceRoot(info.type === 'Directory' ? path : dirname(path)),\n ),\n )\n\n const lockFile = (root: Path): Path =>\n resolvePath(root, '.loom', 'loom.lock')\n\n const readLock = (root: Path): Effect.Effect<LoomLock> =>\n fs.readFileString(lockFile(root)).pipe(\n Effect.flatMap((text) => Effect.try(() => JSON.parse(text) as unknown)),\n Effect.flatMap(Schema.decodeUnknownEffect(LoomLockSchema)),\n Effect.orElseSucceed(() => emptyLock),\n )\n\n const writeLock = (root: Path, lock: LoomLock): Effect.Effect<void> =>\n fs\n .makeDirectory(dirname(lockFile(root)), { recursive: true })\n .pipe(\n Effect.andThen(\n fs.writeFileString(\n lockFile(root),\n JSON.stringify(lock, null, 2) + '\\n',\n ),\n ),\n Effect.orDie,\n )\n\n const tangle = (\n path: Path,\n ): Effect.Effect<ReadonlyArray<TangledFile>, TangleError> =>\n Effect.gen(function* () {\n const looms = yield* loomsOf(path)\n const written = (yield* Effect.forEach(looms, tangleFile)).flat()\n const root = yield* workspaceOf(path)\n const lock = yield* readLock(root)\n yield* writeLock(\n root,\n recorded(lock, Array.map(written, (file) => relative(root, file.path))),\n )\n return written\n })\n\n const orphanState = (\n from: Path,\n ): Effect.Effect<\n {\n readonly root: Path\n readonly produced: ReadonlyArray<string>\n readonly orphans: ReadonlyArray<string>\n },\n TangleError\n > =>\n Effect.gen(function* () {\n const root = workspaceRoot(from)\n const looms = yield* loomsUnder(root)\n const files = (\n yield* Effect.forEach(looms, (loom) => compiler.tangle(loom))\n ).flat()\n const produced = Array.map(files, (file) => relative(root, file.path))\n const lock = yield* readLock(root)\n return { root, produced, orphans: orphansOf(lock, new Set(produced)) }\n })\n\n const orphans = (\n from: Path,\n ): Effect.Effect<ReadonlyArray<Path>, TangleError> =>\n orphanState(from).pipe(\n Effect.map(({ root, orphans }) =>\n Array.map(orphans, (rel) => resolvePath(root, rel)),\n ),\n )\n\n const prune = (\n from: Path,\n ): Effect.Effect<ReadonlyArray<Path>, TangleError> =>\n Effect.gen(function* () {\n const { root, produced, orphans } = yield* orphanState(from)\n yield* Effect.forEach(orphans, (rel) =>\n fs.remove(resolvePath(root, rel), { force: true }).pipe(Effect.orDie),\n )\n yield* writeLock(root, pruned(produced))\n return Array.map(orphans, (rel) => resolvePath(root, rel))\n })\n\n const batchWindow = '50 millis'\n const batchLimit = 1000\n\n const isLoomEvent = (event: FileSystem.WatchEvent): boolean =>\n event.path.endsWith('.loom') && !isStorePath(event.path)\n\n const watchRoot = (path: Path): Effect.Effect<Path> =>\n fs.stat(path).pipe(\n Effect.orDie,\n Effect.flatMap((info) =>\n info.type === 'Directory'\n ? Effect.succeed(path)\n : config.resolve(path).pipe(\n Effect.map(({ corpusDir }) =>\n Option.getOrElse(Option.fromNullishOr(corpusDir), () => dirname(path)),\n ),\n ),\n ),\n )\n\n const watch = (\n path: Path,\n ): Stream.Stream<Result.Result<ReadonlyArray<TangledFile>, TangleError>> =>\n Stream.unwrap(\n watchRoot(path).pipe(\n Effect.map((root) =>\n Stream.concat(\n Stream.fromEffect(Effect.result(tangle(path))),\n fs.watch(root).pipe(\n Stream.filter(isLoomEvent),\n Stream.groupedWithin(batchLimit, batchWindow),\n Stream.mapEffect((events) =>\n Effect.forEach(\n Array.dedupe(\n Array.map(events, (event) => resolvePath(root, event.path)),\n ),\n (changed) => compiler.invalidate(changed),\n { discard: true },\n ).pipe(Effect.andThen(Effect.result(tangle(path)))),\n ),\n Stream.orDie,\n ),\n ),\n ),\n ),\n )\n\n return { tangle, orphans, prune, watch }\n }),\n}) {\n static readonly layer = Layer.effect(this, this.make).pipe(\n Layer.provide(LoomCompiler.layer),\n )\n}\n","import { Context, Effect, FileSystem, Layer } from 'effect'\nimport { dirname } from 'node:path'\nimport { type Path } from '@athrio/loom-ast/LoomCorpusAst'\nimport { LoomCompiler } from '../LoomCompiler'\n\nexport class LoomWeaver extends Context.Service<LoomWeaver>()('LoomWeaver', {\n make: Effect.gen(function* () {\n const compiler = yield* LoomCompiler\n const fs = yield* FileSystem.FileSystem\n\n const weave = (entry: Path, out: Path): Effect.Effect<Path> =>\n compiler.weave(entry).pipe(\n Effect.map((corpus) => JSON.stringify(corpus, null, 2)),\n Effect.flatMap((json) =>\n fs\n .makeDirectory(dirname(out), { recursive: true })\n .pipe(\n Effect.andThen(fs.writeFileString(out, json)),\n Effect.orDie,\n Effect.as(out),\n ),\n ),\n )\n\n return { weave }\n }),\n}) {\n static readonly layer = Layer.effect(this, this.make).pipe(\n Layer.provide(LoomCompiler.layer),\n )\n}\n","import { Context, Effect, FileSystem, Layer } from 'effect'\nimport { type Path } from '@athrio/loom-ast/LoomCorpusAst'\nimport { LoomCompiler } from '../LoomCompiler'\n\nexport class LoomContents extends Context.Service<LoomContents>()('LoomContents', {\n make: Effect.gen(function* () {\n const compiler = yield* LoomCompiler\n const fs = yield* FileSystem.FileSystem\n\n const write = (entry: Path): Effect.Effect<Path> =>\n compiler.contents(entry).pipe(\n Effect.flatMap((text) =>\n fs.writeFileString(entry, text).pipe(Effect.orDie, Effect.as(entry)),\n ),\n )\n\n return { write }\n }),\n}) {\n static readonly layer = Layer.effect(this, this.make).pipe(\n Layer.provide(LoomCompiler.layer),\n )\n}\n","import { Console, Effect, Option, Result, Stream } from 'effect'\nimport { Argument, Command, Flag, Prompt } from 'effect/unstable/cli'\nimport { NodeRuntime, NodeServices } from '@effect/platform-node'\nimport { existsSync, readFileSync, writeFileSync } from 'node:fs'\nimport { resolve as resolvePath } from 'node:path'\nimport {\n DocumentSource,\n type TangledFile,\n type TangleError,\n} from '@athrio/loom-lang/LoomCompiler'\nimport { LoomTangler } from '@athrio/loom-lang/LoomTangler'\nimport { LoomWeaver } from '@athrio/loom-lang/weave/LoomWeaver'\nimport { LoomContents } from '@athrio/loom-lang/weave/LoomContents'\nimport { PackageConfig } from '@athrio/loom-lang/PackageConfig'\nimport { LoomConfig } from '@athrio/loom-config/LoomConfig'\nimport {\n addService,\n installedServices,\n removeService,\n servicePackage,\n storeDir,\n workspaceRoot,\n} from '@athrio/loom-lang-services/LoomStore'\n\nconst reset = '\\x1b[0m'\nconst teal = (s: string): string => `\\x1b[38;5;44m${s}${reset}`\nconst dim = (s: string): string => `\\x1b[2m${s}${reset}`\n\nconst wordmark = [\n ' ██╗ ██████╗ ██████╗ ███╗ ███╗',\n ' ██║ ██╔═══██╗██╔═══██╗████╗ ████║',\n ' ██║ ██║ ██║██║ ██║██╔████╔██║',\n ' ██║ ██║ ██║██║ ██║██║╚██╔╝██║',\n ' ███████╗╚██████╔╝╚██████╔╝██║ ╚═╝ ██║',\n ' ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝',\n].join('\\n')\n\nconst banner = Console.log(\n `\\n${teal(wordmark)}\\n ${dim('a literate framework')}\\n`,\n)\n\nconst reportWritten = (\n written: ReadonlyArray<TangledFile>,\n): Effect.Effect<void> =>\n written.length === 0\n ? Console.log('loom: no {path} sinks to tangle')\n : Effect.forEach(\n written,\n (f) => Console.log(`loom: tangled ${f.section} → ${f.path}`),\n { discard: true },\n )\n\nconst tangleOnce = (file: string) =>\n Effect.gen(function* () {\n const tangler = yield* LoomTangler\n const written = yield* tangler.tangle(resolvePath(process.cwd(), file))\n yield* reportWritten(written)\n }).pipe(\n Effect.catchTag('TangleError', (e) =>\n Console.error(e.message).pipe(\n Effect.andThen(Effect.sync(() => void (process.exitCode = 1))),\n ),\n ),\n )\n\nconst tangleWatch = (file: string) =>\n Effect.gen(function* () {\n const tangler = yield* LoomTangler\n yield* Console.log(`loom: watching ${file} — re-tangling on change`)\n yield* Stream.runForEach(\n tangler.watch(resolvePath(process.cwd(), file)),\n Result.match({\n onSuccess: reportWritten,\n onFailure: (error: TangleError) => Console.error(error.message),\n }),\n )\n })\n\nconst tangle = (file: string, watch: boolean) =>\n watch ? tangleWatch(file) : tangleOnce(file)\n\nconst orphans = (prune: boolean) =>\n Effect.gen(function* () {\n const tangler = yield* LoomTangler\n if (prune) {\n const removed = yield* tangler.prune(process.cwd())\n yield* removed.length === 0\n ? Console.log('loom: no orphans to prune')\n : Effect.forEach(removed, (path) => Console.log(`loom: pruned ${path}`))\n } else {\n const found = yield* tangler.orphans(process.cwd())\n yield* Effect.forEach(found, (path) => Console.log(path))\n }\n }).pipe(\n Effect.catchTag('TangleError', (e) =>\n Console.error(e.message).pipe(\n Effect.andThen(Effect.sync(() => void (process.exitCode = 1))),\n ),\n ),\n )\n\nconst weave = (file: string, out: string) =>\n Effect.gen(function* () {\n const weaver = yield* LoomWeaver\n const written = yield* weaver.weave(\n resolvePath(process.cwd(), file),\n resolvePath(process.cwd(), out),\n )\n yield* Console.log(`loom: wove ${file} → ${written}`)\n })\n\nconst toc = (file: string) =>\n Effect.gen(function* () {\n const contents = yield* LoomContents\n const written = yield* contents.write(resolvePath(process.cwd(), file))\n yield* Console.log(`loom: wrote the table of contents into ${written}`)\n })\n\nconst mergeMcpConfig = (root: string): void => {\n const path = resolvePath(root, '.mcp.json')\n const existing = existsSync(path)\n ? (JSON.parse(readFileSync(path, 'utf8')) as Record<string, unknown>)\n : {}\n const servers = (existing.mcpServers as Record<string, unknown> | undefined) ?? {}\n const merged = {\n ...existing,\n mcpServers: {\n ...servers,\n loom: { type: 'http', url: 'http://localhost:5710/mcp' },\n },\n }\n writeFileSync(path, JSON.stringify(merged, null, 2) + '\\n')\n}\n\nconst init = (dir: Option.Option<string>) =>\n Effect.gen(function* () {\n const root = resolvePath(process.cwd(), Option.getOrElse(dir, () => '.'))\n const config = yield* LoomConfig\n yield* banner\n\n const configFile = resolvePath(root, '.loom', 'config.yaml')\n const configured = yield* Effect.sync(() => existsSync(configFile))\n\n if (configured) {\n yield* Console.log(`\\n ${dim(`✓ using the configuration at ${configFile}`)}\\n`)\n } else {\n const language = yield* Prompt.run(\n Prompt.text({\n message: 'Primary language for specifier-less sections',\n default: 'typescript',\n }),\n )\n const activation = yield* Prompt.run(\n Prompt.text({\n message: 'Activate editor services for (space-separated language ids)',\n default: language,\n }),\n )\n const ids = activation.split(/\\s+/).filter((id) => id.length > 0)\n yield* config.materialize(root, {\n corpus: 'corpus',\n languages: Object.fromEntries(ids.map((id) => [id, {}])),\n primary: language,\n })\n yield* Effect.sync(() =>\n writeFileSync(resolvePath(root, '.loom', '.gitignore'), 'services/\\n'),\n )\n yield* Console.log(\n `\\n ${teal('✓')} wrote ${configFile}\\n` +\n ` ${dim(`primary language: ${language}`)}\\n` +\n ` ${dim(`activated: ${ids.join(', ') || 'none'}`)}\\n`,\n )\n }\n\n yield* Effect.sync(() => mergeMcpConfig(root))\n yield* Console.log(` ${teal('✓')} wrote ${resolvePath(root, '.mcp.json')}\\n`)\n }).pipe(\n Effect.catchTag('QuitError', () => Console.log(dim('\\n Cancelled.\\n'))),\n )\n\nconst updateLanguages = (\n config: LoomConfig['Service'],\n dir: string,\n change: (ids: ReadonlyArray<string>) => ReadonlyArray<string>,\n): Effect.Effect<void> =>\n Effect.gen(function* () {\n const workspace = workspaceRoot(dir)\n const current = yield* config.manifest(workspace)\n const ids = change(Object.keys(current?.languages ?? {}))\n const languages = Object.fromEntries(\n ids.map((id) => [id, current?.languages?.[id] ?? {}]),\n )\n yield* config.materialize(workspace, { ...(current ?? {}), languages })\n })\n\nconst add = (language: string) =>\n Effect.gen(function* () {\n const config = yield* LoomConfig\n const dir = process.cwd()\n yield* addService(language, dir)\n yield* updateLanguages(config, dir, (ids) => [\n ...new Set([...ids, language]),\n ])\n yield* Console.log(\n `\\n ${teal('✓')} activated ${language}\\n` +\n ` ${dim(`store: ${storeDir(dir)}`)}\\n`,\n )\n }).pipe(\n Effect.catchTag('StoreError', (error) =>\n Console.error(\n `loom: could not install ${servicePackage(error.id)} — ${String(error.cause)}`,\n ).pipe(Effect.andThen(Effect.sync(() => void (process.exitCode = 1)))),\n ),\n )\n\nconst remove = (language: string) =>\n Effect.gen(function* () {\n const config = yield* LoomConfig\n const dir = process.cwd()\n yield* removeService(language, dir)\n yield* updateLanguages(config, dir, (ids) =>\n ids.filter((id) => id !== language),\n )\n yield* Console.log(`\\n ${teal('✓')} removed ${language}\\n`)\n })\n\nconst status = Effect.gen(function* () {\n const config = yield* LoomConfig\n const dir = process.cwd()\n const manifest = yield* config.manifest(workspaceRoot(dir))\n const primary = manifest?.primary\n const languages = Object.keys(manifest?.languages ?? {})\n const installed = new Set(yield* installedServices(dir))\n const mark = (id: string): string =>\n installed.has(id)\n ? ` ${teal('●')} ${id}`\n : ` ${dim('○')} ${id}${dim(` — run \\`loom add ${id}\\``)}`\n yield* Console.log(\n `\\n ${dim('store')} ${storeDir(dir)}\\n` +\n ` ${dim('primary')} ${primary ?? dim('(none)')}\\n` +\n ` ${dim('activated')} ${\n languages.length === 0 ? dim('(none)') : languages.join(', ')\n }\\n`,\n )\n if (languages.length > 0) yield* Console.log(`${languages.map(mark).join('\\n')}\\n`)\n})\n\nconst set = (name: string, value: string) =>\n Effect.gen(function* () {\n const config = yield* LoomConfig\n const tangler = yield* LoomTangler\n const workspace = workspaceRoot(process.cwd())\n const usage = 'usage: loom set <name> <value>'\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {\n yield* Console.error(`loom: \\`${name}\\` is not a variable name — ${usage}`)\n yield* Effect.sync(() => void (process.exitCode = 1))\n return\n }\n if (value.startsWith('=')) {\n yield* Console.error(`loom: a value cannot begin with \\`=\\`; give the name and value with a space, no \\`=\\` — ${usage}`)\n yield* Effect.sync(() => void (process.exitCode = 1))\n return\n }\n const current = yield* config.manifest(workspace)\n yield* config.materialize(workspace, {\n ...(current ?? {}),\n variables: { ...(current?.variables ?? {}), [name]: value },\n })\n const corpus = resolvePath(workspace, current?.corpus ?? 'corpus')\n const written = yield* tangler.tangle(corpus)\n yield* Console.log(`loom: set ${name} = ${value} (re-tangled ${written.length} files)`)\n }).pipe(\n Effect.catchTag('TangleError', (e) =>\n Console.error(e.message).pipe(\n Effect.andThen(Effect.sync(() => void (process.exitCode = 1))),\n ),\n ),\n )\n\nconst tangleCommand = Command.make(\n 'tangle',\n { path: Argument.string('path'), watch: Flag.boolean('watch') },\n ({ path, watch }) => tangle(path, watch),\n)\n\nconst orphansCommand = Command.make(\n 'orphans',\n { prune: Flag.boolean('prune') },\n ({ prune }) => orphans(prune),\n)\n\nconst weaveCommand = Command.make(\n 'weave',\n { path: Argument.string('path'), out: Argument.string('out') },\n ({ path, out }) => weave(path, out),\n)\n\nconst tocCommand = Command.make(\n 'toc',\n { path: Argument.string('path') },\n ({ path }) => toc(path),\n)\n\nconst initCommand = Command.make(\n 'init',\n { dir: Argument.optional(Argument.directory('dir')) },\n ({ dir }) => init(dir),\n)\n\nconst addCommand = Command.make(\n 'add',\n { language: Argument.string('language') },\n ({ language }) => add(language),\n)\n\nconst removeCommand = Command.make(\n 'remove',\n { language: Argument.string('language') },\n ({ language }) => remove(language),\n)\n\nconst statusCommand = Command.make('status', {}, () => status)\n\nconst setCommand = Command.make(\n 'set',\n { name: Argument.string('name'), value: Argument.string('value') },\n ({ name, value }) => set(name, value),\n)\n\nconst loom = Command.make('loom').pipe(\n Command.withSubcommands([\n tangleCommand,\n orphansCommand,\n weaveCommand,\n tocCommand,\n initCommand,\n addCommand,\n removeCommand,\n statusCommand,\n setCommand,\n ]),\n)\n\nconst program = Command.run(loom, {\n version: '0.0.7',\n}).pipe(\n Effect.provide(LoomTangler.layer),\n Effect.provide(LoomWeaver.layer),\n Effect.provide(LoomContents.layer),\n Effect.provide(DocumentSource.layer),\n Effect.provide(PackageConfig.layer),\n Effect.provide(LoomConfig.layer),\n Effect.provide(NodeServices.layer),\n)\n\nif (process.argv[2] === 'lsp') {\n const { createRequire } = await import('node:module')\n ;(globalThis as { require?: unknown }).require = createRequire(import.meta.url)\n const { startLanguageServer } = await import('@athrio/loom-lang/LoomServer')\n startLanguageServer()\n} else {\n NodeRuntime.runMain(program)\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,IAAMA,WAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+Bf,IAAa,cAAa,MAAKC,YAAsB,GAAGD,QAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkC9D,IAAa,qBAAb,cAAqDE,WAAkB,GAAGF,SAAO,oBAAoB,CAAC,CAAC;CACrG,MAAmB,kBAAW,oBAAoB;CAClD,QAAQG;CACR,SAAsB,yBAA6B,0BAAaA,QAAa,CAAC;CAC9E,aAA0B,0BAAaA,QAAa;AACtD,CAAC,CAAC,CAAC;;;;;;CAMD,CAACH,YAAUA;;;;;;CAMX,IAAI,UAAU;EACZ,MAAM,iBAAiB,KAAK,YAAY,SAAS,IAAI,iCAAiC,KAAK,YAAY,KAAK,QAAQ,MAAM;EAE1H,QADoB,KAAK,UAAU,sBAAsB,KAAK,OAAO,cAAc,KAAK,QAAQ,KAAK,GAAG,MAAM,sBAAsB,KAAK,YACpH;CACvB;AACF;;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAa,kBAAb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