@leostera/evalkit 0.5.0 → 0.6.1
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/CHANGELOG.md +70 -6
- package/README.md +10 -8
- package/dist/cli.mjs +1227 -258
- package/dist/dashboard/assets/index-CTJpd8q8.js +34 -0
- package/dist/dashboard/assets/index-YAabTN3X.css +2 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/files-C-U0-PWW.mjs +0 -2
- package/dist/index-db-vbqEGFaU.mjs +0 -2
- package/dist/index.d.mts +1346 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -4
- package/dist/runner.d.mts +809 -11
- package/dist/runner.d.mts.map +1 -1
- package/dist/runner.mjs +2 -2
- package/dist/share-worker.d.mts +76 -1
- package/dist/share-worker.d.mts.map +1 -1
- package/dist/share-worker.mjs +0 -2
- package/dist/share.d.mts +149 -6
- package/dist/share.d.mts.map +1 -1
- package/dist/share.mjs +1 -1
- package/dist/skills/evalkit/SKILL.md +32 -0
- package/dist/skills/evalkit-agents/SKILL.md +16 -0
- package/dist/skills/evalkit-datasets/SKILL.md +17 -0
- package/dist/skills/evalkit-evals/SKILL.md +19 -0
- package/dist/skills/evalkit-judges/SKILL.md +17 -0
- package/dist/skills/evalkit-matrices/SKILL.md +14 -0
- package/dist/skills/evalkit-results/SKILL.md +14 -0
- package/dist/{src-DoPs9Yug.mjs → src-CKqOzeBi.mjs} +448 -116
- package/dist/{src-ButXPY8P.mjs → src-CZPufWN_.mjs} +419 -94
- package/dist/{src-DzZueFn3.mjs → src-CZnDXP1K.mjs} +46 -10
- package/package.json +3 -2
- package/dist/cli.mjs.map +0 -1
- package/dist/dashboard/assets/index-D9NtA46z.css +0 -2
- package/dist/dashboard/assets/index-DrBwLKJD.js +0 -30
- package/dist/files-C-U0-PWW.mjs.map +0 -1
- package/dist/index-db-HdZXelOS.d.mts +0 -142
- package/dist/index-db-HdZXelOS.d.mts.map +0 -1
- package/dist/index-db-vbqEGFaU.mjs.map +0 -1
- package/dist/index-lOw0fmak.d.mts +0 -1028
- package/dist/index-lOw0fmak.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/share-worker.mjs.map +0 -1
- package/dist/src-ButXPY8P.mjs.map +0 -1
- package/dist/src-DoPs9Yug.mjs.map +0 -1
- package/dist/src-DzZueFn3.mjs.map +0 -1
package/dist/cli.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.mjs","names":["TypeId","tag","Size","make","Effect","Error.BadArgument","Option","internal.Size","internal.tag","make","internal.make","map","struct","make","map","array","struct","semigroup.array","semigroup.struct","red","green","magenta","cyan","white","toCode","color.toCode","make","Option","none","bold","italicized","strikethrough","underlined","SGR.setColor","color","red","InternalColor.red","green","InternalColor.green","white","InternalColor.white","blackBright","InternalColor.black","cyanBright","InternalColor.cyan","beep","cursorTo","cursorMove","cursorDown","cursorLeft","cursorSavePosition","cursorRestorePosition","cursorHide","cursorShow","eraseLines","eraseLine","combine","SGR.toEscapeSequence","SGR.reset","bold","InternalAnsi.bold","InternalAnsi.italicized","InternalAnsi.strikethrough","InternalAnsi.underlined","InternalAnsi.color","red","InternalAnsi.red","green","InternalAnsi.green","white","InternalAnsi.white","InternalAnsi.blackBright","InternalAnsi.cyanBright","InternalAnsi.combine","protoHash","protoEqual","proto","map","protoHash","protoEqual","proto","isEmpty","isText","char","text","cat","empty","hardLine","line","space","cats","hsep","vsep","InternalFlatten.isFlattened","nest","align","indent","flatten","Effect","annotate","InternalFlatten.neverFlat","InternalFlatten.alreadyFlat","InternalFlatten.flattened","InternalFlatten.isNeverFlat","InternalFlatten.isAlreadyFlat","InternalFlatten.map","protoHash","protoEqual","proto","empty","char","text","proto","unbounded","defaultPageWidth","options","Effect","InternalPipeline.cons","InternalPipeline.nil","InternalDocStream.empty","InternalDocStream.failed","InternalDocStream.char","InternalDocStream.text","InternalDocStream.isEmptyStream","InternalDocStream.isLineStream","InternalDocStream.line","InternalPipeline.undoAnnotation","InternalDocStream.pushAnnotation","InternalDocStream.popAnnotation","compact","InternalPageWidth.unbounded","pretty","remainingWidth","InternalPageWidth.remainingWidth","smart","Option","internal.char","text","internal.text","empty","internal.empty","internal.hardLine","space","internal.space","internal.cat","internal.cats","internal.hsep","internal.vsep","internal.nest","internal.align","internal.indent","internal.annotate","beep","Doc.empty","InternalAnsi.beep","cursorTo","Doc.annotate","InternalAnsi.cursorTo","cursorMove","InternalAnsi.cursorMove","cursorDown","InternalAnsi.cursorDown","cursorLeft","InternalAnsi.cursorLeft","cursorSavePosition","InternalAnsi.cursorSavePosition","cursorRestorePosition","InternalAnsi.cursorRestorePosition","cursorHide","InternalAnsi.cursorHide","cursorShow","InternalAnsi.cursorShow","eraseLines","InternalAnsi.eraseLines","eraseLine","InternalAnsi.eraseLine","internal.defaultPageWidth","internal.options","internal.compact","internal.pretty","internal.smart","render","Layout.compact","PageWidth.defaultPageWidth","Layout.pretty","Layout.options","Layout.smart","Effect","InternalAnsi.none","InternalAnsi.combine","InternalAnsi.stringify","InternalAnsiDoc.beep","InternalAnsiDoc.cursorTo","InternalAnsiDoc.cursorMove","InternalAnsiDoc.cursorDown","InternalAnsiDoc.cursorLeft","InternalAnsiDoc.cursorSavePosition","InternalAnsiDoc.cursorRestorePosition","InternalAnsiDoc.cursorHide","InternalAnsiDoc.cursorShow","InternalAnsiDoc.eraseLines","InternalAnsiDoc.eraseLine","render","InternalAnsiRender.render","optimize","Effect","InternalDoc.flatAlt","InternalDoc.isEmpty","InternalDoc.isChar","InternalDoc.text","InternalDoc.isText","InternalDoc.isCat","InternalDoc.cat","InternalDoc.isNest","InternalDoc.nest","InternalDoc.union","InternalDoc.column","InternalDoc.pageWidth","InternalDoc.nesting","InternalDoc.annotate","internal.optimize","red","internal.red","internal.magenta","cyan","internal.cyan","internal.white","text","empty","Color.white","Color.red","concat","isEmpty","toAnsiDoc","Doc.annotate","Ansi.color","Doc.cat","Ansi.bold","Doc.text","Ansi.underlined","Ansi.blackBright","isEmpty","empty","InternalSpan.empty","InternalSpan.text","Optimize.optimize","Optimize.Deep","Doc.render","Doc.empty","Doc.annotate","InternalSpan.toAnsiDoc","Ansi.bold","Doc.cat","Doc.hardLine","Doc.cats","Doc.indent","Doc.vsep","Doc.text","InternalTerminal.tag","proto","run","map","Terminal.Terminal","Terminal.QuitException","Effect","Doc.render","Doc.cursorShow","Doc.cat","Doc.eraseLine","Doc.cursorTo","Doc.eraseLines","renderBeep","Doc.beep","handleClear","Effect","Terminal.Terminal","Doc.cat","Doc.eraseLine","Doc.cursorLeft","Option","Doc.empty","Doc.cursorDown","InternalAnsiUtils.lines","InternalAnsiUtils.eraseText","Optimize.optimize","Optimize.Deep","Doc.render","NEWLINE_REGEX","renderError","Doc.annotate","Doc.text","Ansi.combine","Ansi.italicized","Ansi.red","Doc.space","Doc.hardLine","Doc.align","Doc.vsep","Doc.cursorRestorePosition","Ansi.underlined","Ansi.cyanBright","renderOutput","Ansi.bold","Doc.hsep","Doc.nest","renderNextFrame","figures","InternalAnsiUtils.figures","Ansi.blackBright","renderSubmission","Ansi.green","processCursorLeft","processCursorRight","processNext","defaultProcessor","handleRender","handleProcess","InternalPrompt.custom","TypeId","Path","TypeId","internal.TypeId","Path","internal.Path","renderBeep","Doc.beep","Option","Effect","FileSystem.FileSystem","Path.Path","handleClear","Terminal.Terminal","InternalAnsiUtils.eraseText","Doc.cat","Optimize.optimize","Optimize.Deep","Doc.render","NEWLINE_REGEX","Doc.annotate","Doc.text","Ansi.bold","Doc.space","Doc.hsep","Doc.nest","Doc.vsep","Ansi.cyanBright","Ansi.combine","Ansi.underlined","renderNextFrame","figures","InternalAnsiUtils.figures","Ansi.blackBright","Doc.hardLine","Ansi.green","Doc.empty","renderSubmission","Ansi.white","handleRender","processCursorUp","processCursorDown","handleProcess","InternalPrompt.custom","renderBeep","Doc.beep","handleClear","Effect","Terminal.Terminal","Doc.cat","Doc.eraseLine","Doc.cursorLeft","Option","Doc.empty","Doc.cursorDown","InternalAnsiUtils.lines","InternalAnsiUtils.eraseText","Optimize.optimize","Optimize.Deep","Doc.render","renderInput","Ansi.combine","Ansi.underlined","Ansi.cyanBright","Ansi.red","Doc.text","Doc.annotate","NEWLINE_REGEX","renderError","Ansi.italicized","Doc.space","Doc.hardLine","Doc.align","Doc.vsep","Doc.cursorRestorePosition","renderOutput","Ansi.bold","Doc.hsep","Doc.nest","renderNextFrame","figures","InternalAnsiUtils.figures","Ansi.blackBright","renderSubmission","Ansi.green","processBackspace","initialState","integer","InternalPrompt.custom","renderBeep","Doc.beep","renderOutput","Doc.annotate","Doc.text","Ansi.bold","Doc.cat","Doc.space","Doc.hsep","Doc.nest","Doc.vsep","Ansi.combine","Ansi.blackBright","Ansi.cyanBright","Ansi.underlined","Ansi.strikethrough","Doc.char","Doc.empty","renderNextFrame","Effect","Terminal.Terminal","figures","InternalAnsiUtils.figures","Doc.hardLine","Doc.render","renderSubmission","Ansi.green","Ansi.white","handleRender","handleClear","Doc.eraseLine","Doc.cursorLeft","InternalAnsiUtils.eraseText","Optimize.optimize","Optimize.Deep","handleProcess","InternalPrompt.custom","renderBeep","Doc.beep","Effect","Terminal.Terminal","Doc.cat","Doc.eraseLine","Doc.cursorLeft","Option","Doc.empty","Doc.cursorDown","InternalAnsiUtils.lines","InternalAnsiUtils.eraseText","Optimize.optimize","Optimize.Deep","Doc.render","Ansi.white","Ansi.blackBright","Ansi.combine","Ansi.underlined","Ansi.cyanBright","Ansi.red","Doc.annotate","Doc.text","Ansi.italicized","Doc.space","Doc.hardLine","Doc.align","Doc.vsep","Doc.cursorRestorePosition","renderOutput","Ansi.bold","Doc.nest","Doc.hsep","renderNextFrame","figures","InternalAnsiUtils.figures","Doc.cursorMove","renderSubmission","Ansi.green","handleRender","handleProcess","handleClear","InternalPrompt.custom","InternalPrompt.map","text","Doc.beep","Effect","Terminal.Terminal","Doc.cat","Doc.eraseLine","Doc.cursorLeft","InternalAnsiUtils.eraseText","Optimize.optimize","Optimize.Deep","Doc.render","Doc.annotate","Doc.char","Ansi.blackBright","Ansi.combine","Ansi.underlined","Ansi.white","Ansi.cyanBright","Doc.text","Doc.hsep","Ansi.bold","Doc.space","Doc.nest","Doc.vsep","figures","InternalAnsiUtils.figures","Ansi.green","Doc.hardLine","InternalPrompt.custom","proto","boolean","integer","text","getHelp","getHelpInternal","validate","validateInternal","wizard","wizardInternal","Option","InternalSpan.text","InternalCliConfig.normalizeCase","Effect","FileSystem.FileSystem","EffectRedacted","InternalHelpDoc.p","InternalHelpDoc.sequence","InternalTogglePrompt.toggle","InternalHelpDoc.toAnsiText","InternalPrompt.map","InternalSelectPrompt.select","InternalDatePrompt.date","InternalNumberPrompt.float","InternalNumberPrompt.integer","InternalFilePrompt.file","InternalTextPrompt.hidden","InternalTextPrompt.text","getBashCompletions","getFishCompletions","getZshCompletions","optional","repeated","getHelp","InternalCliConfig.defaultConfig","InternalHelpDoc.p","InternalHelpDoc.empty","InternalHelpDoc.sequence","Option","InternalSpan.text","InternalSpan.empty","InternalSpan.concat","InternalSpan.space","InternalSpan.spans","proto","proto","isEmpty","all","map","allTupled","makeBoth","none","text","makeSingle","Option","InternalPrimitive.text","getHelp","getHelpInternal","getUsage","getUsageInternal","mapEffect","Effect","makeMap","repeated","makeVariadic","wizard","wizardInternal","InternalHelpDoc.empty","InternalHelpDoc.descriptionList","InternalSpan.weak","InternalHelpDoc.sequence","InternalHelpDoc.p","InternalPrimitive.getHelp","InternalHelpDoc.mapDescriptionList","getMinSizeInternal","getMaxSizeInternal","InternalSpan.text","InternalSpan.concat","InternalUsage.empty","InternalUsage.named","InternalPrimitive.getChoices","InternalUsage.concat","InternalUsage.repeated","InternalUsage.optional","InternalPrimitive.getTypeName","InternalValidationError.missingValue","InternalPrimitive.validate","InternalValidationError.invalidArgument","InternalValidationError.invalidValue","InternalPrimitive.wizard","InternalNumberPrompt.integer","InternalHelpDoc.toAnsiText","InternalSelectPrompt.select","getShortDescription","InternalSpan.getText","InternalHelpDoc.getSpan","getFishCompletions","InternalPrimitive.getFishCompletions","InternalCompletion.escapeSingleQuoted","getZshCompletions","InternalPrimitive.getZshCompletions","repeated","InternalArgs.repeated","text","InternalArgs.text","cliConfig.normalizeCase","InternalTextPrompt.text","InternalPrompt.map","proto","all","map","boolean","InternalPrimitive.boolean","Option","withDefault","InternalPrimitive.choice","integer","InternalPrimitive.integer","text","InternalPrimitive.text","getHelp","getHelpInternal","getUsage","getUsageInternal","Either","optional","Effect","parseInternal","repeated","InternalHelpDoc.sequence","InternalHelpDoc.p","wizard","wizardInternal","InternalHelpDoc.empty","InternalHelpDoc.descriptionList","InternalHelpDoc.getSpan","InternalUsage.getHelp","InternalPrimitive.getHelp","InternalHelpDoc.mapDescriptionList","InternalHelpDoc.enumeration","InternalSpan.text","InternalSpan.concat","InternalPrompt.isPrompt","InternalUsage.empty","InternalPrimitive.isBool","InternalPrimitive.getChoices","InternalUsage.named","getNames","InternalUsage.concat","InternalUsage.alternation","InternalUsage.repeated","InternalUsage.optional","InternalPrimitive.getTypeName","InternalPrimitive.validate","InternalValidationError.invalidValue","InternalValidationError.multipleValuesDetected","InternalValidationError.missingValue","InternalValidationError.invalidArgument","InternalValidationError.isMultipleValuesDetected","InternalValidationError.isMissingValue","InternalPrimitive.wizard","InternalListPrompt.list","InternalHelpDoc.toAnsiText","InternalSelectPrompt.select","InternalNumberPrompt.integer","InternalValidationError.unclusteredFlag","InternalValidationError.missingFlag","InternalCliConfig.normalizeCase","InternalPrimitive.isTrueValue","InternalPrimitive.isFalseValue","InternalAutoCorrect.levensteinDistance","InternalValidationError.correctedFlag","InternalCompletion.escapeSingleQuoted","getShortDescription","InternalSpan.getText","getBashCompletions","InternalPrimitive.getBashCompletions","getFishCompletions","InternalPrimitive.getFishCompletions","getZshCompletions","InternalPrimitive.getZshCompletions","InternalOptions.optional","LogLevel","InternalOptions.map","Option","InternalOptions.all","InternalOptions.boolean","InternalOptions.integer","InternalOptions.text","InternalOptions.optional","InternalOptions.repeated","InternalOptions.withDefault","TypeId","proto","make","InternalOptions.none","InternalArgs.none","InternalHelpDoc.empty","Either","withSubcommands","InternalHelpDoc.isEmpty","InternalHelpDoc.sequence","InternalHelpDoc.h1","InternalArgs.getHelp","Options.all","InternalBuiltInOptions.builtIns","InternalOptions.getHelp","InternalHelpDoc.getSpan","InternalUsage.getHelp","InternalSpan.empty","InternalSpan.isText","InternalSpan.spans","InternalSpan.space","Option","InternalSpan.size","InternalHelpDoc.p","InternalSpan.text","InternalHelpDoc.enumeration","InternalUsage.concat","InternalUsage.named","InternalOptions.getUsage","InternalArgs.getUsage","InternalUsage.mixed","Effect","InternalValidationError.commandMismatch","InternalCliConfig.normalizeCase","InternalBuiltInOptions.builtInOptions","InternalOptions.processCommandLine","InternalValidationError.noBuiltInMatch","InternalCommandDirective.builtIn","InternalArgs.validate","InternalCommandDirective.userDefined","InternalValidationError.isValidationError","InternalPrompt.run","InternalCommandDirective.isUserDefined","InternalValidationError.isCommandMismatch","InternalBuiltInOptions.showHelp","InternalCommandDirective.isBuiltIn","InternalBuiltInOptions.isShowHelp","InternalValidationError.invalidArgument","InternalBuiltInOptions.showWizard","InternalBuiltInOptions.isShowWizard","InternalSpan.strong","InternalSpan.highlight","Color.cyan","InternalSpan.concat","Color.magenta","InternalHelpDoc.toAnsiText","InternalOptions.isEmpty","InternalOptions.wizard","InternalArgs.isEmpty","InternalArgs.wizard","InternalSelectPrompt.select","InternalSpan.getText","InternalOptions.getNames","InternalOptions.getBashCompletions","InternalOptions.all","InternalOptions.getFishCompletions","InternalArgs.getFishCompletions","InternalCompletion.escapeSingleQuoted","InternalOptions.getZshCompletions","InternalArgs.getZshCompletions","InternalValidationError.proto","make","InternalSpan.empty","InternalHelpDoc.empty","run","Effect","Option","InternalCliConfig.Tag","InternalCliConfig.defaultConfig","InternalCommand.parse","InternalValidationError.isValidationError","InternalValidationError.isHelpRequested","InternalBuiltInOptions.showHelp","InternalCommand.getUsage","InternalCommand.getHelp","InternalHelpDoc.p","InternalValidationError.invalidValue","InternalHelpDoc.toAnsiText","Logger","InternalHelpDoc.h1","InternalSpan.code","InternalSpan.spans","InternalSpan.text","InternalSpan.isEmpty","InternalSpan.space","InternalHelpDoc.sequence","InternalUsage.enumerate","InternalSpan.concat","InternalCommand.getNames","InternalCommand.getBashCompletions","InternalCommand.getFishCompletions","InternalCommand.getZshCompletions","InternalHelpDoc.descriptionList","InternalCommand.wizard","InternalTogglePrompt.toggle","Terminal.isQuitException","InternalSpan.error","InternalCommand.getSubcommands","InternalHelpDoc.blocks","InternalSpan.strong","InternalSpan.highlight","Color.cyan","InternalCommand.helpRequestedError","TypeId","InternalArgs.isArgs","InternalOptions.isOptions","InternalDescriptor.isCommand","Effect","ValidationError.helpRequested","InternalDescriptor.getNames","InternalDescriptor.map","InternalDescriptor.make","InternalOptions.all","InternalArgs.all","make","withSubcommands","InternalDescriptor.withSubcommands","run","InternalCliApp.make","InternalCliApp.run","make","Internal.make","Internal.withSubcommands","Internal.run","Effect","WorkerErrorTypeId","internal.WorkerErrorTypeId","PlatformWorker","Effect","Transferable.unsafeMakeCollector","Transferable.Collector","Option","Exit","layerManager","makePlatform","Scope","internal.makePlatform","internal.PlatformWorker","layerManager","internal.layerManager","effectify","Effect","internal.effectify","Error.BadArgument","copyFile","Effect","FileSystem.FileDescriptor","FileSystem.FileTypeId","FileSystem.Size","Option","Error.SystemError","readFile","rename","stat","FileSystem.WatchEventCreate","FileSystem.WatchEventRemove","FileSystem.WatchEventUpdate","writeFile","FileSystem.WatchBackend","FileSystem.make","layer","FileSystem.FileSystem","layer","internal.layer","Effect","Exit","Effect","ProcessTypeId","ExitCode","ProcessId","CommandExecutor","makeExecutor","Effect","flatten","stdin","internal.flatten","internal.stdin","internal.CommandExecutor","internal.ProcessTypeId","internal.ExitCode","internal.ProcessId","internal.makeExecutor","Command.flatten","CommandExecutor.ProcessTypeId","runCommand","Effect","Option","CommandExecutor.ExitCode","CommandExecutor.ProcessId","Command.stdin","stdin","layer","CommandExecutor.CommandExecutor","FileSystem.FileSystem","CommandExecutor.makeExecutor","layer","internal.layer","Effect","Path","TypeId","NodePath","layer","layer","internal.layer","Effect","Option","Exit","Error.BadArgument","layer","Terminal.Terminal","layer","InternalTerminal.layer","Effect","Exit","Scope","Worker.PlatformWorker","layerManager","Worker.layerManager","internal.layerManager","NodePath.layer","NodeCommandExecutor.layer","NodeTerminal.layer","NodeWorker.layerManager","NodeFileSystem.layer","exists","Options.text","Options.optional","Options.repeated","Options.boolean","Command.make","Args.text","Args.repeated","Options.withDefault","Options.integer","Command.withSubcommands","Command.run","NodeContext.layer"],"sources":["../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/completion.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/Error.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/internal/fileSystem.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/FileSystem.js","../../../node_modules/.bun/@effect+typeclass@0.41.0+452b06a93f937da4/node_modules/@effect/typeclass/dist/esm/internal/Iterable.js","../../../node_modules/.bun/@effect+typeclass@0.41.0+452b06a93f937da4/node_modules/@effect/typeclass/dist/esm/Product.js","../../../node_modules/.bun/@effect+typeclass@0.41.0+452b06a93f937da4/node_modules/@effect/typeclass/dist/esm/Semigroup.js","../../../node_modules/.bun/@effect+typeclass@0.41.0+452b06a93f937da4/node_modules/@effect/typeclass/dist/esm/Monoid.js","../../../node_modules/.bun/@effect+printer-ansi@0.51.0+4e526cd47ba32532/node_modules/@effect/printer-ansi/dist/esm/internal/color.js","../../../node_modules/.bun/@effect+printer-ansi@0.51.0+4e526cd47ba32532/node_modules/@effect/printer-ansi/dist/esm/internal/sgr.js","../../../node_modules/.bun/@effect+printer-ansi@0.51.0+4e526cd47ba32532/node_modules/@effect/printer-ansi/dist/esm/internal/ansi.js","../../../node_modules/.bun/@effect+printer-ansi@0.51.0+4e526cd47ba32532/node_modules/@effect/printer-ansi/dist/esm/Ansi.js","../../../node_modules/.bun/@effect+printer@0.51.0+4e526cd47ba32532/node_modules/@effect/printer/dist/esm/internal/flatten.js","../../../node_modules/.bun/@effect+printer@0.51.0+4e526cd47ba32532/node_modules/@effect/printer/dist/esm/internal/doc.js","../../../node_modules/.bun/@effect+printer@0.51.0+4e526cd47ba32532/node_modules/@effect/printer/dist/esm/internal/docStream.js","../../../node_modules/.bun/@effect+printer@0.51.0+4e526cd47ba32532/node_modules/@effect/printer/dist/esm/internal/layoutPipeline.js","../../../node_modules/.bun/@effect+printer@0.51.0+4e526cd47ba32532/node_modules/@effect/printer/dist/esm/internal/pageWidth.js","../../../node_modules/.bun/@effect+printer@0.51.0+4e526cd47ba32532/node_modules/@effect/printer/dist/esm/internal/layout.js","../../../node_modules/.bun/@effect+printer@0.51.0+4e526cd47ba32532/node_modules/@effect/printer/dist/esm/Doc.js","../../../node_modules/.bun/@effect+printer-ansi@0.51.0+4e526cd47ba32532/node_modules/@effect/printer-ansi/dist/esm/internal/ansiDoc.js","../../../node_modules/.bun/@effect+printer@0.51.0+4e526cd47ba32532/node_modules/@effect/printer/dist/esm/PageWidth.js","../../../node_modules/.bun/@effect+printer@0.51.0+4e526cd47ba32532/node_modules/@effect/printer/dist/esm/Layout.js","../../../node_modules/.bun/@effect+printer-ansi@0.51.0+4e526cd47ba32532/node_modules/@effect/printer-ansi/dist/esm/internal/ansiRender.js","../../../node_modules/.bun/@effect+printer-ansi@0.51.0+4e526cd47ba32532/node_modules/@effect/printer-ansi/dist/esm/AnsiDoc.js","../../../node_modules/.bun/@effect+printer@0.51.0+4e526cd47ba32532/node_modules/@effect/printer/dist/esm/internal/optimize.js","../../../node_modules/.bun/@effect+printer@0.51.0+4e526cd47ba32532/node_modules/@effect/printer/dist/esm/Optimize.js","../../../node_modules/.bun/@effect+printer-ansi@0.51.0+4e526cd47ba32532/node_modules/@effect/printer-ansi/dist/esm/Color.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/helpDoc/span.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/helpDoc.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/cliConfig.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/internal/terminal.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/Terminal.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/prompt/action.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/prompt.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/prompt/ansi-utils.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/prompt/date.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/internal/path.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/Path.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/prompt/utils.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/prompt/file.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/prompt/number.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/prompt/select.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/prompt/text.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/prompt/toggle.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/primitive.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/usage.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/validationError.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/args.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/Args.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/autoCorrect.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/prompt/list.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/options.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/builtInOptions.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/Options.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/commandDirective.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/commandDescriptor.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/cliApp.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/ValidationError.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/internal/command.js","../../../node_modules/.bun/@effect+cli@0.77.2+74e017304edf4bf0/node_modules/@effect/cli/dist/esm/Command.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/Transferable.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/internal/workerError.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/WorkerError.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/internal/worker.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/Worker.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/internal/effectify.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/Effectify.js","../../../node_modules/.bun/@effect+platform-node-shared@0.61.1+1edbab697a2570fc/node_modules/@effect/platform-node-shared/dist/esm/internal/error.js","../../../node_modules/.bun/@effect+platform-node-shared@0.61.1+1edbab697a2570fc/node_modules/@effect/platform-node-shared/dist/esm/internal/fileSystem.js","../../../node_modules/.bun/@effect+platform-node-shared@0.61.1+1edbab697a2570fc/node_modules/@effect/platform-node-shared/dist/esm/NodeFileSystem.js","../../../node_modules/.bun/@effect+platform-node-shared@0.61.1+1edbab697a2570fc/node_modules/@effect/platform-node-shared/dist/esm/internal/stream.js","../../../node_modules/.bun/@effect+platform-node-shared@0.61.1+1edbab697a2570fc/node_modules/@effect/platform-node-shared/dist/esm/internal/sink.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/internal/commandExecutor.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/internal/command.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/Command.js","../../../node_modules/.bun/@effect+platform@0.97.2+452b06a93f937da4/node_modules/@effect/platform/dist/esm/CommandExecutor.js","../../../node_modules/.bun/@effect+platform-node-shared@0.61.1+1edbab697a2570fc/node_modules/@effect/platform-node-shared/dist/esm/internal/commandExecutor.js","../../../node_modules/.bun/@effect+platform-node-shared@0.61.1+1edbab697a2570fc/node_modules/@effect/platform-node-shared/dist/esm/NodeCommandExecutor.js","../../../node_modules/.bun/@effect+platform-node-shared@0.61.1+1edbab697a2570fc/node_modules/@effect/platform-node-shared/dist/esm/internal/path.js","../../../node_modules/.bun/@effect+platform-node-shared@0.61.1+1edbab697a2570fc/node_modules/@effect/platform-node-shared/dist/esm/NodePath.js","../../../node_modules/.bun/@effect+platform-node-shared@0.61.1+1edbab697a2570fc/node_modules/@effect/platform-node-shared/dist/esm/internal/terminal.js","../../../node_modules/.bun/@effect+platform-node-shared@0.61.1+1edbab697a2570fc/node_modules/@effect/platform-node-shared/dist/esm/NodeTerminal.js","../../../node_modules/.bun/@effect+platform-node@0.108.2+1edbab697a2570fc/node_modules/@effect/platform-node/dist/esm/internal/worker.js","../../../node_modules/.bun/@effect+platform-node@0.108.2+1edbab697a2570fc/node_modules/@effect/platform-node/dist/esm/NodeWorker.js","../../../node_modules/.bun/@effect+platform-node@0.108.2+1edbab697a2570fc/node_modules/@effect/platform-node/dist/esm/NodeContext.js","../../cli/src/dashboard-reports.ts","../../cli/src/dashboard-build.ts","../../cli/src/dashboard-cells.ts","../../cli/src/dashboard-matrix.ts","../../cli/src/project.ts","../../cli/src/terminal.ts","../../cli/src/source.ts","../../cli/src/run-command.ts","../../cli/src/tidy.ts","../../cli/src/share-command.ts","../../cli/src/new-project-template.ts","../../cli/src/new-project.ts","../../cli/src/index.ts"],"sourcesContent":["/** @internal */\nexport const escapeSingleQuoted = string => string.replaceAll(\"'\", \"'\\\\''\");\n//# sourceMappingURL=completion.js.map","import * as Data from \"effect/Data\";\nimport * as Predicate from \"effect/Predicate\";\nimport * as Schema from \"effect/Schema\";\n/**\n * @since 1.0.0\n * @category type id\n */\nexport const TypeId = /*#__PURE__*/Symbol.for(\"@effect/platform/Error\");\n/**\n * @since 1.0.0\n * @category refinements\n */\nexport const isPlatformError = u => Predicate.hasProperty(u, TypeId);\n/**\n * @since 1.0.0\n * @category error\n */\nexport const TypeIdError = (typeId, tag) => {\n class Base extends Data.Error {\n _tag = tag;\n }\n ;\n Base.prototype[typeId] = typeId;\n Base.prototype.name = tag;\n return Base;\n};\n/**\n * @since 1.0.0\n * @category Models\n */\nexport const Module = /*#__PURE__*/Schema.Literal(\"Clipboard\", \"Command\", \"FileSystem\", \"KeyValueStore\", \"Path\", \"Stream\", \"Terminal\");\n/**\n * @since 1.0.0\n * @category Models\n */\nexport class BadArgument extends /*#__PURE__*/Schema.TaggedError(\"@effect/platform/Error/BadArgument\")(\"BadArgument\", {\n module: Module,\n method: Schema.String,\n description: /*#__PURE__*/Schema.optional(Schema.String),\n cause: /*#__PURE__*/Schema.optional(Schema.Defect)\n}) {\n /**\n * @since 1.0.0\n */\n [TypeId] = TypeId;\n /**\n * @since 1.0.0\n */\n get message() {\n return `${this.module}.${this.method}${this.description ? `: ${this.description}` : \"\"}`;\n }\n}\n/**\n * @since 1.0.0\n * @category Model\n */\nexport const SystemErrorReason = /*#__PURE__*/Schema.Literal(\"AlreadyExists\", \"BadResource\", \"Busy\", \"InvalidData\", \"NotFound\", \"PermissionDenied\", \"TimedOut\", \"UnexpectedEof\", \"Unknown\", \"WouldBlock\", \"WriteZero\");\n/**\n * @since 1.0.0\n * @category models\n */\nexport class SystemError extends /*#__PURE__*/Schema.TaggedError(\"@effect/platform/Error/SystemError\")(\"SystemError\", {\n reason: SystemErrorReason,\n module: Module,\n method: Schema.String,\n description: /*#__PURE__*/Schema.optional(Schema.String),\n syscall: /*#__PURE__*/Schema.optional(Schema.String),\n pathOrDescriptor: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Union(Schema.String, Schema.Number)),\n cause: /*#__PURE__*/Schema.optional(Schema.Defect)\n}) {\n /**\n * @since 1.0.0\n */\n [TypeId] = TypeId;\n /**\n * @since 1.0.0\n */\n get message() {\n return `${this.reason}: ${this.module}.${this.method}${this.pathOrDescriptor !== undefined ? ` (${this.pathOrDescriptor})` : \"\"}${this.description ? `: ${this.description}` : \"\"}`;\n }\n}\n/**\n * @since 1.0.0\n * @category Models\n */\nexport const PlatformError = /*#__PURE__*/Schema.Union(BadArgument, SystemError);\n//# sourceMappingURL=Error.js.map","import * as Channel from \"effect/Channel\";\nimport * as Chunk from \"effect/Chunk\";\nimport { GenericTag } from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport { identity, pipe } from \"effect/Function\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport * as Sink from \"effect/Sink\";\nimport * as Stream from \"effect/Stream\";\nimport * as Error from \"../Error.js\";\n/** @internal */\nexport const tag = /*#__PURE__*/GenericTag(\"@effect/platform/FileSystem\");\n/** @internal */\nexport const Size = bytes => typeof bytes === \"bigint\" ? bytes : BigInt(bytes);\n/** @internal */\nexport const KiB = n => Size(n * 1024);\n/** @internal */\nexport const MiB = n => Size(n * 1024 * 1024);\n/** @internal */\nexport const GiB = n => Size(n * 1024 * 1024 * 1024);\n/** @internal */\nexport const TiB = n => Size(n * 1024 * 1024 * 1024 * 1024);\nconst bigint1024 = /*#__PURE__*/BigInt(1024);\nconst bigintPiB = bigint1024 * bigint1024 * bigint1024 * bigint1024 * bigint1024;\n/** @internal */\nexport const PiB = n => Size(BigInt(n) * bigintPiB);\n/** @internal */\nexport const make = impl => {\n return tag.of({\n ...impl,\n exists: path => pipe(impl.access(path), Effect.as(true), Effect.catchTag(\"SystemError\", e => e.reason === \"NotFound\" ? Effect.succeed(false) : Effect.fail(e))),\n readFileString: (path, encoding) => Effect.tryMap(impl.readFile(path), {\n try: _ => new TextDecoder(encoding).decode(_),\n catch: cause => new Error.BadArgument({\n module: \"FileSystem\",\n method: \"readFileString\",\n description: \"invalid encoding\",\n cause\n })\n }),\n stream: (path, options) => pipe(impl.open(path, {\n flag: \"r\"\n }), options?.offset ? Effect.tap(file => file.seek(options.offset, \"start\")) : identity, Effect.map(file => stream(file, options)), Stream.unwrapScoped),\n sink: (path, options) => pipe(impl.open(path, {\n flag: \"w\",\n ...options\n }), Effect.map(file => Sink.forEach(_ => file.writeAll(_))), Sink.unwrapScoped),\n writeFileString: (path, data, options) => Effect.flatMap(Effect.try({\n try: () => new TextEncoder().encode(data),\n catch: cause => new Error.BadArgument({\n module: \"FileSystem\",\n method: \"writeFileString\",\n description: \"could not encode string\",\n cause\n })\n }), _ => impl.writeFile(path, _, options))\n });\n};\nconst notFound = (method, path) => new Error.SystemError({\n module: \"FileSystem\",\n method,\n reason: \"NotFound\",\n description: \"No such file or directory\",\n pathOrDescriptor: path\n});\n/** @internal */\nexport const makeNoop = fileSystem => {\n return {\n access(path) {\n return Effect.fail(notFound(\"access\", path));\n },\n chmod(path) {\n return Effect.fail(notFound(\"chmod\", path));\n },\n chown(path) {\n return Effect.fail(notFound(\"chown\", path));\n },\n copy(path) {\n return Effect.fail(notFound(\"copy\", path));\n },\n copyFile(path) {\n return Effect.fail(notFound(\"copyFile\", path));\n },\n exists() {\n return Effect.succeed(false);\n },\n link(path) {\n return Effect.fail(notFound(\"link\", path));\n },\n makeDirectory() {\n return Effect.die(\"not implemented\");\n },\n makeTempDirectory() {\n return Effect.die(\"not implemented\");\n },\n makeTempDirectoryScoped() {\n return Effect.die(\"not implemented\");\n },\n makeTempFile() {\n return Effect.die(\"not implemented\");\n },\n makeTempFileScoped() {\n return Effect.die(\"not implemented\");\n },\n open(path) {\n return Effect.fail(notFound(\"open\", path));\n },\n readDirectory(path) {\n return Effect.fail(notFound(\"readDirectory\", path));\n },\n readFile(path) {\n return Effect.fail(notFound(\"readFile\", path));\n },\n readFileString(path) {\n return Effect.fail(notFound(\"readFileString\", path));\n },\n readLink(path) {\n return Effect.fail(notFound(\"readLink\", path));\n },\n realPath(path) {\n return Effect.fail(notFound(\"realPath\", path));\n },\n remove() {\n return Effect.void;\n },\n rename(oldPath) {\n return Effect.fail(notFound(\"rename\", oldPath));\n },\n sink(path) {\n return Sink.fail(notFound(\"sink\", path));\n },\n stat(path) {\n return Effect.fail(notFound(\"stat\", path));\n },\n stream(path) {\n return Stream.fail(notFound(\"stream\", path));\n },\n symlink(fromPath) {\n return Effect.fail(notFound(\"symlink\", fromPath));\n },\n truncate(path) {\n return Effect.fail(notFound(\"truncate\", path));\n },\n utimes(path) {\n return Effect.fail(notFound(\"utimes\", path));\n },\n watch(path) {\n return Stream.fail(notFound(\"watch\", path));\n },\n writeFile(path) {\n return Effect.fail(notFound(\"writeFile\", path));\n },\n writeFileString(path) {\n return Effect.fail(notFound(\"writeFileString\", path));\n },\n ...fileSystem\n };\n};\n/** @internal */\nexport const layerNoop = fileSystem => Layer.succeed(tag, makeNoop(fileSystem));\n/** @internal */\nconst stream = (file, {\n bufferSize = 16,\n bytesToRead: bytesToRead_,\n chunkSize: chunkSize_ = Size(64 * 1024)\n} = {}) => {\n const bytesToRead = bytesToRead_ !== undefined ? Size(bytesToRead_) : undefined;\n const chunkSize = Size(chunkSize_);\n function loop(totalBytesRead) {\n if (bytesToRead !== undefined && bytesToRead <= totalBytesRead) {\n return Channel.void;\n }\n const toRead = bytesToRead !== undefined && bytesToRead - totalBytesRead < chunkSize ? bytesToRead - totalBytesRead : chunkSize;\n return Channel.flatMap(file.readAlloc(toRead), Option.match({\n onNone: () => Channel.void,\n onSome: buf => Channel.flatMap(Channel.write(Chunk.of(buf)), _ => loop(totalBytesRead + BigInt(buf.length)))\n }));\n }\n return Stream.bufferChunks(Stream.fromChannel(loop(BigInt(0))), {\n capacity: bufferSize\n });\n};\n//# sourceMappingURL=fileSystem.js.map","/**\n * @since 1.0.0\n */\nimport * as Brand from \"effect/Brand\";\nimport * as Context from \"effect/Context\";\nimport * as Data from \"effect/Data\";\nimport * as internal from \"./internal/fileSystem.js\";\n/**\n * @since 1.0.0\n * @category sizes\n */\nexport const Size = internal.Size;\n/**\n * @since 1.0.0\n * @category sizes\n */\nexport const KiB = internal.KiB;\n/**\n * @since 1.0.0\n * @category sizes\n */\nexport const MiB = internal.MiB;\n/**\n * @since 1.0.0\n * @category sizes\n */\nexport const GiB = internal.GiB;\n/**\n * @since 1.0.0\n * @category sizes\n */\nexport const TiB = internal.TiB;\n/**\n * @since 1.0.0\n * @category sizes\n */\nexport const PiB = internal.PiB;\n/**\n * @since 1.0.0\n * @category tag\n */\nexport const FileSystem = internal.tag;\n/**\n * @since 1.0.0\n * @category constructor\n */\nexport const make = internal.make;\n/**\n * Create a no-op file system that can be used for testing.\n *\n * @since 1.0.0\n * @category constructor\n */\nexport const makeNoop = internal.makeNoop;\n/**\n * Create a no-op file system that can be used for testing.\n *\n * @since 1.0.0\n * @category layers\n */\nexport const layerNoop = internal.layerNoop;\n/**\n * @since 1.0.0\n * @category type id\n */\nexport const FileTypeId = /*#__PURE__*/Symbol.for(\"@effect/platform/FileSystem/File\");\n/**\n * @since 1.0.0\n * @category guard\n */\nexport const isFile = u => typeof u === \"object\" && u !== null && FileTypeId in u;\n/**\n * @since 1.0.0\n * @category constructor\n */\nexport const FileDescriptor = /*#__PURE__*/Brand.nominal();\n/**\n * @since 1.0.0\n * @category constructor\n */\nexport const WatchEventCreate = /*#__PURE__*/Data.tagged(\"Create\");\n/**\n * @since 1.0.0\n * @category constructor\n */\nexport const WatchEventUpdate = /*#__PURE__*/Data.tagged(\"Update\");\n/**\n * @since 1.0.0\n * @category constructor\n */\nexport const WatchEventRemove = /*#__PURE__*/Data.tagged(\"Remove\");\n/**\n * @since 1.0.0\n * @category file watcher\n */\nexport class WatchBackend extends /*#__PURE__*/Context.Tag(\"@effect/platform/FileSystem/WatchBackend\")() {}\n//# sourceMappingURL=FileSystem.js.map","/** @internal */\nexport function reduce(b, f) {\n return function (iterable) {\n if (Array.isArray(iterable)) {\n return iterable.reduce(f, b);\n }\n let result = b;\n for (const n of iterable) {\n result = f(result, n);\n }\n return result;\n };\n}\n/** @internal */\nexport function map(f) {\n return function (iterable) {\n if (Array.isArray(iterable)) {\n return iterable.map(f);\n }\n return function* () {\n for (const n of iterable) {\n yield f(n);\n }\n }();\n };\n}\n//# sourceMappingURL=Iterable.js.map","/**\n * @since 0.24.0\n */\n/**\n * @since 0.24.0\n */\nexport const tuple = F => (...elements) => F.productAll(elements);\n/**\n * @since 0.24.0\n */\nexport const struct = F => fields => {\n const keys = Object.keys(fields);\n return F.imap(F.productAll(keys.map(k => fields[k])), values => {\n const out = {};\n for (let i = 0; i < values.length; i++) {\n out[keys[i]] = values[i];\n }\n return out;\n }, r => keys.map(k => r[k]));\n};\n//# sourceMappingURL=Product.js.map","/**\n * @since 0.24.0\n */\nimport { dual } from \"effect/Function\";\nimport { map, reduce } from \"./internal/Iterable.js\";\nimport * as product_ from \"./Product.js\";\n/**\n * The `combineMany` parameter is optional and defaults to a standard\n * implementation. You can provide a custom implementation when performance\n * optimizations are possible.\n *\n * @category constructors\n * @since 0.24.0\n */\nexport const make = (combine, combineMany = (self, collection) => reduce(self, combine)(collection)) => ({\n combine,\n combineMany\n});\n/**\n * `Semigroup` that returns last minimum of elements.\n *\n * @category constructors\n * @since 0.24.0\n */\nexport const min = O => make((self, that) => O(self, that) === -1 ? self : that);\n/**\n * `Semigroup` that returns last maximum of elements.\n *\n * @category constructors\n * @since 0.24.0\n */\nexport const max = O => make((self, that) => O(self, that) === 1 ? self : that);\n/**\n * @category constructors\n * @since 0.24.0\n */\nexport const constant = a => make(() => a, () => a);\n/**\n * The dual of a `Semigroup`, obtained by flipping the arguments of `combine`.\n *\n * @since 0.24.0\n */\nexport const reverse = S => make((self, that) => S.combine(that, self), (self, collection) => {\n const reversed = Array.from(collection).reverse();\n return reversed.length > 0 ? S.combine(S.combineMany(reversed[0], reversed.slice(1)), self) : self;\n});\n/**\n * The `intercalate` API returns a function that takes a `Semigroup` instance and a separator value, and returns a new\n * `Semigroup` instance that combines values with the given separator.\n *\n * This API is useful when you want to combine values with a specific separator. For example, when you want to concatenate\n * an array of strings with a separator string in between.\n *\n * It is interesting to note that there is no equivalent API in the `Monoid` module. This is because the value `empty`,\n * which is required for the `Monoid` interface, cannot exist.\n *\n * @since 0.24.0\n */\nexport const intercalate = /*#__PURE__*/dual(2, (S, separator) => make((self, that) => S.combineMany(self, [separator, that])));\n/**\n * Always return the first argument.\n *\n * @category instances\n * @since 0.24.0\n */\nexport const first = () => make(a => a, a => a);\n/**\n * Always return the last argument.\n *\n * @category instances\n * @since 0.24.0\n */\nexport const last = () => make((_, second) => second, (self, collection) => {\n let a = self;\n // eslint-disable-next-line no-empty\n for (a of collection) {}\n return a;\n});\n/**\n * @since 0.24.0\n */\nexport const imap = /*#__PURE__*/dual(3, (S, to, from) => make((self, that) => to(S.combine(from(self), from(that))), (self, collection) => to(S.combineMany(from(self), map(from)(collection)))));\n/**\n * @category instances\n * @since 0.24.0\n */\nexport const Invariant = {\n imap\n};\nconst product = (self, that) => make(([xa, xb], [ya, yb]) => [self.combine(xa, ya), that.combine(xb, yb)]);\nconst productAll = collection => {\n return make((x, y) => {\n const len = Math.min(x.length, y.length);\n const out = [];\n let collectionLength = 0;\n for (const s of collection) {\n if (collectionLength >= len) {\n break;\n }\n out.push(s.combine(x[collectionLength], y[collectionLength]));\n collectionLength++;\n }\n return out;\n });\n};\nconst productMany = (self, collection) => {\n const semigroup = productAll(collection);\n return make((x, y) => [self.combine(x[0], y[0]), ...semigroup.combine(x.slice(1), y.slice(1))]);\n};\n/**\n * @category instances\n * @since 0.24.0\n */\nexport const SemiProduct = {\n imap,\n product,\n productMany\n};\nconst of = constant;\n/**\n * @category instances\n * @since 0.24.0\n */\nexport const Product = {\n of,\n imap,\n product,\n productMany,\n productAll\n};\n/**\n * Similar to `Promise.all` but operates on `Semigroup`s.\n *\n * ```\n * [Semigroup<A>, Semigroup<B>, ...] -> Semigroup<[A, B, ...]>\n * ```\n *\n * This function creates and returns a new `Semigroup` for a tuple of values based on the given `Semigroup`s for each element in the tuple.\n * The returned `Semigroup` combines two tuples of the same type by applying the corresponding `Semigroup` passed as arguments to each element in the tuple.\n *\n * It is useful when you need to combine two tuples of the same type and you have a specific way of combining each element of the tuple.\n *\n * @category combinators\n * @since 0.24.0\n */\nexport const tuple = /*#__PURE__*/product_.tuple(Product);\n/**\n * Given a type `A`, this function creates and returns a `Semigroup` for `ReadonlyArray<A>`.\n * The returned `Semigroup` combines two arrays by concatenating them.\n *\n * @category combinators\n * @since 0.24.0\n */\nexport const array = () => make((self, that) => self.concat(that));\n/**\n * This function creates and returns a new `Semigroup` for a struct of values based on the given `Semigroup`s for each property in the struct.\n * The returned `Semigroup` combines two structs of the same type by applying the corresponding `Semigroup` passed as arguments to each property in the struct.\n *\n * It is useful when you need to combine two structs of the same type and you have a specific way of combining each property of the struct.\n *\n * @category combinators\n * @since 0.24.0\n */\nexport const struct = /*#__PURE__*/product_.struct(Product);\n//# sourceMappingURL=Semigroup.js.map","import * as semigroup from \"./Semigroup.js\";\n/**\n * @category constructors\n * @since 0.24.0\n */\nexport const fromSemigroup = (S, empty) => ({\n combine: S.combine,\n combineMany: S.combineMany,\n empty,\n combineAll: collection => S.combineMany(empty, collection)\n});\n/**\n * Get a monoid where `combine` will return the minimum, based on the provided bounded order.\n *\n * The `empty` value is the `maxBound` value.\n *\n * @category constructors\n * @since 0.24.0\n */\nexport const min = B => fromSemigroup(semigroup.min(B.compare), B.maxBound);\n/**\n * Get a monoid where `combine` will return the maximum, based on the provided bounded order.\n *\n * The `empty` value is the `minimum` value.\n *\n * @category constructors\n * @since 0.24.0\n */\nexport const max = B => fromSemigroup(semigroup.max(B.compare), B.minBound);\n/**\n * The dual of a `Monoid`, obtained by swapping the arguments of `combine`.\n *\n * @category combinators\n * @since 0.24.0\n */\nexport const reverse = M => fromSemigroup(semigroup.reverse(M), M.empty);\n/**\n * Similar to `Promise.all` but operates on `Monoid`s.\n *\n * ```\n * [Monoid<A>, Monoid<B>, ...] -> Monoid<[A, B, ...]>\n * ```\n *\n * This function creates and returns a new `Monoid` for a tuple of values based on the given `Monoid`s for each element in the tuple.\n * The returned `Monoid` combines two tuples of the same type by applying the corresponding `Monoid` passed as arguments to each element in the tuple.\n *\n * The `empty` value of the returned `Monoid` is the tuple of `empty` values of the input `Monoid`s.\n *\n * It is useful when you need to combine two tuples of the same type and you have a specific way of combining each element of the tuple.\n *\n * @category combinators\n * @since 0.24.0\n */\nexport const tuple = (...elements) => {\n const empty = elements.map(m => m.empty);\n return fromSemigroup(semigroup.tuple(...elements), empty);\n};\n/**\n * Given a type `A`, this function creates and returns a `Semigroup` for `ReadonlyArray<A>`.\n *\n * The `empty` value is the empty array.\n *\n * @category combinators\n * @since 0.24.0\n */\nexport const array = () => fromSemigroup(semigroup.array(), []);\n/**\n * This function creates and returns a new `Monoid` for a struct of values based on the given `Monoid`s for each property in the struct.\n * The returned `Monoid` combines two structs of the same type by applying the corresponding `Monoid` passed as arguments to each property in the struct.\n *\n * The `empty` value of the returned `Monoid` is a struct where each property is the `empty` value of the corresponding `Monoid` in the input `monoids` object.\n *\n * It is useful when you need to combine two structs of the same type and you have a specific way of combining each property of the struct.\n *\n * @category combinators\n * @since 0.24.0\n */\nexport const struct = fields => {\n const empty = {};\n for (const k in fields) {\n if (Object.prototype.hasOwnProperty.call(fields, k)) {\n empty[k] = fields[k].empty;\n }\n }\n return fromSemigroup(semigroup.struct(fields), empty);\n};\n//# sourceMappingURL=Monoid.js.map","// -----------------------------------------------------------------------------\n// Destructors\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const black = {\n _tag: \"Black\"\n};\n/** @internal */\nexport const red = {\n _tag: \"Red\"\n};\n/** @internal */\nexport const green = {\n _tag: \"Green\"\n};\n/** @internal */\nexport const yellow = {\n _tag: \"Yellow\"\n};\n/** @internal */\nexport const blue = {\n _tag: \"Blue\"\n};\n/** @internal */\nexport const magenta = {\n _tag: \"Magenta\"\n};\n/** @internal */\nexport const cyan = {\n _tag: \"Cyan\"\n};\n/** @internal */\nexport const white = {\n _tag: \"White\"\n};\n// -----------------------------------------------------------------------------\n// Destructors\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const toCode = color => {\n switch (color._tag) {\n case \"Black\":\n {\n return 0;\n }\n case \"Red\":\n {\n return 1;\n }\n case \"Green\":\n {\n return 2;\n }\n case \"Yellow\":\n {\n return 3;\n }\n case \"Blue\":\n {\n return 4;\n }\n case \"Magenta\":\n {\n return 5;\n }\n case \"Cyan\":\n {\n return 6;\n }\n case \"White\":\n {\n return 7;\n }\n }\n};\n//# sourceMappingURL=color.js.map","import * as color from \"./color.js\";\n// -----------------------------------------------------------------------------\n// Constructors\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const reset = {\n _tag: \"Reset\"\n};\n/** @internal */\nexport const setBold = bold => ({\n _tag: \"SetBold\",\n bold\n});\n/** @internal */\nexport const setColor = (color, vivid, layer) => ({\n _tag: \"SetColor\",\n color,\n vivid,\n layer\n});\n/** @internal */\nexport const setItalicized = italicized => ({\n _tag: \"SetItalicized\",\n italicized\n});\n/** @internal */\nexport const setStrikethrough = strikethrough => ({\n _tag: \"SetStrikethrough\",\n strikethrough\n});\n/** @internal */\nexport const setUnderlined = underlined => ({\n _tag: \"SetUnderlined\",\n underlined\n});\n// -----------------------------------------------------------------------------\n// Destructors\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const toCode = self => {\n switch (self._tag) {\n case \"Reset\":\n {\n return 0;\n }\n case \"SetBold\":\n {\n return self.bold ? 1 : 22;\n }\n case \"SetColor\":\n {\n switch (self.layer) {\n case \"foreground\":\n {\n return self.vivid ? 90 + color.toCode(self.color) : 30 + color.toCode(self.color);\n }\n case \"background\":\n {\n return self.vivid ? 100 + color.toCode(self.color) : 40 + color.toCode(self.color);\n }\n }\n }\n case \"SetItalicized\":\n {\n return self.italicized ? 3 : 23;\n }\n case \"SetStrikethrough\":\n {\n return self.strikethrough ? 9 : 29;\n }\n case \"SetUnderlined\":\n {\n return self.underlined ? 4 : 24;\n }\n }\n};\n/** @internal */\nexport const toEscapeSequence = sgrs => csi(\"m\", sgrs);\nconst csi = (controlFunction, sgrs) => {\n const params = Array.from(sgrs).map(sgr => `${toCode(sgr)}`).join(\";\");\n return `\\u001b[${params}${controlFunction}`;\n};\n//# sourceMappingURL=sgr.js.map","import * as Monoid from \"@effect/typeclass/Monoid\";\nimport * as Semigroup from \"@effect/typeclass/Semigroup\";\nimport * as Arr from \"effect/Array\";\nimport { dual } from \"effect/Function\";\nimport * as Option from \"effect/Option\";\nimport * as InternalColor from \"./color.js\";\nimport * as SGR from \"./sgr.js\";\nconst AnsiSymbolKey = \"@effect/printer-ansi/Ansi\";\n/** @internal */\nexport const AnsiTypeId = /*#__PURE__*/Symbol.for(AnsiSymbolKey);\nconst make = params => ({\n ...AnsiMonoid.empty,\n ...params\n});\n// -----------------------------------------------------------------------------\n// Instances\n// -----------------------------------------------------------------------------\nconst typeIdSemigroup = /*#__PURE__*/Semigroup.first();\nconst getFirstSomeSemigroup = /*#__PURE__*/Semigroup.make((self, that) => Option.isSome(self) ? self : that);\nconst AnsiSemigroup = /*#__PURE__*/Semigroup.struct({\n [AnsiTypeId]: typeIdSemigroup,\n commands: /*#__PURE__*/Semigroup.array(),\n foreground: getFirstSomeSemigroup,\n background: getFirstSomeSemigroup,\n bold: getFirstSomeSemigroup,\n italicized: getFirstSomeSemigroup,\n strikethrough: getFirstSomeSemigroup,\n underlined: getFirstSomeSemigroup\n});\nconst typeIdMonoid = /*#__PURE__*/Monoid.fromSemigroup(typeIdSemigroup, AnsiTypeId);\nconst monoidOrElse = /*#__PURE__*/Monoid.fromSemigroup(getFirstSomeSemigroup, /*#__PURE__*/Option.none());\nconst AnsiMonoid = /*#__PURE__*/Monoid.struct({\n [AnsiTypeId]: typeIdMonoid,\n commands: /*#__PURE__*/Monoid.array(),\n foreground: monoidOrElse,\n background: monoidOrElse,\n bold: monoidOrElse,\n italicized: monoidOrElse,\n strikethrough: monoidOrElse,\n underlined: monoidOrElse\n});\n/** @internal */\nexport const none = AnsiMonoid.empty;\nconst ESC = \"\\u001B[\";\nconst BEL = \"\\u0007\";\nconst SEP = \";\";\n// -----------------------------------------------------------------------------\n// Styles\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const bold = /*#__PURE__*/make({\n bold: /*#__PURE__*/Option.some(/*#__PURE__*/SGR.setBold(true))\n});\n/** @internal */\nexport const italicized = /*#__PURE__*/make({\n italicized: /*#__PURE__*/Option.some(/*#__PURE__*/SGR.setItalicized(true))\n});\n/** @internal */\nexport const strikethrough = /*#__PURE__*/make({\n strikethrough: /*#__PURE__*/Option.some(/*#__PURE__*/SGR.setStrikethrough(true))\n});\n/** @internal */\nexport const underlined = /*#__PURE__*/make({\n underlined: /*#__PURE__*/Option.some(/*#__PURE__*/SGR.setUnderlined(true))\n});\n// -----------------------------------------------------------------------------\n// Colors\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const brightColor = color => make({\n foreground: Option.some(SGR.setColor(color, true, \"foreground\"))\n});\n/** @internal */\nexport const color = color => make({\n foreground: Option.some(SGR.setColor(color, false, \"foreground\"))\n});\n/** @internal */\nexport const bgColorBright = color => make({\n background: Option.some(SGR.setColor(color, true, \"background\"))\n});\n/** @internal */\nexport const bgColor = color => make({\n background: Option.some(SGR.setColor(color, false, \"background\"))\n});\n/** @internal */\nexport const black = /*#__PURE__*/color(InternalColor.black);\n/** @internal */\nexport const red = /*#__PURE__*/color(InternalColor.red);\n/** @internal */\nexport const green = /*#__PURE__*/color(InternalColor.green);\n/** @internal */\nexport const yellow = /*#__PURE__*/color(InternalColor.yellow);\n/** @internal */\nexport const blue = /*#__PURE__*/color(InternalColor.blue);\n/** @internal */\nexport const magenta = /*#__PURE__*/color(InternalColor.magenta);\n/** @internal */\nexport const cyan = /*#__PURE__*/color(InternalColor.cyan);\n/** @internal */\nexport const white = /*#__PURE__*/color(InternalColor.white);\n/** @internal */\nexport const blackBright = /*#__PURE__*/brightColor(InternalColor.black);\n/** @internal */\nexport const redBright = /*#__PURE__*/brightColor(InternalColor.red);\n/** @internal */\nexport const greenBright = /*#__PURE__*/brightColor(InternalColor.green);\n/** @internal */\nexport const yellowBright = /*#__PURE__*/brightColor(InternalColor.yellow);\n/** @internal */\nexport const blueBright = /*#__PURE__*/brightColor(InternalColor.blue);\n/** @internal */\nexport const magentaBright = /*#__PURE__*/brightColor(InternalColor.magenta);\n/** @internal */\nexport const cyanBright = /*#__PURE__*/brightColor(InternalColor.cyan);\n/** @internal */\nexport const whiteBright = /*#__PURE__*/brightColor(InternalColor.white);\n/** @internal */\nexport const bgBlack = /*#__PURE__*/bgColor(InternalColor.black);\n/** @internal */\nexport const bgRed = /*#__PURE__*/bgColor(InternalColor.red);\n/** @internal */\nexport const bgGreen = /*#__PURE__*/bgColor(InternalColor.green);\n/** @internal */\nexport const bgYellow = /*#__PURE__*/bgColor(InternalColor.yellow);\n/** @internal */\nexport const bgBlue = /*#__PURE__*/bgColor(InternalColor.blue);\n/** @internal */\nexport const bgMagenta = /*#__PURE__*/bgColor(InternalColor.magenta);\n/** @internal */\nexport const bgCyan = /*#__PURE__*/bgColor(InternalColor.cyan);\n/** @internal */\nexport const bgWhite = /*#__PURE__*/bgColor(InternalColor.white);\n/** @internal */\nexport const bgBlackBright = /*#__PURE__*/bgColorBright(InternalColor.black);\n/** @internal */\nexport const bgRedBright = /*#__PURE__*/bgColorBright(InternalColor.red);\n/** @internal */\nexport const bgGreenBright = /*#__PURE__*/bgColorBright(InternalColor.green);\n/** @internal */\nexport const bgYellowBright = /*#__PURE__*/bgColorBright(InternalColor.yellow);\n/** @internal */\nexport const bgBlueBright = /*#__PURE__*/bgColorBright(InternalColor.blue);\n/** @internal */\nexport const bgMagentaBright = /*#__PURE__*/bgColorBright(InternalColor.magenta);\n/** @internal */\nexport const bgCyanBright = /*#__PURE__*/bgColorBright(InternalColor.cyan);\n/** @internal */\nexport const bgWhiteBright = /*#__PURE__*/bgColorBright(InternalColor.white);\n// -----------------------------------------------------------------------------\n// Commands\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const beep = /*#__PURE__*/make({\n commands: /*#__PURE__*/Arr.of(BEL)\n});\n/** @internal */\nexport const cursorTo = (column, row) => {\n if (row === undefined) {\n const command = `${ESC}${Math.max(column + 1, 0)}G`;\n return make({\n commands: Arr.of(command)\n });\n }\n const command = `${ESC}${row + 1}${SEP}${Math.max(column + 1, 0)}H`;\n return make({\n commands: Arr.of(command)\n });\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 make({\n commands: Arr.of(command)\n });\n};\n/** @internal */\nexport const cursorUp = (lines = 1) => {\n const command = `${ESC}${lines}A`;\n return make({\n commands: Arr.of(command)\n });\n};\n/** @internal */\nexport const cursorDown = (lines = 1) => {\n const command = `${ESC}${lines}B`;\n return make({\n commands: Arr.of(command)\n });\n};\n/** @internal */\nexport const cursorForward = (columns = 1) => {\n const command = `${ESC}${columns}C`;\n return make({\n commands: Arr.of(command)\n });\n};\n/** @internal */\nexport const cursorBackward = (columns = 1) => {\n const command = `${ESC}${columns}D`;\n return make({\n commands: Arr.of(command)\n });\n};\n/** @internal */\nexport const cursorLeft = /*#__PURE__*/make({\n commands: /*#__PURE__*/Arr.of(`${ESC}G`)\n});\n/** @internal */\nexport const cursorSavePosition = /*#__PURE__*/make({\n commands: /*#__PURE__*/Arr.of(`${ESC}s`)\n});\n/** @internal */\nexport const cursorRestorePosition = /*#__PURE__*/make({\n commands: /*#__PURE__*/Arr.of(`${ESC}u`)\n});\n/** @internal */\nexport const cursorNextLine = (rows = 1) => make({\n commands: Arr.of(`${ESC}${rows}E`)\n});\n/** @internal */\nexport const cursorPrevLine = (rows = 1) => make({\n commands: Arr.of(`${ESC}${rows}F`)\n});\n/** @internal */\nexport const cursorHide = /*#__PURE__*/make({\n commands: /*#__PURE__*/Arr.of(`${ESC}?25l`)\n});\n/** @internal */\nexport const cursorShow = /*#__PURE__*/make({\n commands: /*#__PURE__*/Arr.of(`${ESC}?25h`)\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 make({\n commands: Arr.of(command)\n });\n};\n/** @internal */\nexport const eraseEndLine = /*#__PURE__*/make({\n commands: /*#__PURE__*/Arr.of(`${ESC}K`)\n});\n/** @internal */\nexport const eraseStartLine = /*#__PURE__*/make({\n commands: /*#__PURE__*/Arr.of(`${ESC}1K`)\n});\n/** @internal */\nexport const eraseLine = /*#__PURE__*/make({\n commands: /*#__PURE__*/Arr.of(`${ESC}2K`)\n});\n/** @internal */\nexport const eraseDown = /*#__PURE__*/make({\n commands: /*#__PURE__*/Arr.of(`${ESC}J`)\n});\n/** @internal */\nexport const eraseUp = /*#__PURE__*/make({\n commands: /*#__PURE__*/Arr.of(`${ESC}1J`)\n});\n/** @internal */\nexport const eraseScreen = /*#__PURE__*/make({\n commands: /*#__PURE__*/Arr.of(`${ESC}2J`)\n});\n// -----------------------------------------------------------------------------\n// Destructors\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const stringify = self => stringifyInternal(self);\n// -----------------------------------------------------------------------------\n// Combinators\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const combine = /*#__PURE__*/dual(2, (self, that) => combineInternal(self, that));\n// -----------------------------------------------------------------------------\n// Internal\n// -----------------------------------------------------------------------------\nconst combineInternal = (self, that) => AnsiSemigroup.combine(self, that);\nconst stringifyInternal = self => {\n const displaySequence = SGR.toEscapeSequence(Arr.getSomes([Option.some(SGR.reset), self.foreground, self.background, self.bold, self.italicized, self.strikethrough, self.underlined]));\n const commandSequence = Arr.join(self.commands, \"\");\n return `${displaySequence}${commandSequence}`;\n};\n//# sourceMappingURL=ansi.js.map","import * as InternalAnsi from \"./internal/ansi.js\";\n// -----------------------------------------------------------------------------\n// Models\n// -----------------------------------------------------------------------------\n/**\n * @since 1.0.0\n * @category symbol\n */\nexport const AnsiTypeId = InternalAnsi.AnsiTypeId;\n// -----------------------------------------------------------------------------\n// Style Constructors\n// -----------------------------------------------------------------------------\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const bold = InternalAnsi.bold;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const italicized = InternalAnsi.italicized;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const strikethrough = InternalAnsi.strikethrough;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const underlined = InternalAnsi.underlined;\n// -----------------------------------------------------------------------------\n// Color Constructors\n// -----------------------------------------------------------------------------\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const color = InternalAnsi.color;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const brightColor = InternalAnsi.brightColor;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const bgColor = InternalAnsi.bgColor;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const bgColorBright = InternalAnsi.bgColorBright;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const black = InternalAnsi.black;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const red = InternalAnsi.red;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const green = InternalAnsi.green;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const yellow = InternalAnsi.yellow;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const blue = InternalAnsi.blue;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const magenta = InternalAnsi.magenta;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const cyan = InternalAnsi.cyan;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const white = InternalAnsi.white;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const blackBright = InternalAnsi.blackBright;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const redBright = InternalAnsi.redBright;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const greenBright = InternalAnsi.greenBright;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const yellowBright = InternalAnsi.yellowBright;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const blueBright = InternalAnsi.blueBright;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const magentaBright = InternalAnsi.magentaBright;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const cyanBright = InternalAnsi.cyanBright;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const whiteBright = InternalAnsi.whiteBright;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const bgBlack = InternalAnsi.bgBlack;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const bgRed = InternalAnsi.bgRed;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const bgGreen = InternalAnsi.bgGreen;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const bgYellow = InternalAnsi.bgYellow;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const bgBlue = InternalAnsi.bgBlue;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const bgMagenta = InternalAnsi.bgMagenta;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const bgCyan = InternalAnsi.bgCyan;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const bgWhite = InternalAnsi.bgWhite;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const bgBlackBright = InternalAnsi.bgBlackBright;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const bgRedBright = InternalAnsi.bgRedBright;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const bgGreenBright = InternalAnsi.bgGreenBright;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const bgYellowBright = InternalAnsi.bgYellowBright;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const bgBlueBright = InternalAnsi.bgBlueBright;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const bgMagentaBright = InternalAnsi.bgMagentaBright;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const bgCyanBright = InternalAnsi.bgCyanBright;\n/**\n * @since 1.0.0\n * @category colors\n */\nexport const bgWhiteBright = InternalAnsi.bgWhiteBright;\n// -----------------------------------------------------------------------------\n// Command Constructors\n// -----------------------------------------------------------------------------\n/**\n * Play a beeping sound.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const beep = InternalAnsi.beep;\n/**\n * Moves the cursor to the specified `row` and `column`.\n *\n * Though the ANSI Control Sequence for Cursor Position is `1`-based, this\n * method takes row and column values starting from `0` and adjusts them to `1`-\n * based values.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorTo = InternalAnsi.cursorTo;\n/**\n * Move the cursor position the specified number of `rows` and `columns`\n * relative to the current cursor position.\n *\n * If the cursor is already at the edge of the screen in either direction, then\n * additional movement will have no effect.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorMove = InternalAnsi.cursorMove;\n/**\n * Moves the cursor up by the specified number of `lines` (default `1`) relative\n * to the current cursor position.\n *\n * If the cursor is already at the edge of the screen, this has no effect.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorUp = InternalAnsi.cursorUp;\n/**\n * Moves the cursor down by the specified number of `lines` (default `1`)\n * relative to the current cursor position.\n *\n * If the cursor is already at the edge of the screen, this has no effect.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorDown = InternalAnsi.cursorDown;\n/**\n * Moves the cursor forward by the specified number of `columns` (default `1`)\n * relative to the current cursor position.\n *\n * If the cursor is already at the edge of the screen, this has no effect.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorForward = InternalAnsi.cursorForward;\n/**\n * Moves the cursor backward by the specified number of `columns` (default `1`)\n * relative to the current cursor position.\n *\n * If the cursor is already at the edge of the screen, this has no effect.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorBackward = InternalAnsi.cursorBackward;\n/**\n * Moves the cursor to the first column of the current row.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorLeft = InternalAnsi.cursorLeft;\n/**\n * Saves the cursor position, encoding shift state and formatting attributes.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorSavePosition = InternalAnsi.cursorSavePosition;\n/**\n * Restores the cursor position, encoding shift state and formatting attributes\n * from the previous save, if any, otherwise resets these all to their defaults.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorRestorePosition = InternalAnsi.cursorRestorePosition;\n/**\n * Moves cursor to beginning of the line the specified number of rows down\n * (default `1`).\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorNextLine = InternalAnsi.cursorNextLine;\n/**\n * Moves cursor to beginning of the line the specified number of rows up\n * (default `1`).\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorPrevLine = InternalAnsi.cursorPrevLine;\n/**\n * Hides the cursor.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorHide = InternalAnsi.cursorHide;\n/**\n * Shows the cursor.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorShow = InternalAnsi.cursorShow;\n/**\n * Erase from the current cursor position up the specified amount of rows.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const eraseLines = InternalAnsi.eraseLines;\n/**\n * Clears from the current cursor position to the end of the current line.\n *\n * The current cursor position does not change.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const eraseEndLine = InternalAnsi.eraseEndLine;\n/**\n * Clears from the current cursor position to the start of the current line.\n *\n * The current cursor position does not change.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const eraseStartLine = InternalAnsi.eraseStartLine;\n/**\n * Clears the current line.\n *\n * The current cursor position does not change.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const eraseLine = InternalAnsi.eraseLine;\n/**\n * Clears from the current cursor position to the end of the screen.\n *\n * The current cursor position does not change.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const eraseDown = InternalAnsi.eraseDown;\n/**\n * Clears from the current cursor position to the beginning of the screen.\n *\n * The current cursor position does not change.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const eraseUp = InternalAnsi.eraseUp;\n/**\n * Clears the entire screen and move the cursor to the upper left.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const eraseScreen = InternalAnsi.eraseScreen;\n// -----------------------------------------------------------------------------\n// Destructors\n// -----------------------------------------------------------------------------\n/**\n * @since 1.0.0\n * @category destructors\n */\nexport const stringify = InternalAnsi.stringify;\n// -----------------------------------------------------------------------------\n// Instances\n// -----------------------------------------------------------------------------\n/**\n * @since 1.0.0\n * @categrory combinators\n */\nexport const combine = InternalAnsi.combine;\n//# sourceMappingURL=Ansi.js.map","import * as Equal from \"effect/Equal\";\nimport { dual } from \"effect/Function\";\nimport * as Hash from \"effect/Hash\";\n// -----------------------------------------------------------------------------\n// Models\n// -----------------------------------------------------------------------------\nconst FlattenSymbolKey = \"@effect/printer/Flatten\";\n/** @internal */\nexport const FlattenTypeId = /*#__PURE__*/Symbol.for(FlattenSymbolKey);\nconst protoHash = {\n Flattened: self => Hash.combine(Hash.hash(self.value))(Hash.string(FlattenSymbolKey)),\n AlreadyFlat: _ => Hash.combine(Hash.string(\"@effect/printer/Flattened/AlreadyFlat\"))(Hash.string(FlattenSymbolKey)),\n NeverFlat: _ => Hash.combine(Hash.string(\"@effect/printer/Flattened/NeverFlat\"))(Hash.string(FlattenSymbolKey))\n};\nconst protoEqual = {\n Flattened: (self, that) => isFlatten(that) && that._tag === \"Flattened\" && Equal.equals(self.value, that.value),\n AlreadyFlat: (_, that) => isFlatten(that) && that._tag === \"AlreadyFlat\",\n NeverFlat: (_, that) => isFlatten(that) && that._tag === \"NeverFlat\"\n};\nconst proto = {\n [FlattenTypeId]: {\n _A: _ => _\n },\n [Hash.symbol]() {\n return Hash.cached(this, protoHash[this._tag](this));\n },\n [Equal.symbol](that) {\n return protoEqual[this._tag](this, that);\n }\n};\n// -----------------------------------------------------------------------------\n// Refinements\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const isFlatten = u => typeof u === \"object\" && u != null && FlattenTypeId in u;\n/** @internal */\nexport const isFlattened = self => self._tag === \"Flattened\";\n/** @internal */\nexport const isAlreadyFlat = self => self._tag === \"AlreadyFlat\";\n/** @internal */\nexport const isNeverFlat = self => self._tag === \"NeverFlat\";\n// -----------------------------------------------------------------------------\n// Constructors\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const flattened = value => (() => {\n const op = Object.create(proto);\n op._tag = \"Flattened\";\n op.value = value;\n return op;\n})();\n/** @internal */\nexport const alreadyFlat = /*#__PURE__*/(() => {\n const op = /*#__PURE__*/Object.create(proto);\n op._tag = \"AlreadyFlat\";\n return op;\n})();\n/** @internal */\nexport const neverFlat = /*#__PURE__*/(() => {\n const op = /*#__PURE__*/Object.create(proto);\n op._tag = \"NeverFlat\";\n return op;\n})();\n// -----------------------------------------------------------------------------\n// Combinators\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const map = /*#__PURE__*/dual(2, (self, f) => {\n switch (self._tag) {\n case \"Flattened\":\n {\n return flattened(f(self.value));\n }\n case \"AlreadyFlat\":\n {\n return alreadyFlat;\n }\n case \"NeverFlat\":\n {\n return neverFlat;\n }\n }\n});\n//# sourceMappingURL=flatten.js.map","import * as covariant from \"@effect/typeclass/Covariant\";\nimport * as Arr from \"effect/Array\";\nimport * as Effect from \"effect/Effect\";\nimport * as Equal from \"effect/Equal\";\nimport { dual, pipe } from \"effect/Function\";\nimport * as Hash from \"effect/Hash\";\nimport { pipeArguments } from \"effect/Pipeable\";\nimport * as InternalFlatten from \"./flatten.js\";\nconst DocSymbolKey = \"@effect/printer/Doc\";\n/** @internal */\nexport const DocTypeId = /*#__PURE__*/Symbol.for(DocSymbolKey);\nconst protoHash = {\n Fail: _ => Hash.combine(Hash.hash(DocSymbolKey))(Hash.hash(\"@effect/printer/Doc/Fail\")),\n Empty: _ => Hash.combine(Hash.hash(DocSymbolKey))(Hash.hash(\"@effect/printer/Doc/Empty\")),\n Char: self => Hash.combine(Hash.hash(DocSymbolKey))(Hash.string(self.char)),\n Text: self => Hash.combine(Hash.hash(DocSymbolKey))(Hash.string(self.text)),\n Line: _ => Hash.combine(Hash.hash(DocSymbolKey))(Hash.hash(\"@effect/printer/Doc/Line\")),\n FlatAlt: self => Hash.combine(Hash.hash(DocSymbolKey))(Hash.combine(Hash.hash(self.left))(Hash.hash(self.right))),\n Cat: self => Hash.combine(Hash.hash(DocSymbolKey))(Hash.combine(Hash.hash(self.left))(Hash.hash(self.right))),\n Nest: self => Hash.combine(Hash.hash(DocSymbolKey))(Hash.combine(Hash.hash(self.indent))(Hash.hash(self.doc))),\n Union: self => Hash.combine(Hash.hash(DocSymbolKey))(Hash.combine(Hash.hash(self.left))(Hash.hash(self.right))),\n Column: self => Hash.combine(Hash.hash(DocSymbolKey))(Hash.hash(self.react)),\n WithPageWidth: self => Hash.combine(Hash.hash(DocSymbolKey))(Hash.hash(self.react)),\n Nesting: self => Hash.combine(Hash.hash(DocSymbolKey))(Hash.hash(self.react)),\n Annotated: self => Hash.combine(Hash.hash(DocSymbolKey))(Hash.combine(Hash.hash(self.annotation))(Hash.hash(self.doc)))\n};\nconst protoEqual = {\n Fail: (_, that) => isDoc(that) && that._tag === \"Fail\",\n Empty: (_, that) => isDoc(that) && that._tag === \"Empty\",\n Char: (self, that) => isDoc(that) && that._tag === \"Char\" && self.char === that.char,\n Text: (self, that) => isDoc(that) && that._tag === \"Text\" && self.text === that.text,\n Line: (_, that) => isDoc(that) && that._tag === \"Line\",\n FlatAlt: (self, that) => isDoc(that) && that._tag === \"FlatAlt\" && Equal.equals(that.left)(self.left) && Equal.equals(that.right)(self.right),\n Cat: (self, that) => isDoc(that) && that._tag === \"Cat\" && Equal.equals(that.left)(self.left) && Equal.equals(that.right)(self.right),\n Nest: (self, that) => isDoc(that) && that._tag === \"Nest\" && self.indent === that.indent && Equal.equals(that.doc)(self.doc),\n Union: (self, that) => isDoc(that) && that._tag === \"Union\" && Equal.equals(that.left)(self.left) && Equal.equals(that.right)(self.right),\n Column: (self, that) => isDoc(that) && that._tag === \"Column\" && Equal.equals(that.react)(self.react),\n WithPageWidth: (self, that) => isDoc(that) && that._tag === \"WithPageWidth\" && Equal.equals(that.react)(self.react),\n Nesting: (self, that) => isDoc(that) && that._tag === \"Nesting\" && Equal.equals(that.react)(self.react),\n Annotated: (self, that) => isDoc(that) && that._tag === \"Annotated\" && Equal.equals(that.annotation)(self.annotation) && Equal.equals(that.doc)(self.doc)\n};\nconst proto = {\n [DocTypeId]: {\n _A: _ => _\n },\n [Hash.symbol]() {\n return Hash.cached(this, protoHash[this._tag](this));\n },\n [Equal.symbol](that) {\n return protoEqual[this._tag](this, that);\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n// -----------------------------------------------------------------------------\n// Refinements\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const isDoc = u => typeof u === \"object\" && u != null && DocTypeId in u;\n/** @internal */\nexport const isFail = self => self._tag === \"Fail\";\n/** @internal */\nexport const isEmpty = self => self._tag === \"Empty\";\n/** @internal */\nexport const isChar = self => self._tag === \"Char\";\n/** @internal */\nexport const isText = self => self._tag === \"Text\";\n/** @internal */\nexport const isLine = self => self._tag === \"Line\";\n/** @internal */\nexport const isFlatAlt = self => self._tag === \"FlatAlt\";\n/** @internal */\nexport const isCat = self => self._tag === \"Cat\";\n/** @internal */\nexport const isNest = self => self._tag === \"Nest\";\n/** @internal */\nexport const isUnion = self => self._tag === \"Union\";\n/** @internal */\nexport const isColumn = self => self._tag === \"Column\";\n/** @internal */\nexport const isWithPageWidth = self => self._tag === \"WithPageWidth\";\n/** @internal */\nexport const isNesting = self => self._tag === \"Nesting\";\n/** @internal */\nexport const isAnnotated = self => self._tag === \"Annotated\";\n// -----------------------------------------------------------------------------\n// Primitives\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const char = char => {\n const op = Object.create(proto);\n op._tag = \"Char\";\n op.char = char;\n return op;\n};\n/** @internal */\nexport const text = text => {\n const op = Object.create(proto);\n op._tag = \"Text\";\n op.text = text;\n return op;\n};\n/** @internal */\nexport const flatAlt = /*#__PURE__*/dual(2, (self, that) => {\n const op = Object.create(proto);\n op._tag = \"FlatAlt\";\n op.left = self;\n op.right = that;\n return op;\n});\n/** @internal */\nexport const union = /*#__PURE__*/dual(2, (self, that) => {\n const op = Object.create(proto);\n op._tag = \"Union\";\n op.left = self;\n op.right = that;\n return op;\n});\n/** @internal */\nexport const cat = /*#__PURE__*/dual(2, (self, that) => {\n const op = Object.create(proto);\n op._tag = \"Cat\";\n op.left = self;\n op.right = that;\n return op;\n});\n/** @internal */\nexport const empty = /*#__PURE__*/(() => {\n const op = /*#__PURE__*/Object.create(proto);\n op._tag = \"Empty\";\n return op;\n})();\n/** @internal */\nexport const fail = /*#__PURE__*/(() => {\n const op = /*#__PURE__*/Object.create(proto);\n op._tag = \"Fail\";\n return op;\n})();\n/** @internal */\nexport const hardLine = /*#__PURE__*/(() => {\n const op = /*#__PURE__*/Object.create(proto);\n op._tag = \"Line\";\n return op;\n})();\n/** @internal */\nexport const line = /*#__PURE__*/flatAlt(hardLine, /*#__PURE__*/char(\" \"));\n/** @internal */\nexport const lineBreak = /*#__PURE__*/flatAlt(hardLine, empty);\n/** @internal */\nexport const softLine = /*#__PURE__*/union(/*#__PURE__*/char(\" \"), hardLine);\n/** @internal */\nexport const softLineBreak = /*#__PURE__*/union(empty, hardLine);\n/** @internal */\nexport const backslash = /*#__PURE__*/char(\"\\\\\");\n/** @internal */\nexport const colon = /*#__PURE__*/char(\":\");\n/** @internal */\nexport const comma = /*#__PURE__*/char(\",\");\n/** @internal */\nexport const dot = /*#__PURE__*/char(\".\");\n/** @internal */\nexport const dquote = /*#__PURE__*/char(\"\\\"\");\n/** @internal */\nexport const equalSign = /*#__PURE__*/char(\"=\");\n/** @internal */\nexport const langle = /*#__PURE__*/char(\"<\");\n/** @internal */\nexport const lbrace = /*#__PURE__*/char(\"{\");\n/** @internal */\nexport const lbracket = /*#__PURE__*/char(\"[\");\n/** @internal */\nexport const lparen = /*#__PURE__*/char(\"(\");\n/** @internal */\nexport const rangle = /*#__PURE__*/char(\">\");\n/** @internal */\nexport const rbrace = /*#__PURE__*/char(\"}\");\n/** @internal */\nexport const rbracket = /*#__PURE__*/char(\"]\");\n/** @internal */\nexport const rparen = /*#__PURE__*/char(\")\");\n/** @internal */\nexport const semi = /*#__PURE__*/char(\";\");\n/** @internal */\nexport const slash = /*#__PURE__*/char(\"/\");\n/** @internal */\nexport const squote = /*#__PURE__*/char(\"'\");\n/** @internal */\nexport const space = /*#__PURE__*/char(\" \");\n/** @internal */\nexport const vbar = /*#__PURE__*/char(\"|\");\n/** @internal */\nexport const cats = docs => group(vcat(docs));\n/** @internal */\nexport const catWithLine = /*#__PURE__*/dual(2, (self, that) => cat(self, cat(line, that)));\n/** @internal */\nexport const catWithLineBreak = /*#__PURE__*/dual(2, (self, that) => cat(self, cat(lineBreak, that)));\n/** @internal */\nexport const catWithSoftLine = /*#__PURE__*/dual(2, (self, that) => cat(self, cat(softLine, that)));\n/** @internal */\nexport const catWithSoftLineBreak = /*#__PURE__*/dual(2, (self, that) => cat(self, cat(softLineBreak, that)));\n/** @internal */\nexport const catWithSpace = /*#__PURE__*/dual(2, (self, that) => cat(self, cat(space, that)));\n/** @internal */\nexport const concatWith = /*#__PURE__*/dual(2, (docs, f) => Arr.matchRight(Arr.fromIterable(docs), {\n onEmpty: () => empty,\n onNonEmpty: (init, last) => Arr.reduceRight(init, last, (curr, acc) => f(acc, curr))\n}));\n/** @internal */\nexport const vcat = docs => concatWith(docs, (left, right) => catWithLineBreak(left, right));\n/** @internal */\nexport const hcat = docs => concatWith(docs, (left, right) => cat(left, right));\n/** @internal */\nexport const fillCat = docs => concatWith(docs, (left, right) => catWithSoftLineBreak(left, right));\n// -----------------------------------------------------------------------------\n// Separation\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const hsep = docs => concatWith(docs, (left, right) => catWithSpace(left, right));\n/** @internal */\nexport const vsep = docs => concatWith(docs, (left, right) => catWithLine(left, right));\n/** @internal */\nexport const fillSep = docs => concatWith(docs, (left, right) => catWithSoftLine(left, right));\n/** @internal */\nexport const seps = docs => group(vsep(docs));\n/** @internal */\nexport const group = self => {\n switch (self._tag) {\n case \"FlatAlt\":\n {\n const flattened = changesUponFlattening(self.right);\n switch (flattened._tag) {\n case \"Flattened\":\n {\n return union(flattened.value, self.left);\n }\n case \"AlreadyFlat\":\n {\n return union(self.right, self.left);\n }\n case \"NeverFlat\":\n {\n return self.left;\n }\n }\n }\n case \"Union\":\n {\n return self;\n }\n default:\n {\n const flattened = changesUponFlattening(self);\n return InternalFlatten.isFlattened(flattened) ? union(flattened.value, self) : self;\n }\n }\n};\n// -----------------------------------------------------------------------------\n// Reactive Layouts\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const column = react => {\n const op = Object.create(proto);\n op._tag = \"Column\";\n op.react = react;\n return op;\n};\n/** @internal */\nexport const nesting = react => {\n const op = Object.create(proto);\n op._tag = \"Nesting\";\n op.react = react;\n return op;\n};\n/** @internal */\nexport const width = /*#__PURE__*/dual(2, (self, react) => column(colStart => cat(self, column(colEnd => react(colEnd - colStart)))));\n/** @internal */\nexport const pageWidth = react => {\n const op = Object.create(proto);\n op._tag = \"WithPageWidth\";\n op.react = react;\n return op;\n};\n// -----------------------------------------------------------------------------\n// Alignment\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const nest = /*#__PURE__*/dual(2, (self, indent) => indent === 0 ? self : (() => {\n const op = Object.create(proto);\n op._tag = \"Nest\";\n op.indent = indent;\n op.doc = self;\n return op;\n})());\n/** @internal */\nexport const align = self => column(position => nesting(level => nest(self, position - level)));\n/** @internal */\nexport const hang = /*#__PURE__*/dual(2, (self, indent) => align(nest(self, indent)));\n/** @internal */\nexport const indent = /*#__PURE__*/dual(2, (self, indent) => hang(cat(spaces(indent), self), indent));\n/** @internal */\nexport const encloseSep = /*#__PURE__*/dual(4, (docs, left, right, sep) => {\n const documents = Arr.fromIterable(docs);\n if (Arr.isEmptyReadonlyArray(documents)) {\n return cat(left, right);\n }\n if (documents.length === 1) {\n return cat(left, cat(documents[0], right));\n }\n const xs = pipe(Arr.makeBy(documents.length - 1, () => sep), Arr.prepend(left), Arr.zipWith(documents, (left, right) => cat(left, right)));\n return cat(cats(xs), right);\n});\n/** @internal */\nexport const list = docs => group(encloseSep(docs, flatAlt(text(\"[ \"), lbracket), flatAlt(text(\" ]\"), rbracket), text(\", \")));\n/** @internal */\nexport const tupled = docs => group(encloseSep(docs, flatAlt(text(\"( \"), lparen), flatAlt(text(\" )\"), rparen), text(\", \")));\n// -----------------------------------------------------------------------------\n// Filling\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const fill = /*#__PURE__*/dual(2, (self, w) => width(self, i => spaces(w - i)));\n/** @internal */\nexport const fillBreak = /*#__PURE__*/dual(2, (self, w) => width(self, i => i > w ? nest(lineBreak, w) : spaces(w - i)));\n// -----------------------------------------------------------------------------\n// Flattening\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const flatten = self => Effect.runSync(flattenSafe(self));\nconst flattenSafe = self => Effect.gen(function* () {\n switch (self._tag) {\n case \"Fail\":\n {\n return self;\n }\n case \"Empty\":\n {\n return self;\n }\n case \"Char\":\n {\n return self;\n }\n case \"Text\":\n {\n return self;\n }\n case \"Line\":\n {\n return fail;\n }\n case \"FlatAlt\":\n {\n return yield* flattenSafe(self.right);\n }\n case \"Cat\":\n {\n const left = yield* flattenSafe(self.left);\n const right = yield* flattenSafe(self.right);\n return cat(left, right);\n }\n case \"Nest\":\n {\n const doc = yield* flattenSafe(self.doc);\n return nest(doc, self.indent);\n }\n case \"Union\":\n {\n return yield* flattenSafe(self.left);\n }\n case \"Column\":\n {\n return column(position => flatten(self.react(position)));\n }\n case \"WithPageWidth\":\n {\n return pageWidth(pageWidth => flatten(self.react(pageWidth)));\n }\n case \"Nesting\":\n {\n return nesting(level => flatten(self.react(level)));\n }\n case \"Annotated\":\n {\n const doc = yield* flattenSafe(self.doc);\n return annotate(doc, self.annotation);\n }\n }\n});\n/** @internal */\nexport const changesUponFlattening = self => Effect.runSync(changesUponFlatteningSafe(self));\nconst changesUponFlatteningSafe = self => Effect.gen(function* () {\n switch (self._tag) {\n case \"Fail\":\n case \"Line\":\n {\n return InternalFlatten.neverFlat;\n }\n case \"Empty\":\n case \"Char\":\n case \"Text\":\n {\n return InternalFlatten.alreadyFlat;\n }\n case \"FlatAlt\":\n {\n const doc = yield* flattenSafe(self.right);\n return InternalFlatten.flattened(doc);\n }\n case \"Cat\":\n {\n const left = yield* changesUponFlatteningSafe(self.left);\n const right = yield* changesUponFlatteningSafe(self.right);\n if (InternalFlatten.isNeverFlat(left) || InternalFlatten.isNeverFlat(right)) {\n return InternalFlatten.neverFlat;\n }\n if (InternalFlatten.isFlattened(left) && InternalFlatten.isFlattened(right)) {\n return InternalFlatten.flattened(cat(left.value, right.value));\n }\n if (InternalFlatten.isFlattened(left) && InternalFlatten.isAlreadyFlat(right)) {\n return InternalFlatten.flattened(cat(left.value, self.right));\n }\n if (InternalFlatten.isAlreadyFlat(left) && InternalFlatten.isFlattened(right)) {\n return InternalFlatten.flattened(cat(self.left, right.value));\n }\n if (InternalFlatten.isAlreadyFlat(left) && InternalFlatten.isAlreadyFlat(right)) {\n return InternalFlatten.alreadyFlat;\n }\n throw new Error(\"[BUG]: Doc.changesUponFlattening - unable to flatten a Cat document \" + \"- please open an issue at https://github.com/IMax153/contentlayer/issues/new\");\n }\n case \"Nest\":\n {\n return yield* pipe(changesUponFlatteningSafe(self.doc), Effect.map(InternalFlatten.map(doc => nest(doc, self.indent))));\n }\n case \"Union\":\n {\n return InternalFlatten.flattened(self.left);\n }\n case \"Column\":\n {\n const doc = column(position => Effect.runSync(flattenSafe(self.react(position))));\n return InternalFlatten.flattened(doc);\n }\n case \"WithPageWidth\":\n {\n const doc = pageWidth(pageWidth => Effect.runSync(flattenSafe(self.react(pageWidth))));\n return InternalFlatten.flattened(doc);\n }\n case \"Nesting\":\n {\n const doc = nesting(level => Effect.runSync(flattenSafe(self.react(level))));\n return InternalFlatten.flattened(doc);\n }\n case \"Annotated\":\n {\n return yield* pipe(changesUponFlatteningSafe(self.doc), Effect.map(InternalFlatten.map(doc => annotate(doc, self.annotation))));\n }\n }\n});\n// -----------------------------------------------------------------------------\n// Annotations\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const annotate = /*#__PURE__*/dual(2, (self, annotation) => {\n const op = Object.create(proto);\n op._tag = \"Annotated\";\n op.doc = self;\n op.annotation = annotation;\n return op;\n});\n/** @internal */\nexport const alterAnnotations = /*#__PURE__*/dual(2, (self, f) => Effect.runSync(alterAnnotationsSafe(self, f)));\nconst alterAnnotationsSafe = (self, f) => {\n switch (self._tag) {\n case \"Cat\":\n {\n return Effect.zipWith(Effect.suspend(() => alterAnnotationsSafe(self.left, f)), alterAnnotationsSafe(self.right, f), (left, right) => cat(left, right));\n }\n case \"FlatAlt\":\n {\n return Effect.zipWith(Effect.suspend(() => alterAnnotationsSafe(self.left, f)), alterAnnotationsSafe(self.right, f), (left, right) => flatAlt(left, right));\n }\n case \"Union\":\n {\n return Effect.zipWith(Effect.suspend(() => alterAnnotationsSafe(self.left, f)), alterAnnotationsSafe(self.right, f), (left, right) => union(left, right));\n }\n case \"Nest\":\n {\n return Effect.map(Effect.suspend(() => alterAnnotationsSafe(self.doc, f)), nest(self.indent));\n }\n case \"Column\":\n {\n return Effect.succeed(column(position => Effect.runSync(alterAnnotationsSafe(self.react(position), f))));\n }\n case \"WithPageWidth\":\n {\n return Effect.succeed(pageWidth(pageWidth => Effect.runSync(alterAnnotationsSafe(self.react(pageWidth), f))));\n }\n case \"Nesting\":\n {\n return Effect.succeed(nesting(level => Effect.runSync(alterAnnotationsSafe(self.react(level), f))));\n }\n case \"Annotated\":\n {\n return Effect.map(alterAnnotationsSafe(self.doc, f), doc => Arr.reduceRight(Arr.fromIterable(f(self.annotation)), doc, (doc, b) => annotate(doc, b)));\n }\n default:\n {\n return Effect.succeed(self);\n }\n }\n};\n/** @internal */\nexport const reAnnotate = /*#__PURE__*/dual(2, (self, f) => alterAnnotations(self, a => [f(a)]));\n/** @internal */\nexport const unAnnotate = self => alterAnnotations(() => [])(self);\n// -----------------------------------------------------------------------------\n// Instances\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const map = reAnnotate;\n/** @internal */\nexport const imap = /*#__PURE__*/covariant.imap(map);\n/** @internal */\nexport const getSemigroup = () => ({\n combine: cat,\n combineMany: (self, others) => cat(self, cats(others))\n});\n/** @internal */\nexport const getMonoid = () => ({\n empty,\n combine: cat,\n combineMany: (self, others) => cat(self, cats(others)),\n combineAll: cats\n});\n/** @internal */\nexport const Covariant = {\n map,\n imap\n};\n/** @internal */\nexport const Invariant = {\n imap\n};\n// -----------------------------------------------------------------------------\n// Utilities\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const string = str => {\n return cats(str.split(\"\\n\").map(s => s.length === 0 ? empty : s.length === 1 ? char(s) : text(s)));\n};\nconst stripControlCharacters = value => {\n let sanitized = \"\";\n for (let i = 0; i < value.length; i++) {\n const code = value.charCodeAt(i);\n if ((code > 0x1f || code === 0x09 || code === 0x0a) && (code < 0x7f || code > 0x9f)) {\n sanitized += value[i];\n }\n }\n return sanitized;\n};\nconst sanitizeLeaf = self => {\n const value = self._tag === \"Char\" ? self.char : self.text;\n const sanitized = stripControlCharacters(value);\n if (sanitized === value) {\n return self;\n }\n if (sanitized.length === 0) {\n return empty;\n }\n return sanitized.length === 1 ? char(sanitized) : text(sanitized);\n};\n/** @internal */\nexport const sanitize = self => Effect.runSync(sanitizeSafe(self));\nconst sanitizeSafe = self => {\n switch (self._tag) {\n case \"Char\":\n case \"Text\":\n {\n return Effect.succeed(sanitizeLeaf(self));\n }\n case \"Cat\":\n {\n return Effect.zipWith(Effect.suspend(() => sanitizeSafe(self.left)), sanitizeSafe(self.right), (left, right) => cat(left, right));\n }\n case \"FlatAlt\":\n {\n return Effect.zipWith(Effect.suspend(() => sanitizeSafe(self.left)), sanitizeSafe(self.right), (left, right) => flatAlt(left, right));\n }\n case \"Union\":\n {\n return Effect.zipWith(Effect.suspend(() => sanitizeSafe(self.left)), sanitizeSafe(self.right), (left, right) => union(left, right));\n }\n case \"Nest\":\n {\n return Effect.map(Effect.suspend(() => sanitizeSafe(self.doc)), nest(self.indent));\n }\n case \"Column\":\n {\n return Effect.succeed(column(position => Effect.runSync(sanitizeSafe(self.react(position)))));\n }\n case \"WithPageWidth\":\n {\n return Effect.succeed(pageWidth(width => Effect.runSync(sanitizeSafe(self.react(width)))));\n }\n case \"Nesting\":\n {\n return Effect.succeed(nesting(level => Effect.runSync(sanitizeSafe(self.react(level)))));\n }\n case \"Annotated\":\n {\n return Effect.map(Effect.suspend(() => sanitizeSafe(self.doc)), doc => annotate(doc, self.annotation));\n }\n default:\n {\n return Effect.succeed(self);\n }\n }\n};\n/** @internal */\nexport const surround = /*#__PURE__*/dual(3, (self, left, right) => cat(left, cat(self, right)));\n/** @internal */\nexport const singleQuoted = self => surround(self, squote, squote);\n/** @Internal */\nexport const doubleQuoted = self => surround(self, dquote, dquote);\n/** @internal */\nexport const parenthesized = self => surround(self, lparen, rparen);\n/** @internal */\nexport const angleBracketed = self => surround(self, langle, rangle);\n/** @internal */\nexport const squareBracketed = self => surround(self, lbracket, rbracket);\n/** @internal */\nexport const curlyBraced = self => surround(self, lbrace, rbrace);\n/** @internal */\nexport const spaces = n => {\n if (n <= 0) {\n return empty;\n }\n if (n === 1) {\n return char(\" \");\n }\n return text(textSpaces(n));\n};\n/** @internal */\nexport const words = (str, splitChar = \" \") => str.split(splitChar).map(word => {\n if (word === \"\") {\n return empty;\n }\n if (word === \"\\n\") {\n return hardLine;\n }\n if (word.length === 1) {\n return char(word);\n }\n return text(word);\n});\n/** @internal */\nexport const reflow = (s, char = \" \") => fillSep(words(s, char));\n/** @internal */\nexport const punctuate = /*#__PURE__*/dual(2, (docs, punctuator) => {\n const documents = Arr.fromIterable(docs);\n return Arr.map(documents, (x, i) => documents.length - 1 === i ? x : cat(x, punctuator));\n});\n/** @internal */\nexport const match = /*#__PURE__*/dual(2, (self, patterns) => {\n switch (self._tag) {\n case \"Fail\":\n {\n return patterns.Fail();\n }\n case \"Empty\":\n {\n return patterns.Empty();\n }\n case \"Char\":\n {\n return patterns.Char(self.char);\n }\n case \"Text\":\n {\n return patterns.Text(self.text);\n }\n case \"Line\":\n {\n return patterns.Line();\n }\n case \"FlatAlt\":\n {\n return patterns.FlatAlt(self.left, self.right);\n }\n case \"Cat\":\n {\n return patterns.Cat(self.left, self.right);\n }\n case \"Nest\":\n {\n return patterns.Nest(self.indent, self.doc);\n }\n case \"Union\":\n {\n return patterns.Union(self.left, self.right);\n }\n case \"Column\":\n {\n return patterns.Column(self.react);\n }\n case \"WithPageWidth\":\n {\n return patterns.WithPageWidth(self.react);\n }\n case \"Nesting\":\n {\n return patterns.Nesting(self.react);\n }\n case \"Annotated\":\n {\n return patterns.Annotated(self.annotation, self.doc);\n }\n }\n});\n/** @internal */\nexport const textSpaces = n => {\n let s = \"\";\n for (let i = 0; i < n; i++) {\n s = s += \" \";\n }\n return s;\n};\n//# sourceMappingURL=doc.js.map","import * as covariant from \"@effect/typeclass/Covariant\";\nimport * as Effect from \"effect/Effect\";\nimport * as Equal from \"effect/Equal\";\nimport { dual, pipe } from \"effect/Function\";\nimport * as Hash from \"effect/Hash\";\nimport * as List from \"effect/List\";\nimport * as Option from \"effect/Option\";\n// -----------------------------------------------------------------------------\n// Models\n// -----------------------------------------------------------------------------\nconst DocStreamSymbolKey = \"@effect/printer/DocStream\";\n/** @internal */\nexport const DocStreamTypeId = /*#__PURE__*/Symbol.for(DocStreamSymbolKey);\nconst protoHash = {\n FailedStream: _ => pipe(Hash.string(\"@effect/printer/DocStream/FailedStream\"), Hash.combine(Hash.string(DocStreamSymbolKey))),\n EmptyStream: _ => pipe(Hash.string(\"@effect/printer/DocStream/EmptyStream\"), Hash.combine(Hash.string(DocStreamSymbolKey))),\n CharStream: self => pipe(Hash.hash(\"@effect/printer/DocStream/CharStream\"), Hash.combine(Hash.string(DocStreamSymbolKey)), Hash.combine(Hash.string(self.char)), Hash.combine(Hash.hash(self.stream))),\n TextStream: self => pipe(Hash.string(\"@effect/printer/DocStream/TextStream\"), Hash.combine(Hash.string(DocStreamSymbolKey)), Hash.combine(Hash.string(self.text)), Hash.combine(Hash.hash(self.stream))),\n LineStream: self => pipe(Hash.string(\"@effect/printer/DocStream/LineStream\"), Hash.combine(Hash.string(DocStreamSymbolKey)), Hash.combine(Hash.hash(self.stream))),\n PushAnnotationStream: self => pipe(Hash.string(\"@effect/printer/DocStream/PopAnnotationStream\"), Hash.combine(Hash.string(DocStreamSymbolKey)), Hash.combine(Hash.hash(self.annotation)), Hash.combine(Hash.hash(self.stream))),\n PopAnnotationStream: self => pipe(Hash.string(\"@effect/printer/DocStream/PopAnnotationStream\"), Hash.combine(Hash.string(DocStreamSymbolKey)), Hash.combine(Hash.hash(self.stream)))\n};\nconst protoEqual = {\n FailedStream: (self, that) => isDocStream(that) && that._tag === \"FailedStream\",\n EmptyStream: (self, that) => isDocStream(that) && that._tag === \"EmptyStream\",\n CharStream: (self, that) => isDocStream(that) && that._tag === \"CharStream\" && self.char === that.char && Equal.equals(self.stream, that.stream),\n TextStream: (self, that) => isDocStream(that) && that._tag === \"TextStream\" && self.text === that.text && Equal.equals(self.stream, that.stream),\n LineStream: (self, that) => isDocStream(that) && that._tag === \"LineStream\" && Equal.equals(self.stream, that.stream),\n PushAnnotationStream: (self, that) => isDocStream(that) && that._tag === \"PushAnnotationStream\" && Equal.equals(self.annotation, that.annotation) && Equal.equals(self.stream, that.stream),\n PopAnnotationStream: (self, that) => isDocStream(that) && that._tag === \"PopAnnotationStream\" && Equal.equals(self.stream, that.stream)\n};\nconst proto = {\n [DocStreamTypeId]: {\n _A: _ => _\n },\n [Hash.symbol]() {\n return Hash.cached(this, protoHash[this._tag](this));\n },\n [Equal.symbol](that) {\n return protoEqual[this._tag](this, that);\n }\n};\n// -----------------------------------------------------------------------------\n// Refinements\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const isDocStream = u => typeof u === \"object\" && u != null && DocStreamTypeId in u;\n/** @internal */\nexport const isFailedStream = self => self._tag === \"FailedStream\";\n/** @internal */\nexport const isEmptyStream = self => self._tag === \"EmptyStream\";\n/** @internal */\nexport const isCharStream = self => self._tag === \"CharStream\";\n/** @internal */\nexport const isTextStream = self => self._tag === \"TextStream\";\n/** @internal */\nexport const isLineStream = self => self._tag === \"LineStream\";\n/** @internal */\nexport const isPushAnnotationStream = self => self._tag === \"PushAnnotationStream\";\n/** @internal */\nexport const isPopAnnotationStream = self => self._tag === \"PopAnnotationStream\";\n// -----------------------------------------------------------------------------\n// Constructors\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const failed = /*#__PURE__*/(() => {\n const op = /*#__PURE__*/Object.create(proto);\n op._tag = \"FailedStream\";\n return op;\n})();\n/** @internal */\nexport const empty = /*#__PURE__*/(() => {\n const op = /*#__PURE__*/Object.create(proto);\n op._tag = \"EmptyStream\";\n return op;\n})();\n/** @internal */\nexport const char = /*#__PURE__*/dual(2, (self, char) => {\n const op = Object.create(proto);\n op._tag = \"CharStream\";\n op.char = char;\n op.stream = self;\n return op;\n});\n/** @internal */\nexport const text = /*#__PURE__*/dual(2, (self, text) => {\n const op = Object.create(proto);\n op._tag = \"TextStream\";\n op.text = text;\n op.stream = self;\n return op;\n});\n/** @internal */\nexport const line = /*#__PURE__*/dual(2, (self, indentation) => {\n const op = Object.create(proto);\n op._tag = \"LineStream\";\n op.indentation = indentation;\n op.stream = self;\n return op;\n});\n/** @internal */\nexport const pushAnnotation = /*#__PURE__*/dual(2, (self, annotation) => {\n const op = Object.create(proto);\n op._tag = \"PushAnnotationStream\";\n op.annotation = annotation;\n op.stream = self;\n return op;\n});\n/** @internal */\nexport const popAnnotation = stream => {\n const op = Object.create(proto);\n op._tag = \"PopAnnotationStream\";\n op.stream = stream;\n return op;\n};\nconst Remove = \"Remove\";\nconst DontRemove = \"DontRemove\";\n/** @internal */\nexport const alterAnnotations = /*#__PURE__*/dual(2, (self, f) => Effect.runSync(alterAnnotationSafe(self, f, List.nil())));\nconst alterAnnotationSafe = (self, f, stack) => {\n switch (self._tag) {\n case \"CharStream\":\n {\n return Effect.map(Effect.suspend(() => alterAnnotationSafe(self.stream, f, stack)), char(self.char));\n }\n case \"TextStream\":\n {\n return Effect.map(Effect.suspend(() => alterAnnotationSafe(self.stream, f, stack)), text(self.text));\n }\n case \"LineStream\":\n {\n return Effect.map(Effect.suspend(() => alterAnnotationSafe(self.stream, f, stack)), line(self.indentation));\n }\n case \"PushAnnotationStream\":\n {\n const altered = f(self.annotation);\n if (Option.isSome(altered)) {\n return Effect.map(Effect.suspend(() => alterAnnotationSafe(self.stream, f, List.prepend(stack, DontRemove))), pushAnnotation(altered.value));\n }\n return Effect.suspend(() => alterAnnotationSafe(self.stream, f, List.prepend(stack, Remove)));\n }\n case \"PopAnnotationStream\":\n {\n if (List.isNil(stack)) {\n return Effect.dieMessage(\"BUG: DocStream.alterAnnotations - received empty stack to pop from\" + \" - please report an issue at https://github.com/Effect-TS/printer/issues\");\n }\n if (stack.head === DontRemove) {\n return Effect.map(Effect.suspend(() => alterAnnotationSafe(self.stream, f, stack.tail)), popAnnotation);\n }\n return Effect.suspend(() => alterAnnotationSafe(self.stream, f, stack.tail));\n }\n default:\n {\n return Effect.succeed(self);\n }\n }\n};\n/** @internal */\nexport const reAnnotate = /*#__PURE__*/dual(2, (self, f) => Effect.runSync(reAnnotateSafe(self, f)));\nconst reAnnotateSafe = (self, f) => {\n switch (self._tag) {\n case \"CharStream\":\n {\n return Effect.map(Effect.suspend(() => reAnnotateSafe(self.stream, f)), char(self.char));\n }\n case \"TextStream\":\n {\n return Effect.map(Effect.suspend(() => reAnnotateSafe(self.stream, f)), text(self.text));\n }\n case \"LineStream\":\n {\n return Effect.map(Effect.suspend(() => reAnnotateSafe(self.stream, f)), line(self.indentation));\n }\n case \"PushAnnotationStream\":\n {\n return Effect.map(Effect.suspend(() => reAnnotateSafe(self.stream, f)), pushAnnotation(f(self.annotation)));\n }\n case \"PopAnnotationStream\":\n {\n return Effect.suspend(() => reAnnotateSafe(self.stream, f));\n }\n default:\n {\n return Effect.succeed(self);\n }\n }\n};\n/** @internal */\nexport const unAnnotate = self => Effect.runSync(unAnnotateSafe(self));\nconst unAnnotateSafe = self => {\n switch (self._tag) {\n case \"CharStream\":\n {\n return Effect.map(Effect.suspend(() => unAnnotateSafe(self.stream)), char(self.char));\n }\n case \"TextStream\":\n {\n return Effect.map(Effect.suspend(() => unAnnotateSafe(self.stream)), text(self.text));\n }\n case \"LineStream\":\n {\n return Effect.map(Effect.suspend(() => unAnnotateSafe(self.stream)), line(self.indentation));\n }\n case \"PushAnnotationStream\":\n case \"PopAnnotationStream\":\n {\n return Effect.suspend(() => unAnnotateSafe(self.stream));\n }\n default:\n {\n return Effect.succeed(self);\n }\n }\n};\n// -----------------------------------------------------------------------------\n// Folding\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const foldMap = /*#__PURE__*/dual(3, (self, M, f) => Effect.runSync(foldMapSafe(self, M, f)));\nconst foldMapSafe = (self, M, f) => {\n switch (self._tag) {\n case \"CharStream\":\n {\n return Effect.suspend(() => foldMapSafe(self.stream, M, f));\n }\n case \"TextStream\":\n {\n return Effect.suspend(() => foldMapSafe(self.stream, M, f));\n }\n case \"LineStream\":\n {\n return Effect.suspend(() => foldMapSafe(self.stream, M, f));\n }\n case \"PushAnnotationStream\":\n {\n return Effect.map(Effect.suspend(() => foldMapSafe(self.stream, M, f)), that => M.combine(f(self.annotation), that));\n }\n case \"PopAnnotationStream\":\n {\n return Effect.suspend(() => foldMapSafe(self.stream, M, f));\n }\n default:\n {\n return Effect.succeed(M.empty);\n }\n }\n};\n/** @internal */\nexport const match = /*#__PURE__*/dual(2, (self, patterns) => {\n switch (self._tag) {\n case \"FailedStream\":\n {\n return patterns.FailedStream();\n }\n case \"EmptyStream\":\n {\n return patterns.EmptyStream();\n }\n case \"CharStream\":\n {\n return patterns.CharStream(self.char, self.stream);\n }\n case \"TextStream\":\n {\n return patterns.TextStream(self.text, self.stream);\n }\n case \"LineStream\":\n {\n return patterns.LineStream(self.indentation, self.stream);\n }\n case \"PushAnnotationStream\":\n {\n return patterns.PushAnnotationStream(self.annotation, self.stream);\n }\n case \"PopAnnotationStream\":\n {\n return patterns.PopAnnotationStream(self.stream);\n }\n }\n});\n// -----------------------------------------------------------------------------\n// Instances\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const map = reAnnotate;\n/** @internal */\nexport const imap = /*#__PURE__*/covariant.imap(map);\n/** @internal */\nexport const Covariant = {\n map,\n imap\n};\n/** @internal */\nexport const Invariant = {\n imap\n};\n//# sourceMappingURL=docStream.js.map","/** @internal */\nexport const nil = {\n _tag: \"Nil\"\n};\n/** @internal */\nexport const cons = (indent, document, pipeline) => ({\n _tag: \"Cons\",\n indent,\n document,\n pipeline\n});\n/** @internal */\nexport const undoAnnotation = pipeline => ({\n _tag: \"UndoAnnotation\",\n pipeline\n});\n//# sourceMappingURL=layoutPipeline.js.map","import * as Equal from \"effect/Equal\";\nimport { pipe } from \"effect/Function\";\nimport * as Hash from \"effect/Hash\";\n// -----------------------------------------------------------------------------\n// Models\n// -----------------------------------------------------------------------------\nconst PageWidthSymbolKey = \"@effect/printer/PageWidth\";\n/** @internal */\nexport const PageWidthTypeId = /*#__PURE__*/Symbol.for(PageWidthSymbolKey);\nconst protoHash = {\n AvailablePerLine: self => pipe(Hash.hash(\"@effect/printer/PageWidth/AvailablePerLine\"), Hash.combine(Hash.hash(PageWidthSymbolKey)), Hash.combine(Hash.hash(self.lineWidth)), Hash.combine(Hash.hash(self.ribbonFraction))),\n Unbounded: _ => pipe(Hash.hash(\"@effect/printer/PageWidth/Unbounded\"), Hash.combine(Hash.hash(PageWidthSymbolKey)))\n};\nconst protoEqual = {\n AvailablePerLine: (self, that) => isPageWidth(that) && that._tag === \"AvailablePerLine\" && self.lineWidth === that.lineWidth && self.ribbonFraction === that.ribbonFraction,\n Unbounded: (self, that) => isPageWidth(that) && that._tag === \"Unbounded\"\n};\nconst proto = {\n [PageWidthTypeId]: PageWidthTypeId,\n [Hash.symbol]() {\n return Hash.cached(this, protoHash[this._tag](this));\n },\n [Equal.symbol](that) {\n return protoEqual[this._tag](this, that);\n }\n};\n// -----------------------------------------------------------------------------\n// Refinements\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const isPageWidth = u => typeof u === \"object\" && u != null && PageWidthTypeId in u;\n/** @internal */\nexport const isAvailablePerLine = self => self._tag === \"AvailablePerLine\";\n/** @internal */\nexport const isUnbounded = self => self._tag === \"AvailablePerLine\";\n// -----------------------------------------------------------------------------\n// Constructors\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const availablePerLine = (lineWidth, ribbonFraction) => {\n const op = Object.create(proto);\n op._tag = \"AvailablePerLine\";\n op.lineWidth = lineWidth;\n op.ribbonFraction = ribbonFraction;\n return op;\n};\n/** @internal */\nexport const unbounded = /*#__PURE__*/(() => {\n const op = /*#__PURE__*/Object.create(proto);\n op._tag = \"Unbounded\";\n return op;\n})();\n/** @internal */\nexport const defaultPageWidth = /*#__PURE__*/availablePerLine(80, 1);\n// -----------------------------------------------------------------------------\n// Utilities\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const remainingWidth = (pageWidth, ribbonFraction, indentation, currentColumn) => {\n const columnsLeftInLine = pageWidth - currentColumn;\n const ribbonWidth = Math.max(0, Math.min(pageWidth, Math.floor(pageWidth * ribbonFraction)));\n const columnsLeftInRibbon = indentation + ribbonWidth - currentColumn;\n return Math.min(columnsLeftInLine, columnsLeftInRibbon);\n};\n//# sourceMappingURL=pageWidth.js.map","import * as Effect from \"effect/Effect\";\nimport { dual } from \"effect/Function\";\nimport * as List from \"effect/List\";\nimport * as Option from \"effect/Option\";\nimport * as InternalDocStream from \"./docStream.js\";\nimport * as InternalPipeline from \"./layoutPipeline.js\";\nimport * as InternalPageWidth from \"./pageWidth.js\";\n/** @internal */\nexport const options = pageWidth => ({\n pageWidth\n});\n/** @internal */\nexport const defaultOptions = /*#__PURE__*/options(InternalPageWidth.defaultPageWidth);\n// -----------------------------------------------------------------------------\n// wadlerLeijen\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const wadlerLeijen = /*#__PURE__*/dual(3, (self, fits, options) => Effect.runSync(wadlerLeijenSafe(InternalPipeline.cons(0, self, InternalPipeline.nil), 0, 0, fits, options)));\nconst wadlerLeijenSafe = (self, nestingLevel, currentColumn, fits, options) => {\n const best = (self, nl, cc) => Effect.gen(function* () {\n switch (self._tag) {\n case \"Nil\":\n {\n return InternalDocStream.empty;\n }\n case \"Cons\":\n {\n switch (self.document._tag) {\n case \"Fail\":\n {\n return InternalDocStream.failed;\n }\n case \"Empty\":\n {\n return yield* best(self.pipeline, nl, cc);\n }\n case \"Char\":\n {\n const stream = yield* best(self.pipeline, nl, cc + 1);\n return InternalDocStream.char(stream, self.document.char);\n }\n case \"Text\":\n {\n const length = self.document.text.length;\n const stream = yield* best(self.pipeline, nl, cc + length);\n return InternalDocStream.text(stream, self.document.text);\n }\n case \"Line\":\n {\n const stream = yield* best(self.pipeline, self.indent, self.indent);\n // Do not produce indentation if there is no subsequent text on\n // the same line (prevents trailing whitespace)\n const nextIndent = InternalDocStream.isEmptyStream(stream) || InternalDocStream.isLineStream(stream) ? 0 : self.indent;\n return InternalDocStream.line(stream, nextIndent);\n }\n case \"FlatAlt\":\n {\n const next = InternalPipeline.cons(self.indent, self.document.left, self.pipeline);\n return yield* best(next, nl, cc);\n }\n case \"Cat\":\n {\n const inner = InternalPipeline.cons(self.indent, self.document.right, self.pipeline);\n const outer = InternalPipeline.cons(self.indent, self.document.left, inner);\n return yield* best(outer, nl, cc);\n }\n case \"Nest\":\n {\n const indent = self.indent + self.document.indent;\n const next = InternalPipeline.cons(indent, self.document.doc, self.pipeline);\n return yield* best(next, nl, cc);\n }\n case \"Union\":\n {\n const leftPipeline = InternalPipeline.cons(self.indent, self.document.left, self.pipeline);\n const rightPipeline = InternalPipeline.cons(self.indent, self.document.right, self.pipeline);\n const left = best(leftPipeline, nl, cc);\n const right = best(rightPipeline, nl, cc);\n return selectNicer(fits, nl, cc, left, right);\n }\n case \"Column\":\n {\n const doc = self.document.react(cc);\n const next = InternalPipeline.cons(self.indent, doc, self.pipeline);\n return yield* best(next, nl, cc);\n }\n case \"WithPageWidth\":\n {\n const doc = self.document.react(options.pageWidth);\n const next = InternalPipeline.cons(self.indent, doc, self.pipeline);\n return yield* best(next, nl, cc);\n }\n case \"Nesting\":\n {\n const doc = self.document.react(self.indent);\n const next = InternalPipeline.cons(self.indent, doc, self.pipeline);\n return yield* best(next, nl, cc);\n }\n case \"Annotated\":\n {\n const undo = InternalPipeline.undoAnnotation(self.pipeline);\n const next = InternalPipeline.cons(self.indent, self.document.doc, undo);\n const stream = yield* best(next, nl, cc);\n return InternalDocStream.pushAnnotation(stream, self.document.annotation);\n }\n }\n }\n case \"UndoAnnotation\":\n {\n const stream = yield* best(self.pipeline, nestingLevel, currentColumn);\n return InternalDocStream.popAnnotation(stream);\n }\n }\n });\n return best(self, nestingLevel, currentColumn);\n};\nconst selectNicer = (fits, lineIndent, currentColumn, left, right) => {\n const leftStream = Effect.runSync(left);\n let rightStream = undefined;\n return fits(leftStream, lineIndent, currentColumn, () => rightStream ?? (rightStream = Effect.runSync(right), rightStream)) ? leftStream : rightStream ?? Effect.runSync(right);\n};\n// -----------------------------------------------------------------------------\n// compact\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const compact = self => Effect.runSync(compactSafe(List.of(self), 0));\nconst compactSafe = (docs, i) => Effect.gen(function* () {\n if (List.isNil(docs)) {\n return InternalDocStream.empty;\n }\n const head = docs.head;\n const tail = docs.tail;\n switch (head._tag) {\n case \"Fail\":\n {\n return InternalDocStream.failed;\n }\n case \"Empty\":\n {\n return yield* compactSafe(tail, i);\n }\n case \"Char\":\n {\n const stream = yield* compactSafe(tail, i + 1);\n return InternalDocStream.char(stream, head.char);\n }\n case \"Text\":\n {\n const stream = yield* compactSafe(tail, i + head.text.length);\n return InternalDocStream.text(stream, head.text);\n }\n case \"Line\":\n {\n const stream = yield* compactSafe(tail, 0);\n return InternalDocStream.line(stream, 0);\n }\n case \"FlatAlt\":\n {\n return yield* compactSafe(List.cons(head.left, tail), i);\n }\n case \"Cat\":\n {\n const list = List.cons(head.left, List.cons(head.right, tail));\n return yield* compactSafe(list, i);\n }\n case \"Nest\":\n {\n return yield* compactSafe(List.cons(head.doc, tail), i);\n }\n case \"Union\":\n {\n return yield* compactSafe(List.cons(head.right, tail), i);\n }\n case \"Column\":\n {\n return yield* compactSafe(List.cons(head.react(i), tail), i);\n }\n case \"WithPageWidth\":\n {\n return yield* compactSafe(List.cons(head.react(InternalPageWidth.unbounded), tail), i);\n }\n case \"Nesting\":\n {\n return yield* compactSafe(List.cons(head.react(0), tail), i);\n }\n case \"Annotated\":\n {\n return yield* compactSafe(List.cons(head.doc, tail), i);\n }\n }\n});\n// -----------------------------------------------------------------------------\n// pretty\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const pretty = /*#__PURE__*/dual(2, (self, options) => {\n const width = options.pageWidth;\n if (width._tag === \"AvailablePerLine\") {\n return wadlerLeijen(self, (stream, indentation, currentColumn) => {\n const remainingWidth = InternalPageWidth.remainingWidth(width.lineWidth, width.ribbonFraction, indentation, currentColumn);\n return fitsPretty(stream, remainingWidth);\n }, options);\n }\n return unbounded(self);\n});\nconst fitsPretty = (self, width) => {\n let w = width;\n let stream = self;\n while (w >= 0) {\n switch (stream._tag) {\n case \"FailedStream\":\n {\n return false;\n }\n case \"EmptyStream\":\n {\n return true;\n }\n case \"CharStream\":\n {\n w = w - 1;\n stream = stream.stream;\n break;\n }\n case \"TextStream\":\n {\n w = w - stream.text.length;\n stream = stream.stream;\n break;\n }\n case \"LineStream\":\n {\n return true;\n }\n case \"PushAnnotationStream\":\n {\n stream = stream.stream;\n break;\n }\n case \"PopAnnotationStream\":\n {\n stream = stream.stream;\n break;\n }\n }\n }\n return false;\n};\n// -----------------------------------------------------------------------------\n// smart\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const smart = /*#__PURE__*/dual(2, (self, options) => {\n const width = options.pageWidth;\n if (width._tag === \"AvailablePerLine\") {\n return wadlerLeijen(self, fitsSmart(width.lineWidth, width.ribbonFraction), options);\n }\n return unbounded(self);\n});\nconst fitsSmart = (pageWidth, ribbonFraction) => {\n return (stream, indentation, currentColumn, comparator) => {\n const availableWidth = InternalPageWidth.remainingWidth(pageWidth, ribbonFraction, indentation, currentColumn);\n return fitsSmartLoop(stream, comparator, pageWidth, currentColumn, availableWidth);\n };\n};\nconst fitsSmartLoop = (self, comparator, pageWidth, currentColumn, availableWidth) => {\n let minNestingLevel;\n let stream = self;\n let w = availableWidth;\n while (w >= 0) {\n switch (stream._tag) {\n case \"FailedStream\":\n {\n return false;\n }\n case \"EmptyStream\":\n {\n return true;\n }\n case \"CharStream\":\n {\n w = w - 1;\n stream = stream.stream;\n break;\n }\n case \"TextStream\":\n {\n w = w - stream.text.length;\n stream = stream.stream;\n break;\n }\n case \"LineStream\":\n {\n if (!minNestingLevel) {\n minNestingLevel = Option.match(getInitialIndentation(comparator()), {\n // Definitely not a hanging layout. Return the same `minNestingLevel` that\n // subsequent lines with the same indentation use\n onNone: () => currentColumn,\n // Could be a (less wide) hanging layout, so take the minimum of the indent\n // and the current column\n onSome: value => Math.min(value, currentColumn)\n });\n }\n if (minNestingLevel < stream.indentation) {\n return false;\n }\n w = pageWidth - stream.indentation;\n stream = stream.stream;\n break;\n }\n case \"PushAnnotationStream\":\n {\n stream = stream.stream;\n break;\n }\n case \"PopAnnotationStream\":\n {\n stream = stream.stream;\n break;\n }\n }\n }\n return false;\n};\nconst getInitialIndentation = self => {\n let stream = self;\n while (stream._tag === \"LineStream\" || stream._tag === \"PushAnnotationStream\" || stream._tag === \"PopAnnotationStream\") {\n if (stream._tag === \"LineStream\") {\n return Option.some(stream.indentation);\n }\n stream = stream.stream;\n }\n return Option.none();\n};\n// -----------------------------------------------------------------------------\n// unbounded\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const unbounded = self => wadlerLeijen(self, stream => !failsOnFirstLine(stream), {\n pageWidth: InternalPageWidth.unbounded\n});\nconst failsOnFirstLine = self => {\n let stream = self;\n // eslint-disable-next-line no-constant-condition\n while (1) {\n switch (stream._tag) {\n case \"FailedStream\":\n {\n return true;\n }\n case \"EmptyStream\":\n {\n return false;\n }\n case \"CharStream\":\n {\n stream = stream.stream;\n break;\n }\n case \"TextStream\":\n {\n stream = stream.stream;\n break;\n }\n case \"LineStream\":\n {\n return false;\n }\n case \"PushAnnotationStream\":\n {\n stream = stream.stream;\n break;\n }\n case \"PopAnnotationStream\":\n {\n stream = stream.stream;\n break;\n }\n }\n }\n throw new Error(\"bug\");\n};\n//# sourceMappingURL=layout.js.map","/**\n * The abstract data type `Doc<A>` represents prettified documents that have\n * been annotated with data of type `A`.\n *\n * More specifically, a value of type `Doc` represents a non-empty set of\n * possible layouts for a given document. The layout algorithms select one of\n * these possibilities, taking into account variables such as the width of the\n * document.\n *\n * The annotation is an arbitrary piece of data associated with (part of) a\n * document. Annotations may be used by rendering algorithms to display\n * documents differently by providing information such as:\n * - color information (e.g., when rendering to the terminal)\n * - mouseover text (e.g., when rendering to rich HTML)\n * - whether to show something or not (to allow simple or detailed versions)\n *\n * @since 1.0.0\n */\nimport * as internal from \"./internal/doc.js\";\nimport * as InternalRender from \"./internal/render.js\";\n// -----------------------------------------------------------------------------\n// Models\n// -----------------------------------------------------------------------------\n/**\n * @since 1.0.0\n * @category symbol\n */\nexport const DocTypeId = internal.DocTypeId;\n// -----------------------------------------------------------------------------\n// Refinements\n// -----------------------------------------------------------------------------\n/**\n * Returns `true` if the specified value is a `Doc`, `false` otherwise.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isDoc = internal.isDoc;\n/**\n * Returns `true` if the specified `Doc` is a `Fail`, `false` otherwise.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isFail = internal.isFail;\n/**\n * Returns `true` if the specified `Doc` is an `Empty`, `false` otherwise.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isEmpty = internal.isEmpty;\n/**\n * Returns `true` if the specified `Doc` is a `Char`, `false` otherwise.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isChar = internal.isChar;\n/**\n * Returns `true` if the specified `Doc` is a `Text`, `false` otherwise.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isText = internal.isText;\n/**\n * Returns `true` if the specified `Doc` is a `Line`, `false` otherwise.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isLine = internal.isLine;\n/**\n * Returns `true` if the specified `Doc` is a `FlatAlt`, `false` otherwise.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isFlatAlt = internal.isFlatAlt;\n/**\n * Returns `true` if the specified `Doc` is a `Cat`, `false` otherwise.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isCat = internal.isCat;\n/**\n * Returns `true` if the specified `Doc` is a `Nest`, `false` otherwise.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isNest = internal.isNest;\n/**\n * Returns `true` if the specified `Doc` is a `Union`, `false` otherwise.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isUnion = internal.isUnion;\n/**\n * Returns `true` if the specified `Doc` is a `Column`, `false` otherwise.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isColumn = internal.isColumn;\n/**\n * Returns `true` if the specified `Doc` is a `WithPageWidth`, `false` otherwise.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isWithPageWidth = internal.isWithPageWidth;\n/**\n * Returns `true` if the specified `Doc` is a `Nesting`, `false` otherwise.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isNesting = internal.isNesting;\n/**\n * Returns `true` if the specified `Doc` is a `Annotated`, `false` otherwise.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isAnnotated = internal.isAnnotated;\n// -----------------------------------------------------------------------------\n// Constructors\n// -----------------------------------------------------------------------------\n/**\n * A document containing a single character.\n *\n * **Invariants**\n * - Cannot be the newline (`\"\\n\"`) character\n *\n * Control characters are preserved verbatim. Apply `sanitize` before rendering\n * a document containing untrusted text to a terminal.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const char = internal.char;\n/**\n * A document containing a string of text.\n *\n * **Invariants**\n * - Text cannot be less than two characters long\n * - Text cannot contain a newline (`\"\\n\"`) character\n *\n * Control characters are preserved verbatim. Apply `sanitize` before rendering\n * a document containing untrusted text to a terminal.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const text = internal.text;\n/**\n * Constructs a document containing a string of text.\n *\n * **Note**: newline characters (`\\n`) contained in the provided string will be\n * disregarded (i.e. not rendered) in the output document.\n *\n * Control characters are preserved verbatim. Apply `sanitize` before rendering\n * a document containing untrusted text to a terminal.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const string = internal.string;\n// -----------------------------------------------------------------------------\n// Primitives\n// -----------------------------------------------------------------------------\n/**\n * The `empty` document behaves like a document containing the empty string\n * (`\"\"`), so it has a height of `1`.\n *\n * This may lead to surprising behavior if the empty document is expected to\n * bear no weight inside certain layout functions, such as`vcat`, where it will\n * render an empty line of output.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import * as String from \"effect/String\"\n *\n * const doc = Doc.vsep([\n * Doc.text(\"hello\"),\n * // `parentheses` for visibility purposes only\n * Doc.parenthesized(Doc.empty),\n * Doc.text(\"world\")\n * ])\n *\n * const expected = `|hello\n * |()\n * |world`\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * String.stripMargin(expected)\n * )\n * ```\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const empty = internal.empty;\n/**\n * The `fail` document is a document that cannot be rendered.\n *\n * Generally occurs when flattening a line. The layout algorithms will reject\n * this document and choose a more suitable rendering.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const fail = internal.fail;\n/**\n * The `line` document advances to the next line and indents to the current\n * nesting level. However, `line` will behave like `space` if the line break is\n * undone by `group`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import * as String from \"effect/String\"\n *\n * const doc: Doc.Doc<never> = Doc.hcat([\n * Doc.text(\"lorem ipsum\"),\n * Doc.line,\n * Doc.text(\"dolor sit amet\")\n * ])\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * String.stripMargin(\n * `|lorem ipsum\n * |dolor sit amet`\n * )\n * )\n * assert.strictEqual(\n * Doc.render(Doc.group(doc), { style: \"pretty\" }),\n * \"lorem ipsum dolor sit amet\"\n * )\n * ```\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const line = internal.line;\n/**\n * The `lineBreak` document is like `line` but behaves like `empty` if the line\n * break is undone by `group` (instead of `space`).\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import * as String from \"effect/String\"\n *\n * const doc: Doc.Doc<never> = Doc.hcat([\n * Doc.text(\"lorem ipsum\"),\n * Doc.lineBreak,\n * Doc.text(\"dolor sit amet\")\n * ])\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * String.stripMargin(\n * `|lorem ipsum\n * |dolor sit amet`\n * )\n * )\n * assert.strictEqual(\n * Doc.render(Doc.group(doc), { style: \"pretty\" }),\n * \"lorem ipsumdolor sit amet\"\n * )\n * ```\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const lineBreak = internal.lineBreak;\n/**\n * The `softLine` document behaves like `space` if the resulting output fits\n * onto the page, otherwise it behaves like `line`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import * as String from \"effect/String\"\n *\n * const doc: Doc.Doc<never> = Doc.hcat([\n * Doc.text(\"lorem ipsum\"),\n * Doc.softLine,\n * Doc.text(\"dolor sit amet\")\n * ])\n *\n * // Here we have enough space to put everything onto one line\n * assert.strictEqual(\n * Doc.render(doc, {\n * style: \"pretty\",\n * options: { lineWidth: 80 }\n * }),\n * \"lorem ipsum dolor sit amet\"\n * )\n *\n * // If the page width is narrowed to `10`, the layout algorithm will\n * // introduce a line break\n * assert.strictEqual(\n * Doc.render(Doc.group(doc), {\n * style: \"pretty\",\n * options: { lineWidth: 10 }\n * }),\n * String.stripMargin(\n * `|lorem ipsum\n * |dolor sit amet`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const softLine = internal.softLine;\n/**\n * The `softLineBreak` document is similar to `softLine`, but behaves like\n * `empty` if the resulting output does not fit onto the page (instead of\n * `space`).\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import * as String from \"effect/String\"\n *\n * const doc: Doc.Doc<never> = Doc.hcat([\n * Doc.text(\"ThisText\"),\n * Doc.softLineBreak,\n * Doc.text(\"IsWayTooLong\")\n * ])\n *\n * // With enough space, we get direct concatenation of documents:\n * assert.strictEqual(\n * Doc.render(doc, {\n * style: \"pretty\",\n * options: { lineWidth: 80 }\n * }),\n * \"ThisTextIsWayTooLong\"\n * )\n *\n * // If the page width is narrowed to `10`, the layout algorithm will\n * // introduce a line break\n * assert.strictEqual(\n * Doc.render(Doc.group(doc), {\n * style: \"pretty\",\n * options: { lineWidth: 10 }\n * }),\n * String.stripMargin(\n * `|ThisText\n * |IsWayTooLong`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const softLineBreak = internal.softLineBreak;\n/**\n * The `hardLine` document is always laid out as a line break, regardless of\n * space or whether or not the document was `group`\"ed.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import * as String from \"effect/String\"\n *\n * const doc: Doc.Doc<never> = Doc.hcat([\n * Doc.text(\"lorem ipsum\"),\n * Doc.hardLine,\n * Doc.text(\"dolor sit amet\")\n * ])\n *\n * // Even with enough space, a line break is introduced\n * assert.strictEqual(\n * Doc.render(doc, {\n * style: \"pretty\",\n * options: { lineWidth: 1000 }\n * }),\n * String.stripMargin(\n * `|lorem ipsum\n * |dolor sit amet`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const hardLine = internal.hardLine;\n/**\n * A document containing a single `\\` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const backslash = internal.backslash;\n/**\n * A document containing a single `:` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const colon = internal.colon;\n/**\n * A document containing a single `,` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const comma = internal.comma;\n/**\n * A document containing a single `.` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const dot = internal.dot;\n/**\n * A document containing a single `\"` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const dquote = internal.dquote;\n/**\n * A document containing a single `=` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const equalSign = internal.equalSign;\n/**\n * A document containing a single `<` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const langle = internal.langle;\n/**\n * A document containing a single `{` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const lbrace = internal.lbrace;\n/**\n * A document containing a single `[` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const lbracket = internal.lbracket;\n/**\n * A document containing a single `(` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const lparen = internal.lparen;\n/**\n * A document containing a single `>` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const rangle = internal.rangle;\n/**\n * A document containing a single `}` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const rbrace = internal.rbrace;\n/**\n * A document containing a single `]` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const rbracket = internal.rbracket;\n/**\n * A document containing a single `)` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const rparen = internal.rparen;\n/**\n * A document containing a single `;` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const semi = internal.semi;\n/**\n * A document containing a single `/` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const slash = internal.slash;\n/**\n * A document containing a single `\"` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const squote = internal.squote;\n/**\n * A document containing a single ` ` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const space = internal.space;\n/**\n * A document containing a single `|` character.\n *\n * @since 1.0.0\n * @category primitives\n */\nexport const vbar = internal.vbar;\n// -----------------------------------------------------------------------------\n// Concatenation\n// -----------------------------------------------------------------------------\n/**\n * The `cat` combinator lays out two documents separated by nothing.\n *\n * @since 1.0.0\n * @category concatenation\n */\nexport const cat = internal.cat;\n/**\n * The `cats` combinator will attempt to lay out a collection of documents\n * separated by nothing. If the output does not fit the page, then the documents\n * will be separated by newlines. This is what differentiates it from `vcat`,\n * which always lays out documents beneath one another.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import * as String from \"effect/String\"\n *\n * const doc: Doc.Doc<never> = Doc.hsep([\n * Doc.text(\"Docs:\"),\n * Doc.cats(Doc.words(\"lorem ipsum dolor\"))\n * ])\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * \"Docs: loremipsumdolor\"\n * )\n *\n * // If the document exceeds the width of the page, the documents are rendered\n * // one above another\n * assert.strictEqual(\n * Doc.render(doc, {\n * style: \"pretty\",\n * options: { lineWidth: 10 }\n * }),\n * String.stripMargin(\n * `|Docs: lorem\n * |ipsum\n * |dolor`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category concatenation\n */\nexport const cats = internal.cats;\n/**\n * The `catWithLine` combinator concatenates two documents by placing a `line`\n * document between them.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import { pipe } from \"effect/Function\"\n * import * as String from \"effect/String\"\n *\n * const doc: Doc.Doc<never> = pipe(\n * Doc.char(\"a\"),\n * Doc.catWithLine(Doc.char(\"b\"))\n * )\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * String.stripMargin(\n * `|a\n * |b`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category concatenation\n */\nexport const catWithLine = internal.catWithLine;\n/**\n * The `catWithLineBreak` combinator concatenates two documents by placing a\n * `lineBreak` document between them.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import { pipe } from \"effect/Function\"\n * import * as String from \"effect/String\"\n *\n * const doc: Doc.Doc<never> = pipe(\n * Doc.char(\"a\"),\n * Doc.catWithLineBreak(Doc.char(\"b\"))\n * )\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * String.stripMargin(\n * `|a\n * |b`\n * )\n * )\n *\n * assert.strictEqual(\n * Doc.render(Doc.group(doc), { style: \"pretty\" }),\n * \"ab\"\n * )\n * ```\n *\n * @since 1.0.0\n * @category concatenation\n */\nexport const catWithLineBreak = internal.catWithLineBreak;\n/**\n * The `catWithSoftLine` combinator concatenates two documents by placing a\n * `softLine` document between them.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import { pipe } from \"effect/Function\"\n * import * as String from \"effect/String\"\n *\n * const doc: Doc.Doc<never> = pipe(\n * Doc.char(\"a\"),\n * Doc.catWithSoftLine(Doc.char(\"b\"))\n * )\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * \"a b\"\n * )\n *\n * assert.strictEqual(\n * Doc.render(doc, {\n * style: \"pretty\",\n * options: { lineWidth: 1 }\n * }),\n * String.stripMargin(\n * `|a\n * |b`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category concatenation\n */\nexport const catWithSoftLine = internal.catWithSoftLine;\n/**\n * The `catWithSoftLineBreak` combinator concatenates two documents by\n * placing a `softLineBreak` document between them.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import { pipe } from \"effect/Function\"\n * import * as String from \"effect/String\"\n *\n * const doc: Doc.Doc<never> = pipe(\n * Doc.char(\"a\"),\n * Doc.catWithSoftLineBreak(Doc.char(\"b\"))\n * )\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * \"ab\"\n * )\n *\n * assert.strictEqual(\n * Doc.render(doc, {\n * style: \"pretty\",\n * options: { lineWidth: 1 }\n * }),\n * String.stripMargin(\n * `|a\n * |b`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category concatenation\n */\nexport const catWithSoftLineBreak = internal.catWithSoftLineBreak;\n/**\n * The `catWithSpace` combinator concatenates two documents by placing a\n * `space` document between them.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import { pipe } from \"effect/Function\"\n *\n * const doc: Doc.Doc<never> = pipe(\n * Doc.char(\"a\"),\n * Doc.catWithSpace(Doc.char(\"b\"))\n * )\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * \"a b\"\n * )\n * ```\n *\n * @since 1.0.0\n * @category concatenation\n */\nexport const catWithSpace = internal.catWithSpace;\n/**\n * The `concatWith` combinator concatenates all documents in a collection\n * element-wise with the specified binary function.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import { pipe } from \"effect/Function\"\n *\n * const doc: Doc.Doc<never> = pipe(\n * [Doc.char(\"a\"), Doc.char(\"b\")],\n * Doc.concatWith((x, y) => Doc.catWithSpace(y)(x))\n * )\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * \"a b\"\n * )\n * ```\n *\n * @since 1.0.0\n * @category concatenation\n */\nexport const concatWith = internal.concatWith;\n/**\n * The `vcat` combinator concatenates all documents in a collection vertically.\n * If the output is grouped then the line breaks are removed.\n *\n * In other words `vcat` is like `vsep`, with newlines removed instead of\n * replaced by spaces.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import * as String from \"effect/String\"\n *\n * const doc: Doc.Doc<never> = Doc.vcat(Doc.words(\"lorem ipsum dolor\"))\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * String.stripMargin(\n * `|lorem\n * |ipsum\n * |dolor`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category concatenation\n */\nexport const vcat = internal.vcat;\n/**\n * The `hcat` combinator concatenates all documents in a collection horizontally\n * without any spacing.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import * as String from \"effect/String\"\n *\n * const doc: Doc.Doc<never> = Doc.hcat(Doc.words(\"lorem ipsum dolor\"))\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * \"loremipsumdolor\"\n * )\n * ```\n *\n * @since 1.0.0\n * @category concatenation\n */\nexport const hcat = internal.hcat;\n/**\n * The `fillCat` combinator concatenates all documents in a collection\n * horizontally by placing a `empty` between each pair of documents as long as\n * they fit the page. Once the page width is exceeded, a `lineBreak` is inserted\n * and the process is repeated for all documents in the collection.\n *\n * **Note**: the use of `lineBreak` means that if `group`ed, the documents will\n * be separated with `empty` instead of newlines. See `fillSep` if you want a\n * `space` instead.\n *\n * @since 1.0.0\n * @category concatenation\n */\nexport const fillCat = internal.fillCat;\n// -----------------------------------------------------------------------------\n// Separation\n// -----------------------------------------------------------------------------\n/**\n * The `hsep` combinator concatenates all documents in a collection horizontally\n * by placing a `space` between each pair of documents.\n *\n * For automatic line breaks, consider using `fillSep`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n *\n * const doc: Doc.Doc<never> = Doc.hsep(Doc.words(\"lorem ipsum dolor sit amet\"))\n *\n * assert.strictEqual(\n * Doc.render(doc, {\n * style: \"pretty\",\n * options: { lineWidth: 80 }\n * }),\n * \"lorem ipsum dolor sit amet\"\n * )\n *\n * // The `hsep` combinator will not introduce line breaks on its own, even when\n * // the page is too narrow\n * assert.strictEqual(\n * Doc.render(doc, {\n * style: \"pretty\",\n * options: { lineWidth: 5 }\n * }),\n * \"lorem ipsum dolor sit amet\"\n * )\n * ```\n *\n * @since 1.0.0\n * @category separation\n */\nexport const hsep = internal.hsep;\n/**\n * The `vsep` combinator concatenates all documents in a collection vertically.\n * If a `group` undoes the line breaks inserted by `vsep`, the documents are\n * separated with a space instead.\n *\n * When a `vsep` is `group`ed, the documents are separated with a `space` if the\n * layoutfits the page, otherwise nothing is done. See the `sep` convenience\n * function for this use case.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import * as String from \"effect/String\"\n *\n * const unaligned = Doc.hsep([\n * Doc.text(\"prefix\"),\n * Doc.vsep(Doc.words(\"text to lay out\"))\n * ])\n *\n * assert.strictEqual(\n * Doc.render(unaligned, { style: \"pretty\" }),\n * String.stripMargin(\n * `|prefix text\n * |to\n * |lay\n * |out`\n * )\n * )\n *\n * // The `align` function can be used to align the documents under their first\n * // element\n * const aligned = Doc.hsep([\n * Doc.text(\"prefix\"),\n * Doc.align(Doc.vsep(Doc.words(\"text to lay out\")))\n * ])\n *\n * assert.strictEqual(\n * Doc.render(aligned, { style: \"pretty\" }),\n * String.stripMargin(\n * `|prefix text\n * | to\n * | lay\n * | out`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category separation\n */\nexport const vsep = internal.vsep;\n/**\n * The `fillSep` combinator concatenates all documents in a collection\n * horizontally by placing a `space` between each pair of documents as long as\n * they fit the page. Once the page width is exceeded, a `line` is inserted and\n * the process is repeated for all documents in the collection.\n *\n * **Note**: the use of `line` means that if `group`ed, the documents will be\n * separated with a `space` instead of newlines. See `fillCat` if you do not\n * want a `space`.\n *\n * @since 1.0.0\n * @category separation\n */\nexport const fillSep = internal.fillSep;\n/**\n * The `seps` combinator will attempt to lay out a collection of documents\n * separated by `space`s. If the output does not fit the page, then the\n * documents will be separated by newlines. This is what differentiates it from\n * `vsep`, which always lays out documents beneath one another.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import * as String from \"effect/String\"\n *\n * const doc: Doc.Doc<never> = Doc.hsep([\n * Doc.text(\"prefix\"),\n * Doc.seps(Doc.words(\"text to lay out\"))\n * ])\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * \"prefix text to lay out\"\n * )\n *\n * // If the page width is too narrow, documents are separated by newlines\n * assert.strictEqual(\n * Doc.render(doc, {\n * style: \"pretty\",\n * options: { lineWidth: 20 }\n * }),\n * String.stripMargin(\n * `|prefix text\n * |to\n * |lay\n * |out`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category separation\n */\nexport const seps = internal.seps;\n// -----------------------------------------------------------------------------\n// Alternative Layouts\n// -----------------------------------------------------------------------------\n/**\n * The `flatAlt` document will render `left` by default. However, when\n * `group`ed, `y` will be preferred with `left` as the fallback for cases where\n * `y` does not fit onto the page.\n *\n * **NOTE**:\n * Users should be careful to ensure that `left` is less wide than `right`.\n * Otherwise, if `right` ends up not fitting the page, then the layout\n * algorithms will fall back to an even wider layout.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import { pipe } from \"effect/Function\"\n * import * as String from \"effect/String\"\n *\n * const open = pipe(Doc.empty, Doc.flatAlt(Doc.text(\"{ \")))\n * const close = pipe(Doc.empty, Doc.flatAlt(Doc.text(\" }\")))\n * const separator = pipe(Doc.empty, Doc.flatAlt(Doc.text(\"; \")))\n *\n * const prettyDo = <A>(documents: Array<Doc.Doc<A>>): Doc.Doc<A> => {\n * return pipe(\n * Doc.hsep([\n * Doc.text(\"do\"),\n * pipe(\n * documents,\n * Doc.encloseSep(open, close, separator),\n * Doc.align\n * )\n * ]),\n * Doc.group\n * )\n * }\n *\n * const statements = [\n * Doc.text(\"name:_ <- getArgs\"),\n * Doc.text(\"let greet = \\\"Hello, \\\" <> name\"),\n * Doc.text(\"putStrLn greet\")\n * ]\n *\n * // If it fits, then the content is put onto a single line with the `{;}` style\n * assert.strictEqual(\n * pipe(\n * prettyDo(statements),\n * Doc.render({\n * style: \"pretty\",\n * options: { lineWidth: 80 }\n * })\n * ),\n * \"do { name:_ <- getArgs; let greet = \\\"Hello, \\\" <> name; putStrLn greet }\"\n * )\n *\n * // When there is not enough space, the content is broken up onto multiple lines\n * assert.strictEqual(\n * pipe(\n * prettyDo(statements),\n * Doc.render({\n * style: \"pretty\",\n * options: { lineWidth: 10 }\n * })\n * ),\n * String.stripMargin(\n * `|do name:_ <- getArgs\n * | let greet = \"Hello, \" <> name\n * | putStrLn greet`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category alternative layouts\n */\nexport const flatAlt = internal.flatAlt;\n/**\n * @since 1.0.0\n * @category alternative layouts\n */\nexport const union = internal.union;\n/**\n * The `group` combinator attempts to lay out a document onto a single line by\n * removing the contained line breaks. If the result does not fit the page, or\n * if a `hardLine` prevents flattening the document, `x` is laid out without\n * any changes.\n *\n * The `group` function is key to layouts that adapt to available space nicely.\n *\n * @since 1.0.0\n * @category alternative layouts\n */\nexport const group = internal.group;\n// -----------------------------------------------------------------------------\n// Reactive Layouts\n// -----------------------------------------------------------------------------\n/**\n * Lays out a document depending upon the column at which the document starts.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import * as String from \"effect/String\"\n *\n * // Example 1:\n * const example1 = Doc.column((l) =>\n * Doc.hsep([Doc.text(\"Columns are\"), Doc.text(`${l}-based`)])\n * )\n *\n * assert.strictEqual(\n * Doc.render(example1, { style: \"pretty\" }),\n * \"Columns are 0-based\"\n * )\n *\n * // Example 2:\n * const doc = Doc.hsep([\n * Doc.text(\"prefix\"),\n * Doc.column((l) => Doc.text(`| <- column ${l}`))\n * ])\n *\n * const example2 = Doc.vsep([0, 4, 8].map((n) => Doc.indent(n)(doc)))\n *\n * assert.strictEqual(\n * Doc.render(example2, { style: \"pretty\" }),\n * String.stripMargin(\n * `|prefix | <- column 7\n * | prefix | <- column 11\n * | prefix | <- column 15`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category reactive layouts\n */\nexport const column = internal.column;\n/**\n * Lays out a document depending upon the current nesting level (i.e., the\n * current indentation of the document).\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import * as String from \"effect/String\"\n *\n * const doc = Doc.hsep([\n * Doc.text(\"prefix\"),\n * Doc.nesting((l) => Doc.squareBracketed(Doc.text(`Nested: ${l}`)))\n * ])\n *\n * const example = Doc.vsep([0, 4, 8].map((n) => Doc.indent(n)(doc)))\n *\n * assert.strictEqual(\n * Doc.render(example, { style: \"pretty\" }),\n * String.stripMargin(\n * `|prefix [Nested: 0]\n * | prefix [Nested: 4]\n * | prefix [Nested: 8]`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category reactive layouts\n */\nexport const nesting = internal.nesting;\n/**\n * The `width` combinator makes the column width of a document available to the\n * document while rendering.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import { pipe } from \"effect/Function\"\n * import * as String from \"effect/String\"\n *\n * const annotate = <A>(doc: Doc.Doc<A>): Doc.Doc<A> =>\n * pipe(\n * Doc.squareBracketed(doc),\n * Doc.width((w) => Doc.text(` <- width: ${w}`))\n * )\n *\n * const docs = [\n * Doc.text(\"---\"),\n * Doc.text(\"------\"),\n * Doc.indent(Doc.text(\"---\"), 3),\n * Doc.vsep([Doc.text(\"---\"), Doc.indent(Doc.text(\"---\"), 4)])\n * ]\n *\n * const doc = Doc.align(Doc.vsep(docs.map(annotate)))\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * String.stripMargin(\n * `|[---] <- width: 5\n * |[------] <- width: 8\n * |[ ---] <- width: 8\n * |[---\n * | ---] <- width: 8`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category reactive layouts\n */\nexport const width = internal.width;\n/**\n * Lays out a document according to the document\"s`PageWidth`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import * as String from \"effect/String\"\n *\n * const doc = Doc.hsep([\n * Doc.text(\"prefix\"),\n * Doc.pageWidth((pageWidth) => {\n * switch (pageWidth._tag) {\n * case \"AvailablePerLine\": {\n * const { lineWidth, ribbonFraction } = pageWidth\n * return Doc.squareBracketed(\n * Doc.text(`Width: ${lineWidth}, Ribbon Fraction: ${ribbonFraction}`)\n * )\n * }\n * case \"Unbounded\": {\n * return Doc.empty\n * }\n * }\n * })\n * ])\n *\n * const example = Doc.vsep([0, 4, 8].map((n) => Doc.indent(n)(doc)))\n *\n * assert.strictEqual(\n * Doc.render(example, {\n * style: \"pretty\",\n * options: { lineWidth: 32 }\n * }),\n * String.stripMargin(\n * `|prefix [Width: 32, Ribbon Fraction: 1]\n * | prefix [Width: 32, Ribbon Fraction: 1]\n * | prefix [Width: 32, Ribbon Fraction: 1]`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const pageWidth = internal.pageWidth;\n// -----------------------------------------------------------------------------\n// Alignment\n// -----------------------------------------------------------------------------\n/**\n * Lays out a document with the current nesting level (indentation\n * of the following lines) increased by the specified `indent`.\n * Negative values are allowed and will decrease the nesting level\n * accordingly.\n *\n * See also:\n * * `hang`: nest a document relative to the current cursor\n * position instead of the current nesting level\n * * `align`: set the nesting level to the current cursor\n * position\n * * `indent`: increase the indentation on the spot, padding\n * any empty space with spaces\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import { pipe } from \"effect/Function\"\n * import * as String from \"effect/String\"\n *\n * const doc = Doc.vsep([\n * pipe(Doc.vsep(Doc.words(\"lorem ipsum dolor\")), Doc.nest(4)),\n * Doc.text(\"sit\"),\n * Doc.text(\"amet\")\n * ])\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * String.stripMargin(\n * `|lorem\n * | ipsum\n * | dolor\n * |sit\n * |amet`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category alignment\n */\nexport const nest = internal.nest;\n/**\n * The `align` combinator lays out a document with the nesting level set to the\n * current column.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import * as String from \"effect/String\"\n *\n * // As an example, the documents below will be placed one above the other\n * // regardless of the current nesting level\n *\n * // Without `align`ment, the second line is simply placed below everything\n * // that has been laid out so far\n * const unaligned = Doc.hsep([\n * Doc.text(\"lorem\"),\n * Doc.vsep([Doc.text(\"ipsum\"), Doc.text(\"dolor\")])\n * ])\n *\n * assert.strictEqual(\n * Doc.render(unaligned, { style: \"pretty\" }),\n * String.stripMargin(\n * `|lorem ipsum\n * |dolor`\n * )\n * )\n *\n * // With `align`ment, the `vsep`ed documents all start at the same column\n * const aligned = Doc.hsep([\n * Doc.text(\"lorem\"),\n * Doc.align(Doc.vsep([Doc.text(\"ipsum\"), Doc.text(\"dolor\")]))\n * ])\n *\n * assert.strictEqual(\n * Doc.render(aligned, { style: \"pretty\" }),\n * String.stripMargin(\n * `|lorem ipsum\n * | dolor`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category alignment\n */\nexport const align = internal.align;\n/**\n * The `hang` combinator lays out a document with the nesting level set to\n * the *current column* plus the specified `indent`. Negative values for\n * `indent` are allowed and decrease the nesting level accordingly.\n *\n * This differs from the `nest` combinator, which is based on the *current\n * nesting level* plus the specified `indent`. When you\"re not sure, try the\n * more efficient combinator (`nest`) first.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import { pipe } from \"effect/Function\"\n * import * as String from \"effect/String\"\n *\n * const doc = Doc.hsep([\n * Doc.text(\"prefix\"),\n * pipe(Doc.reflow(\"Indenting these words with hang\"), Doc.hang(4))\n * ])\n *\n * assert.strictEqual(\n * Doc.render(doc, {\n * style: \"pretty\",\n * options: { lineWidth: 24 }\n * }),\n * String.stripMargin(\n * `|prefix Indenting these\n * | words with\n * | hang`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category alignment\n */\nexport const hang = internal.hang;\n/**\n * The `indent` combinator indents a document by the specified `indent`\n * beginning from the current cursor position.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import { pipe } from \"effect/Function\"\n * import * as String from \"effect/String\"\n *\n * const doc = Doc.hcat([\n * Doc.text(\"prefix\"),\n * pipe(Doc.reflow(\"The indent function indents these words!\"), Doc.indent(4))\n * ])\n *\n * assert.strictEqual(\n * Doc.render(doc, {\n * style: \"pretty\",\n * options: { lineWidth: 24 }\n * }),\n * String.stripMargin(\n * `|prefix The indent\n * | function\n * | indents these\n * | words!`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category alignment\n */\nexport const indent = internal.indent;\n/**\n * The `encloseSep` combinator concatenates a collection of documents,\n * separating each document in the collection using the specified `sep`\n * document. After concatenation, the resulting document is enclosed by the\n * specified `left` and `right` documents.\n *\n * To place the `sep` document at the end of each entry, see the `punctuate`\n * combinator.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import { pipe } from \"effect/Function\"\n * import * as String from \"effect/String\"\n *\n * const doc = Doc.hsep([\n * Doc.text(\"list\"),\n * Doc.align(\n * pipe(\n * [\"1\", \"20\", \"300\", \"4000\"].map(\n * (n) => n.length === 1 ? Doc.char(n) : Doc.text(n)\n * ),\n * Doc.encloseSep(Doc.lbracket, Doc.rbracket, Doc.comma)\n * )\n * )\n * ])\n *\n * // The documents are laid out horizontally if the document fits the page\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * \"list [1,20,300,4000]\"\n * )\n *\n * // Otherwise they are laid out vertically, with separators put in the front\n * assert.strictEqual(\n * Doc.render(doc, {\n * style: \"pretty\",\n * options: { lineWidth: 10 }\n * }),\n * String.stripMargin(\n * `|list [1\n * | ,20\n * | ,300\n * | ,4000]`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category alignment\n */\nexport const encloseSep = internal.encloseSep;\n/**\n * A Haskell-inspired variant of `encloseSep` that uses a comma as the separator\n * and braces as the enclosure for a collection of documents.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n *\n * const doc = Doc.list(\n * [\"1\", \"20\", \"300\", \"4000\"].map(\n * (n) => (n.length === 1 ? Doc.char(n) : Doc.text(n))\n * )\n * )\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * \"[1, 20, 300, 4000]\"\n * )\n * ```\n *\n * @since 1.0.0\n * @category alignment\n */\nexport const list = internal.list;\n/**\n * A Haskell-inspired variant of `encloseSep` that uses a comma as the separator\n * and parentheses as the enclosure for a collection of documents.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n *\n * const doc = Doc.tupled(\n * [\"1\", \"20\", \"300\", \"4000\"].map(\n * (n) => (n.length === 1 ? Doc.char(n) : Doc.text(n))\n * )\n * )\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * \"(1, 20, 300, 4000)\"\n * )\n * ```\n *\n * @since 1.0.0\n * @category alignment\n */\nexport const tupled = internal.tupled;\n// -----------------------------------------------------------------------------\n// Filling\n// -----------------------------------------------------------------------------\n/**\n * The `fill` combinator first lays out the document `x` and then appends\n * `space`s until the width of the document is equal to the specified `width`.\n * If the width of `x` is already larger than the specified `width`, nothing is\n * appended.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import { pipe } from \"effect/Function\"\n * import * as String from \"effect/String\"\n *\n * type Signature = [name: string, type: string]\n *\n * const signatures: Array<Signature> = [\n * [\"empty\", \"Doc\"],\n * [\"nest\", \"Int -> Doc -> Doc\"],\n * [\"fillSep\", \"[Doc] -> Doc\"]\n * ]\n *\n * const prettySignature = <A>([name, type]: Signature): Doc.Doc<A> =>\n * Doc.hsep([\n * pipe(Doc.text(name), Doc.fill(5)),\n * Doc.text(\"::\"),\n * Doc.text(type)\n * ])\n *\n * const doc = Doc.hsep([\n * Doc.text(\"let\"),\n * Doc.align(Doc.vcat(signatures.map(prettySignature)))\n * ])\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * String.stripMargin(\n * `|let empty :: Doc\n * | nest :: Int -> Doc -> Doc\n * | fillSep :: [Doc] -> Doc`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category filling\n */\nexport const fill = internal.fill;\n/**\n * The `fillBreak` combinator first lays out the document `x` and then appends\n * `space`s until the width of the document is equal to the specified `width`.\n * If the width of `x` is already larger than the specified `width`, the nesting\n * level is increased by the specified `width` and a `line` is appended.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import { pipe } from \"effect/Function\"\n * import * as String from \"effect/String\"\n *\n * type Signature = [name: string, type: string]\n *\n * const signatures: Array<Signature> = [\n * [\"empty\", \"Doc\"],\n * [\"nest\", \"Int -> Doc -> Doc\"],\n * [\"fillSep\", \"[Doc] -> Doc\"]\n * ]\n *\n * const prettySignature = <A>([name, type]: Signature): Doc.Doc<A> =>\n * Doc.hsep([\n * pipe(Doc.text(name), Doc.fillBreak(5)),\n * Doc.text(\"::\"),\n * Doc.text(type)\n * ])\n *\n * const doc = Doc.hsep([\n * Doc.text(\"let\"),\n * Doc.align(Doc.vcat(signatures.map(prettySignature)))\n * ])\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * String.stripMargin(\n * `|let empty :: Doc\n * | nest :: Int -> Doc -> Doc\n * | fillSep\n * | :: [Doc] -> Doc`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category filling\n */\nexport const fillBreak = internal.fillBreak;\n// -----------------------------------------------------------------------------\n// Flattening\n// -----------------------------------------------------------------------------\n/**\n * Flattens a document but does not report changes.\n *\n * @since 1.0.0\n * @category flattening\n */\nexport const flatten = internal.flatten;\n/**\n * Select the first element of each `Union` and discard the first element of\n * each `FlatAlt` to produce a \"flattened\" version of the input document.\n *\n * The result is `Flattened` if the element might change depending on the chosen\n * layout algorithm (i.e., the resulting document contains sub-documents that\n * may be rendered differently).\n *\n * The result is `AlreadyFlat` if the document is static (i.e., the resulting\n * document contains only a plain `Empty` node).\n *\n * `NeverFlat` is returned when the document cannot be flattened because it\n * contains either a hard `Line` or a `Fail`.\n *\n * @since 1.0.0\n * @category flattening\n */\nexport const changesUponFlattening = internal.changesUponFlattening;\n// -----------------------------------------------------------------------------\n// Annotations\n// -----------------------------------------------------------------------------\n/**\n * Adds an annotation to a `Doc`. The annotation can then be used by the rendering\n * algorithm to, for example, add color to certain parts of the output.\n *\n * **Note** This function is relevant only for custom formats with their own annotations,\n * and is not relevant for basic pretty printing.\n *\n * @since 1.0.0\n * @category annotations\n */\nexport const annotate = internal.annotate;\n/**\n * Change the annotations of a document. Individual annotations can be removed,\n * changed, or replaced by multiple ones.\n *\n * This is a general function that combines `unAnnotate` and `reAnnotate`, and\n * is useful for mapping semantic annotations (such as »this is a keyword«) to\n * display annotations (such as »this is red and underlined«) because some\n * backends may not care about certain annotations while others may.\n *\n * Annotations earlier in the new list will be applied earlier, so returning\n * `[Bold, Green]` will result in a bold document that contains green text, and\n * not vice versa.\n *\n * Since this traverses the entire document tree, including the parts that are\n * not rendered (due to other layouts having better fit), it is preferable to\n * reannotate a document **after** producing the layout by using\n * `alterAnnotations` from the `SimpleDocStream` module.\n *\n * @since 1.0.0\n * @category annotations\n */\nexport const alterAnnotations = internal.alterAnnotations;\n/**\n * Changes the annotation of a document. Useful for modifying documents embedded\n * with one form of annotation with a more general annotation.\n *\n * **Note** that with each invocation, the entire document tree is traversed.\n * If possible, it is preferable to reannotate a document after producing the\n * layout using `reAnnotateS`.\n *\n * @since 1.0.0\n * @category annotations\n */\nexport const reAnnotate = internal.reAnnotate;\n/**\n * Removes all annotations from a document.\n *\n * **Note**: with each invocation, the entire document tree is traversed.\n * If possible, it is preferable to unannotate a document after producing the\n * layout using `unAnnotateS`.\n *\n * @since 1.0.0\n * @category annotations\n */\nexport const unAnnotate = internal.unAnnotate;\n// -----------------------------------------------------------------------------\n// Folding\n// -----------------------------------------------------------------------------\n/**\n * @since 1.0.0\n * @category folding\n */\nexport const match = internal.match;\n// -----------------------------------------------------------------------------\n// Instances\n// -----------------------------------------------------------------------------\n/**\n * @since 1.0.0\n * @category rendering\n */\nexport const render = InternalRender.render;\n/**\n * @since 1.0.0\n * @category rendering\n */\nexport const renderStream = InternalRender.renderStream;\n// -----------------------------------------------------------------------------\n// Instances\n// -----------------------------------------------------------------------------\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const map = internal.map;\n/**\n * @since 1.0.0\n * @category instances\n */\nexport const getSemigroup = internal.getSemigroup;\n/**\n * @since 1.0.0\n * @category instances\n */\nexport const getMonoid = internal.getMonoid;\n/**\n * @since 1.0.0\n * @category instances\n */\nexport const Covariant = internal.Covariant;\n/**\n * @since 1.0.0\n * @category instances\n */\nexport const Invariant = internal.Invariant;\n// -----------------------------------------------------------------------------\n// Utilities\n// -----------------------------------------------------------------------------\n/**\n * Removes control characters from the text leaves of a document while\n * preserving its structure and annotations.\n *\n * Horizontal tabs (`U+0009`) and line feeds (`U+000A`) are preserved. Other C0\n * controls, DEL (`U+007F`), and C1 controls (`U+0080` through `U+009F`) are\n * removed.\n *\n * Use this at the boundary where untrusted text enters a document that will be\n * rendered to a terminal. Existing constructors and renderers remain suitable\n * for trusted text containing intentional terminal sequences, such as OSC 8\n * hyperlinks.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n *\n * const doc = Doc.sanitize(Doc.text(\"hello\\u001bworld\"))\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * \"helloworld\"\n * )\n * ```\n *\n * @since 1.0.0\n * @category utilities\n */\nexport const sanitize = internal.sanitize;\n/**\n * The `surround` combinator encloses a document in between `left` and `right`\n * documents.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import { pipe } from \"effect/Function\"\n *\n * const doc = pipe(\n * Doc.char(\"-\"),\n * Doc.surround(Doc.char(\"A\"), Doc.char(\"Z\"))\n * )\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * \"A-Z\"\n * )\n * ```\n *\n * @since 1.0.0\n * @category utilities\n */\nexport const surround = internal.surround;\n/**\n * Encloses the input document in single quotes (`\"\"`).\n *\n * @since 1.0.0\n * @category utilities\n */\nexport const singleQuoted = internal.singleQuoted;\n/**\n * Encloses the input document in double quotes (`\"\"`).\n *\n * @since 1.0.0\n * @category utilities\n */\nexport const doubleQuoted = internal.doubleQuoted;\n/**\n * Encloses the input document in parentheses (`()`).\n *\n * @since 1.0.0\n * @category utilities\n */\nexport const parenthesized = internal.parenthesized;\n/**\n * Encloses the input document in angle brackets (`<>`).\n *\n * @since 1.0.0\n * @category utilities\n */\nexport const angleBracketed = internal.angleBracketed;\n/**\n * Encloses the input document in square brackets (`[]`).\n *\n * @since 1.0.0\n * @category utilities\n */\nexport const squareBracketed = internal.squareBracketed;\n/**\n * Encloses the input document in curly braces (`{}`).\n *\n * @since 1.0.0\n * @category utilities\n */\nexport const curlyBraced = internal.curlyBraced;\n/**\n * The `spaces` combinator lays out a document containing `n` spaces. Negative\n * values for `n` count as `0` spaces.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n *\n * const doc = Doc.squareBracketed(Doc.doubleQuoted(Doc.spaces(5)))\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * \"[\\\" \\\"]\"\n * )\n * ```\n *\n * @since 1.0.0\n * @category utilities\n */\nexport const spaces = internal.spaces;\n/**\n * @since 1.0.0\n * @category utilities\n */\nexport const textSpaces = internal.textSpaces;\n/**\n * Splits a string of words into individual `Text` documents using the\n * specified `char` to split on (defaults to `\" \"`).\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n *\n * const doc = Doc.tupled(Doc.words(\"lorem ipsum dolor\"))\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * \"(lorem, ipsum, dolor)\"\n * )\n * ```\n *\n * @since 1.0.0\n * @category utilities\n */\nexport const words = internal.words;\n/**\n * Splits a string of words into individual `Text` documents using the specified\n * `char` to split on (defaults to `\" \"`). In addition, a `softLine` is inserted\n * in between each word so that if the text exceeds the available width it will\n * be broken into multiple lines.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import * as String from \"effect/String\"\n *\n * const doc = Doc.reflow(\n * \"Lorem ipsum dolor sit amet, consectetur adipisicing elit, \" +\n * \"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n * )\n *\n * assert.strictEqual(\n * Doc.render(doc, {\n * style: \"pretty\",\n * options: { lineWidth: 32 }\n * }),\n * String.stripMargin(\n * `|Lorem ipsum dolor sit amet,\n * |consectetur adipisicing elit,\n * |sed do eiusmod tempor incididunt\n * |ut labore et dolore magna\n * |aliqua.`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category utilities\n */\nexport const reflow = internal.reflow;\n/**\n * The `punctuate` combinator appends the `punctuator` document to all but the\n * last document in a collection of documents. The separators are places after\n * the document entries, which can be observed if the result is oriented\n * vertically.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import { pipe } from \"effect/Function\"\n * import * as String from \"effect/String\"\n *\n * const docs = pipe(\n * Doc.words(\"lorem ipsum dolor sit amet\"),\n * Doc.punctuate(Doc.comma)\n * )\n *\n * assert.strictEqual(\n * Doc.render(Doc.hsep(docs), { style: \"pretty\" }),\n * \"lorem, ipsum, dolor, sit, amet\"\n * )\n *\n * // The separators are put at the end of the entries, which can be better\n * // visualzied if the documents are rendered vertically\n * assert.strictEqual(\n * Doc.render(Doc.vsep(docs), { style: \"pretty\" }),\n * String.stripMargin(\n * `|lorem,\n * |ipsum,\n * |dolor,\n * |sit,\n * |amet`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category utilities\n */\nexport const punctuate = internal.punctuate;\n//# sourceMappingURL=Doc.js.map","import * as Doc from \"@effect/printer/Doc\";\nimport * as InternalAnsi from \"./ansi.js\";\n/** @internal */\nexport const beep = /*#__PURE__*/Doc.annotate(Doc.empty, InternalAnsi.beep);\n/** @internal */\nexport const cursorTo = (column, row) => Doc.annotate(Doc.empty, InternalAnsi.cursorTo(column, row));\n/** @internal */\nexport const cursorMove = (column, row) => Doc.annotate(Doc.empty, InternalAnsi.cursorMove(column, row));\n/** @internal */\nexport const cursorUp = (lines = 1) => Doc.annotate(Doc.empty, InternalAnsi.cursorUp(lines));\n/** @internal */\nexport const cursorDown = (lines = 1) => Doc.annotate(Doc.empty, InternalAnsi.cursorDown(lines));\n/** @internal */\nexport const cursorForward = (columns = 1) => Doc.annotate(Doc.empty, InternalAnsi.cursorForward(columns));\n/** @internal */\nexport const cursorBackward = (columns = 1) => Doc.annotate(Doc.empty, InternalAnsi.cursorBackward(columns));\n/** @internal */\nexport const cursorLeft = /*#__PURE__*/Doc.annotate(Doc.empty, InternalAnsi.cursorLeft);\n/** @internal */\nexport const cursorSavePosition = /*#__PURE__*/Doc.annotate(Doc.empty, InternalAnsi.cursorSavePosition);\n/** @internal */\nexport const cursorRestorePosition = /*#__PURE__*/Doc.annotate(Doc.empty, InternalAnsi.cursorRestorePosition);\n/** @internal */\nexport const cursorNextLine = (rows = 1) => Doc.annotate(Doc.empty, InternalAnsi.cursorNextLine(rows));\n/** @internal */\nexport const cursorPrevLine = (rows = 1) => Doc.annotate(Doc.empty, InternalAnsi.cursorPrevLine(rows));\n/** @internal */\nexport const cursorHide = /*#__PURE__*/Doc.annotate(Doc.empty, InternalAnsi.cursorHide);\n/** @internal */\nexport const cursorShow = /*#__PURE__*/Doc.annotate(Doc.empty, InternalAnsi.cursorShow);\n/** @internal */\nexport const eraseLines = rows => Doc.annotate(Doc.empty, InternalAnsi.eraseLines(rows));\n/** @internal */\nexport const eraseEndLine = /*#__PURE__*/Doc.annotate(Doc.empty, InternalAnsi.eraseEndLine);\n/** @internal */\nexport const eraseStartLine = /*#__PURE__*/Doc.annotate(Doc.empty, InternalAnsi.eraseStartLine);\n/** @internal */\nexport const eraseLine = /*#__PURE__*/Doc.annotate(Doc.empty, InternalAnsi.eraseLine);\n/** @internal */\nexport const eraseDown = /*#__PURE__*/Doc.annotate(Doc.empty, InternalAnsi.eraseDown);\n/** @internal */\nexport const eraseUp = /*#__PURE__*/Doc.annotate(Doc.empty, InternalAnsi.eraseUp);\n/** @internal */\nexport const eraseScreen = /*#__PURE__*/Doc.annotate(Doc.empty, InternalAnsi.eraseScreen);\n//# sourceMappingURL=ansiDoc.js.map","/**\n * @since 1.0.0\n */\nimport * as internal from \"./internal/pageWidth.js\";\n// -----------------------------------------------------------------------------\n// Models\n// -----------------------------------------------------------------------------\n/**\n * @since 1.0.0\n * @category symbol\n */\nexport const PageWidthTypeId = internal.PageWidthTypeId;\n// -----------------------------------------------------------------------------\n// Refinements\n// -----------------------------------------------------------------------------\n/**\n * Returns `true` if the specified value is a `PageWidth`, `false` otherwise.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isPageWidth = internal.isPageWidth;\n/**\n * Returns `true` if the specified `PageWidth` is an `AvailablePerLine`, `false`\n * otherwise.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isAvailablePerLine = internal.isAvailablePerLine;\n/**\n * Returns `true` if the specified `PageWidth` is an `Unbounded`, `false`\n * otherwise.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isUnbounded = internal.isUnbounded;\n// -----------------------------------------------------------------------------\n// Constructors\n// -----------------------------------------------------------------------------\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const availablePerLine = internal.availablePerLine;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const unbounded = internal.unbounded;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const defaultPageWidth = internal.defaultPageWidth;\n// -----------------------------------------------------------------------------\n// Utilities\n// -----------------------------------------------------------------------------\n/**\n * Calculates the remaining width on the current line.\n *\n * @since 1.0.0\n * @category utilities\n */\nexport const remainingWidth = internal.remainingWidth;\n//# sourceMappingURL=PageWidth.js.map","/**\n * @since 1.0.0\n */\nimport * as internal from \"./internal/layout.js\";\nimport { defaultPageWidth } from \"./PageWidth.js\";\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const options = internal.options;\n/**\n * The default layout options, which are suitable when you want to obtain output\n * but do not care about the details.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const defaultOptions = /*#__PURE__*/options(defaultPageWidth);\n// -----------------------------------------------------------------------------\n// Layout Algorithms\n// -----------------------------------------------------------------------------\n/**\n * @since 1.0.0\n * @category layout algorithms\n */\nexport const wadlerLeijen = internal.wadlerLeijen;\n/**\n * A layout algorithm which will lay out a document without adding any\n * indentation and without preserving annotations.\n *\n * Since no pretty-printing is involved, this layout algorithm is very fast. The\n * resulting output contains fewer characters than a pretty-printed version and\n * can be used for output that is read by other programs.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import { pipe } from \"effect/Function\"\n * import * as String from \"effect/String\"\n *\n * const doc = pipe(\n * Doc.vsep([\n * Doc.text(\"lorem\"),\n * Doc.text(\"ipsum\"),\n * pipe(\n * Doc.vsep([Doc.text(\"dolor\"), Doc.text(\"sit\")]),\n * Doc.hang(4)\n * )\n * ]),\n * Doc.hang(4)\n * )\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"pretty\" }),\n * String.stripMargin(\n * `|lorem\n * | ipsum\n * | dolor\n * | sit`\n * )\n * )\n *\n * assert.strictEqual(\n * Doc.render(doc, { style: \"compact\" }),\n * String.stripMargin(\n * `|lorem\n * |ipsum\n * |dolor\n * |sit`\n * )\n * )\n * ```\n *\n * @since 1.0.0\n * @category layout algorithms\n */\nexport const compact = internal.compact;\n/**\n * The `pretty` layout algorithm is the default algorithm for rendering\n * documents.\n *\n * `pretty` commits to rendering something in a certain way if the next\n * element fits the layout constrants. In other words, it has one `DocStream`\n * element lookahead when rendering.\n *\n * Consider using the smarter, but slightly less performant `smart`\n * algorithm if the results seem to run off to the right before having lots of\n * line breaks.\n *\n * @since 1.0.0\n * @category layout algorithms\n */\nexport const pretty = internal.pretty;\n/**\n * A layout algorithm with more look ahead than `pretty`, which will introduce\n * line breaks into a document earlier if the content does not, or will not, fit\n * onto one line.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import * as Doc from \"@effect/printer/Doc\"\n * import type * as DocStream from \"@effect/printer/DocStream\"\n * import * as Layout from \"@effect/printer/Layout\"\n * import * as PageWidth from \"@effect/printer/PageWidth\"\n * import { pipe } from \"effect/Function\"\n * import * as String from \"effect/String\"\n *\n * // Consider the following python-ish document:\n * const fun = <A>(doc: Doc.Doc<A>): Doc.Doc<A> =>\n * Doc.hcat([\n * pipe(\n * Doc.hcat([Doc.text(\"fun(\"), Doc.softLineBreak, doc]),\n * Doc.hang(2)\n * ),\n * Doc.text(\")\")\n * ])\n *\n * const funs = <A>(doc: Doc.Doc<A>): Doc.Doc<A> =>\n * pipe(doc, fun, fun, fun, fun, fun)\n *\n * const doc = funs(Doc.align(Doc.list(Doc.words(\"abcdef ghijklm\"))))\n *\n * // The document will be rendered using the following pipeline, where the choice\n * // of layout algorithm has been left open:\n * const pageWidth = PageWidth.availablePerLine(26, 1)\n * const layoutOptions = Layout.options(pageWidth)\n * const dashes = Doc.text(Array.from({ length: 26 - 2 }, () => \"-\").join(\"\"))\n * const hr = Doc.hcat([Doc.vbar, dashes, Doc.vbar])\n *\n * const render = <A>(\n * doc: Doc.Doc<A>\n * ) =>\n * (\n * layoutAlgorithm: (options: Layout.Layout.Options) => (doc: Doc.Doc<A>) => DocStream.DocStream<A>\n * ): string => pipe(Doc.vsep([hr, doc, hr]), layoutAlgorithm(layoutOptions), Doc.renderStream)\n *\n * // If rendered using `Layout.pretty`, with a page width of `26` characters per line,\n * // all the calls to `fun` will fit into the first line. However, this exceeds the\n * // desired `26` character page width.\n * assert.strictEqual(\n * render(doc)(Layout.pretty),\n * String.stripMargin(\n * `||------------------------|\n * |fun(fun(fun(fun(fun(\n * | [ abcdef\n * | , ghijklm ])))))\n * ||------------------------|`\n * )\n * )\n *\n * // The same document, rendered with `Layout.smart`, fits the layout contstraints:\n * assert.strictEqual(\n * render(doc)(Layout.smart),\n * String.stripMargin(\n * `||------------------------|\n * |fun(\n * | fun(\n * | fun(\n * | fun(\n * | fun(\n * | [ abcdef\n * | , ghijklm ])))))\n * ||------------------------|`\n * )\n * )\n *\n * // The key difference between `Layout.pretty` and `Layout.smart` is that the\n * // latter will check the potential document until it encounters a line with the\n * // same indentation or less than the start of the document. Any line encountered\n * // earlier is assumed to belong to the same syntactic structure. In contrast,\n * // `Layout.pretty` checks only the first line.\n *\n * // Consider for example the question of whether the `A`s fit into the document\n * // below:\n * // > 1 A\n * // > 2 A\n * // > 3 A\n * // > 4 B\n * // > 5 B\n *\n * // `pretty` will check only the first line, ignoring whether the second line\n * // may already be too wide. In contrast, `Layout.smart` stops only once it reaches\n * // the fourth line 4, where the `B` has the same indentation as the first `A`.\n * ```\n *\n * @since 1.0.0\n * @category layout algorithms\n */\nexport const smart = internal.smart;\n/**\n * The `unbounded` layout algorithm will lay out a document an `Unbounded`\n * page width.\n *\n * @since 1.0.0\n * @category layout algorithms\n */\nexport const unbounded = internal.unbounded;\n//# sourceMappingURL=Layout.js.map","import * as Layout from \"@effect/printer/Layout\";\nimport * as PageWidth from \"@effect/printer/PageWidth\";\nimport * as Effect from \"effect/Effect\";\nimport { dual } from \"effect/Function\";\nimport * as List from \"effect/List\";\nimport * as InternalAnsi from \"./ansi.js\";\n// -----------------------------------------------------------------------------\n// Rendering Algorithms\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const render = /*#__PURE__*/dual(2, (self, config) => {\n switch (config.style) {\n case \"compact\":\n {\n return renderStream(Layout.compact(self));\n }\n case \"pretty\":\n {\n const width = Object.assign({}, PageWidth.defaultPageWidth, config.options);\n return renderStream(Layout.pretty(self, Layout.options(width)));\n }\n case \"smart\":\n {\n const width = Object.assign({}, PageWidth.defaultPageWidth, config.options);\n return renderStream(Layout.smart(self, Layout.options(width)));\n }\n }\n});\n/** @internal */\nexport const renderStream = self => Effect.runSync(renderSafe(self, List.of(InternalAnsi.none)));\nconst unsafePeek = stack => {\n if (List.isNil(stack)) {\n throw new Error(\"BUG: AnsiRender.unsafePeek - peeked at an empty stack\" + \" - please report an issue at https://github.com/Effect-TS/printer/issues\");\n }\n return stack.head;\n};\nconst unsafePop = stack => {\n if (List.isNil(stack)) {\n throw new Error(\"BUG: AnsiRender.unsafePop - popped from an empty stack\" + \" - please report an issue at https://github.com/Effect-TS/printer/issues\");\n }\n return [stack.head, stack.tail];\n};\nconst renderSafe = (self, stack) => {\n switch (self._tag) {\n case \"FailedStream\":\n {\n return Effect.dieMessage(\"BUG: AnsiRender.renderSafe - attempted to render a failed doc stream\" + \" - please report an issue at https://github.com/Effect-TS/printer/issues\");\n }\n case \"EmptyStream\":\n {\n return Effect.succeed(\"\");\n }\n case \"CharStream\":\n {\n return Effect.map(Effect.suspend(() => renderSafe(self.stream, stack)), rest => self.char + rest);\n }\n case \"TextStream\":\n {\n return Effect.map(Effect.suspend(() => renderSafe(self.stream, stack)), rest => self.text + rest);\n }\n case \"LineStream\":\n {\n let indent = \"\\n\";\n for (let i = 0; i < self.indentation; i++) {\n indent = indent += \" \";\n }\n return Effect.map(Effect.suspend(() => renderSafe(self.stream, stack)), rest => indent + rest);\n }\n case \"PushAnnotationStream\":\n {\n const currentStyle = unsafePeek(stack);\n const nextStyle = InternalAnsi.combine(self.annotation, currentStyle);\n return Effect.map(Effect.suspend(() => renderSafe(self.stream, List.cons(self.annotation, stack))), rest => InternalAnsi.stringify(nextStyle) + rest);\n }\n case \"PopAnnotationStream\":\n {\n const [, styles] = unsafePop(stack);\n const nextStyle = unsafePeek(styles);\n return Effect.map(Effect.suspend(() => renderSafe(self.stream, styles)), rest => InternalAnsi.stringify(nextStyle) + rest);\n }\n }\n};\n//# sourceMappingURL=ansiRender.js.map","import * as InternalAnsiDoc from \"./internal/ansiDoc.js\";\nimport * as InternalAnsiRender from \"./internal/ansiRender.js\";\n// -----------------------------------------------------------------------------\n// Constructors\n// -----------------------------------------------------------------------------\n/**\n * Play a beeping sound.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const beep = InternalAnsiDoc.beep;\n/**\n * Moves the cursor to the specified `row` and `column`.\n *\n * Though the ANSI Control Sequence for Cursor Position is `1`-based, this\n * method takes row and column values starting from `0` and adjusts them to `1`-\n * based values.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const cursorTo = InternalAnsiDoc.cursorTo;\n/**\n * Move the cursor position the specified number of `rows` and `columns`\n * relative to the current cursor position.\n *\n * If the cursor is already at the edge of the screen in either direction, then\n * additional movement will have no effect.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const cursorMove = InternalAnsiDoc.cursorMove;\n/**\n * Moves the cursor up by the specified number of `lines` (default `1`) relative\n * to the current cursor position.\n *\n * If the cursor is already at the edge of the screen, this has no effect.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorUp = InternalAnsiDoc.cursorUp;\n/**\n * Moves the cursor down by the specified number of `lines` (default `1`)\n * relative to the current cursor position.\n *\n * If the cursor is already at the edge of the screen, this has no effect.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorDown = InternalAnsiDoc.cursorDown;\n/**\n * Moves the cursor forward by the specified number of `columns` (default `1`)\n * relative to the current cursor position.\n *\n * If the cursor is already at the edge of the screen, this has no effect.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorForward = InternalAnsiDoc.cursorForward;\n/**\n * Moves the cursor backward by the specified number of `columns` (default `1`)\n * relative to the current cursor position.\n *\n * If the cursor is already at the edge of the screen, this has no effect.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorBackward = InternalAnsiDoc.cursorBackward;\n/**\n * Moves the cursor to the first column of the current row.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorLeft = InternalAnsiDoc.cursorLeft;\n/**\n * Saves the cursor position, encoding shift state and formatting attributes.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorSavePosition = InternalAnsiDoc.cursorSavePosition;\n/**\n * Restores the cursor position, encoding shift state and formatting attributes\n * from the previous save, if any, otherwise resets these all to their defaults.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorRestorePosition = InternalAnsiDoc.cursorRestorePosition;\n/**\n * Moves cursor to beginning of the line the specified number of rows down\n * (default `1`).\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorNextLine = InternalAnsiDoc.cursorNextLine;\n/**\n * Moves cursor to beginning of the line the specified number of rows up\n * (default `1`).\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorPrevLine = InternalAnsiDoc.cursorPrevLine;\n/**\n * Hides the cursor.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorHide = InternalAnsiDoc.cursorHide;\n/**\n * Shows the cursor.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const cursorShow = InternalAnsiDoc.cursorShow;\n/**\n * Erase from the current cursor position up the specified amount of rows.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const eraseLines = InternalAnsiDoc.eraseLines;\n/**\n * Clears from the current cursor position to the end of the current line.\n *\n * The current cursor position does not change.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const eraseEndLine = InternalAnsiDoc.eraseEndLine;\n/**\n * Clears from the current cursor position to the start of the current line.\n *\n * The current cursor position does not change.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const eraseStartLine = InternalAnsiDoc.eraseStartLine;\n/**\n * Clears the current line.\n *\n * The current cursor position does not change.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const eraseLine = InternalAnsiDoc.eraseLine;\n/**\n * Clears from the current cursor position to the end of the screen.\n *\n * The current cursor position does not change.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const eraseDown = InternalAnsiDoc.eraseDown;\n/**\n * Clears from the current cursor position to the beginning of the screen.\n *\n * The current cursor position does not change.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const eraseUp = InternalAnsiDoc.eraseUp;\n/**\n * Clears the entire screen and move the cursor to the upper left.\n *\n * @since 1.0.0\n * @category commands\n */\nexport const eraseScreen = InternalAnsiDoc.eraseScreen;\n// -----------------------------------------------------------------------------\n// Destructors\n// -----------------------------------------------------------------------------\n/**\n * Text leaves are rendered verbatim, including control characters. Apply\n * `sanitize` to untrusted subtrees before writing the result to a terminal.\n * Use the raw document when embedded terminal sequences are trusted and\n * intentional.\n *\n * @since 1.0.0\n * @category destructors\n */\nexport const render = InternalAnsiRender.render;\nexport {\n/**\n * @since 1.0.0\n * @category alignment\n */\nalign,\n/**\n * @since 1.0.0\n * @category annotations\n */\nalterAnnotations,\n/**\n * @since 1.0.0\n * @category utilities\n */\nangleBracketed,\n/**\n * @since 1.0.0\n * @category annotations\n */\nannotate,\n/**\n * @since 1.0.0\n * @category primitives\n */\nbackslash,\n/**\n * @since 1.0.0\n * @category concatenation\n */\ncat,\n/**\n * @since 1.0.0\n * @category concatenation\n */\ncats,\n/**\n * @since 1.0.0\n * @category concatenation\n */\ncatWithLine,\n/**\n * @since 1.0.0\n * @category concatenation\n */\ncatWithLineBreak,\n/**\n * @since 1.0.0\n * @category concatenation\n */\ncatWithSoftLine,\n/**\n * @since 1.0.0\n * @category concatenation\n */\ncatWithSoftLineBreak,\n/**\n * @since 1.0.0\n * @category concatenation\n */\ncatWithSpace,\n/**\n * @since 1.0.0\n * @category flattening\n */\nchangesUponFlattening,\n/**\n * @since 1.0.0\n * @category constructors\n */\nchar,\n/**\n * @since 1.0.0\n * @category primitives\n */\ncolon,\n/**\n * @since 1.0.0\n * @category reactive layouts\n */\ncolumn,\n/**\n * @since 1.0.0\n * @category primitives\n */\ncomma,\n/**\n * @since 1.0.0\n * @category concatenation\n */\nconcatWith,\n/**\n * @since 1.0.0\n * @category utilities\n */\ncurlyBraced,\n/**\n * @since 1.0.0\n * @category primitives\n */\ndot,\n/**\n * @since 1.0.0\n * @category utilities\n */\ndoubleQuoted,\n/**\n * @since 1.0.0\n * @category primitives\n */\ndquote,\n/**\n * @since 1.0.0\n * @category primitives\n */\nempty,\n/**\n * @since 1.0.0\n * @category alignment\n */\nencloseSep,\n/**\n * @since 1.0.0\n * @category primitives\n */\nequalSign,\n/**\n * @since 1.0.0\n * @category primitives\n */\nfail,\n/**\n * @since 1.0.0\n * @category filling\n */\nfill,\n/**\n * @since 1.0.0\n * @category filling\n */\nfillBreak,\n/**\n * @since 1.0.0\n * @category filling\n */\nfillCat,\n/**\n * @since 1.0.0\n * @category filling\n */\nfillSep,\n/**\n * @since 1.0.0\n * @category alternative layouts\n */\nflatAlt,\n/**\n * @since 1.0.0\n * @category flattening\n */\nflatten,\n/**\n * @since 1.0.0\n * @category alternative layouts\n */\ngroup,\n/**\n * @since 1.0.0\n * @category alignment\n */\nhang,\n/**\n * @since 1.0.0\n * @category primitives\n */\nhardLine,\n/**\n * @since 1.0.0\n * @category concatenation\n */\nhcat,\n/**\n * @since 1.0.0\n * @category separation\n */\nhsep,\n/**\n * @since 1.0.0\n * @category alignment\n */\nindent,\n/**\n * @since 1.0.0\n * @category instances\n */\nInvariant,\n/**\n * @since 1.0.0\n * @category refinements\n */\nisAnnotated,\n/**\n * @since 1.0.0\n * @category refinements\n */\nisCat,\n/**\n * @since 1.0.0\n * @category refinements\n */\nisChar,\n/**\n * @since 1.0.0\n * @category refinements\n */\nisColumn,\n/**\n * @since 1.0.0\n * @category refinements\n */\nisDoc,\n/**\n * @since 1.0.0\n * @category refinements\n */\nisEmpty,\n/**\n * @since 1.0.0\n * @category refinements\n */\nisFail,\n/**\n * @since 1.0.0\n * @category refinements\n */\nisFlatAlt,\n/**\n * @since 1.0.0\n * @category refinements\n */\nisLine,\n/**\n * @since 1.0.0\n * @category refinements\n */\nisNest,\n/**\n * @since 1.0.0\n * @category refinements\n */\nisNesting,\n/**\n * @since 1.0.0\n * @category refinements\n */\nisText,\n/**\n * @since 1.0.0\n * @category refinements\n */\nisUnion,\n/**\n * @since 1.0.0\n * @category refinements\n */\nisWithPageWidth,\n/**\n * @since 1.0.0\n * @category primitives\n */\nlangle,\n/**\n * @since 1.0.0\n * @category primitives\n */\nlbrace,\n/**\n * @since 1.0.0\n * @category primitives\n */\nlbracket,\n/**\n * @since 1.0.0\n * @category primitives\n */\nline,\n/**\n * @since 1.0.0\n * @category primitives\n */\nlineBreak,\n/**\n * @since 1.0.0\n * @category alignment\n */\nlist,\n/**\n * @since 1.0.0\n * @category primitives\n */\nlparen,\n/**\n * @since 1.0.0\n * @category combinators\n */\nmap,\n/**\n * @since 1.0.0\n * @category matching\n */\nmatch,\n/**\n * @since 1.0.0\n * @category alignment\n */\nnest,\n/**\n * @since 1.0.0\n * @category reactive layouts\n */\nnesting,\n/**\n * @since 1.0.0\n * @category reactive layouts\n */\npageWidth,\n/**\n * @since 1.0.0\n * @category utilities\n */\nparenthesized,\n/**\n * @since 1.0.0\n * @category utilities\n */\npunctuate,\n/**\n * @since 1.0.0\n * @category primitives\n */\nrangle,\n/**\n * @since 1.0.0\n * @category primitives\n */\nrbrace,\n/**\n * @since 1.0.0\n * @category primitives\n */\nrbracket,\n/**\n * @since 1.0.0\n * @category annotations\n */\nreAnnotate,\n/**\n * @since 1.0.0\n * @category utilities\n */\nreflow,\n/**\n * @since 1.0.0\n * @category primitives\n */\nrparen,\n/**\n * @since 1.0.0\n * @category utilities\n */\nsanitize,\n/**\n * @since 1.0.0\n * @category primitives\n */\nsemi,\n/**\n * @since 1.0.0\n * @category separation\n */\nseps,\n/**\n * @since 1.0.0\n * @category utilities\n */\nsingleQuoted,\n/**\n * @since 1.0.0\n * @category primitives\n */\nslash,\n/**\n * @since 1.0.0\n * @category primitives\n */\nsoftLine,\n/**\n * @since 1.0.0\n * @category primitives\n */\nsoftLineBreak,\n/**\n * @since 1.0.0\n * @category primitives\n */\nspace,\n/**\n * @since 1.0.0\n * @category utilities\n */\nspaces,\n/**\n * @since 1.0.0\n * @category utilities\n */\nsquareBracketed,\n/**\n * @since 1.0.0\n * @category primitives\n */\nsquote,\n/**\n * @since 1.0.0\n * @category constructors\n */\nstring,\n/**\n * @since 1.0.0\n * @category utilities\n */\nsurround,\n/**\n * @since 1.0.0\n * @category constructors\n */\ntext,\n/**\n * @since 1.0.0\n * @category utilities\n */\ntextSpaces,\n/**\n * @since 1.0.0\n * @category alignment\n */\ntupled,\n/**\n * @since 1.0.0\n * @category annotations\n */\nunAnnotate,\n/**\n * @since 1.0.0\n * @category alternative layouts\n */\nunion,\n/**\n * @since 1.0.0\n * @category primitives\n */\nvbar,\n/**\n * @since 1.0.0\n * @category concatenation\n */\nvcat,\n/**\n * @since 1.0.0\n * @category separation\n */\nvsep,\n/**\n * @since 1.0.0\n * @category reactive layouts\n */\nwidth,\n/**\n * @since 1.0.0\n * @category utilities\n */\nwords } from \"@effect/printer/Doc\";\n//# sourceMappingURL=AnsiDoc.js.map","import * as Effect from \"effect/Effect\";\nimport { dual } from \"effect/Function\";\nimport * as InternalDoc from \"./doc.js\";\n/** @internal */\nexport const optimize = /*#__PURE__*/dual(2, (self, depth) => Effect.runSync(optimizeSafe(self, depth)));\nconst optimizeSafe = (self, depth) => {\n const optimize = self => Effect.gen(function* () {\n switch (self._tag) {\n case \"Fail\":\n case \"Empty\":\n case \"Char\":\n case \"Text\":\n case \"Line\":\n {\n return self;\n }\n case \"FlatAlt\":\n {\n const left = yield* optimize(self.left);\n const right = yield* optimize(self.right);\n return InternalDoc.flatAlt(left, right);\n }\n case \"Cat\":\n {\n // Empty Documents\n if (InternalDoc.isEmpty(self.left)) {\n return yield* optimize(self.right);\n }\n if (InternalDoc.isEmpty(self.right)) {\n return yield* optimize(self.left);\n }\n // Text Documents\n if (InternalDoc.isChar(self.left) && InternalDoc.isChar(self.right)) {\n return InternalDoc.text(self.left.char + self.right.char);\n }\n if (InternalDoc.isText(self.left) && InternalDoc.isChar(self.right)) {\n return InternalDoc.text(self.left.text + self.right.char);\n }\n if (InternalDoc.isChar(self.left) && InternalDoc.isText(self.right)) {\n return InternalDoc.text(self.left.char + self.right.text);\n }\n if (InternalDoc.isText(self.left) && InternalDoc.isText(self.right)) {\n return InternalDoc.text(self.left.text + self.right.text);\n }\n // Nested Text Documents\n if (InternalDoc.isChar(self.left) && InternalDoc.isCat(self.right) && InternalDoc.isChar(self.right.left) || InternalDoc.isChar(self.left) && InternalDoc.isCat(self.right) && InternalDoc.isText(self.right.left) || InternalDoc.isText(self.left) && InternalDoc.isCat(self.right) && InternalDoc.isChar(self.right.left) || InternalDoc.isText(self.left) && InternalDoc.isCat(self.right) && InternalDoc.isText(self.right.left)) {\n const inner = yield* optimize(InternalDoc.cat(self.left, self.right.left));\n return yield* optimize(InternalDoc.cat(inner, self.right.right));\n }\n // Nested Documents\n if (InternalDoc.isCat(self.left) && InternalDoc.isChar(self.left.right) || InternalDoc.isCat(self.left) && InternalDoc.isText(self.left.right)) {\n const inner = yield* optimize(InternalDoc.cat(self.left.right, self.right));\n return yield* optimize(InternalDoc.cat(self.left.left, inner));\n }\n // Otherwise\n const left = yield* optimize(self.left);\n const right = yield* optimize(self.right);\n return InternalDoc.cat(left, right);\n }\n case \"Nest\":\n {\n if (self.indent === 0) {\n return yield* optimize(self.doc);\n }\n if (InternalDoc.isEmpty(self.doc) || InternalDoc.isChar(self.doc) || InternalDoc.isText(self.doc)) {\n return self.doc;\n }\n if (InternalDoc.isNest(self.doc)) {\n const indent = self.indent + self.doc.indent;\n return yield* optimize(InternalDoc.nest(self.doc.doc, indent));\n }\n return InternalDoc.nest(yield* optimize(self.doc), self.indent);\n }\n case \"Union\":\n {\n const left = yield* optimize(self.left);\n const right = yield* optimize(self.right);\n return InternalDoc.union(left, right);\n }\n case \"Column\":\n {\n return depth._tag === \"Shallow\" ? self : InternalDoc.column(position => Effect.runSync(optimizeSafe(self.react(position), depth)));\n }\n case \"WithPageWidth\":\n {\n return depth._tag === \"Shallow\" ? self : InternalDoc.pageWidth(pageWidth => Effect.runSync(optimizeSafe(self.react(pageWidth), depth)));\n }\n case \"Nesting\":\n {\n return depth._tag === \"Shallow\" ? self : InternalDoc.nesting(level => Effect.runSync(optimizeSafe(self.react(level), depth)));\n }\n case \"Annotated\":\n {\n return InternalDoc.annotate(yield* optimize(self.doc), self.annotation);\n }\n }\n });\n return optimize(self);\n};\n//# sourceMappingURL=optimize.js.map","/**\n * @since 1.0.0\n */\nimport * as internal from \"./internal/optimize.js\";\n/**\n * @since 1.0.0\n * @category instances\n */\nexport const Shallow = {\n _tag: \"Shallow\"\n};\n/**\n * @since 1.0.0\n * @category instances\n */\nexport const Deep = {\n _tag: \"Deep\"\n};\n// -----------------------------------------------------------------------------\n// Optimization\n// -----------------------------------------------------------------------------\n/**\n * The `optimize` function will combine text nodes so that they can be rendered\n * more efficiently. An optimized document is always laid out in an identical\n * manner to its un-optimized counterpart.\n *\n * When laying a `Doc` out to a `SimpleDocStream`, every component of the input\n * document is translated directly to the simpler output format. This sometimes\n * yields undesirable chunking when many pieces have been concatenated together.\n *\n * It is therefore a good idea to run `fuse` on concatenations of lots of small\n * strings that are used many times.\n *\n * @example\n * ```ts\n * import * as Doc from \"@effect/printer/Doc\"\n * import * as Optimize from \"@effect/printer/Optimize\"\n *\n * // The document below contains a chain of four entries in the output `DocStream`\n * const inefficient = Doc.hsep([\n * Doc.char(\"a\"),\n * Doc.char(\"b\"),\n * Doc.char(\"c\"),\n * Doc.char(\"d\")\n * ])\n *\n * // However, the above document is fully equivalent to the tightly packed\n * // document below which is only a single entry in the output `DocStream` and\n * // can be processed much more efficiently.\n * const efficient = Doc.text(\"abcd\")\n *\n * // We can optimize the `inefficient` document using `Optimize`\n * Optimize.optimize(Optimize.Deep)(inefficient)\n * ```\n *\n * @since 1.0.0\n * @category optimization\n */\nexport const optimize = internal.optimize;\n//# sourceMappingURL=Optimize.js.map","/**\n * @since 1.0.0\n */\nimport * as internal from \"./internal/color.js\";\n// -----------------------------------------------------------------------------\n// Constructors\n// -----------------------------------------------------------------------------\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const black = internal.black;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const red = internal.red;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const green = internal.green;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const yellow = internal.yellow;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const blue = internal.blue;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const magenta = internal.magenta;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const cyan = internal.cyan;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const white = internal.white;\n// -----------------------------------------------------------------------------\n// Destructors\n// -----------------------------------------------------------------------------\n/**\n * @since 1.0.0\n * @category destructors\n */\nexport const toCode = internal.toCode;\n//# sourceMappingURL=Color.js.map","import * as Ansi from \"@effect/printer-ansi/Ansi\";\nimport * as Doc from \"@effect/printer-ansi/AnsiDoc\";\nimport * as Color from \"@effect/printer-ansi/Color\";\nimport * as Arr from \"effect/Array\";\nimport { dual } from \"effect/Function\";\n/** @internal */\nexport const text = value => ({\n _tag: \"Text\",\n value\n});\n/** @internal */\nexport const empty = /*#__PURE__*/text(\"\");\n/** @internal */\nexport const space = /*#__PURE__*/text(\" \");\n/** @internal */\nexport const code = value => highlight(value, Color.white);\n/** @internal */\nexport const error = value => highlight(value, Color.red);\n/** @internal */\nexport const highlight = (value, color) => ({\n _tag: \"Highlight\",\n value: typeof value === \"string\" ? text(value) : value,\n color\n});\n/** @internal */\nexport const strong = value => ({\n _tag: \"Strong\",\n value: typeof value === \"string\" ? text(value) : value\n});\n/** @internal */\nexport const uri = value => ({\n _tag: \"URI\",\n value\n});\n/** @internal */\nexport const weak = value => ({\n _tag: \"Weak\",\n value: typeof value === \"string\" ? text(value) : value\n});\n/** @internal */\nexport const isSequence = self => self._tag === \"Sequence\";\n/** @internal */\nexport const isStrong = self => self._tag === \"Strong\";\n/** @internal */\nexport const isText = self => self._tag === \"Text\";\n/** @internal */\nexport const isUri = self => self._tag === \"URI\";\n/** @internal */\nexport const isWeak = self => self._tag === \"Weak\";\n/** @internal */\nexport const concat = /*#__PURE__*/dual(2, (self, that) => ({\n _tag: \"Sequence\",\n left: self,\n right: that\n}));\nexport const getText = self => {\n switch (self._tag) {\n case \"Text\":\n case \"URI\":\n {\n return self.value;\n }\n case \"Highlight\":\n case \"Weak\":\n case \"Strong\":\n {\n return getText(self.value);\n }\n case \"Sequence\":\n {\n return getText(self.left) + getText(self.right);\n }\n }\n};\n/** @internal */\nexport const spans = spans => {\n const elements = Arr.fromIterable(spans);\n if (Arr.isNonEmptyReadonlyArray(elements)) {\n return elements.slice(1).reduce(concat, elements[0]);\n }\n return empty;\n};\n/** @internal */\nexport const isEmpty = self => size(self) === 0;\n/** @internal */\nexport const size = self => {\n switch (self._tag) {\n case \"Text\":\n case \"URI\":\n {\n return self.value.length;\n }\n case \"Highlight\":\n case \"Strong\":\n case \"Weak\":\n {\n return size(self.value);\n }\n case \"Sequence\":\n {\n return size(self.left) + size(self.right);\n }\n }\n};\n/** @internal */\nexport const toAnsiDoc = self => {\n switch (self._tag) {\n case \"Highlight\":\n {\n return Doc.annotate(toAnsiDoc(self.value), Ansi.color(self.color));\n }\n case \"Sequence\":\n {\n return Doc.cat(toAnsiDoc(self.left), toAnsiDoc(self.right));\n }\n case \"Strong\":\n {\n return Doc.annotate(toAnsiDoc(self.value), Ansi.bold);\n }\n case \"Text\":\n {\n return Doc.text(self.value);\n }\n case \"URI\":\n {\n return Doc.annotate(Doc.text(self.value), Ansi.underlined);\n }\n case \"Weak\":\n {\n return Doc.annotate(toAnsiDoc(self.value), Ansi.blackBright);\n }\n }\n};\n//# sourceMappingURL=span.js.map","import * as Ansi from \"@effect/printer-ansi/Ansi\";\nimport * as Doc from \"@effect/printer-ansi/AnsiDoc\";\nimport * as Optimize from \"@effect/printer/Optimize\";\nimport * as Arr from \"effect/Array\";\nimport { dual, pipe } from \"effect/Function\";\nimport * as InternalSpan from \"./helpDoc/span.js\";\n/** @internal */\nexport const isEmpty = helpDoc => helpDoc._tag === \"Empty\";\n/** @internal */\nexport const isHeader = helpDoc => helpDoc._tag === \"Header\";\n/** @internal */\nexport const isParagraph = helpDoc => helpDoc._tag === \"Paragraph\";\n/** @internal */\nexport const isDescriptionList = helpDoc => helpDoc._tag === \"DescriptionList\";\n/** @internal */\nexport const isEnumeration = helpDoc => helpDoc._tag === \"Enumeration\";\n/** @internal */\nexport const isSequence = helpDoc => helpDoc._tag === \"Sequence\";\n/** @internal */\nexport const empty = {\n _tag: \"Empty\"\n};\n/** @internal */\nexport const sequence = /*#__PURE__*/dual(2, (self, that) => {\n if (isEmpty(self)) {\n return that;\n }\n if (isEmpty(that)) {\n return self;\n }\n return {\n _tag: \"Sequence\",\n left: self,\n right: that\n };\n});\n/** @internal */\nexport const orElse = /*#__PURE__*/dual(2, (self, that) => isEmpty(self) ? that : self);\n/** @internal */\nexport const blocks = helpDocs => {\n const elements = Arr.fromIterable(helpDocs);\n if (Arr.isNonEmptyReadonlyArray(elements)) {\n return elements.slice(1).reduce(sequence, elements[0]);\n }\n return empty;\n};\n/** @internal */\nexport const getSpan = self => isHeader(self) || isParagraph(self) ? self.value : InternalSpan.empty;\n/** @internal */\nexport const descriptionList = definitions => ({\n _tag: \"DescriptionList\",\n definitions\n});\n/** @internal */\nexport const enumeration = elements => ({\n _tag: \"Enumeration\",\n elements\n});\n/** @internal */\nexport const h1 = value => ({\n _tag: \"Header\",\n value: typeof value === \"string\" ? InternalSpan.text(value) : value,\n level: 1\n});\n/** @internal */\nexport const h2 = value => ({\n _tag: \"Header\",\n value: typeof value === \"string\" ? InternalSpan.text(value) : value,\n level: 2\n});\n/** @internal */\nexport const h3 = value => ({\n _tag: \"Header\",\n value: typeof value === \"string\" ? InternalSpan.text(value) : value,\n level: 3\n});\n/** @internal */\nexport const p = value => ({\n _tag: \"Paragraph\",\n value: typeof value === \"string\" ? InternalSpan.text(value) : value\n});\n/** @internal */\nexport const mapDescriptionList = /*#__PURE__*/dual(2, (self, f) => isDescriptionList(self) ? descriptionList(Arr.map(self.definitions, ([span, helpDoc]) => f(span, helpDoc))) : self);\n/** @internal */\nexport const toAnsiDoc = self => Optimize.optimize(toAnsiDocInternal(self), Optimize.Deep);\n/** @internal */\nexport const toAnsiText = self => Doc.render(toAnsiDoc(self), {\n style: \"pretty\"\n});\n// =============================================================================\n// Internals\n// =============================================================================\nconst toAnsiDocInternal = self => {\n switch (self._tag) {\n case \"Empty\":\n {\n return Doc.empty;\n }\n case \"Header\":\n {\n return pipe(Doc.annotate(InternalSpan.toAnsiDoc(self.value), Ansi.bold), Doc.cat(Doc.hardLine));\n }\n case \"Paragraph\":\n {\n return pipe(InternalSpan.toAnsiDoc(self.value), Doc.cat(Doc.hardLine));\n }\n case \"DescriptionList\":\n {\n const definitions = self.definitions.map(([span, doc]) => Doc.cats([Doc.annotate(InternalSpan.toAnsiDoc(span), Ansi.bold), Doc.empty, Doc.indent(toAnsiDocInternal(doc), 2)]));\n return Doc.vsep(definitions);\n }\n case \"Enumeration\":\n {\n const elements = self.elements.map(doc => Doc.cat(Doc.text(\"- \"), toAnsiDocInternal(doc)));\n return Doc.indent(Doc.vsep(elements), 2);\n }\n case \"Sequence\":\n {\n return Doc.vsep([toAnsiDocInternal(self.left), toAnsiDocInternal(self.right)]);\n }\n }\n};\n//# sourceMappingURL=helpDoc.js.map","import * as Context from \"effect/Context\";\nimport { dual } from \"effect/Function\";\nimport * as Layer from \"effect/Layer\";\n/** @internal */\nexport const make = params => ({\n ...defaultConfig,\n ...params\n});\n/** @internal */\nexport const Tag = /*#__PURE__*/Context.GenericTag(\"@effect/cli/CliConfig\");\n/** @internal */\nexport const defaultConfig = {\n isCaseSensitive: false,\n autoCorrectLimit: 2,\n finalCheckBuiltIn: false,\n showAllNames: true,\n showBuiltIns: true,\n showTypes: true\n};\n/** @internal */\nexport const defaultLayer = /*#__PURE__*/Layer.succeed(Tag, defaultConfig);\n/** @internal */\nexport const layer = config => Layer.succeed(Tag, make(config));\n/** @internal */\nexport const normalizeCase = /*#__PURE__*/dual(2, (self, text) => self.isCaseSensitive ? text : text.toLowerCase());\n//# sourceMappingURL=cliConfig.js.map","import { GenericTag } from \"effect/Context\";\n/** @internal */\nexport const tag = /*#__PURE__*/GenericTag(\"@effect/platform/Terminal\");\n//# sourceMappingURL=terminal.js.map","import { TaggedError } from \"effect/Data\";\nimport * as InternalTerminal from \"./internal/terminal.js\";\n/**\n * A `QuitException` represents an exception that occurs when a user attempts to\n * quit out of a `Terminal` prompt for input (usually by entering `ctrl`+`c`).\n *\n * @since 1.0.0\n * @category model\n */\nexport class QuitException extends /*#__PURE__*/TaggedError(\"QuitException\") {}\n/**\n * @since 1.0.0\n * @category refinements\n */\nexport const isQuitException = u => typeof u === \"object\" && u != null && \"_tag\" in u && u._tag === \"QuitException\";\n/**\n * @since 1.0.0\n * @category tag\n */\nexport const Terminal = InternalTerminal.tag;\n//# sourceMappingURL=Terminal.js.map","import * as Data from \"effect/Data\";\n/** @internal */\nexport const Action = /*#__PURE__*/Data.taggedEnum();\n//# sourceMappingURL=action.js.map","import * as Terminal from \"@effect/platform/Terminal\";\nimport * as Doc from \"@effect/printer-ansi/AnsiDoc\";\nimport * as Effect from \"effect/Effect\";\nimport * as Effectable from \"effect/Effectable\";\nimport { dual } from \"effect/Function\";\nimport * as Pipeable from \"effect/Pipeable\";\nimport { Action } from \"./prompt/action.js\";\n/** @internal */\nconst PromptSymbolKey = \"@effect/cli/Prompt\";\n/** @internal */\nexport const PromptTypeId = /*#__PURE__*/Symbol.for(PromptSymbolKey);\n/** @internal */\nconst proto = {\n ...Effectable.CommitPrototype,\n [PromptTypeId]: {\n _Output: _ => _\n },\n commit() {\n return run(this);\n },\n pipe() {\n return Pipeable.pipeArguments(this, arguments);\n }\n};\n/** @internal */\nexport const isPrompt = u => typeof u === \"object\" && u != null && PromptTypeId in u;\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};\n/** @internal */\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};\n/** @internal */\nexport const custom = (initialState, handlers) => {\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 return op;\n};\n/** @internal */\nexport const map = /*#__PURE__*/dual(2, (self, f) => flatMap(self, a => succeed(f(a))));\n/** @internal */\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/** @internal */\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.QuitException()), Effect.scoped);\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 const event = yield* input.take;\n action = yield* loop.process(event, state);\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(Doc.render(Doc.cursorShow, {\n style: \"pretty\"\n})))));\n/** @internal */\nexport const succeed = value => {\n const op = Object.create(proto);\n op._tag = \"Succeed\";\n op.value = value;\n return op;\n};\n//# sourceMappingURL=prompt.js.map","import * as Doc from \"@effect/printer-ansi/AnsiDoc\";\nimport * as Arr from \"effect/Array\";\nimport * as Effect from \"effect/Effect\";\nimport { pipe } from \"effect/Function\";\nconst defaultFigures = {\n arrowUp: /*#__PURE__*/Doc.text(\"↑\"),\n arrowDown: /*#__PURE__*/Doc.text(\"↓\"),\n arrowLeft: /*#__PURE__*/Doc.text(\"←\"),\n arrowRight: /*#__PURE__*/Doc.text(\"→\"),\n radioOn: /*#__PURE__*/Doc.text(\"◉\"),\n radioOff: /*#__PURE__*/Doc.text(\"◯\"),\n checkboxOn: /*#__PURE__*/Doc.text(\"☒\"),\n checkboxOff: /*#__PURE__*/Doc.text(\"☐\"),\n tick: /*#__PURE__*/Doc.text(\"✔\"),\n cross: /*#__PURE__*/Doc.text(\"✖\"),\n ellipsis: /*#__PURE__*/Doc.text(\"…\"),\n pointerSmall: /*#__PURE__*/Doc.text(\"›\"),\n line: /*#__PURE__*/Doc.text(\"─\"),\n pointer: /*#__PURE__*/Doc.text(\"❯\")\n};\nconst windowsFigures = {\n arrowUp: defaultFigures.arrowUp,\n arrowDown: defaultFigures.arrowDown,\n arrowLeft: defaultFigures.arrowLeft,\n arrowRight: defaultFigures.arrowRight,\n radioOn: /*#__PURE__*/Doc.text(\"(*)\"),\n radioOff: /*#__PURE__*/Doc.text(\"( )\"),\n checkboxOn: /*#__PURE__*/Doc.text(\"[*]\"),\n checkboxOff: /*#__PURE__*/Doc.text(\"[ ]\"),\n tick: /*#__PURE__*/Doc.text(\"√\"),\n cross: /*#__PURE__*/Doc.text(\"×\"),\n ellipsis: /*#__PURE__*/Doc.text(\"...\"),\n pointerSmall: /*#__PURE__*/Doc.text(\"»\"),\n line: /*#__PURE__*/Doc.text(\"─\"),\n pointer: /*#__PURE__*/Doc.text(\">\")\n};\n/** @internal */\nexport const figures = /*#__PURE__*/Effect.map(/*#__PURE__*/Effect.sync(() => process.platform === \"win32\"), isWindows => isWindows ? windowsFigures : defaultFigures);\n/**\n * Clears all lines taken up by the specified `text`.\n *\n * @internal\n */\nexport function eraseText(text, columns) {\n if (columns === 0) {\n return Doc.cat(Doc.eraseLine, Doc.cursorTo(0));\n }\n let rows = 0;\n const lines = text.split(/\\r?\\n/);\n for (const line of lines) {\n rows += 1 + Math.floor(Math.max(line.length - 1, 0) / columns);\n }\n return Doc.eraseLines(rows);\n}\n/** @internal */\nexport function lines(prompt, columns) {\n const lines = prompt.split(/\\r?\\n/);\n return columns === 0 ? lines.length : pipe(Arr.map(lines, line => Math.ceil(line.length / columns)), Arr.reduce(0, (left, right) => left + right));\n}\n//# sourceMappingURL=ansi-utils.js.map","import * as Terminal from \"@effect/platform/Terminal\";\nimport * as Ansi from \"@effect/printer-ansi/Ansi\";\nimport * as Doc from \"@effect/printer-ansi/AnsiDoc\";\nimport * as Optimize from \"@effect/printer/Optimize\";\nimport * as Arr from \"effect/Array\";\nimport * as Effect from \"effect/Effect\";\nimport * as Match from \"effect/Match\";\nimport * as Option from \"effect/Option\";\nimport * as InternalPrompt from \"../prompt.js\";\nimport { Action } from \"./action.js\";\nimport * as InternalAnsiUtils from \"./ansi-utils.js\";\nconst renderBeep = /*#__PURE__*/Doc.render(Doc.beep, {\n style: \"pretty\"\n});\nfunction handleClear(options) {\n return (state, _) => {\n return Effect.gen(function* () {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const resetCurrentLine = Doc.cat(Doc.eraseLine, Doc.cursorLeft);\n const clearError = Option.match(state.error, {\n onNone: () => Doc.empty,\n onSome: error => Doc.cursorDown(InternalAnsiUtils.lines(error, columns)).pipe(Doc.cat(InternalAnsiUtils.eraseText(`\\n${error}`, columns)))\n });\n const clearOutput = InternalAnsiUtils.eraseText(options.message, columns);\n return clearError.pipe(Doc.cat(clearOutput), Doc.cat(resetCurrentLine), Optimize.optimize(Optimize.Deep), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n });\n };\n}\nconst NEWLINE_REGEX = /\\r?\\n/;\nfunction renderError(state, pointer) {\n return Option.match(state.error, {\n onNone: () => Doc.empty,\n onSome: error => {\n const errorLines = error.split(NEWLINE_REGEX);\n if (Arr.isNonEmptyReadonlyArray(errorLines)) {\n const annotateLine = line => Doc.annotate(Doc.text(line), Ansi.combine(Ansi.italicized, Ansi.red));\n const prefix = Doc.cat(Doc.annotate(pointer, Ansi.red), Doc.space);\n const lines = Arr.map(errorLines, str => annotateLine(str));\n return Doc.cursorSavePosition.pipe(Doc.cat(Doc.hardLine), Doc.cat(prefix), Doc.cat(Doc.align(Doc.vsep(lines))), Doc.cat(Doc.cursorRestorePosition));\n }\n return Doc.empty;\n }\n });\n}\nfunction renderParts(state, submitted = false) {\n return Arr.reduce(state.dateParts, Doc.empty, (doc, part, currentIndex) => {\n const partDoc = Doc.text(part.toString());\n if (currentIndex === state.cursor && !submitted) {\n const annotation = Ansi.combine(Ansi.underlined, Ansi.cyanBright);\n return Doc.cat(doc, Doc.annotate(partDoc, annotation));\n }\n return Doc.cat(doc, partDoc);\n });\n}\nfunction renderOutput(leadingSymbol, trailingSymbol, parts, options) {\n const annotateLine = line => Doc.annotate(Doc.text(line), Ansi.bold);\n const prefix = Doc.cat(leadingSymbol, Doc.space);\n return Arr.match(options.message.split(/\\r?\\n/), {\n onEmpty: () => Doc.hsep([prefix, trailingSymbol, parts]),\n onNonEmpty: promptLines => {\n const lines = Arr.map(promptLines, line => annotateLine(line));\n return prefix.pipe(Doc.cat(Doc.nest(Doc.vsep(lines), 2)), Doc.cat(Doc.space), Doc.cat(trailingSymbol), Doc.cat(Doc.space), Doc.cat(parts));\n }\n });\n}\nfunction renderNextFrame(state, options) {\n return Effect.gen(function* () {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* InternalAnsiUtils.figures;\n const leadingSymbol = Doc.annotate(Doc.text(\"?\"), Ansi.cyanBright);\n const trailingSymbol = Doc.annotate(figures.pointerSmall, Ansi.blackBright);\n const parts = renderParts(state);\n const promptMsg = renderOutput(leadingSymbol, trailingSymbol, parts, options);\n const errorMsg = renderError(state, figures.pointerSmall);\n return Doc.cursorHide.pipe(Doc.cat(promptMsg), Doc.cat(errorMsg), Optimize.optimize(Optimize.Deep), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n });\n}\nfunction renderSubmission(state, options) {\n return Effect.gen(function* () {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* InternalAnsiUtils.figures;\n const leadingSymbol = Doc.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Doc.annotate(figures.ellipsis, Ansi.blackBright);\n const parts = renderParts(state, true);\n const promptMsg = renderOutput(leadingSymbol, trailingSymbol, parts, options);\n return promptMsg.pipe(Doc.cat(Doc.hardLine), Optimize.optimize(Optimize.Deep), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n });\n}\nfunction processUp(state) {\n state.dateParts[state.cursor].increment();\n return Action.NextFrame({\n state: {\n ...state,\n typed: \"\"\n }\n });\n}\nfunction processDown(state) {\n state.dateParts[state.cursor].decrement();\n return Action.NextFrame({\n state: {\n ...state,\n typed: \"\"\n }\n });\n}\nfunction processCursorLeft(state) {\n const previousPart = state.dateParts[state.cursor].previousPart();\n return Option.match(previousPart, {\n onNone: () => Action.Beep(),\n onSome: previous => Action.NextFrame({\n state: {\n ...state,\n typed: \"\",\n cursor: state.dateParts.indexOf(previous)\n }\n })\n });\n}\nfunction processCursorRight(state) {\n const nextPart = state.dateParts[state.cursor].nextPart();\n return Option.match(nextPart, {\n onNone: () => Action.Beep(),\n onSome: next => Action.NextFrame({\n state: {\n ...state,\n typed: \"\",\n cursor: state.dateParts.indexOf(next)\n }\n })\n });\n}\nfunction processNext(state) {\n const nextPart = state.dateParts[state.cursor].nextPart();\n const cursor = Option.match(nextPart, {\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}\nfunction defaultProcessor(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};\nfunction handleRender(options) {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderNextFrame(state, options),\n Submit: () => renderSubmission(state, options)\n });\n };\n}\nfunction handleProcess(options) {\n return (input, state) => {\n switch (input.key.name) {\n case \"left\":\n {\n return Effect.succeed(processCursorLeft(state));\n }\n case \"right\":\n {\n return Effect.succeed(processCursorRight(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(processNext(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 const value = Option.getOrElse(input.input, () => \"\");\n return Effect.succeed(defaultProcessor(value, state));\n }\n }\n };\n}\n/** @internal */\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 InternalPrompt.custom(initialState, {\n render: handleRender(opts),\n process: handleProcess(opts),\n clear: handleClear(opts)\n });\n};\nconst DATE_PART_REGEX = /\\\\(.)|\"((?:\\\\[\"\\\\]|[^\"])+)\"|(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 regexGroups = {\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 // eslint-disable-next-line no-cond-assign\n while (result = DATE_PART_REGEX.exec(dateMask)) {\n const match = result.shift();\n const index = result.findIndex(group => group !== undefined);\n if (index in regexGroups) {\n const token = result[index] || match;\n parts.push(regexGroups[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 return Arr.findFirstIndex(this.parts, part => part === this).pipe(Option.flatMap(currentPartIndex => 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 return Arr.findFirstIndex(this.parts, part => part === this).pipe(Option.flatMap(currentPartIndex => Arr.findLast(this.parts.slice(0, currentPartIndex), part => !part.isToken())));\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 return Match.value(this.token).pipe(Match.when(\"DD\", () => `${date}`.padStart(2, \"0\")), Match.when(\"Do\", () => `${date}${this.ordinalIndicator(date)}`), Match.when(\"d\", () => `${day + 1}`), Match.when(\"ddd\", () => this.locales.weekdaysShort[day]), Match.when(\"dddd\", () => this.locales.weekdays[day]), Match.orElse(() => `${date}`));\n }\n ordinalIndicator(day) {\n return Match.value(day % 10).pipe(Match.when(1, () => \"st\"), Match.when(2, () => \"nd\"), Match.when(3, () => \"rd\"), Match.orElse(() => \"th\"));\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 return Match.value(this.token.length).pipe(Match.when(2, () => `${month + 1}`.padStart(2, \"0\")), Match.when(3, () => this.locales.monthsShort[month]), Match.when(4, () => this.locales.months[month]), Match.orElse(() => `${month + 1}`));\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}\n//# sourceMappingURL=date.js.map","import { GenericTag } from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport { identity } from \"effect/Function\";\nimport * as Layer from \"effect/Layer\";\nimport { BadArgument } from \"../Error.js\";\n/** @internal */\nexport const TypeId = /*#__PURE__*/Symbol.for(\"@effect/platform/Path\");\n/** @internal */\nexport const Path = /*#__PURE__*/GenericTag(\"@effect/platform/Path\");\n/**\n * The following functions are adapted from the Node.js source code:\n * https://github.com/nodejs/node/blob/main/lib/internal/url.js\n *\n * The following license applies to these functions:\n * - MIT\n */\n// Resolves . and .. elements in a path with directory names\nfunction normalizeStringPosix(path, allowAboveRoot) {\n let res = \"\";\n let lastSegmentLength = 0;\n let lastSlash = -1;\n let dots = 0;\n let code;\n for (let i = 0; i <= path.length; ++i) {\n if (i < path.length) {\n code = path.charCodeAt(i);\n } else if (code === 47 /*/*/) {\n break;\n } else {\n code = 47; /*/*/\n }\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n const lastSlashIndex = res.lastIndexOf(\"/\");\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = \"\";\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf(\"/\");\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = \"\";\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0) {\n res += \"/..\";\n } else {\n res = \"..\";\n }\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0) {\n res += \"/\" + path.slice(lastSlash + 1, i);\n } else {\n res = path.slice(lastSlash + 1, i);\n }\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\nfunction _format(sep, pathObject) {\n const dir = pathObject.dir || pathObject.root;\n const base = pathObject.base || (pathObject.name || \"\") + (pathObject.ext || \"\");\n if (!dir) {\n return base;\n }\n if (dir === pathObject.root) {\n return dir + base;\n }\n return dir + sep + base;\n}\nfunction fromFileUrl(url) {\n if (url.protocol !== \"file:\") {\n return Effect.fail(new BadArgument({\n module: \"Path\",\n method: \"fromFileUrl\",\n description: \"URL must be of scheme file\"\n }));\n } else if (url.hostname !== \"\") {\n return Effect.fail(new BadArgument({\n module: \"Path\",\n method: \"fromFileUrl\",\n description: \"Invalid file URL host\"\n }));\n }\n const pathname = url.pathname;\n for (let n = 0; n < pathname.length; n++) {\n if (pathname[n] === \"%\") {\n const third = pathname.codePointAt(n + 2) | 0x20;\n if (pathname[n + 1] === \"2\" && third === 102) {\n return Effect.fail(new BadArgument({\n module: \"Path\",\n method: \"fromFileUrl\",\n description: \"must not include encoded / characters\"\n }));\n }\n }\n }\n return Effect.succeed(decodeURIComponent(pathname));\n}\nconst resolve = function resolve() {\n let resolvedPath = \"\";\n let resolvedAbsolute = false;\n let cwd = undefined;\n for (let i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n let path;\n if (i >= 0) {\n path = arguments[i];\n } else {\n const process = globalThis.process;\n if (cwd === undefined && \"process\" in globalThis && typeof process === \"object\" && process !== null && typeof process.cwd === \"function\") {\n cwd = process.cwd();\n }\n path = cwd;\n }\n // Skip empty entries\n if (path.length === 0) {\n continue;\n }\n resolvedPath = path + \"/\" + resolvedPath;\n resolvedAbsolute = path.charCodeAt(0) === 47; /*/*/\n }\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n // Normalize the path\n resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);\n if (resolvedAbsolute) {\n if (resolvedPath.length > 0) {\n return \"/\" + resolvedPath;\n } else {\n return \"/\";\n }\n } else if (resolvedPath.length > 0) {\n return resolvedPath;\n } else {\n return \".\";\n }\n};\nconst CHAR_FORWARD_SLASH = 47;\nfunction toFileUrl(filepath) {\n const outURL = new URL(\"file://\");\n let resolved = resolve(filepath);\n // path.resolve strips trailing slashes so we must add them back\n const filePathLast = filepath.charCodeAt(filepath.length - 1);\n if (filePathLast === CHAR_FORWARD_SLASH && resolved[resolved.length - 1] !== \"/\") {\n resolved += \"/\";\n }\n outURL.pathname = encodePathChars(resolved);\n return Effect.succeed(outURL);\n}\nconst percentRegEx = /%/g;\nconst backslashRegEx = /\\\\/g;\nconst newlineRegEx = /\\n/g;\nconst carriageReturnRegEx = /\\r/g;\nconst tabRegEx = /\\t/g;\nfunction encodePathChars(filepath) {\n if (filepath.includes(\"%\")) {\n filepath = filepath.replace(percentRegEx, \"%25\");\n }\n if (filepath.includes(\"\\\\\")) {\n filepath = filepath.replace(backslashRegEx, \"%5C\");\n }\n if (filepath.includes(\"\\n\")) {\n filepath = filepath.replace(newlineRegEx, \"%0A\");\n }\n if (filepath.includes(\"\\r\")) {\n filepath = filepath.replace(carriageReturnRegEx, \"%0D\");\n }\n if (filepath.includes(\"\\t\")) {\n filepath = filepath.replace(tabRegEx, \"%09\");\n }\n return filepath;\n}\nconst posixImpl = /*#__PURE__*/Path.of({\n [TypeId]: TypeId,\n resolve,\n normalize(path) {\n if (path.length === 0) return \".\";\n const isAbsolute = path.charCodeAt(0) === 47; /*/*/\n const trailingSeparator = path.charCodeAt(path.length - 1) === 47; /*/*/\n // Normalize the path\n path = normalizeStringPosix(path, !isAbsolute);\n if (path.length === 0 && !isAbsolute) path = \".\";\n if (path.length > 0 && trailingSeparator) path += \"/\";\n if (isAbsolute) return \"/\" + path;\n return path;\n },\n isAbsolute(path) {\n return path.length > 0 && path.charCodeAt(0) === 47; /*/*/\n },\n join() {\n if (arguments.length === 0) {\n return \".\";\n }\n let joined;\n for (let i = 0; i < arguments.length; ++i) {\n const arg = arguments[i];\n if (arg.length > 0) {\n if (joined === undefined) {\n joined = arg;\n } else {\n joined += \"/\" + arg;\n }\n }\n }\n if (joined === undefined) {\n return \".\";\n }\n return posixImpl.normalize(joined);\n },\n relative(from, to) {\n if (from === to) return \"\";\n from = posixImpl.resolve(from);\n to = posixImpl.resolve(to);\n if (from === to) return \"\";\n // Trim any leading backslashes\n let fromStart = 1;\n for (; fromStart < from.length; ++fromStart) {\n if (from.charCodeAt(fromStart) !== 47 /*/*/) {\n break;\n }\n }\n const fromEnd = from.length;\n const fromLen = fromEnd - fromStart;\n // Trim any leading backslashes\n let toStart = 1;\n for (; toStart < to.length; ++toStart) {\n if (to.charCodeAt(toStart) !== 47 /*/*/) {\n break;\n }\n }\n const toEnd = to.length;\n const toLen = toEnd - toStart;\n // Compare paths to find the longest common path from root\n const length = fromLen < toLen ? fromLen : toLen;\n let lastCommonSep = -1;\n let i = 0;\n for (; i <= length; ++i) {\n if (i === length) {\n if (toLen > length) {\n if (to.charCodeAt(toStart + i) === 47 /*/*/) {\n // We get here if `from` is the exact base path for `to`.\n // For example: from='/foo/bar'; to='/foo/bar/baz'\n return to.slice(toStart + i + 1);\n } else if (i === 0) {\n // We get here if `from` is the root\n // For example: from='/'; to='/foo'\n return to.slice(toStart + i);\n }\n } else if (fromLen > length) {\n if (from.charCodeAt(fromStart + i) === 47 /*/*/) {\n // We get here if `to` is the exact base path for `from`.\n // For example: from='/foo/bar/baz'; to='/foo/bar'\n lastCommonSep = i;\n } else if (i === 0) {\n // We get here if `to` is the root.\n // For example: from='/foo'; to='/'\n lastCommonSep = 0;\n }\n }\n break;\n }\n const fromCode = from.charCodeAt(fromStart + i);\n const toCode = to.charCodeAt(toStart + i);\n if (fromCode !== toCode) {\n break;\n } else if (fromCode === 47 /*/*/) {\n lastCommonSep = i;\n }\n }\n let out = \"\";\n // Generate the relative path based on the path difference between `to`\n // and `from`\n for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {\n if (out.length === 0) {\n out += \"..\";\n } else {\n out += \"/..\";\n }\n }\n }\n // Lastly, append the rest of the destination (`to`) path that comes after\n // the common path parts\n if (out.length > 0) {\n return out + to.slice(toStart + lastCommonSep);\n } else {\n toStart += lastCommonSep;\n if (to.charCodeAt(toStart) === 47 /*/*/) {\n ++toStart;\n }\n return to.slice(toStart);\n }\n },\n dirname(path) {\n if (path.length === 0) return \".\";\n let code = path.charCodeAt(0);\n const hasRoot = code === 47; /*/*/\n let end = -1;\n let matchedSlash = true;\n for (let i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n if (end === -1) return hasRoot ? \"/\" : \".\";\n if (hasRoot && end === 1) return \"//\";\n return path.slice(0, end);\n },\n basename(path, ext) {\n let start = 0;\n let end = -1;\n let matchedSlash = true;\n let i;\n if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n if (ext.length === path.length && ext === path) return \"\";\n let extIdx = ext.length - 1;\n let firstNonSlashEnd = -1;\n for (i = path.length - 1; i >= 0; --i) {\n const code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else {\n if (firstNonSlashEnd === -1) {\n // We saw the first non-path separator, remember this index in case\n // we need it if the extension ends up not matching\n matchedSlash = false;\n firstNonSlashEnd = i + 1;\n }\n if (extIdx >= 0) {\n // Try to match the explicit extension\n if (code === ext.charCodeAt(extIdx)) {\n if (--extIdx === -1) {\n // We matched the extension, so mark this as the end of our path\n // component\n end = i;\n }\n } else {\n // Extension does not match, so our result is the entire path\n // component\n extIdx = -1;\n end = firstNonSlashEnd;\n }\n }\n }\n }\n if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;\n return path.slice(start, end);\n } else {\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n if (end === -1) return \"\";\n return path.slice(start, end);\n }\n },\n extname(path) {\n let startDot = -1;\n let startPart = 0;\n let end = -1;\n let matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n let preDotState = 0;\n for (let i = path.length - 1; i >= 0; --i) {\n const code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1) {\n startDot = i;\n } else if (preDotState !== 1) {\n preDotState = 1;\n }\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return \"\";\n }\n return path.slice(startDot, end);\n },\n format: function format(pathObject) {\n if (pathObject === null || typeof pathObject !== \"object\") {\n throw new TypeError(\"The \\\"pathObject\\\" argument must be of type Object. Received type \" + typeof pathObject);\n }\n return _format(\"/\", pathObject);\n },\n parse(path) {\n const ret = {\n root: \"\",\n dir: \"\",\n base: \"\",\n ext: \"\",\n name: \"\"\n };\n if (path.length === 0) return ret;\n let code = path.charCodeAt(0);\n const isAbsolute = code === 47; /*/*/\n let start;\n if (isAbsolute) {\n ret.root = \"/\";\n start = 1;\n } else {\n start = 0;\n }\n let startDot = -1;\n let startPart = 0;\n let end = -1;\n let matchedSlash = true;\n let i = path.length - 1;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n let preDotState = 0;\n // Get non-dir info\n for (; i >= start; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n if (end !== -1) {\n if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);\n }\n } else {\n if (startPart === 0 && isAbsolute) {\n ret.name = path.slice(1, startDot);\n ret.base = path.slice(1, end);\n } else {\n ret.name = path.slice(startPart, startDot);\n ret.base = path.slice(startPart, end);\n }\n ret.ext = path.slice(startDot, end);\n }\n if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = \"/\";\n return ret;\n },\n sep: \"/\",\n fromFileUrl,\n toFileUrl,\n toNamespacedPath: identity\n});\n/** @internal */\nexport const layer = /*#__PURE__*/Layer.succeed(Path, posixImpl);\n//# sourceMappingURL=path.js.map","/**\n * @since 1.0.0\n */\nimport * as internal from \"./internal/path.js\";\n/**\n * @since 1.0.0\n * @category type ids\n */\nexport const TypeId = internal.TypeId;\n/**\n * @since 1.0.0\n * @category tag\n */\nexport const Path = internal.Path;\n/**\n * An implementation of the Path interface that can be used in all environments\n * (including browsers).\n *\n * It uses the POSIX standard for paths.\n *\n * @since 1.0.0\n * @category layer\n */\nexport const layer = internal.layer;\n//# sourceMappingURL=Path.js.map","/** @internal */\nexport const 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=utils.js.map","import * as FileSystem from \"@effect/platform/FileSystem\";\nimport * as Path from \"@effect/platform/Path\";\nimport * as Terminal from \"@effect/platform/Terminal\";\nimport * as Ansi from \"@effect/printer-ansi/Ansi\";\nimport * as Doc from \"@effect/printer-ansi/AnsiDoc\";\nimport * as Optimize from \"@effect/printer/Optimize\";\nimport * as Arr from \"effect/Array\";\nimport * as Data from \"effect/Data\";\nimport * as Effect from \"effect/Effect\";\nimport { identity } from \"effect/Function\";\nimport * as Option from \"effect/Option\";\nimport * as InternalPrompt from \"../prompt.js\";\nimport { Action } from \"./action.js\";\nimport * as InternalAnsiUtils from \"./ansi-utils.js\";\nimport { entriesToDisplay } from \"./utils.js\";\nconst CONFIRM_MESSAGE = \"The selected directory contains files. Would you like to traverse the selected directory?\";\nconst Confirm = /*#__PURE__*/Data.taggedEnum();\nconst showConfirmation = /*#__PURE__*/Confirm.$is(\"Show\");\nconst renderBeep = /*#__PURE__*/Doc.render(Doc.beep, {\n style: \"pretty\"\n});\nfunction resolveCurrentPath(path, options) {\n return Option.match(path, {\n onNone: () => Option.match(options.startingPath, {\n onNone: () => Effect.sync(() => process.cwd()),\n onSome: path => Effect.flatMap(FileSystem.FileSystem, fs =>\n // Ensure the user provided starting path exists\n Effect.orDie(fs.exists(path)).pipe(Effect.filterOrDieMessage(identity, `The provided starting path '${path}' does not exist`), Effect.as(path)))\n }),\n onSome: path => Effect.succeed(path)\n });\n}\nfunction getFileList(directory, options) {\n return Effect.gen(function* () {\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 });\n}\nfunction handleClear(options) {\n return (state, _) => {\n return Effect.gen(function* () {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const currentPath = yield* resolveCurrentPath(state.path, options);\n const text = \"\\n\".repeat(Math.min(state.files.length, options.maxPerPage));\n const clearPath = InternalAnsiUtils.eraseText(currentPath, columns);\n const message = showConfirmation(state.confirm) ? CONFIRM_MESSAGE : options.message;\n const clearPrompt = InternalAnsiUtils.eraseText(`\\n${message}`, columns);\n const clearOptions = InternalAnsiUtils.eraseText(text, columns);\n return clearOptions.pipe(Doc.cat(clearPath), Doc.cat(clearPrompt), Optimize.optimize(Optimize.Deep), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n });\n };\n}\nconst NEWLINE_REGEX = /\\r?\\n/;\nfunction renderPrompt(confirm, message, leadingSymbol, trailingSymbol) {\n const annotateLine = line => Doc.annotate(Doc.text(line), Ansi.bold);\n const prefix = Doc.cat(leadingSymbol, Doc.space);\n return Arr.match(message.split(NEWLINE_REGEX), {\n onEmpty: () => Doc.hsep([prefix, trailingSymbol, confirm]),\n onNonEmpty: promptLines => {\n const lines = Arr.map(promptLines, line => annotateLine(line));\n return prefix.pipe(Doc.cat(Doc.nest(Doc.vsep(lines), 2)), Doc.cat(Doc.space), Doc.cat(trailingSymbol), Doc.cat(Doc.space), Doc.cat(confirm));\n }\n });\n}\nfunction renderPrefix(state, toDisplay, currentIndex, length, figures) {\n let prefix = Doc.space;\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 return state.cursor === currentIndex ? figures.pointer.pipe(Doc.annotate(Ansi.cyanBright), Doc.cat(prefix)) : prefix.pipe(Doc.cat(Doc.space));\n}\nfunction renderFileName(file, isSelected) {\n return isSelected ? Doc.annotate(Doc.text(file), Ansi.combine(Ansi.underlined, Ansi.cyanBright)) : Doc.text(file);\n}\nfunction renderFiles(state, files, figures, options) {\n const length = files.length;\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);\n const fileName = renderFileName(files[index], isSelected);\n documents.push(Doc.cat(prefix, fileName));\n }\n return Doc.vsep(documents);\n}\nfunction renderNextFrame(state, options) {\n return Effect.gen(function* () {\n const path = yield* Path.Path;\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* InternalAnsiUtils.figures;\n const currentPath = yield* resolveCurrentPath(state.path, options);\n const selectedPath = state.files[state.cursor];\n const resolvedPath = path.resolve(currentPath, selectedPath);\n const resolvedPathMsg = figures.pointerSmall.pipe(Doc.cat(Doc.space), Doc.cat(Doc.text(resolvedPath)), Doc.annotate(Ansi.blackBright));\n if (showConfirmation(state.confirm)) {\n const leadingSymbol = Doc.annotate(Doc.text(\"?\"), Ansi.cyanBright);\n const trailingSymbol = Doc.annotate(figures.pointerSmall, Ansi.blackBright);\n const confirm = Doc.annotate(Doc.text(\"(Y/n)\"), Ansi.blackBright);\n const promptMsg = renderPrompt(confirm, CONFIRM_MESSAGE, leadingSymbol, trailingSymbol);\n return Doc.cursorHide.pipe(Doc.cat(promptMsg), Doc.cat(Doc.hardLine), Doc.cat(resolvedPathMsg), Optimize.optimize(Optimize.Deep), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n }\n const leadingSymbol = Doc.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Doc.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderPrompt(Doc.empty, options.message, leadingSymbol, trailingSymbol);\n const files = renderFiles(state, state.files, figures, options);\n return Doc.cursorHide.pipe(Doc.cat(promptMsg), Doc.cat(Doc.hardLine), Doc.cat(resolvedPathMsg), Doc.cat(Doc.hardLine), Doc.cat(files), Optimize.optimize(Optimize.Deep), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n });\n}\nfunction renderSubmission(value, options) {\n return Effect.gen(function* () {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* InternalAnsiUtils.figures;\n const leadingSymbol = Doc.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Doc.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderPrompt(Doc.empty, options.message, leadingSymbol, trailingSymbol);\n return promptMsg.pipe(Doc.cat(Doc.space), Doc.cat(Doc.annotate(Doc.text(value), Ansi.white)), Doc.cat(Doc.hardLine), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n });\n}\nfunction handleRender(options) {\n return (_, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderNextFrame(state, options),\n Submit: ({\n value\n }) => renderSubmission(value, options)\n });\n };\n}\nfunction processCursorUp(state) {\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}\nfunction processCursorDown(state) {\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n cursor: (state.cursor + 1) % state.files.length\n }\n }));\n}\nfunction processSelection(state, options) {\n return Effect.gen(function* () {\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 path: Option.some(resolvedPath),\n confirm: Confirm.Hide()\n }\n });\n }\n return Action.Submit({\n value: resolvedPath\n });\n });\n}\nfunction handleProcess(options) {\n return (input, state) => Effect.gen(function* () {\n switch (input.key.name) {\n case \"k\":\n case \"up\":\n {\n return yield* processCursorUp(state);\n }\n case \"j\":\n case \"down\":\n case \"tab\":\n {\n return yield* processCursorDown(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 path: Option.some(resolvedPath),\n confirm: Confirm.Hide()\n }\n });\n }\n return Action.Beep();\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 Action.Beep();\n }\n default:\n {\n return Action.Beep();\n }\n }\n });\n}\n/** @internal */\nexport const file = (options = {}) => {\n const opts = {\n type: options.type ?? \"file\",\n message: options.message ?? `Choose a file`,\n startingPath: Option.fromNullable(options.startingPath),\n maxPerPage: options.maxPerPage ?? 10,\n filter: options.filter ?? (() => Effect.succeed(true))\n };\n const initialState = Effect.gen(function* () {\n const path = Option.none();\n const currentPath = yield* resolveCurrentPath(path, opts);\n const files = yield* getFileList(currentPath, opts);\n const confirm = Confirm.Hide();\n return {\n cursor: 0,\n files,\n path,\n confirm\n };\n });\n return InternalPrompt.custom(initialState, {\n render: handleRender(opts),\n process: handleProcess(opts),\n clear: handleClear(opts)\n });\n};\n//# sourceMappingURL=file.js.map","import * as Terminal from \"@effect/platform/Terminal\";\nimport * as Ansi from \"@effect/printer-ansi/Ansi\";\nimport * as Doc from \"@effect/printer-ansi/AnsiDoc\";\nimport * as Optimize from \"@effect/printer/Optimize\";\nimport * as Arr from \"effect/Array\";\nimport * as Effect from \"effect/Effect\";\nimport * as EffectNumber from \"effect/Number\";\nimport * as Option from \"effect/Option\";\nimport * as Schema from \"effect/Schema\";\nimport * as InternalPrompt from \"../prompt.js\";\nimport { Action } from \"./action.js\";\nimport * as InternalAnsiUtils from \"./ansi-utils.js\";\nconst parseInt = /*#__PURE__*/Schema.NumberFromString.pipe(/*#__PURE__*/Schema.int(), Schema.decodeUnknown);\nconst parseFloat = /*#__PURE__*/Schema.decodeUnknown(Schema.NumberFromString);\nconst renderBeep = /*#__PURE__*/Doc.render(Doc.beep, {\n style: \"pretty\"\n});\nfunction handleClear(options) {\n return (state, _) => {\n return Effect.gen(function* () {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const resetCurrentLine = Doc.cat(Doc.eraseLine, Doc.cursorLeft);\n const clearError = Option.match(state.error, {\n onNone: () => Doc.empty,\n onSome: error => Doc.cursorDown(InternalAnsiUtils.lines(error, columns)).pipe(Doc.cat(InternalAnsiUtils.eraseText(`\\n${error}`, columns)))\n });\n const clearOutput = InternalAnsiUtils.eraseText(options.message, columns);\n return clearError.pipe(Doc.cat(clearOutput), Doc.cat(resetCurrentLine), Optimize.optimize(Optimize.Deep), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n });\n };\n}\nfunction renderInput(state, submitted) {\n const annotation = Option.match(state.error, {\n onNone: () => Ansi.combine(Ansi.underlined, Ansi.cyanBright),\n onSome: () => Ansi.red\n });\n const value = state.value === \"\" ? Doc.empty : Doc.text(`${state.value}`);\n return submitted ? value : Doc.annotate(value, annotation);\n}\nconst NEWLINE_REGEX = /\\r?\\n/;\nfunction renderError(state, pointer) {\n return Option.match(state.error, {\n onNone: () => Doc.empty,\n onSome: error => Arr.match(error.split(NEWLINE_REGEX), {\n onEmpty: () => Doc.empty,\n onNonEmpty: errorLines => {\n const annotateLine = line => Doc.annotate(Doc.text(line), Ansi.combine(Ansi.italicized, Ansi.red));\n const prefix = Doc.cat(Doc.annotate(pointer, Ansi.red), Doc.space);\n const lines = Arr.map(errorLines, str => annotateLine(str));\n return Doc.cursorSavePosition.pipe(Doc.cat(Doc.hardLine), Doc.cat(prefix), Doc.cat(Doc.align(Doc.vsep(lines))), Doc.cat(Doc.cursorRestorePosition));\n }\n })\n });\n}\nfunction renderOutput(state, leadingSymbol, trailingSymbol, options, submitted = false) {\n const annotateLine = line => Doc.annotate(Doc.text(line), Ansi.bold);\n const prefix = Doc.cat(leadingSymbol, Doc.space);\n return Arr.match(options.message.split(/\\r?\\n/), {\n onEmpty: () => Doc.hsep([prefix, trailingSymbol, renderInput(state, submitted)]),\n onNonEmpty: promptLines => {\n const lines = Arr.map(promptLines, line => annotateLine(line));\n return prefix.pipe(Doc.cat(Doc.nest(Doc.vsep(lines), 2)), Doc.cat(Doc.space), Doc.cat(trailingSymbol), Doc.cat(Doc.space), Doc.cat(renderInput(state, submitted)));\n }\n });\n}\nfunction renderNextFrame(state, options) {\n return Effect.gen(function* () {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* InternalAnsiUtils.figures;\n const leadingSymbol = Doc.annotate(Doc.text(\"?\"), Ansi.cyanBright);\n const trailingSymbol = Doc.annotate(figures.pointerSmall, Ansi.blackBright);\n const errorMsg = renderError(state, figures.pointerSmall);\n const promptMsg = renderOutput(state, leadingSymbol, trailingSymbol, options);\n return promptMsg.pipe(Doc.cat(errorMsg), Optimize.optimize(Optimize.Deep), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n });\n}\nfunction renderSubmission(nextState, options) {\n return Effect.gen(function* () {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* InternalAnsiUtils.figures;\n const leadingSymbol = Doc.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Doc.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderOutput(nextState, leadingSymbol, trailingSymbol, options, true);\n return promptMsg.pipe(Doc.cat(Doc.hardLine), Optimize.optimize(Optimize.Deep), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n });\n}\nfunction processBackspace(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}\nfunction defaultIntProcessor(state, input) {\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 return Effect.match(parseInt(state.value + input), {\n onFailure: () => Action.Beep(),\n onSuccess: value => Action.NextFrame({\n state: {\n ...state,\n value: `${value}`,\n error: Option.none()\n }\n })\n });\n}\nfunction defaultFloatProcessor(state, input) {\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 return Effect.match(parseFloat(state.value + input), {\n onFailure: () => Action.Beep(),\n onSuccess: value => Action.NextFrame({\n state: {\n ...state,\n value: input === \".\" ? `${value}.` : `${value}`,\n error: Option.none()\n }\n })\n });\n}\nconst initialState = {\n cursor: 0,\n value: \"\",\n error: /*#__PURE__*/Option.none()\n};\nfunction handleRenderInteger(options) {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderNextFrame(state, options),\n Submit: () => renderSubmission(state, options)\n });\n };\n}\nfunction handleProcessInteger(options) {\n return (input, state) => {\n switch (input.key.name) {\n case \"backspace\":\n {\n return processBackspace(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 return Effect.matchEffect(parseInt(state.value), {\n onFailure: () => Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n error: Option.some(\"Must provide an integer value\")\n }\n })),\n onSuccess: n => Effect.match(options.validate(n), {\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 const value = Option.getOrElse(input.input, () => \"\");\n return defaultIntProcessor(state, value);\n }\n }\n };\n}\n/** @internal */\nexport const integer = options => {\n const opts = {\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 return InternalPrompt.custom(initialState, {\n render: handleRenderInteger(opts),\n process: handleProcessInteger(opts),\n clear: handleClear(opts)\n });\n};\nfunction handleRenderFloat(options) {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderNextFrame(state, options),\n Submit: () => renderSubmission(state, options)\n });\n };\n}\nfunction handleProcessFloat(options) {\n return (input, state) => {\n switch (input.key.name) {\n case \"backspace\":\n {\n return processBackspace(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 return Effect.matchEffect(parseFloat(state.value), {\n onFailure: () => Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n error: Option.some(\"Must provide a floating point value\")\n }\n })),\n onSuccess: n => Effect.flatMap(Effect.sync(() => EffectNumber.round(n, 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 const value = Option.getOrElse(input.input, () => \"\");\n return defaultFloatProcessor(state, value);\n }\n }\n };\n}\n/** @internal */\nexport const float = options => {\n const opts = {\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 return InternalPrompt.custom(initialState, {\n render: handleRenderFloat(opts),\n process: handleProcessFloat(opts),\n clear: handleClear(opts)\n });\n};\n//# sourceMappingURL=number.js.map","import * as Terminal from \"@effect/platform/Terminal\";\nimport * as Ansi from \"@effect/printer-ansi/Ansi\";\nimport * as Doc from \"@effect/printer-ansi/AnsiDoc\";\nimport * as Optimize from \"@effect/printer/Optimize\";\nimport * as Arr from \"effect/Array\";\nimport * as Effect from \"effect/Effect\";\nimport * as InternalPrompt from \"../prompt.js\";\nimport { Action } from \"./action.js\";\nimport * as InternalAnsiUtils from \"./ansi-utils.js\";\nimport { entriesToDisplay } from \"./utils.js\";\nconst renderBeep = /*#__PURE__*/Doc.render(Doc.beep, {\n style: \"pretty\"\n});\nconst NEWLINE_REGEX = /\\r?\\n/;\nfunction renderOutput(leadingSymbol, trailingSymbol, options) {\n const annotateLine = line => Doc.annotate(Doc.text(line), Ansi.bold);\n const prefix = Doc.cat(leadingSymbol, Doc.space);\n return Arr.match(options.message.split(NEWLINE_REGEX), {\n onEmpty: () => Doc.hsep([prefix, trailingSymbol]),\n onNonEmpty: promptLines => {\n const lines = Arr.map(promptLines, line => annotateLine(line));\n return prefix.pipe(Doc.cat(Doc.nest(Doc.vsep(lines), 2)), Doc.cat(Doc.space), Doc.cat(trailingSymbol), Doc.cat(Doc.space));\n }\n });\n}\nfunction renderChoicePrefix(state, choices, toDisplay, currentIndex, figures) {\n let prefix = Doc.space;\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 (choices[currentIndex].disabled) {\n const annotation = Ansi.combine(Ansi.bold, Ansi.blackBright);\n return state === currentIndex ? figures.pointer.pipe(Doc.annotate(annotation), Doc.cat(prefix)) : prefix.pipe(Doc.cat(Doc.space));\n }\n return state === currentIndex ? figures.pointer.pipe(Doc.annotate(Ansi.cyanBright), Doc.cat(prefix)) : prefix.pipe(Doc.cat(Doc.space));\n}\nfunction renderChoiceTitle(choice, isSelected) {\n const title = Doc.text(choice.title);\n if (isSelected) {\n return choice.disabled ? Doc.annotate(title, Ansi.combine(Ansi.underlined, Ansi.blackBright)) : Doc.annotate(title, Ansi.combine(Ansi.underlined, Ansi.cyanBright));\n }\n return choice.disabled ? Doc.annotate(title, Ansi.combine(Ansi.strikethrough, Ansi.blackBright)) : title;\n}\nfunction renderChoiceDescription(choice, isSelected) {\n if (!choice.disabled && choice.description && isSelected) {\n return Doc.char(\"-\").pipe(Doc.cat(Doc.space), Doc.cat(Doc.text(choice.description)), Doc.annotate(Ansi.blackBright));\n }\n return Doc.empty;\n}\nfunction renderChoices(state, options, figures) {\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);\n const title = renderChoiceTitle(choice, isSelected);\n const description = renderChoiceDescription(choice, isSelected);\n documents.push(prefix.pipe(Doc.cat(title), Doc.cat(Doc.space), Doc.cat(description)));\n }\n return Doc.vsep(documents);\n}\nfunction renderNextFrame(state, options) {\n return Effect.gen(function* () {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* InternalAnsiUtils.figures;\n const choices = renderChoices(state, options, figures);\n const leadingSymbol = Doc.annotate(Doc.text(\"?\"), Ansi.cyanBright);\n const trailingSymbol = Doc.annotate(figures.pointerSmall, Ansi.blackBright);\n const promptMsg = renderOutput(leadingSymbol, trailingSymbol, options);\n return Doc.cursorHide.pipe(Doc.cat(promptMsg), Doc.cat(Doc.hardLine), Doc.cat(choices), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n });\n}\nfunction renderSubmission(state, options) {\n return Effect.gen(function* () {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* InternalAnsiUtils.figures;\n const selected = Doc.text(options.choices[state].title);\n const leadingSymbol = Doc.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Doc.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderOutput(leadingSymbol, trailingSymbol, options);\n return promptMsg.pipe(Doc.cat(Doc.space), Doc.cat(Doc.annotate(selected, Ansi.white)), Doc.cat(Doc.hardLine), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n });\n}\nfunction processCursorUp(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}\nfunction processCursorDown(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}\nfunction processNext(state, choices) {\n return Effect.succeed(Action.NextFrame({\n state: (state + 1) % choices.length\n }));\n}\nfunction handleRender(options) {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderNextFrame(state, options),\n Submit: () => renderSubmission(state, options)\n });\n };\n}\nexport function handleClear(options) {\n return Effect.gen(function* () {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const clearPrompt = Doc.cat(Doc.eraseLine, Doc.cursorLeft);\n const text = \"\\n\".repeat(Math.min(options.choices.length, options.maxPerPage)) + options.message;\n const clearOutput = InternalAnsiUtils.eraseText(text, columns);\n return clearOutput.pipe(Doc.cat(clearPrompt), Optimize.optimize(Optimize.Deep), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n });\n}\nfunction handleProcess(options) {\n return (input, state) => {\n switch (input.key.name) {\n case \"k\":\n case \"up\":\n {\n return processCursorUp(state, options.choices);\n }\n case \"j\":\n case \"down\":\n {\n return processCursorDown(state, options.choices);\n }\n case \"tab\":\n {\n return processNext(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}\n/** @internal */\nexport const select = options => {\n const opts = {\n maxPerPage: 10,\n ...options\n };\n // Validate and seed initial index from any choice marked selected: true\n let initialIndex = 0;\n let seenSelected = -1;\n for (let i = 0; i < opts.choices.length; i++) {\n const choice = opts.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 InternalPrompt.custom(initialIndex, {\n render: handleRender(opts),\n process: handleProcess(opts),\n clear: () => handleClear(opts)\n });\n};\n//# sourceMappingURL=select.js.map","import * as Terminal from \"@effect/platform/Terminal\";\nimport * as Ansi from \"@effect/printer-ansi/Ansi\";\nimport * as Doc from \"@effect/printer-ansi/AnsiDoc\";\nimport * as Optimize from \"@effect/printer/Optimize\";\nimport * as Arr from \"effect/Array\";\nimport * as Effect from \"effect/Effect\";\nimport * as Option from \"effect/Option\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as InternalPrompt from \"../prompt.js\";\nimport { Action } from \"./action.js\";\nimport * as InternalAnsiUtils from \"./ansi-utils.js\";\nfunction getValue(state, options) {\n return state.value.length > 0 ? state.value : options.default;\n}\nconst renderBeep = /*#__PURE__*/Doc.render(Doc.beep, {\n style: \"pretty\"\n});\nfunction renderClearScreen(state, options) {\n return Effect.gen(function* () {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n // Erase the current line and place the cursor in column one\n const resetCurrentLine = Doc.cat(Doc.eraseLine, Doc.cursorLeft);\n // Check for any error output\n const clearError = Option.match(state.error, {\n onNone: () => Doc.empty,\n onSome: error =>\n // If there was an error, move the cursor down to the final error line and\n // then clear all lines of error output\n Doc.cursorDown(InternalAnsiUtils.lines(error, columns)).pipe(\n // Add a leading newline to the error message to ensure that the corrrect\n // number of error lines are erased\n Doc.cat(InternalAnsiUtils.eraseText(`\\n${error}`, columns)))\n });\n // Ensure that the prior prompt output is cleaned up\n // Calculate full rendered line: \"? \" + message + \" › \" + input\n const inputValue = state.value.length > 0 ? state.value : options.default;\n const fullLine = `? ${options.message} \\u203a ${inputValue}`;\n const clearOutput = InternalAnsiUtils.eraseText(fullLine, columns);\n // Concatenate and render all documents\n return clearError.pipe(Doc.cat(clearOutput), Doc.cat(resetCurrentLine), Optimize.optimize(Optimize.Deep), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n });\n}\nfunction renderInput(nextState, options, submitted) {\n const text = getValue(nextState, options);\n const annotation = Option.match(nextState.error, {\n onNone: () => {\n if (submitted) {\n return Ansi.white;\n }\n if (nextState.value.length === 0) {\n return Ansi.blackBright;\n }\n return Ansi.combine(Ansi.underlined, Ansi.cyanBright);\n },\n onSome: () => Ansi.red\n });\n switch (options.type) {\n case \"hidden\":\n {\n return Doc.empty;\n }\n case \"password\":\n {\n return Doc.annotate(Doc.text(\"*\".repeat(text.length)), annotation);\n }\n case \"text\":\n {\n return Doc.annotate(Doc.text(text), annotation);\n }\n }\n}\nfunction renderError(nextState, pointer) {\n return Option.match(nextState.error, {\n onNone: () => Doc.empty,\n onSome: error => Arr.match(error.split(/\\r?\\n/), {\n onEmpty: () => Doc.empty,\n onNonEmpty: errorLines => {\n const annotateLine = line => Doc.text(line).pipe(Doc.annotate(Ansi.combine(Ansi.italicized, Ansi.red)));\n const prefix = Doc.cat(Doc.annotate(pointer, Ansi.red), Doc.space);\n const lines = Arr.map(errorLines, str => annotateLine(str));\n return Doc.cursorSavePosition.pipe(Doc.cat(Doc.hardLine), Doc.cat(prefix), Doc.cat(Doc.align(Doc.vsep(lines))), Doc.cat(Doc.cursorRestorePosition));\n }\n })\n });\n}\nfunction renderOutput(nextState, leadingSymbol, trailingSymbol, options, submitted = false) {\n const annotateLine = line => Doc.annotate(Doc.text(line), Ansi.bold);\n const promptLines = options.message.split(/\\r?\\n/);\n const prefix = Doc.cat(leadingSymbol, Doc.space);\n if (Arr.isNonEmptyReadonlyArray(promptLines)) {\n const lines = Arr.map(promptLines, line => annotateLine(line));\n return prefix.pipe(Doc.cat(Doc.nest(Doc.vsep(lines), 2)), Doc.cat(Doc.space), Doc.cat(trailingSymbol), Doc.cat(Doc.space), Doc.cat(renderInput(nextState, options, submitted)));\n }\n return Doc.hsep([prefix, trailingSymbol, renderInput(nextState, options, submitted)]);\n}\nfunction renderNextFrame(state, options) {\n return Effect.gen(function* () {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* InternalAnsiUtils.figures;\n const leadingSymbol = Doc.annotate(Doc.text(\"?\"), Ansi.cyanBright);\n const trailingSymbol = Doc.annotate(figures.pointerSmall, Ansi.blackBright);\n const promptMsg = renderOutput(state, leadingSymbol, trailingSymbol, options);\n const errorMsg = renderError(state, figures.pointerSmall);\n const offset = state.cursor - state.value.length;\n return promptMsg.pipe(Doc.cat(errorMsg), Doc.cat(Doc.cursorMove(offset)), Optimize.optimize(Optimize.Deep), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n });\n}\nfunction renderSubmission(state, options) {\n return Effect.gen(function* () {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const figures = yield* InternalAnsiUtils.figures;\n const leadingSymbol = Doc.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Doc.annotate(figures.ellipsis, Ansi.blackBright);\n const promptMsg = renderOutput(state, leadingSymbol, trailingSymbol, options, true);\n return promptMsg.pipe(Doc.cat(Doc.hardLine), Optimize.optimize(Optimize.Deep), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n });\n}\nfunction processBackspace(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}\nfunction processCursorLeft(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}\nfunction processCursorRight(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}\nfunction processTab(state, options) {\n if (state.value === options.default) {\n return Effect.succeed(Action.Beep());\n }\n const value = getValue(state, options);\n const cursor = value.length;\n return Effect.succeed(Action.NextFrame({\n state: {\n ...state,\n value,\n cursor,\n error: Option.none()\n }\n }));\n}\nfunction defaultProcessor(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 initialState = {\n cursor: 0,\n value: \"\",\n error: /*#__PURE__*/Option.none()\n};\nfunction handleRender(options) {\n return (state, action) => {\n return Action.$match(action, {\n Beep: () => Effect.succeed(renderBeep),\n NextFrame: ({\n state\n }) => renderNextFrame(state, options),\n Submit: () => renderSubmission(state, options)\n });\n };\n}\nfunction handleProcess(options) {\n return (input, state) => {\n switch (input.key.name) {\n case \"backspace\":\n {\n return processBackspace(state);\n }\n case \"left\":\n {\n return processCursorLeft(state);\n }\n case \"right\":\n {\n return processCursorRight(state);\n }\n case \"enter\":\n case \"return\":\n {\n const value = getValue(state, options);\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 const value = Option.getOrElse(input.input, () => \"\");\n return defaultProcessor(value, state);\n }\n }\n };\n}\nfunction handleClear(options) {\n return (state, _) => {\n return renderClearScreen(state, options);\n };\n}\nfunction basePrompt(options, type) {\n const opts = {\n default: \"\",\n type,\n validate: Effect.succeed,\n ...options\n };\n return InternalPrompt.custom(initialState, {\n render: handleRender(opts),\n process: handleProcess(opts),\n clear: handleClear(opts)\n });\n}\n/** @internal */\nexport const hidden = options => basePrompt(options, \"hidden\").pipe(InternalPrompt.map(Redacted.make));\n/** @internal */\nexport const password = options => basePrompt(options, \"password\").pipe(InternalPrompt.map(Redacted.make));\n/** @internal */\nexport const text = options => basePrompt(options, \"text\");\n//# sourceMappingURL=text.js.map","import * as Terminal from \"@effect/platform/Terminal\";\nimport * as Ansi from \"@effect/printer-ansi/Ansi\";\nimport * as Doc from \"@effect/printer-ansi/AnsiDoc\";\nimport * as Optimize from \"@effect/printer/Optimize\";\nimport * as Arr from \"effect/Array\";\nimport * as Effect from \"effect/Effect\";\nimport * as InternalPrompt from \"../prompt.js\";\nimport { Action } from \"./action.js\";\nimport * as InternalAnsiUtils from \"./ansi-utils.js\";\nconst renderBeep = /*#__PURE__*/Doc.render(Doc.beep, {\n style: \"pretty\"\n});\nfunction handleClear(options) {\n return Effect.gen(function* () {\n const terminal = yield* Terminal.Terminal;\n const columns = yield* terminal.columns;\n const clearPrompt = Doc.cat(Doc.eraseLine, Doc.cursorLeft);\n const clearOutput = InternalAnsiUtils.eraseText(options.message, columns);\n return clearOutput.pipe(Doc.cat(clearPrompt), Optimize.optimize(Optimize.Deep), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n });\n}\nfunction renderToggle(value, options, submitted = false) {\n const separator = Doc.annotate(Doc.char(\"/\"), Ansi.blackBright);\n const selectedAnnotation = Ansi.combine(Ansi.underlined, submitted ? Ansi.white : Ansi.cyanBright);\n const inactive = value ? Doc.text(options.inactive) : Doc.annotate(Doc.text(options.inactive), selectedAnnotation);\n const active = value ? Doc.annotate(Doc.text(options.active), selectedAnnotation) : Doc.text(options.active);\n return Doc.hsep([active, separator, inactive]);\n}\nfunction renderOutput(toggle, leadingSymbol, trailingSymbol, options) {\n const annotateLine = line => Doc.annotate(Doc.text(line), Ansi.bold);\n const promptLines = options.message.split(/\\r?\\n/);\n const prefix = Doc.cat(leadingSymbol, Doc.space);\n if (Arr.isNonEmptyReadonlyArray(promptLines)) {\n const lines = Arr.map(promptLines, line => annotateLine(line));\n return prefix.pipe(Doc.cat(Doc.nest(Doc.vsep(lines), 2)), Doc.cat(Doc.space), Doc.cat(trailingSymbol), Doc.cat(Doc.space), Doc.cat(toggle));\n }\n return Doc.hsep([prefix, trailingSymbol, toggle]);\n}\nfunction renderNextFrame(state, options) {\n return Effect.gen(function* () {\n const terminal = yield* Terminal.Terminal;\n const figures = yield* InternalAnsiUtils.figures;\n const columns = yield* terminal.columns;\n const leadingSymbol = Doc.annotate(Doc.text(\"?\"), Ansi.cyanBright);\n const trailingSymbol = Doc.annotate(figures.pointerSmall, Ansi.blackBright);\n const toggle = renderToggle(state, options);\n const promptMsg = renderOutput(toggle, leadingSymbol, trailingSymbol, options);\n return Doc.cursorHide.pipe(Doc.cat(promptMsg), Optimize.optimize(Optimize.Deep), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\n });\n}\nfunction renderSubmission(value, options) {\n return Effect.gen(function* () {\n const terminal = yield* Terminal.Terminal;\n const figures = yield* InternalAnsiUtils.figures;\n const columns = yield* terminal.columns;\n const leadingSymbol = Doc.annotate(figures.tick, Ansi.green);\n const trailingSymbol = Doc.annotate(figures.ellipsis, Ansi.blackBright);\n const toggle = renderToggle(value, options, true);\n const promptMsg = renderOutput(toggle, leadingSymbol, trailingSymbol, options);\n return promptMsg.pipe(Doc.cat(Doc.hardLine), Optimize.optimize(Optimize.Deep), Doc.render({\n style: \"pretty\",\n options: {\n lineWidth: columns\n }\n }));\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}));\nfunction handleRender(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 renderNextFrame(state, options);\n }\n case \"Submit\":\n {\n return renderSubmission(state, options);\n }\n }\n };\n}\nfunction handleProcess(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}\n/** @internal */\nexport const toggle = options => {\n const opts = {\n initial: false,\n active: \"on\",\n inactive: \"off\",\n ...options\n };\n return InternalPrompt.custom(opts.initial, {\n render: handleRender(opts),\n process: handleProcess,\n clear: () => handleClear(opts)\n });\n};\n//# sourceMappingURL=toggle.js.map","import * as FileSystem from \"@effect/platform/FileSystem\";\nimport * as Arr from \"effect/Array\";\nimport * as Effect from \"effect/Effect\";\nimport { dual, pipe } from \"effect/Function\";\nimport * as Option from \"effect/Option\";\nimport { pipeArguments } from \"effect/Pipeable\";\nimport * as EffectRedacted from \"effect/Redacted\";\nimport * as Schema from \"effect/Schema\";\nimport * as EffectSecret from \"effect/Secret\";\nimport * as InternalCliConfig from \"./cliConfig.js\";\nimport * as InternalHelpDoc from \"./helpDoc.js\";\nimport * as InternalSpan from \"./helpDoc/span.js\";\nimport * as InternalPrompt from \"./prompt.js\";\nimport * as InternalDatePrompt from \"./prompt/date.js\";\nimport * as InternalFilePrompt from \"./prompt/file.js\";\nimport * as InternalNumberPrompt from \"./prompt/number.js\";\nimport * as InternalSelectPrompt from \"./prompt/select.js\";\nimport * as InternalTextPrompt from \"./prompt/text.js\";\nimport * as InternalTogglePrompt from \"./prompt/toggle.js\";\nconst PrimitiveSymbolKey = \"@effect/cli/Primitive\";\n/** @internal */\nexport const PrimitiveTypeId = /*#__PURE__*/Symbol.for(PrimitiveSymbolKey);\nconst proto = {\n [PrimitiveTypeId]: {\n _A: _ => _\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n// =============================================================================\n// Refinements\n// =============================================================================\n/** @internal */\nexport const isPrimitive = u => typeof u === \"object\" && u != null && PrimitiveTypeId in u;\n/** @internal */\nexport const isBool = self => isPrimitive(self) && isBoolType(self);\n/** @internal */\nexport const isBoolType = self => self._tag === \"Bool\";\n/** @internal */\nexport const isChoiceType = self => self._tag === \"Choice\";\n/** @internal */\nexport const isDateTimeType = self => self._tag === \"DateTime\";\n/** @internal */\nexport const isFloatType = self => self._tag === \"Float\";\n/** @internal */\nexport const isIntegerType = self => self._tag === \"Integer\";\n/** @internal */\nexport const isPathType = self => self._tag === \"Path\";\n/** @internal */\nexport const isSecretType = self => self._tag === \"Path\";\n/** @internal */\nexport const isTextType = self => self._tag === \"Text\";\n// =============================================================================\n// Constructors\n// =============================================================================\n/** @internal */\nexport const trueValues = /*#__PURE__*/Schema.Literal(\"true\", \"1\", \"y\", \"yes\", \"on\");\n/** @internal */\nexport const isTrueValue = /*#__PURE__*/Schema.is(trueValues);\n/** @internal */\nexport const falseValues = /*#__PURE__*/Schema.Literal(\"false\", \"0\", \"n\", \"no\", \"off\");\n/** @internal */\nexport const isFalseValue = /*#__PURE__*/Schema.is(falseValues);\n/** @internal */\nexport const boolean = defaultValue => {\n const op = Object.create(proto);\n op._tag = \"Bool\";\n op.defaultValue = defaultValue;\n return op;\n};\n/** @internal */\nexport const choice = alternatives => {\n const op = Object.create(proto);\n op._tag = \"Choice\";\n op.alternatives = alternatives;\n return op;\n};\n/** @internal */\nexport const date = /*#__PURE__*/(() => {\n const op = /*#__PURE__*/Object.create(proto);\n op._tag = \"DateTime\";\n return op;\n})();\n/** @internal */\nexport const float = /*#__PURE__*/(() => {\n const op = /*#__PURE__*/Object.create(proto);\n op._tag = \"Float\";\n return op;\n})();\n/** @internal */\nexport const integer = /*#__PURE__*/(() => {\n const op = /*#__PURE__*/Object.create(proto);\n op._tag = \"Integer\";\n return op;\n})();\n/** @internal */\nexport const path = (pathType, pathExists) => {\n const op = Object.create(proto);\n op._tag = \"Path\";\n op.pathType = pathType;\n op.pathExists = pathExists;\n return op;\n};\n/** @internal */\nexport const redacted = /*#__PURE__*/(() => {\n const op = /*#__PURE__*/Object.create(proto);\n op._tag = \"Redacted\";\n return op;\n})();\n/** @internal */\nexport const secret = /*#__PURE__*/(() => {\n const op = /*#__PURE__*/Object.create(proto);\n op._tag = \"Secret\";\n return op;\n})();\n/** @internal */\nexport const text = /*#__PURE__*/(() => {\n const op = /*#__PURE__*/Object.create(proto);\n op._tag = \"Text\";\n return op;\n})();\n// =============================================================================\n// Combinators\n// =============================================================================\n/** @internal */\nexport const getChoices = self => getChoicesInternal(self);\n/** @internal */\nexport const getHelp = self => getHelpInternal(self);\n/** @internal */\nexport const getTypeName = self => getTypeNameInternal(self);\n/** @internal */\nexport const validate = /*#__PURE__*/dual(3, (self, value, config) => validateInternal(self, value, config));\n/** @internal */\nexport const wizard = /*#__PURE__*/dual(2, (self, help) => wizardInternal(self, help));\n// =============================================================================\n// Internals\n// =============================================================================\nconst getChoicesInternal = self => {\n switch (self._tag) {\n case \"Bool\":\n {\n return Option.some(\"true | false\");\n }\n case \"Choice\":\n {\n const choices = pipe(Arr.map(self.alternatives, ([choice]) => choice), Arr.join(\" | \"));\n return Option.some(choices);\n }\n case \"DateTime\":\n {\n return Option.some(\"date\");\n }\n case \"Float\":\n case \"Integer\":\n case \"Path\":\n case \"Redacted\":\n case \"Secret\":\n case \"Text\":\n {\n return Option.none();\n }\n }\n};\nconst getHelpInternal = self => {\n switch (self._tag) {\n case \"Bool\":\n {\n return InternalSpan.text(\"A true or false value.\");\n }\n case \"Choice\":\n {\n const choices = pipe(Arr.map(self.alternatives, ([choice]) => choice), Arr.join(\", \"));\n return InternalSpan.text(`One of the following: ${choices}`);\n }\n case \"DateTime\":\n {\n return InternalSpan.text(\"A date without a time-zone in the ISO-8601 format, such as 2007-12-03T10:15:30.\");\n }\n case \"Float\":\n {\n return InternalSpan.text(\"A floating point number.\");\n }\n case \"Integer\":\n {\n return InternalSpan.text(\"An integer.\");\n }\n case \"Path\":\n {\n if (self.pathType === \"either\" && self.pathExists === \"yes\") {\n return InternalSpan.text(\"An existing file or directory.\");\n }\n if (self.pathType === \"file\" && self.pathExists === \"yes\") {\n return InternalSpan.text(\"An existing file.\");\n }\n if (self.pathType === \"directory\" && self.pathExists === \"yes\") {\n return InternalSpan.text(\"An existing directory.\");\n }\n if (self.pathType === \"either\" && self.pathExists === \"no\") {\n return InternalSpan.text(\"A file or directory that must not exist.\");\n }\n if (self.pathType === \"file\" && self.pathExists === \"no\") {\n return InternalSpan.text(\"A file that must not exist.\");\n }\n if (self.pathType === \"directory\" && self.pathExists === \"no\") {\n return InternalSpan.text(\"A directory that must not exist.\");\n }\n if (self.pathType === \"either\" && self.pathExists === \"either\") {\n return InternalSpan.text(\"A file or directory.\");\n }\n if (self.pathType === \"file\" && self.pathExists === \"either\") {\n return InternalSpan.text(\"A file.\");\n }\n if (self.pathType === \"directory\" && self.pathExists === \"either\") {\n return InternalSpan.text(\"A directory.\");\n }\n throw new Error(\"[BUG]: Path.help - encountered invalid combination of path type \" + `('${self.pathType}') and path existence ('${self.pathExists}')`);\n }\n case \"Secret\":\n case \"Redacted\":\n {\n return InternalSpan.text(\"A user-defined piece of text that is confidential.\");\n }\n case \"Text\":\n {\n return InternalSpan.text(\"A user-defined piece of text.\");\n }\n }\n};\nconst getTypeNameInternal = self => {\n switch (self._tag) {\n case \"Bool\":\n {\n return \"boolean\";\n }\n case \"Choice\":\n {\n return \"choice\";\n }\n case \"DateTime\":\n {\n return \"date\";\n }\n case \"Float\":\n {\n return \"float\";\n }\n case \"Integer\":\n {\n return \"integer\";\n }\n case \"Path\":\n {\n if (self.pathType === \"either\") {\n return \"path\";\n }\n return self.pathType;\n }\n case \"Redacted\":\n {\n return \"redacted\";\n }\n case \"Secret\":\n {\n return \"secret\";\n }\n case \"Text\":\n {\n return \"text\";\n }\n }\n};\nconst validateInternal = (self, value, config) => {\n switch (self._tag) {\n case \"Bool\":\n {\n return Option.map(value, str => InternalCliConfig.normalizeCase(config, str)).pipe(Option.match({\n onNone: () => Effect.orElseFail(self.defaultValue, () => `Missing default value for boolean parameter`),\n onSome: value => isTrueValue(value) ? Effect.succeed(true) : isFalseValue(value) ? Effect.succeed(false) : Effect.fail(`Unable to recognize '${value}' as a valid boolean`)\n }));\n }\n case \"Choice\":\n {\n return Effect.orElseFail(value, () => `Choice options to not have a default value`).pipe(Effect.flatMap(value => Arr.findFirst(self.alternatives, ([choice]) => choice === value)), Effect.mapBoth({\n onFailure: () => {\n const choices = pipe(Arr.map(self.alternatives, ([choice]) => choice), Arr.join(\", \"));\n return `Expected one of the following cases: ${choices}`;\n },\n onSuccess: ([, value]) => value\n }));\n }\n case \"DateTime\":\n {\n return attempt(value, getTypeNameInternal(self), Schema.decodeUnknown(Schema.Date));\n }\n case \"Float\":\n {\n return attempt(value, getTypeNameInternal(self), Schema.decodeUnknown(Schema.NumberFromString));\n }\n case \"Integer\":\n {\n const intFromString = Schema.compose(Schema.NumberFromString, Schema.Int);\n return attempt(value, getTypeNameInternal(self), Schema.decodeUnknown(intFromString));\n }\n case \"Path\":\n {\n return Effect.flatMap(FileSystem.FileSystem, fileSystem => {\n const errorMsg = \"Path options do not have a default value\";\n return Effect.orElseFail(value, () => errorMsg).pipe(Effect.tap(path => Effect.orDie(fileSystem.exists(path)).pipe(Effect.tap(pathExists => validatePathExistence(path, self.pathExists, pathExists).pipe(Effect.zipRight(validatePathType(path, self.pathType, fileSystem).pipe(Effect.when(() => self.pathExists !== \"no\" && pathExists))))))));\n });\n }\n case \"Redacted\":\n {\n return attempt(value, getTypeNameInternal(self), Schema.decodeUnknown(Schema.String)).pipe(Effect.map(value => EffectRedacted.make(value)));\n }\n case \"Secret\":\n {\n return attempt(value, getTypeNameInternal(self), Schema.decodeUnknown(Schema.String)).pipe(Effect.map(value => EffectSecret.fromString(value)));\n }\n case \"Text\":\n {\n return attempt(value, getTypeNameInternal(self), Schema.decodeUnknown(Schema.String));\n }\n }\n};\nconst attempt = (option, typeName, parse) => Effect.orElseFail(option, () => `${typeName} options do not have a default value`).pipe(Effect.flatMap(value => Effect.orElseFail(parse(value), () => `'${value}' is not a ${typeName}`)));\nconst validatePathExistence = (path, shouldPathExist, pathExists) => {\n if (shouldPathExist === \"no\" && pathExists) {\n return Effect.fail(`Path '${path}' must not exist`);\n }\n if (shouldPathExist === \"yes\" && !pathExists) {\n return Effect.fail(`Path '${path}' must exist`);\n }\n return Effect.void;\n};\nconst validatePathType = (path, pathType, fileSystem) => {\n switch (pathType) {\n case \"file\":\n {\n const checkIsFile = fileSystem.stat(path).pipe(Effect.map(info => info.type === \"File\"), Effect.orDie);\n return Effect.fail(`Expected path '${path}' to be a regular file`).pipe(Effect.unlessEffect(checkIsFile), Effect.asVoid);\n }\n case \"directory\":\n {\n const checkIsDirectory = fileSystem.stat(path).pipe(Effect.map(info => info.type === \"Directory\"), Effect.orDie);\n return Effect.fail(`Expected path '${path}' to be a directory`).pipe(Effect.unlessEffect(checkIsDirectory), Effect.asVoid);\n }\n case \"either\":\n {\n return Effect.void;\n }\n }\n};\nconst wizardInternal = (self, help) => {\n switch (self._tag) {\n case \"Bool\":\n {\n const primitiveHelp = InternalHelpDoc.p(\"Select true or false\");\n const message = InternalHelpDoc.sequence(help, primitiveHelp);\n const initial = Option.getOrElse(self.defaultValue, () => false);\n return InternalTogglePrompt.toggle({\n message: InternalHelpDoc.toAnsiText(message).trimEnd(),\n initial,\n active: \"true\",\n inactive: \"false\"\n }).pipe(InternalPrompt.map(bool => `${bool}`));\n }\n case \"Choice\":\n {\n const primitiveHelp = InternalHelpDoc.p(\"Select one of the following choices\");\n const message = InternalHelpDoc.sequence(help, primitiveHelp);\n return InternalSelectPrompt.select({\n message: InternalHelpDoc.toAnsiText(message).trimEnd(),\n choices: Arr.map(self.alternatives, ([title]) => ({\n title,\n value: title\n }))\n });\n }\n case \"DateTime\":\n {\n const primitiveHelp = InternalHelpDoc.p(\"Enter a date\");\n const message = InternalHelpDoc.sequence(help, primitiveHelp);\n return InternalDatePrompt.date({\n message: InternalHelpDoc.toAnsiText(message).trimEnd()\n }).pipe(InternalPrompt.map(date => date.toISOString()));\n }\n case \"Float\":\n {\n const primitiveHelp = InternalHelpDoc.p(\"Enter a floating point value\");\n const message = InternalHelpDoc.sequence(help, primitiveHelp);\n return InternalNumberPrompt.float({\n message: InternalHelpDoc.toAnsiText(message).trimEnd()\n }).pipe(InternalPrompt.map(value => `${value}`));\n }\n case \"Integer\":\n {\n const primitiveHelp = InternalHelpDoc.p(\"Enter an integer\");\n const message = InternalHelpDoc.sequence(help, primitiveHelp);\n return InternalNumberPrompt.integer({\n message: InternalHelpDoc.toAnsiText(message).trimEnd()\n }).pipe(InternalPrompt.map(value => `${value}`));\n }\n case \"Path\":\n {\n const primitiveHelp = InternalHelpDoc.p(\"Select a file system path\");\n const message = InternalHelpDoc.sequence(help, primitiveHelp);\n return InternalFilePrompt.file({\n type: self.pathType,\n message: InternalHelpDoc.toAnsiText(message).trimEnd()\n });\n }\n case \"Redacted\":\n {\n const primitiveHelp = InternalHelpDoc.p(\"Enter some text (value will be redacted)\");\n const message = InternalHelpDoc.sequence(help, primitiveHelp);\n return InternalTextPrompt.hidden({\n message: InternalHelpDoc.toAnsiText(message).trimEnd()\n });\n }\n case \"Secret\":\n {\n const primitiveHelp = InternalHelpDoc.p(\"Enter some text (value will be redacted)\");\n const message = InternalHelpDoc.sequence(help, primitiveHelp);\n return InternalTextPrompt.hidden({\n message: InternalHelpDoc.toAnsiText(message).trimEnd()\n });\n }\n case \"Text\":\n {\n const primitiveHelp = InternalHelpDoc.p(\"Enter some text\");\n const message = InternalHelpDoc.sequence(help, primitiveHelp);\n return InternalTextPrompt.text({\n message: InternalHelpDoc.toAnsiText(message).trimEnd()\n });\n }\n }\n};\n// =============================================================================\n// Completion Internals\n// =============================================================================\n/** @internal */\nexport const getBashCompletions = self => {\n switch (self._tag) {\n case \"Bool\":\n {\n return \"\\\"${cur}\\\"\";\n }\n case \"DateTime\":\n case \"Float\":\n case \"Integer\":\n case \"Secret\":\n case \"Redacted\":\n case \"Text\":\n {\n return \"$(compgen -f \\\"${cur}\\\")\";\n }\n case \"Path\":\n {\n switch (self.pathType) {\n case \"file\":\n {\n return self.pathExists === \"yes\" || self.pathExists === \"either\" ? \"$(compgen -f \\\"${cur}\\\")\" : \"\";\n }\n case \"directory\":\n {\n return self.pathExists === \"yes\" || self.pathExists === \"either\" ? \"$(compgen -d \\\"${cur}\\\")\" : \"\";\n }\n case \"either\":\n {\n return self.pathExists === \"yes\" || self.pathExists === \"either\" ? \"$(compgen -f \\\"${cur}\\\")\" : \"\";\n }\n }\n }\n case \"Choice\":\n {\n const choices = pipe(Arr.map(self.alternatives, ([choice]) => choice), Arr.join(\",\"));\n return `$(compgen -W \"${choices}\" -- \"\\${cur}\")`;\n }\n }\n};\n/** @internal */\nexport const getFishCompletions = self => {\n switch (self._tag) {\n case \"Bool\":\n {\n return Arr.empty();\n }\n case \"DateTime\":\n case \"Float\":\n case \"Integer\":\n case \"Redacted\":\n case \"Secret\":\n case \"Text\":\n {\n return Arr.make(\"-r\", \"-f\");\n }\n case \"Path\":\n {\n switch (self.pathType) {\n case \"file\":\n {\n return self.pathExists === \"yes\" || self.pathExists === \"either\" ? Arr.make(\"-r\", \"-F\") : Arr.make(\"-r\");\n }\n case \"directory\":\n {\n return self.pathExists === \"yes\" || self.pathExists === \"either\" ? Arr.make(\"-r\", \"-f\", \"-a\", `\"(__fish_complete_directories (commandline -ct))\"`) : Arr.make(\"-r\");\n }\n case \"either\":\n {\n return self.pathExists === \"yes\" || self.pathExists === \"either\" ? Arr.make(\"-r\", \"-F\") : Arr.make(\"-r\");\n }\n }\n }\n case \"Choice\":\n {\n const choices = pipe(Arr.map(self.alternatives, ([choice]) => `${choice}''`), Arr.join(\",\"));\n return Arr.make(\"-r\", \"-f\", \"-a\", `\"{${choices}}\"`);\n }\n }\n};\n/** @internal */\nexport const getZshCompletions = self => {\n switch (self._tag) {\n case \"Bool\":\n {\n return \"\";\n }\n case \"Choice\":\n {\n const choices = pipe(Arr.map(self.alternatives, ([name]) => name), Arr.join(\" \"));\n return `:CHOICE:(${choices})`;\n }\n case \"DateTime\":\n {\n return \"\";\n }\n case \"Float\":\n {\n return \"\";\n }\n case \"Integer\":\n {\n return \"\";\n }\n case \"Path\":\n {\n switch (self.pathType) {\n case \"file\":\n {\n return self.pathExists === \"yes\" || self.pathExists === \"either\" ? \":PATH:_files\" : \"\";\n }\n case \"directory\":\n {\n return self.pathExists === \"yes\" || self.pathExists === \"either\" ? \":PATH:_files -/\" : \"\";\n }\n case \"either\":\n {\n return self.pathExists === \"yes\" || self.pathExists === \"either\" ? \":PATH:_files\" : \"\";\n }\n }\n }\n case \"Redacted\":\n case \"Secret\":\n case \"Text\":\n {\n return \"\";\n }\n }\n};\n//# sourceMappingURL=primitive.js.map","import * as Arr from \"effect/Array\";\nimport { dual, pipe } from \"effect/Function\";\nimport * as Option from \"effect/Option\";\nimport * as InternalCliConfig from \"./cliConfig.js\";\nimport * as InternalHelpDoc from \"./helpDoc.js\";\nimport * as InternalSpan from \"./helpDoc/span.js\";\n// =============================================================================\n// Constructors\n// =============================================================================\n/** @internal */\nexport const empty = {\n _tag: \"Empty\"\n};\n/** @internal */\nexport const mixed = {\n _tag: \"Empty\"\n};\n/** @internal */\nexport const named = (names, acceptedValues) => ({\n _tag: \"Named\",\n names,\n acceptedValues\n});\n/** @internal */\nexport const optional = self => ({\n _tag: \"Optional\",\n usage: self\n});\n/** @internal */\nexport const repeated = self => ({\n _tag: \"Repeated\",\n usage: self\n});\nexport const alternation = /*#__PURE__*/dual(2, (self, that) => ({\n _tag: \"Alternation\",\n left: self,\n right: that\n}));\n/** @internal */\nexport const concat = /*#__PURE__*/dual(2, (self, that) => ({\n _tag: \"Concat\",\n left: self,\n right: that\n}));\n// =============================================================================\n// Combinators\n// =============================================================================\n/** @internal */\nexport const getHelp = self => {\n const spans = enumerate(self, InternalCliConfig.defaultConfig);\n if (Arr.isNonEmptyReadonlyArray(spans)) {\n const head = Arr.headNonEmpty(spans);\n const tail = Arr.tailNonEmpty(spans);\n if (Arr.isNonEmptyReadonlyArray(tail)) {\n return pipe(Arr.map(spans, span => InternalHelpDoc.p(span)), Arr.reduceRight(InternalHelpDoc.empty, (left, right) => InternalHelpDoc.sequence(left, right)));\n }\n return InternalHelpDoc.p(head);\n }\n return InternalHelpDoc.empty;\n};\n/** @internal */\nexport const enumerate = /*#__PURE__*/dual(2, (self, config) => render(simplify(self, config), config));\n// =============================================================================\n// Internals\n// =============================================================================\nconst simplify = (self, config) => {\n switch (self._tag) {\n case \"Empty\":\n {\n return empty;\n }\n case \"Mixed\":\n {\n return mixed;\n }\n case \"Named\":\n {\n if (Option.isNone(Arr.head(render(self, config)))) {\n return empty;\n }\n return self;\n }\n case \"Optional\":\n {\n if (self.usage._tag === \"Empty\") {\n return empty;\n }\n const usage = simplify(self.usage, config);\n // No need to do anything for empty usage\n return usage._tag === \"Empty\" ? empty\n // Avoid re-wrapping the usage in an optional instruction\n : usage._tag === \"Optional\" ? usage : optional(usage);\n }\n case \"Repeated\":\n {\n const usage = simplify(self.usage, config);\n return usage._tag === \"Empty\" ? empty : repeated(usage);\n }\n case \"Alternation\":\n {\n const leftUsage = simplify(self.left, config);\n const rightUsage = simplify(self.right, config);\n return leftUsage._tag === \"Empty\" ? rightUsage : rightUsage._tag === \"Empty\" ? leftUsage : alternation(leftUsage, rightUsage);\n }\n case \"Concat\":\n {\n const leftUsage = simplify(self.left, config);\n const rightUsage = simplify(self.right, config);\n return leftUsage._tag === \"Empty\" ? rightUsage : rightUsage._tag === \"Empty\" ? leftUsage : concat(leftUsage, rightUsage);\n }\n }\n};\nconst render = (self, config) => {\n switch (self._tag) {\n case \"Empty\":\n {\n return Arr.of(InternalSpan.text(\"\"));\n }\n case \"Mixed\":\n {\n return Arr.of(InternalSpan.text(\"<command>\"));\n }\n case \"Named\":\n {\n const typeInfo = config.showTypes ? Option.match(self.acceptedValues, {\n onNone: () => InternalSpan.empty,\n onSome: s => InternalSpan.concat(InternalSpan.space, InternalSpan.text(s))\n }) : InternalSpan.empty;\n const namesToShow = config.showAllNames ? self.names : self.names.length > 1 ? pipe(Arr.filter(self.names, name => name.startsWith(\"--\")), Arr.head, Option.map(Arr.of), Option.getOrElse(() => self.names)) : self.names;\n const nameInfo = InternalSpan.text(Arr.join(namesToShow, \", \"));\n return config.showAllNames && self.names.length > 1 ? Arr.of(InternalSpan.spans([InternalSpan.text(\"(\"), nameInfo, typeInfo, InternalSpan.text(\")\")])) : Arr.of(InternalSpan.concat(nameInfo, typeInfo));\n }\n case \"Optional\":\n {\n return Arr.map(render(self.usage, config), span => InternalSpan.spans([InternalSpan.text(\"[\"), span, InternalSpan.text(\"]\")]));\n }\n case \"Repeated\":\n {\n return Arr.map(render(self.usage, config), span => InternalSpan.concat(span, InternalSpan.text(\"...\")));\n }\n case \"Alternation\":\n {\n if (self.left._tag === \"Repeated\" || self.right._tag === \"Repeated\" || self.left._tag === \"Concat\" || self.right._tag === \"Concat\") {\n return Arr.appendAll(render(self.left, config), render(self.right, config));\n }\n return Arr.flatMap(render(self.left, config), left => Arr.map(render(self.right, config), right => InternalSpan.spans([left, InternalSpan.text(\"|\"), right])));\n }\n case \"Concat\":\n {\n const leftSpan = render(self.left, config);\n const rightSpan = render(self.right, config);\n const separator = Arr.isNonEmptyReadonlyArray(leftSpan) && Arr.isNonEmptyReadonlyArray(rightSpan) ? InternalSpan.space : InternalSpan.empty;\n return Arr.flatMap(leftSpan, left => Arr.map(rightSpan, right => InternalSpan.spans([left, separator, right])));\n }\n }\n};\n//# sourceMappingURL=usage.js.map","const ValidationErrorSymbolKey = \"@effect/cli/ValidationError\";\n/** @internal */\nexport const ValidationErrorTypeId = /*#__PURE__*/Symbol.for(ValidationErrorSymbolKey);\n/** @internal */\nexport const proto = {\n [ValidationErrorTypeId]: ValidationErrorTypeId\n};\n/** @internal */\nexport const isValidationError = u => typeof u === \"object\" && u != null && ValidationErrorTypeId in u;\n/** @internal */\nexport const isCommandMismatch = self => self._tag === \"CommandMismatch\";\n/** @internal */\nexport const isCorrectedFlag = self => self._tag === \"CorrectedFlag\";\n/** @internal */\nexport const isHelpRequested = self => self._tag === \"HelpRequested\";\n/** @internal */\nexport const isInvalidArgument = self => self._tag === \"InvalidArgument\";\n/** @internal */\nexport const isInvalidValue = self => self._tag === \"InvalidValue\";\n/** @internal */\nexport const isMultipleValuesDetected = self => self._tag === \"MultipleValuesDetected\";\n/** @internal */\nexport const isMissingFlag = self => self._tag === \"MissingFlag\";\n/** @internal */\nexport const isMissingValue = self => self._tag === \"MissingValue\";\n/** @internal */\nexport const isMissingSubcommand = self => self._tag === \"MissingSubcommand\";\n/** @internal */\nexport const isNoBuiltInMatch = self => self._tag === \"NoBuiltInMatch\";\n/** @internal */\nexport const isUnclusteredFlag = self => self._tag === \"UnclusteredFlag\";\n/** @internal */\nexport const commandMismatch = error => {\n const op = Object.create(proto);\n op._tag = \"CommandMismatch\";\n op.error = error;\n return op;\n};\n/** @internal */\nexport const correctedFlag = error => {\n const op = Object.create(proto);\n op._tag = \"CorrectedFlag\";\n op.error = error;\n return op;\n};\n/** @internal */\nexport const invalidArgument = error => {\n const op = Object.create(proto);\n op._tag = \"InvalidArgument\";\n op.error = error;\n return op;\n};\n/** @internal */\nexport const invalidValue = error => {\n const op = Object.create(proto);\n op._tag = \"InvalidValue\";\n op.error = error;\n return op;\n};\n/** @internal */\nexport const missingFlag = error => {\n const op = Object.create(proto);\n op._tag = \"MissingFlag\";\n op.error = error;\n return op;\n};\n/** @internal */\nexport const missingValue = error => {\n const op = Object.create(proto);\n op._tag = \"MissingValue\";\n op.error = error;\n return op;\n};\n/** @internal */\nexport const missingSubcommand = error => {\n const op = Object.create(proto);\n op._tag = \"MissingSubcommand\";\n op.error = error;\n return op;\n};\n/** @internal */\nexport const multipleValuesDetected = (error, values) => {\n const op = Object.create(proto);\n op._tag = \"MultipleValuesDetected\";\n op.error = error;\n op.values = values;\n return op;\n};\n/** @internal */\nexport const noBuiltInMatch = error => {\n const op = Object.create(proto);\n op._tag = \"NoBuiltInMatch\";\n op.error = error;\n return op;\n};\n/** @internal */\nexport const unclusteredFlag = (error, unclustered, rest) => {\n const op = Object.create(proto);\n op._tag = \"UnclusteredFlag\";\n op.error = error;\n op.unclustered = unclustered;\n op.rest = rest;\n return op;\n};\n//# sourceMappingURL=validationError.js.map","import * as Arr from \"effect/Array\";\nimport * as ConfigError from \"effect/ConfigError\";\nimport * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as Either from \"effect/Either\";\nimport { dual, pipe } from \"effect/Function\";\nimport * as Inspectable from \"effect/Inspectable\";\nimport * as Option from \"effect/Option\";\nimport * as ParseResult from \"effect/ParseResult\";\nimport { pipeArguments } from \"effect/Pipeable\";\nimport * as Predicate from \"effect/Predicate\";\nimport * as Ref from \"effect/Ref\";\nimport * as InternalCompletion from \"./completion.js\";\nimport * as InternalFiles from \"./files.js\";\nimport * as InternalHelpDoc from \"./helpDoc.js\";\nimport * as InternalSpan from \"./helpDoc/span.js\";\nimport * as InternalPrimitive from \"./primitive.js\";\nimport * as InternalNumberPrompt from \"./prompt/number.js\";\nimport * as InternalSelectPrompt from \"./prompt/select.js\";\nimport * as InternalUsage from \"./usage.js\";\nimport * as InternalValidationError from \"./validationError.js\";\nconst ArgsSymbolKey = \"@effect/cli/Args\";\n/** @internal */\nexport const ArgsTypeId = /*#__PURE__*/Symbol.for(ArgsSymbolKey);\nconst proto = {\n [ArgsTypeId]: {\n _A: _ => _\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n// =============================================================================\n// Refinements\n// =============================================================================\n/** @internal */\nexport const isArgs = u => typeof u === \"object\" && u != null && ArgsTypeId in u;\n/** @internal */\nexport const isInstruction = self => self;\n/** @internal */\nexport const isEmpty = self => self._tag === \"Empty\";\n/** @internal */\nexport const isSingle = self => self._tag === \"Single\";\n/** @internal */\nexport const isBoth = self => self._tag === \"Both\";\n/** @internal */\nexport const isMap = self => self._tag === \"Map\";\n/** @internal */\nexport const isVariadic = self => self._tag === \"Variadic\";\n/** @internal */\nexport const isWithDefault = self => self._tag === \"WithDefault\";\n/** @internal */\nexport const isWithFallbackConfig = self => self._tag === \"WithFallbackConfig\";\n// =============================================================================\n// Constructors\n// =============================================================================\n/** @internal */\nexport const all = function () {\n if (arguments.length === 1) {\n if (isArgs(arguments[0])) {\n return map(arguments[0], x => [x]);\n } else if (Arr.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, options] of rest) {\n result = map(makeBoth(result, options), ([record, value]) => ({\n ...record,\n [key]: value\n }));\n }\n return result;\n }\n }\n return allTupled(arguments[0]);\n};\n/** @internal */\nexport const boolean = config => makeSingle(Option.fromNullable(config?.name), InternalPrimitive.boolean(Option.none()));\n/** @internal */\nexport const choice = (choices, config) => makeSingle(Option.fromNullable(config?.name), InternalPrimitive.choice(choices));\n/** @internal */\nexport const date = config => makeSingle(Option.fromNullable(config?.name), InternalPrimitive.date);\n/** @internal */\nexport const directory = config => makeSingle(Option.fromNullable(config?.name), InternalPrimitive.path(\"directory\", config?.exists || \"either\"));\n/** @internal */\nexport const file = config => makeSingle(Option.fromNullable(config?.name), InternalPrimitive.path(\"file\", config?.exists || \"either\"));\n/** @internal */\nexport const fileContent = config => mapEffect(file({\n ...config,\n exists: \"yes\"\n}), path => Effect.mapError(InternalFiles.read(path), e => InternalHelpDoc.p(e)));\n/** @internal */\nexport const fileParse = config => mapEffect(fileText(config), ([path, content]) => Effect.mapError(InternalFiles.parse(path, content, config?.format), e => InternalHelpDoc.p(e)));\n/** @internal */\nexport const fileSchema = (schema, config) => withSchema(fileParse(config), schema);\n/** @internal */\nexport const fileText = config => mapEffect(file({\n ...config,\n exists: \"yes\"\n}), path => Effect.mapError(InternalFiles.readString(path), e => InternalHelpDoc.p(e)));\n/** @internal */\nexport const float = config => makeSingle(Option.fromNullable(config?.name), InternalPrimitive.float);\n/** @internal */\nexport const integer = config => makeSingle(Option.fromNullable(config?.name), InternalPrimitive.integer);\n/** @internal */\nexport const none = /*#__PURE__*/(() => {\n const op = /*#__PURE__*/Object.create(proto);\n op._tag = \"Empty\";\n return op;\n})();\n/** @internal */\nexport const path = config => makeSingle(Option.fromNullable(config?.name), InternalPrimitive.path(\"either\", config?.exists || \"either\"));\n/** @internal */\nexport const redacted = config => makeSingle(Option.fromNullable(config?.name), InternalPrimitive.redacted);\n/** @internal */\nexport const secret = config => makeSingle(Option.fromNullable(config?.name), InternalPrimitive.secret);\n/** @internal */\nexport const text = config => makeSingle(Option.fromNullable(config?.name), InternalPrimitive.text);\n// =============================================================================\n// Combinators\n// =============================================================================\n/** @internal */\nexport const atLeast = /*#__PURE__*/dual(2, (self, times) => makeVariadic(self, Option.some(times), Option.none()));\n/** @internal */\nexport const atMost = /*#__PURE__*/dual(2, (self, times) => makeVariadic(self, Option.none(), Option.some(times)));\n/** @internal */\nexport const between = /*#__PURE__*/dual(3, (self, min, max) => makeVariadic(self, Option.some(min), Option.some(max)));\n/** @internal */\nexport const getHelp = self => getHelpInternal(self);\n/** @internal */\nexport const getIdentifier = self => getIdentifierInternal(self);\n/** @internal */\nexport const getMinSize = self => getMinSizeInternal(self);\n/** @internal */\nexport const getMaxSize = self => getMaxSizeInternal(self);\n/** @internal */\nexport const getUsage = self => getUsageInternal(self);\n/** @internal */\nexport const map = /*#__PURE__*/dual(2, (self, f) => mapEffect(self, a => Effect.succeed(f(a))));\n/** @internal */\nexport const mapEffect = /*#__PURE__*/dual(2, (self, f) => makeMap(self, f));\n/** @internal */\nexport const mapTryCatch = /*#__PURE__*/dual(3, (self, f, onError) => mapEffect(self, a => {\n try {\n return Either.right(f(a));\n } catch (e) {\n return Either.left(onError(e));\n }\n}));\n/** @internal */\nexport const optional = self => makeWithDefault(map(self, Option.some), Option.none());\n/** @internal */\nexport const repeated = self => makeVariadic(self, Option.none(), Option.none());\n/** @internal */\nexport const validate = /*#__PURE__*/dual(3, (self, args, config) => validateInternal(self, args, config));\n/** @internal */\nexport const withDefault = /*#__PURE__*/dual(2, (self, fallback) => makeWithDefault(self, fallback));\n/** @internal */\nexport const withFallbackConfig = /*#__PURE__*/dual(2, (self, config) => {\n if (isInstruction(self) && isWithDefault(self)) {\n return makeWithDefault(withFallbackConfig(self.args, config), self.fallback);\n }\n return makeWithFallbackConfig(self, config);\n});\n/** @internal */\nexport const withSchema = /*#__PURE__*/dual(2, (self, schema) => {\n const decode = ParseResult.decode(schema);\n return mapEffect(self, _ => Effect.mapError(decode(_), issue => InternalHelpDoc.p(ParseResult.TreeFormatter.formatIssueSync(issue))));\n});\n/** @internal */\nexport const withDescription = /*#__PURE__*/dual(2, (self, description) => withDescriptionInternal(self, description));\n/** @internal */\nexport const wizard = /*#__PURE__*/dual(2, (self, config) => wizardInternal(self, config));\n// =============================================================================\n// Internals\n// =============================================================================\nconst allTupled = arg => {\n if (arg.length === 0) {\n return none;\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 = map(makeBoth(result, curr), ([a, b]) => [...a, b]);\n }\n return result;\n};\nconst getHelpInternal = self => {\n switch (self._tag) {\n case \"Empty\":\n {\n return InternalHelpDoc.empty;\n }\n case \"Single\":\n {\n return InternalHelpDoc.descriptionList([[InternalSpan.weak(self.name), InternalHelpDoc.sequence(InternalHelpDoc.p(InternalPrimitive.getHelp(self.primitiveType)), self.description)]]);\n }\n case \"Map\":\n {\n return getHelpInternal(self.args);\n }\n case \"Both\":\n {\n return InternalHelpDoc.sequence(getHelpInternal(self.left), getHelpInternal(self.right));\n }\n case \"Variadic\":\n {\n const help = getHelpInternal(self.args);\n return InternalHelpDoc.mapDescriptionList(help, (oldSpan, oldBlock) => {\n const min = getMinSizeInternal(self);\n const max = getMaxSizeInternal(self);\n const newSpan = InternalSpan.text(Option.isSome(self.max) ? ` ${min} - ${max}` : min === 0 ? \"...\" : ` ${min}+`);\n const newBlock = InternalHelpDoc.p(Option.isSome(self.max) ? `This argument must be repeated at least ${min} times and may be repeated up to ${max} times.` : min === 0 ? \"This argument may be repeated zero or more times.\" : `This argument must be repeated at least ${min} times.`);\n return [InternalSpan.concat(oldSpan, newSpan), InternalHelpDoc.sequence(oldBlock, newBlock)];\n });\n }\n case \"WithDefault\":\n {\n return InternalHelpDoc.mapDescriptionList(getHelpInternal(self.args), (span, block) => {\n const optionalDescription = Option.isOption(self.fallback) ? Option.match(self.fallback, {\n onNone: () => InternalHelpDoc.p(\"This setting is optional.\"),\n onSome: fallbackValue => {\n const inspectableValue = Predicate.isObject(fallbackValue) ? fallbackValue : String(fallbackValue);\n const displayValue = Inspectable.toStringUnknown(inspectableValue, 0);\n return InternalHelpDoc.p(`This setting is optional. Defaults to: ${displayValue}`);\n }\n }) : InternalHelpDoc.p(\"This setting is optional.\");\n return [span, InternalHelpDoc.sequence(block, optionalDescription)];\n });\n }\n case \"WithFallbackConfig\":\n {\n return InternalHelpDoc.mapDescriptionList(getHelpInternal(self.args), (span, block) => [span, InternalHelpDoc.sequence(block, InternalHelpDoc.p(\"This argument can be set from environment variables.\"))]);\n }\n }\n};\nconst getIdentifierInternal = self => {\n switch (self._tag) {\n case \"Empty\":\n {\n return Option.none();\n }\n case \"Single\":\n {\n return Option.some(self.name);\n }\n case \"Map\":\n case \"Variadic\":\n case \"WithDefault\":\n case \"WithFallbackConfig\":\n {\n return getIdentifierInternal(self.args);\n }\n case \"Both\":\n {\n const ids = Arr.getSomes([getIdentifierInternal(self.left), getIdentifierInternal(self.right)]);\n return Arr.match(ids, {\n onEmpty: () => Option.none(),\n onNonEmpty: ids => Option.some(Arr.join(ids, \", \"))\n });\n }\n }\n};\nconst getMinSizeInternal = self => {\n switch (self._tag) {\n case \"Empty\":\n case \"WithDefault\":\n case \"WithFallbackConfig\":\n {\n return 0;\n }\n case \"Single\":\n {\n return 1;\n }\n case \"Map\":\n {\n return getMinSizeInternal(self.args);\n }\n case \"Both\":\n {\n const leftMinSize = getMinSizeInternal(self.left);\n const rightMinSize = getMinSizeInternal(self.right);\n return leftMinSize + rightMinSize;\n }\n case \"Variadic\":\n {\n const argsMinSize = getMinSizeInternal(self.args);\n return Math.floor(Option.getOrElse(self.min, () => 0) * argsMinSize);\n }\n }\n};\nconst getMaxSizeInternal = self => {\n switch (self._tag) {\n case \"Empty\":\n {\n return 0;\n }\n case \"Single\":\n {\n return 1;\n }\n case \"Map\":\n case \"WithDefault\":\n case \"WithFallbackConfig\":\n {\n return getMaxSizeInternal(self.args);\n }\n case \"Both\":\n {\n const leftMaxSize = getMaxSizeInternal(self.left);\n const rightMaxSize = getMaxSizeInternal(self.right);\n return leftMaxSize + rightMaxSize;\n }\n case \"Variadic\":\n {\n const argsMaxSize = getMaxSizeInternal(self.args);\n return Math.floor(Option.getOrElse(self.max, () => Number.MAX_SAFE_INTEGER / 2) * argsMaxSize);\n }\n }\n};\nconst getUsageInternal = self => {\n switch (self._tag) {\n case \"Empty\":\n {\n return InternalUsage.empty;\n }\n case \"Single\":\n {\n return InternalUsage.named(Arr.of(self.name), InternalPrimitive.getChoices(self.primitiveType));\n }\n case \"Map\":\n {\n return getUsageInternal(self.args);\n }\n case \"Both\":\n {\n return InternalUsage.concat(getUsageInternal(self.left), getUsageInternal(self.right));\n }\n case \"Variadic\":\n {\n return InternalUsage.repeated(getUsageInternal(self.args));\n }\n case \"WithDefault\":\n case \"WithFallbackConfig\":\n {\n return InternalUsage.optional(getUsageInternal(self.args));\n }\n }\n};\nconst makeSingle = (pseudoName, primitiveType, description = InternalHelpDoc.empty) => {\n const op = Object.create(proto);\n op._tag = \"Single\";\n op.name = `<${Option.getOrElse(pseudoName, () => InternalPrimitive.getTypeName(primitiveType))}>`;\n op.pseudoName = pseudoName;\n op.primitiveType = primitiveType;\n op.description = description;\n return op;\n};\nconst makeMap = (self, f) => {\n const op = Object.create(proto);\n op._tag = \"Map\";\n op.args = self;\n op.f = f;\n return op;\n};\nconst makeBoth = (left, right) => {\n const op = Object.create(proto);\n op._tag = \"Both\";\n op.left = left;\n op.right = right;\n return op;\n};\nconst makeWithDefault = (self, fallback) => {\n const op = Object.create(proto);\n op._tag = \"WithDefault\";\n op.args = self;\n op.fallback = fallback;\n return op;\n};\nconst makeWithFallbackConfig = (args, config) => {\n const op = Object.create(proto);\n op._tag = \"WithFallbackConfig\";\n op.args = args;\n op.config = config;\n return op;\n};\nconst makeVariadic = (args, min, max) => {\n const op = Object.create(proto);\n op._tag = \"Variadic\";\n op.args = args;\n op.min = min;\n op.max = max;\n return op;\n};\nconst validateInternal = (self, args, config) => {\n switch (self._tag) {\n case \"Empty\":\n {\n return Effect.succeed([args, undefined]);\n }\n case \"Single\":\n {\n return Effect.suspend(() => {\n return Arr.matchLeft(args, {\n onEmpty: () => {\n const choices = InternalPrimitive.getChoices(self.primitiveType);\n if (Option.isSome(self.pseudoName) && Option.isSome(choices)) {\n return Effect.fail(InternalValidationError.missingValue(InternalHelpDoc.p(`Missing argument <${self.pseudoName.value}> with choices ${choices.value}`)));\n }\n if (Option.isSome(self.pseudoName)) {\n return Effect.fail(InternalValidationError.missingValue(InternalHelpDoc.p(`Missing argument <${self.pseudoName.value}>`)));\n }\n if (Option.isSome(choices)) {\n return Effect.fail(InternalValidationError.missingValue(InternalHelpDoc.p(`Missing argument ${InternalPrimitive.getTypeName(self.primitiveType)} with choices ${choices.value}`)));\n }\n return Effect.fail(InternalValidationError.missingValue(InternalHelpDoc.p(`Missing argument ${InternalPrimitive.getTypeName(self.primitiveType)}`)));\n },\n onNonEmpty: (head, tail) => InternalPrimitive.validate(self.primitiveType, Option.some(head), config).pipe(Effect.mapBoth({\n onFailure: text => InternalValidationError.invalidArgument(InternalHelpDoc.p(text)),\n onSuccess: a => [tail, a]\n }))\n });\n });\n }\n case \"Map\":\n {\n return validateInternal(self.args, args, config).pipe(Effect.flatMap(([leftover, a]) => Effect.matchEffect(self.f(a), {\n onFailure: doc => Effect.fail(InternalValidationError.invalidArgument(doc)),\n onSuccess: b => Effect.succeed([leftover, b])\n })));\n }\n case \"Both\":\n {\n return validateInternal(self.left, args, config).pipe(Effect.flatMap(([args, a]) => validateInternal(self.right, args, config).pipe(Effect.map(([args, b]) => [args, [a, b]]))));\n }\n case \"Variadic\":\n {\n const min1 = Option.getOrElse(self.min, () => 0);\n const max1 = Option.getOrElse(self.max, () => Number.MAX_SAFE_INTEGER);\n const loop = (args, acc) => {\n if (acc.length >= max1) {\n return Effect.succeed([args, acc]);\n }\n return validateInternal(self.args, args, config).pipe(Effect.matchEffect({\n onFailure: failure => acc.length >= min1 && Arr.isEmptyReadonlyArray(args) ? Effect.succeed([args, acc]) : Effect.fail(failure),\n onSuccess: ([args, a]) => loop(args, Arr.append(acc, a))\n }));\n };\n return loop(args, Arr.empty()).pipe(Effect.map(([args, acc]) => [args, acc]));\n }\n case \"WithDefault\":\n {\n return validateInternal(self.args, args, config).pipe(Effect.catchTag(\"MissingValue\", () => Effect.succeed([args, self.fallback])));\n }\n case \"WithFallbackConfig\":\n {\n return validateInternal(self.args, args, config).pipe(Effect.catchTag(\"MissingValue\", e => Effect.map(Effect.catchAll(self.config, e2 => {\n if (ConfigError.isMissingDataOnly(e2)) {\n const help = InternalHelpDoc.p(String(e2));\n const error = InternalValidationError.invalidValue(help);\n return Effect.fail(error);\n }\n return Effect.fail(e);\n }), value => [args, value])));\n }\n }\n};\nconst withDescriptionInternal = (self, description) => {\n switch (self._tag) {\n case \"Empty\":\n {\n return none;\n }\n case \"Single\":\n {\n const desc = InternalHelpDoc.sequence(self.description, InternalHelpDoc.p(description));\n return makeSingle(self.pseudoName, self.primitiveType, desc);\n }\n case \"Map\":\n {\n return makeMap(withDescriptionInternal(self.args, description), self.f);\n }\n case \"Both\":\n {\n return makeBoth(withDescriptionInternal(self.left, description), withDescriptionInternal(self.right, description));\n }\n case \"Variadic\":\n {\n return makeVariadic(withDescriptionInternal(self.args, description), self.min, self.max);\n }\n case \"WithDefault\":\n {\n return makeWithDefault(withDescriptionInternal(self.args, description), self.fallback);\n }\n case \"WithFallbackConfig\":\n {\n return makeWithFallbackConfig(withDescriptionInternal(self.args, description), self.config);\n }\n }\n};\nconst wizardInternal = (self, config) => {\n switch (self._tag) {\n case \"Empty\":\n {\n return Effect.succeed(Arr.empty());\n }\n case \"Single\":\n {\n const help = getHelpInternal(self);\n return InternalPrimitive.wizard(self.primitiveType, help).pipe(Effect.zipLeft(Console.log()), Effect.flatMap(input => {\n const args = Arr.of(input);\n return validateInternal(self, args, config).pipe(Effect.as(args));\n }));\n }\n case \"Map\":\n {\n return wizardInternal(self.args, config).pipe(Effect.tap(args => validateInternal(self.args, args, config)));\n }\n case \"Both\":\n {\n return Effect.zipWith(wizardInternal(self.left, config), wizardInternal(self.right, config), (left, right) => Arr.appendAll(left, right)).pipe(Effect.tap(args => validateInternal(self, args, config)));\n }\n case \"Variadic\":\n {\n const repeatHelp = InternalHelpDoc.p(\"How many times should this argument should be repeated?\");\n const message = pipe(getHelpInternal(self), InternalHelpDoc.sequence(repeatHelp));\n return InternalNumberPrompt.integer({\n message: InternalHelpDoc.toAnsiText(message).trimEnd(),\n min: getMinSizeInternal(self),\n max: getMaxSizeInternal(self)\n }).pipe(Effect.zipLeft(Console.log()), Effect.flatMap(n => n <= 0 ? Effect.succeed(Arr.empty()) : Ref.make(Arr.empty()).pipe(Effect.flatMap(ref => wizardInternal(self.args, config).pipe(Effect.flatMap(args => Ref.update(ref, Arr.appendAll(args))), Effect.repeatN(n - 1), Effect.zipRight(Ref.get(ref)), Effect.tap(args => validateInternal(self, args, config)))))));\n }\n case \"WithDefault\":\n {\n const defaultHelp = InternalHelpDoc.p(`This argument is optional - use the default?`);\n const message = pipe(getHelpInternal(self.args), InternalHelpDoc.sequence(defaultHelp));\n return InternalSelectPrompt.select({\n message: InternalHelpDoc.toAnsiText(message).trimEnd(),\n choices: [{\n title: `Default ['${JSON.stringify(self.fallback)}']`,\n value: true\n }, {\n title: \"Custom\",\n value: false\n }]\n }).pipe(Effect.zipLeft(Console.log()), Effect.flatMap(useFallback => useFallback ? Effect.succeed(Arr.empty()) : wizardInternal(self.args, config)));\n }\n case \"WithFallbackConfig\":\n {\n const defaultHelp = InternalHelpDoc.p(`Try load this option from the environment?`);\n const message = pipe(getHelpInternal(self.args), InternalHelpDoc.sequence(defaultHelp));\n return InternalSelectPrompt.select({\n message: InternalHelpDoc.toAnsiText(message).trimEnd(),\n choices: [{\n title: `Use environment variables`,\n value: true\n }, {\n title: \"Custom\",\n value: false\n }]\n }).pipe(Effect.zipLeft(Console.log()), Effect.flatMap(useFallback => useFallback ? Effect.succeed(Arr.empty()) : wizardInternal(self.args, config)));\n }\n }\n};\n// =============================================================================\n// Completion Internals\n// =============================================================================\nconst getShortDescription = self => {\n switch (self._tag) {\n case \"Empty\":\n case \"Both\":\n {\n return \"\";\n }\n case \"Single\":\n {\n return InternalSpan.getText(InternalHelpDoc.getSpan(self.description));\n }\n case \"Map\":\n case \"Variadic\":\n case \"WithDefault\":\n case \"WithFallbackConfig\":\n {\n return getShortDescription(self.args);\n }\n }\n};\n/** @internal */\nexport const getFishCompletions = self => {\n switch (self._tag) {\n case \"Empty\":\n {\n return Arr.empty();\n }\n case \"Single\":\n {\n const description = getShortDescription(self);\n return pipe(InternalPrimitive.getFishCompletions(self.primitiveType), Arr.appendAll(description.length === 0 ? Arr.empty() : Arr.of(`-d '${InternalCompletion.escapeSingleQuoted(description)}'`)), Arr.join(\" \"), Arr.of);\n }\n case \"Both\":\n {\n return pipe(getFishCompletions(self.left), Arr.appendAll(getFishCompletions(self.right)));\n }\n case \"Map\":\n case \"Variadic\":\n case \"WithDefault\":\n case \"WithFallbackConfig\":\n {\n return getFishCompletions(self.args);\n }\n }\n};\nexport const getZshCompletions = (self, state = {\n multiple: false,\n optional: false\n}) => {\n switch (self._tag) {\n case \"Empty\":\n {\n return Arr.empty();\n }\n case \"Single\":\n {\n const multiple = state.multiple ? \"*\" : \"\";\n const optional = state.optional ? \"::\" : \":\";\n const shortDescription = getShortDescription(self);\n const description = shortDescription.length > 0 ? ` -- ${InternalCompletion.escapeSingleQuoted(shortDescription)}` : \"\";\n const possibleValues = InternalPrimitive.getZshCompletions(self.primitiveType);\n return possibleValues.length === 0 ? Arr.empty() : Arr.of(`${multiple}${optional}${self.name}${description}${possibleValues}`);\n }\n case \"Map\":\n {\n return getZshCompletions(self.args, state);\n }\n case \"Both\":\n {\n const left = getZshCompletions(self.left, state);\n const right = getZshCompletions(self.right, state);\n return Arr.appendAll(left, right);\n }\n case \"Variadic\":\n {\n return Option.isSome(self.max) && self.max.value > 1 ? getZshCompletions(self.args, {\n ...state,\n multiple: true\n }) : getZshCompletions(self.args, state);\n }\n case \"WithDefault\":\n case \"WithFallbackConfig\":\n {\n return getZshCompletions(self.args, {\n ...state,\n optional: true\n });\n }\n }\n};\n//# sourceMappingURL=args.js.map","import * as InternalArgs from \"./internal/args.js\";\n/**\n * @since 1.0.0\n * @category symbols\n */\nexport const ArgsTypeId = InternalArgs.ArgsTypeId;\n/**\n * @since 1.0.0\n * @category refinements\n */\nexport const isArgs = InternalArgs.isArgs;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const all = InternalArgs.all;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const atLeast = InternalArgs.atLeast;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const atMost = InternalArgs.atMost;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const between = InternalArgs.between;\n/**\n * Creates a boolean argument.\n *\n * Can optionally provide a custom argument name (defaults to `\"boolean\"`).\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const boolean = InternalArgs.boolean;\n/**\n * Creates a choice argument.\n *\n * Can optionally provide a custom argument name (defaults to `\"choice\"`).\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const choice = InternalArgs.choice;\n/**\n * Creates a date argument.\n *\n * Can optionally provide a custom argument name (defaults to `\"date\"`).\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const date = InternalArgs.date;\n/**\n * Creates a directory argument.\n *\n * Can optionally provide a custom argument name (defaults to `\"directory\"`).\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const directory = InternalArgs.directory;\n/**\n * Creates a file argument.\n *\n * Can optionally provide a custom argument name (defaults to `\"file\"`).\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const file = InternalArgs.file;\n/**\n * Creates a file argument that reads its contents.\n *\n * Can optionally provide a custom argument name (defaults to `\"file\"`).\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const fileContent = InternalArgs.fileContent;\n/**\n * Creates a file argument that reads and parses its contents.\n *\n * Can optionally provide a custom argument name (defaults to `\"file\"`).\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const fileParse = InternalArgs.fileParse;\n/**\n * Creates a file argument that reads, parses and validates its contents.\n *\n * Can optionally provide a custom argument name (defaults to `\"file\"`).\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const fileSchema = InternalArgs.fileSchema;\n/**\n * Creates a file argument that reads it's contents.\n *\n * Can optionally provide a custom argument name (defaults to `\"file\"`).\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const fileText = InternalArgs.fileText;\n/**\n * Creates a floating point number argument.\n *\n * Can optionally provide a custom argument name (defaults to `\"float\"`).\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const float = InternalArgs.float;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const getHelp = InternalArgs.getHelp;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const getIdentifier = InternalArgs.getIdentifier;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const getMinSize = InternalArgs.getMinSize;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const getMaxSize = InternalArgs.getMaxSize;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const getUsage = InternalArgs.getUsage;\n/**\n * Creates an integer argument.\n *\n * Can optionally provide a custom argument name (defaults to `\"integer\"`).\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const integer = InternalArgs.integer;\n/**\n * @since 1.0.0\n * @category mapping\n */\nexport const map = InternalArgs.map;\n/**\n * @since 1.0.0\n * @category mapping\n */\nexport const mapEffect = InternalArgs.mapEffect;\n/**\n * @since 1.0.0\n * @category mapping\n */\nexport const mapTryCatch = InternalArgs.mapTryCatch;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const optional = InternalArgs.optional;\n/**\n * Creates an empty argument.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const none = InternalArgs.none;\n/**\n * Creates a path argument.\n *\n * Can optionally provide a custom argument name (defaults to `\"path\"`).\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const path = InternalArgs.path;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const repeated = InternalArgs.repeated;\n/**\n * Creates a text argument.\n *\n * Can optionally provide a custom argument name (defaults to `\"redacted\"`).\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const redacted = InternalArgs.redacted;\n/**\n * Creates a text argument.\n *\n * Can optionally provide a custom argument name (defaults to `\"secret\"`).\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const secret = InternalArgs.secret;\n/**\n * Creates a text argument.\n *\n * Can optionally provide a custom argument name (defaults to `\"text\"`).\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const text = InternalArgs.text;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const validate = InternalArgs.validate;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const withDefault = InternalArgs.withDefault;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const withFallbackConfig = InternalArgs.withFallbackConfig;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const withDescription = InternalArgs.withDescription;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const withSchema = InternalArgs.withSchema;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const wizard = InternalArgs.wizard;\n//# sourceMappingURL=Args.js.map","import * as cliConfig from \"./cliConfig.js\";\n/** @internal */\nexport const levensteinDistance = (first, second, config) => {\n if (first.length === 0 && second.length === 0) {\n return 0;\n }\n if (first.length === 0) {\n return second.length;\n }\n if (second.length === 0) {\n return first.length;\n }\n const rowCount = first.length;\n const columnCount = second.length;\n const matrix = new Array(rowCount);\n const normalFirst = cliConfig.normalizeCase(config, first);\n const normalSecond = cliConfig.normalizeCase(config, second);\n // Increment each row in the first column\n for (let x = 0; x <= rowCount; x++) {\n matrix[x] = new Array(columnCount);\n matrix[x][0] = x;\n }\n // Increment each column in the first row\n for (let y = 0; y <= columnCount; y++) {\n matrix[0][y] = y;\n }\n // Fill in the rest of the matrix\n for (let row = 1; row <= rowCount; row++) {\n for (let col = 1; col <= columnCount; col++) {\n const cost = normalFirst.charAt(row - 1) === normalSecond.charAt(col - 1) ? 0 : 1;\n matrix[row][col] = Math.min(matrix[row][col - 1] + 1, Math.min(matrix[row - 1][col] + 1, matrix[row - 1][col - 1] + cost));\n }\n }\n return matrix[rowCount][columnCount];\n};\n//# sourceMappingURL=autoCorrect.js.map","import * as InternalPrompt from \"../prompt.js\";\nimport * as InternalTextPrompt from \"./text.js\";\n/** @internal */\nexport const list = options => InternalTextPrompt.text(options).pipe(InternalPrompt.map(output => output.split(options.delimiter || \",\")));\n//# sourceMappingURL=list.js.map","import * as Arr from \"effect/Array\";\nimport * as Config from \"effect/Config\";\nimport * as ConfigError from \"effect/ConfigError\";\nimport * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as Either from \"effect/Either\";\nimport { dual, pipe } from \"effect/Function\";\nimport * as HashMap from \"effect/HashMap\";\nimport * as Inspectable from \"effect/Inspectable\";\nimport * as Option from \"effect/Option\";\nimport * as Order from \"effect/Order\";\nimport * as ParseResult from \"effect/ParseResult\";\nimport { pipeArguments } from \"effect/Pipeable\";\nimport * as Predicate from \"effect/Predicate\";\nimport * as Ref from \"effect/Ref\";\nimport * as InternalAutoCorrect from \"./autoCorrect.js\";\nimport * as InternalCliConfig from \"./cliConfig.js\";\nimport * as InternalCompletion from \"./completion.js\";\nimport * as InternalFiles from \"./files.js\";\nimport * as InternalHelpDoc from \"./helpDoc.js\";\nimport * as InternalSpan from \"./helpDoc/span.js\";\nimport * as InternalPrimitive from \"./primitive.js\";\nimport * as InternalPrompt from \"./prompt.js\";\nimport * as InternalListPrompt from \"./prompt/list.js\";\nimport * as InternalNumberPrompt from \"./prompt/number.js\";\nimport * as InternalSelectPrompt from \"./prompt/select.js\";\nimport * as InternalUsage from \"./usage.js\";\nimport * as InternalValidationError from \"./validationError.js\";\nconst OptionsSymbolKey = \"@effect/cli/Options\";\n/** @internal */\nexport const OptionsTypeId = /*#__PURE__*/Symbol.for(OptionsSymbolKey);\nconst proto = {\n [OptionsTypeId]: {\n _A: _ => _\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n// =============================================================================\n// Refinements\n// =============================================================================\n/** @internal */\nexport const isOptions = u => typeof u === \"object\" && u != null && OptionsTypeId in u;\n/** @internal */\nexport const isInstruction = self => self;\n/** @internal */\nexport const isEmpty = self => self._tag === \"Empty\";\n/** @internal */\nexport const isSingle = self => self._tag === \"Single\";\n/** @internal */\nexport const isKeyValueMap = self => self._tag === \"KeyValueMap\";\n/** @internal */\nexport const isMap = self => self._tag === \"Map\";\n/** @internal */\nexport const isBoth = self => self._tag === \"Both\";\n/** @internal */\nexport const isOrElse = self => self._tag === \"OrElse\";\n/** @internal */\nexport const isWithDefault = self => self._tag === \"WithDefault\";\n/** @internal */\nexport const isWithFallback = self => self._tag === \"WithFallback\";\n// =============================================================================\n// Constructors\n// =============================================================================\n/** @internal */\nexport const all = function () {\n if (arguments.length === 1) {\n if (isOptions(arguments[0])) {\n return map(arguments[0], x => [x]);\n } else if (Arr.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, options] of rest) {\n result = map(makeBoth(result, options), ([record, value]) => ({\n ...record,\n [key]: value\n }));\n }\n return result;\n }\n }\n return allTupled(arguments[0]);\n};\nconst defaultBooleanOptions = {\n ifPresent: true,\n negationNames: [],\n aliases: []\n};\n/** @internal */\nexport const boolean = (name, options) => {\n const {\n aliases,\n ifPresent,\n negationNames\n } = {\n ...defaultBooleanOptions,\n ...options\n };\n const option = makeSingle(name, aliases, InternalPrimitive.boolean(Option.some(ifPresent)));\n if (Arr.isNonEmptyReadonlyArray(negationNames)) {\n const head = Arr.headNonEmpty(negationNames);\n const tail = Arr.tailNonEmpty(negationNames);\n const negationOption = makeSingle(head, tail, InternalPrimitive.boolean(Option.some(!ifPresent)));\n return withDefault(orElse(option, negationOption), !ifPresent);\n }\n return withDefault(option, !ifPresent);\n};\n/** @internal */\nexport const choice = (name, choices) => {\n const primitive = InternalPrimitive.choice(Arr.map(choices, choice => [choice, choice]));\n return makeSingle(name, Arr.empty(), primitive);\n};\n/** @internal */\nexport const choiceWithValue = (name, choices) => makeSingle(name, Arr.empty(), InternalPrimitive.choice(choices));\n/** @internal */\nexport const date = name => makeSingle(name, Arr.empty(), InternalPrimitive.date);\n/** @internal */\nexport const directory = (name, config) => makeSingle(name, Arr.empty(), InternalPrimitive.path(\"directory\", config?.exists ?? \"either\"));\n/** @internal */\nexport const file = (name, config) => makeSingle(name, Arr.empty(), InternalPrimitive.path(\"file\", config?.exists ?? \"either\"));\n/** @internal */\nexport const fileContent = name => mapEffect(file(name, {\n exists: \"yes\"\n}), path => Effect.mapError(InternalFiles.read(path), msg => InternalValidationError.invalidValue(InternalHelpDoc.p(msg))));\n/** @internal */\nexport const fileParse = (name, format) => mapEffect(fileText(name), ([path, content]) => Effect.mapError(InternalFiles.parse(path, content, format), error => InternalValidationError.invalidValue(InternalHelpDoc.p(error))));\n/** @internal */\nexport const fileSchema = (name, schema, format) => withSchema(fileParse(name, format), schema);\n/** @internal */\nexport const fileText = name => mapEffect(file(name, {\n exists: \"yes\"\n}), path => Effect.mapError(InternalFiles.readString(path), error => InternalValidationError.invalidValue(InternalHelpDoc.p(error))));\n/** @internal */\nexport const filterMap = /*#__PURE__*/dual(3, (self, f, message) => mapEffect(self, a => Option.match(f(a), {\n onNone: () => Either.left(InternalValidationError.invalidValue(InternalHelpDoc.p(message))),\n onSome: Either.right\n})));\n/** @internal */\nexport const float = name => makeSingle(name, Arr.empty(), InternalPrimitive.float);\n/** @internal */\nexport const integer = name => makeSingle(name, Arr.empty(), InternalPrimitive.integer);\n/** @internal */\nexport const keyValueMap = option => {\n if (typeof option === \"string\") {\n const single = makeSingle(option, Arr.empty(), InternalPrimitive.text);\n return makeKeyValueMap(single);\n }\n if (!isSingle(option)) {\n throw new Error(\"InvalidArgumentException: only single options can be key/value maps\");\n } else {\n return makeKeyValueMap(option);\n }\n};\n/** @internal */\nexport const none = /*#__PURE__*/(() => {\n const op = /*#__PURE__*/Object.create(proto);\n op._tag = \"Empty\";\n return op;\n})();\n/** @internal */\nexport const redacted = name => makeSingle(name, Arr.empty(), InternalPrimitive.redacted);\n/** @internal */\nexport const secret = name => makeSingle(name, Arr.empty(), InternalPrimitive.secret);\n/** @internal */\nexport const text = name => makeSingle(name, Arr.empty(), InternalPrimitive.text);\n// =============================================================================\n// Combinators\n// =============================================================================\n/** @internal */\nexport const atLeast = /*#__PURE__*/dual(2, (self, times) => makeVariadic(self, Option.some(times), Option.none()));\n/** @internal */\nexport const atMost = /*#__PURE__*/dual(2, (self, times) => makeVariadic(self, Option.none(), Option.some(times)));\n/** @internal */\nexport const between = /*#__PURE__*/dual(3, (self, min, max) => makeVariadic(self, Option.some(min), Option.some(max)));\n/** @internal */\nexport const isBool = self => isBoolInternal(self);\n/** @internal */\nexport const getHelp = self => getHelpInternal(self);\n/** @internal */\nexport const getIdentifier = self => getIdentifierInternal(self);\n/** @internal */\nexport const getMinSize = self => getMinSizeInternal(self);\n/** @internal */\nexport const getMaxSize = self => getMaxSizeInternal(self);\n/** @internal */\nexport const getUsage = self => getUsageInternal(self);\n/** @internal */\nexport const map = /*#__PURE__*/dual(2, (self, f) => makeMap(self, a => Either.right(f(a))));\n/** @internal */\nexport const mapEffect = /*#__PURE__*/dual(2, (self, f) => makeMap(self, f));\n/** @internal */\nexport const mapTryCatch = /*#__PURE__*/dual(3, (self, f, onError) => mapEffect(self, a => {\n try {\n return Either.right(f(a));\n } catch (e) {\n return Either.left(InternalValidationError.invalidValue(onError(e)));\n }\n}));\n/** @internal */\nexport const optional = self => withDefault(map(self, Option.some), Option.none());\n/** @internal */\nexport const orElse = /*#__PURE__*/dual(2, (self, that) => orElseEither(self, that).pipe(map(Either.merge)));\n/** @internal */\nexport const orElseEither = /*#__PURE__*/dual(2, (self, that) => makeOrElse(self, that));\n/** @internal */\nexport const parse = /*#__PURE__*/dual(3, (self, args, config) => parseInternal(self, args, config));\n/** @internal */\nexport const processCommandLine = /*#__PURE__*/dual(3, (self, args, config) => matchOptions(args, toParseableInstruction(self), config).pipe(Effect.flatMap(([error, commandArgs, matchedOptions]) => parseInternal(self, matchedOptions, config).pipe(Effect.catchAll(e => Option.match(error, {\n onNone: () => Effect.fail(e),\n onSome: err => Effect.fail(err)\n})), Effect.map(a => [error, commandArgs, a])))));\n/** @internal */\nexport const repeated = self => makeVariadic(self, Option.none(), Option.none());\n/** @internal */\nexport const withAlias = /*#__PURE__*/dual(2, (self, alias) => modifySingle(self, single => {\n const aliases = Arr.append(single.aliases, alias);\n return makeSingle(single.name, aliases, single.primitiveType, single.description, single.pseudoName);\n}));\n/** @internal */\nexport const withDefault = /*#__PURE__*/dual(2, (self, fallback) => makeWithDefault(self, fallback));\n/** @internal */\nexport const withFallbackConfig = /*#__PURE__*/dual(2, (self, config) => {\n if (isInstruction(self) && isWithDefault(self)) {\n return makeWithDefault(withFallbackConfig(self.options, config), self.fallback);\n }\n return makeWithFallback(self, config);\n});\n/** @internal */\nexport const withFallbackPrompt = /*#__PURE__*/dual(2, (self, prompt) => {\n if (isInstruction(self) && isWithDefault(self)) {\n return makeWithDefault(withFallbackPrompt(self.options, prompt), self.fallback);\n }\n return makeWithFallback(self, prompt);\n});\n/** @internal */\nexport const withDescription = /*#__PURE__*/dual(2, (self, desc) => modifySingle(self, single => {\n const description = InternalHelpDoc.sequence(single.description, InternalHelpDoc.p(desc));\n return makeSingle(single.name, single.aliases, single.primitiveType, description, single.pseudoName);\n}));\n/** @internal */\nexport const withPseudoName = /*#__PURE__*/dual(2, (self, pseudoName) => modifySingle(self, single => makeSingle(single.name, single.aliases, single.primitiveType, single.description, Option.some(pseudoName))));\n/** @internal */\nexport const withSchema = /*#__PURE__*/dual(2, (self, schema) => {\n const decode = ParseResult.decode(schema);\n return mapEffect(self, _ => Effect.mapError(decode(_), issue => InternalValidationError.invalidValue(InternalHelpDoc.p(ParseResult.TreeFormatter.formatIssueSync(issue)))));\n});\n/** @internal */\nexport const wizard = /*#__PURE__*/dual(2, (self, config) => wizardInternal(self, config));\n// =============================================================================\n// Internals\n// =============================================================================\nconst allTupled = arg => {\n if (arg.length === 0) {\n return none;\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 = map(makeBoth(result, curr), ([a, b]) => [...a, b]);\n }\n return result;\n};\nconst getHelpInternal = self => {\n switch (self._tag) {\n case \"Empty\":\n {\n return InternalHelpDoc.empty;\n }\n case \"Single\":\n {\n return InternalHelpDoc.descriptionList(Arr.of([InternalHelpDoc.getSpan(InternalUsage.getHelp(getUsageInternal(self))), InternalHelpDoc.sequence(InternalHelpDoc.p(InternalPrimitive.getHelp(self.primitiveType)), self.description)]));\n }\n case \"KeyValueMap\":\n {\n // Single options always have an identifier, so we can safely `getOrThrow`\n const identifier = Option.getOrThrow(getIdentifierInternal(self.argumentOption));\n return InternalHelpDoc.mapDescriptionList(getHelpInternal(self.argumentOption), (span, oldBlock) => {\n const header = InternalHelpDoc.p(\"This setting is a property argument which:\");\n const single = `${identifier} key1=value key2=value2`;\n const multiple = `${identifier} key1=value ${identifier} key2=value2`;\n const description = InternalHelpDoc.enumeration([InternalHelpDoc.p(`May be specified a single time: '${single}'`), InternalHelpDoc.p(`May be specified multiple times: '${multiple}'`)]);\n const newBlock = pipe(oldBlock, InternalHelpDoc.sequence(header), InternalHelpDoc.sequence(description));\n return [span, newBlock];\n });\n }\n case \"Map\":\n {\n return getHelpInternal(self.options);\n }\n case \"Both\":\n case \"OrElse\":\n {\n return InternalHelpDoc.sequence(getHelpInternal(self.left), getHelpInternal(self.right));\n }\n case \"Variadic\":\n {\n const help = getHelpInternal(self.argumentOption);\n return InternalHelpDoc.mapDescriptionList(help, (oldSpan, oldBlock) => {\n const min = getMinSizeInternal(self);\n const max = getMaxSizeInternal(self);\n const newSpan = InternalSpan.text(Option.isSome(self.max) ? ` ${min} - ${max}` : min === 0 ? \"...\" : ` ${min}+`);\n const newBlock = InternalHelpDoc.p(Option.isSome(self.max) ? `This option must be repeated at least ${min} times and may be repeated up to ${max} times.` : min === 0 ? \"This option may be repeated zero or more times.\" : `This option must be repeated at least ${min} times.`);\n return [InternalSpan.concat(oldSpan, newSpan), InternalHelpDoc.sequence(oldBlock, newBlock)];\n });\n }\n case \"WithDefault\":\n {\n return InternalHelpDoc.mapDescriptionList(getHelpInternal(self.options), (span, block) => {\n const optionalDescription = Option.isOption(self.fallback) ? Option.match(self.fallback, {\n onNone: () => InternalHelpDoc.p(\"This setting is optional.\"),\n onSome: fallbackValue => {\n const inspectableValue = Predicate.isObject(fallbackValue) ? fallbackValue : String(fallbackValue);\n const displayValue = Inspectable.toStringUnknown(inspectableValue, 0);\n return InternalHelpDoc.p(`This setting is optional. Defaults to: ${displayValue}`);\n }\n }) : InternalHelpDoc.p(\"This setting is optional.\");\n return [span, InternalHelpDoc.sequence(block, optionalDescription)];\n });\n }\n case \"WithFallback\":\n {\n const helpDoc = Config.isConfig(self.effect) ? InternalHelpDoc.p(\"This option can be set from environment variables.\") : InternalPrompt.isPrompt(self.effect) ? InternalHelpDoc.p(\"Will prompt the user for input if this option is not provided.\") : InternalHelpDoc.empty;\n return InternalHelpDoc.mapDescriptionList(getHelpInternal(self.options), (span, block) => [span, InternalHelpDoc.sequence(block, helpDoc)]);\n }\n }\n};\nconst getIdentifierInternal = self => {\n switch (self._tag) {\n case \"Empty\":\n {\n return Option.none();\n }\n case \"Single\":\n {\n return Option.some(self.fullName);\n }\n case \"Both\":\n case \"OrElse\":\n {\n const ids = Arr.getSomes([getIdentifierInternal(self.left), getIdentifierInternal(self.right)]);\n return Arr.match(ids, {\n onEmpty: () => Option.none(),\n onNonEmpty: ids => Option.some(Arr.join(ids, \", \"))\n });\n }\n case \"KeyValueMap\":\n case \"Variadic\":\n {\n return getIdentifierInternal(self.argumentOption);\n }\n case \"Map\":\n case \"WithFallback\":\n case \"WithDefault\":\n {\n return getIdentifierInternal(self.options);\n }\n }\n};\nconst getMinSizeInternal = self => {\n switch (self._tag) {\n case \"Empty\":\n case \"WithDefault\":\n case \"WithFallback\":\n {\n return 0;\n }\n case \"Single\":\n case \"KeyValueMap\":\n {\n return 1;\n }\n case \"Map\":\n {\n return getMinSizeInternal(self.options);\n }\n case \"Both\":\n {\n const leftMinSize = getMinSizeInternal(self.left);\n const rightMinSize = getMinSizeInternal(self.right);\n return leftMinSize + rightMinSize;\n }\n case \"OrElse\":\n {\n const leftMinSize = getMinSizeInternal(self.left);\n const rightMinSize = getMinSizeInternal(self.right);\n return Math.min(leftMinSize, rightMinSize);\n }\n case \"Variadic\":\n {\n const selfMinSize = Option.getOrElse(self.min, () => 0);\n const argumentOptionMinSize = getMinSizeInternal(self.argumentOption);\n return selfMinSize * argumentOptionMinSize;\n }\n }\n};\nconst getMaxSizeInternal = self => {\n switch (self._tag) {\n case \"Empty\":\n {\n return 0;\n }\n case \"Single\":\n {\n return 1;\n }\n case \"KeyValueMap\":\n {\n return Number.MAX_SAFE_INTEGER;\n }\n case \"Map\":\n case \"WithDefault\":\n case \"WithFallback\":\n {\n return getMaxSizeInternal(self.options);\n }\n case \"Both\":\n {\n const leftMaxSize = getMaxSizeInternal(self.left);\n const rightMaxSize = getMaxSizeInternal(self.right);\n return leftMaxSize + rightMaxSize;\n }\n case \"OrElse\":\n {\n const leftMin = getMaxSizeInternal(self.left);\n const rightMin = getMaxSizeInternal(self.right);\n return Math.min(leftMin, rightMin);\n }\n case \"Variadic\":\n {\n const selfMaxSize = Option.getOrElse(self.max, () => Number.MAX_SAFE_INTEGER / 2);\n const optionsMaxSize = getMaxSizeInternal(self.argumentOption);\n return Math.floor(selfMaxSize * optionsMaxSize);\n }\n }\n};\nconst getUsageInternal = self => {\n switch (self._tag) {\n case \"Empty\":\n {\n return InternalUsage.empty;\n }\n case \"Single\":\n {\n const acceptedValues = InternalPrimitive.isBool(self.primitiveType) ? Option.none() : Option.orElse(InternalPrimitive.getChoices(self.primitiveType), () => Option.some(self.placeholder));\n return InternalUsage.named(getNames(self), acceptedValues);\n }\n case \"KeyValueMap\":\n {\n return getUsageInternal(self.argumentOption);\n }\n case \"Map\":\n {\n return getUsageInternal(self.options);\n }\n case \"Both\":\n {\n return InternalUsage.concat(getUsageInternal(self.left), getUsageInternal(self.right));\n }\n case \"OrElse\":\n {\n return InternalUsage.alternation(getUsageInternal(self.left), getUsageInternal(self.right));\n }\n case \"Variadic\":\n {\n return InternalUsage.repeated(getUsageInternal(self.argumentOption));\n }\n case \"WithDefault\":\n case \"WithFallback\":\n {\n return InternalUsage.optional(getUsageInternal(self.options));\n }\n }\n};\nconst isBoolInternal = self => {\n switch (self._tag) {\n case \"Single\":\n {\n return InternalPrimitive.isBool(self.primitiveType);\n }\n case \"Map\":\n {\n return isBoolInternal(self.options);\n }\n case \"WithDefault\":\n {\n return isBoolInternal(self.options);\n }\n default:\n {\n return false;\n }\n }\n};\nconst makeBoth = (left, right) => {\n const op = Object.create(proto);\n op._tag = \"Both\";\n op.left = left;\n op.right = right;\n return op;\n};\nconst makeFullName = str => str.length === 1 ? [true, `-${str}`] : [false, `--${str}`];\nconst makeKeyValueMap = argumentOption => {\n const op = Object.create(proto);\n op._tag = \"KeyValueMap\";\n op.argumentOption = argumentOption;\n return op;\n};\nconst makeMap = (options, f) => {\n const op = Object.create(proto);\n op._tag = \"Map\";\n op.options = options;\n op.f = f;\n return op;\n};\nconst makeOrElse = (left, right) => {\n const op = Object.create(proto);\n op._tag = \"OrElse\";\n op.left = left;\n op.right = right;\n return op;\n};\nconst makeSingle = (name, aliases, primitiveType, description = InternalHelpDoc.empty, pseudoName = Option.none()) => {\n const op = Object.create(proto);\n op._tag = \"Single\";\n op.name = name;\n op.fullName = makeFullName(name)[1];\n op.placeholder = `${Option.getOrElse(pseudoName, () => InternalPrimitive.getTypeName(primitiveType))}`;\n op.aliases = aliases;\n op.primitiveType = primitiveType;\n op.description = description;\n op.pseudoName = pseudoName;\n return op;\n};\nconst makeVariadic = (argumentOption, min, max) => {\n if (!isSingle(argumentOption)) {\n throw new Error(\"InvalidArgumentException: only single options can be variadic\");\n }\n const op = Object.create(proto);\n op._tag = \"Variadic\";\n op.argumentOption = argumentOption;\n op.min = min;\n op.max = max;\n return op;\n};\nconst makeWithDefault = (options, fallback) => {\n const op = Object.create(proto);\n op._tag = \"WithDefault\";\n op.options = options;\n op.fallback = fallback;\n return op;\n};\nconst makeWithFallback = (options, effect) => {\n const op = Object.create(proto);\n op._tag = \"WithFallback\";\n op.options = options;\n op.effect = effect;\n return op;\n};\nconst modifySingle = (self, f) => {\n switch (self._tag) {\n case \"Empty\":\n {\n return none;\n }\n case \"Single\":\n {\n return f(self);\n }\n case \"KeyValueMap\":\n {\n return makeKeyValueMap(f(self.argumentOption));\n }\n case \"Map\":\n {\n return makeMap(modifySingle(self.options, f), self.f);\n }\n case \"Both\":\n {\n return makeBoth(modifySingle(self.left, f), modifySingle(self.right, f));\n }\n case \"OrElse\":\n {\n return makeOrElse(modifySingle(self.left, f), modifySingle(self.right, f));\n }\n case \"Variadic\":\n {\n return makeVariadic(f(self.argumentOption), self.min, self.max);\n }\n case \"WithDefault\":\n {\n return makeWithDefault(modifySingle(self.options, f), self.fallback);\n }\n case \"WithFallback\":\n {\n return makeWithFallback(modifySingle(self.options, f), self.effect);\n }\n }\n};\n/** @internal */\nexport const getNames = self => {\n const loop = self => {\n switch (self._tag) {\n case \"Empty\":\n {\n return Arr.empty();\n }\n case \"Single\":\n {\n return Arr.prepend(self.aliases, self.name);\n }\n case \"KeyValueMap\":\n case \"Variadic\":\n {\n return loop(self.argumentOption);\n }\n case \"Map\":\n case \"WithDefault\":\n case \"WithFallback\":\n {\n return loop(self.options);\n }\n case \"Both\":\n case \"OrElse\":\n {\n const left = loop(self.left);\n const right = loop(self.right);\n return Arr.appendAll(left, right);\n }\n }\n };\n const order = Order.mapInput(Order.boolean, tuple => !tuple[0]);\n return pipe(loop(self), Arr.map(str => makeFullName(str)), Arr.sort(order), Arr.map(tuple => tuple[1]));\n};\nconst toParseableInstruction = self => {\n switch (self._tag) {\n case \"Empty\":\n {\n return Arr.empty();\n }\n case \"Single\":\n case \"KeyValueMap\":\n case \"Variadic\":\n {\n return Arr.of(self);\n }\n case \"Map\":\n case \"WithDefault\":\n case \"WithFallback\":\n {\n return toParseableInstruction(self.options);\n }\n case \"Both\":\n case \"OrElse\":\n {\n return Arr.appendAll(toParseableInstruction(self.left), toParseableInstruction(self.right));\n }\n }\n};\n/** @internal */\nconst keyValueSplitter = /=(.*)/;\nconst parseInternal = (self, args, config) => {\n switch (self._tag) {\n case \"Empty\":\n {\n return Effect.void;\n }\n case \"Single\":\n {\n const singleNames = Arr.filterMap(getNames(self), name => HashMap.get(args, name));\n if (Arr.isNonEmptyReadonlyArray(singleNames)) {\n const head = Arr.headNonEmpty(singleNames);\n const tail = Arr.tailNonEmpty(singleNames);\n if (Arr.isEmptyReadonlyArray(tail)) {\n if (Arr.isEmptyReadonlyArray(head)) {\n return InternalPrimitive.validate(self.primitiveType, Option.none(), config).pipe(Effect.mapError(e => InternalValidationError.invalidValue(InternalHelpDoc.p(e))));\n }\n if (Arr.isNonEmptyReadonlyArray(head) && Arr.isEmptyReadonlyArray(Arr.tailNonEmpty(head))) {\n const value = Arr.headNonEmpty(head);\n return InternalPrimitive.validate(self.primitiveType, Option.some(value), config).pipe(Effect.mapError(e => InternalValidationError.invalidValue(InternalHelpDoc.p(e))));\n }\n return Effect.fail(InternalValidationError.multipleValuesDetected(InternalHelpDoc.empty, head));\n }\n const error = InternalHelpDoc.p(`More than one reference to option '${self.fullName}' detected`);\n return Effect.fail(InternalValidationError.invalidValue(error));\n }\n const error = InternalHelpDoc.p(`Expected to find option: '${self.fullName}'`);\n return Effect.fail(InternalValidationError.missingValue(error));\n }\n case \"KeyValueMap\":\n {\n const extractKeyValue = value => {\n const split = value.trim().split(keyValueSplitter, 2);\n if (Arr.isNonEmptyReadonlyArray(split) && split.length === 2 && split[1] !== \"\") {\n return Effect.succeed(split);\n }\n const error = InternalHelpDoc.p(`Expected a key/value pair but received '${value}'`);\n return Effect.fail(InternalValidationError.invalidArgument(error));\n };\n return parseInternal(self.argumentOption, args, config).pipe(Effect.matchEffect({\n onFailure: e => InternalValidationError.isMultipleValuesDetected(e) ? Effect.forEach(e.values, kv => extractKeyValue(kv)).pipe(Effect.map(HashMap.fromIterable)) : Effect.fail(e),\n onSuccess: kv => extractKeyValue(kv).pipe(Effect.map(HashMap.make))\n }));\n }\n case \"Map\":\n {\n return parseInternal(self.options, args, config).pipe(Effect.flatMap(a => self.f(a)));\n }\n case \"Both\":\n {\n return parseInternal(self.left, args, config).pipe(Effect.catchAll(err1 => parseInternal(self.right, args, config).pipe(Effect.matchEffect({\n onFailure: err2 => {\n const error = InternalHelpDoc.sequence(err1.error, err2.error);\n return Effect.fail(InternalValidationError.missingValue(error));\n },\n onSuccess: () => Effect.fail(err1)\n }))), Effect.zip(parseInternal(self.right, args, config)));\n }\n case \"OrElse\":\n {\n return parseInternal(self.left, args, config).pipe(Effect.matchEffect({\n onFailure: err1 => parseInternal(self.right, args, config).pipe(Effect.mapBoth({\n onFailure: err2 =>\n // orElse option is only missing in case neither option was given\n InternalValidationError.isMissingValue(err1) && InternalValidationError.isMissingValue(err2) ? InternalValidationError.missingValue(InternalHelpDoc.sequence(err1.error, err2.error)) : InternalValidationError.invalidValue(InternalHelpDoc.sequence(err1.error, err2.error)),\n onSuccess: b => Either.right(b)\n })),\n onSuccess: a => parseInternal(self.right, args, config).pipe(Effect.matchEffect({\n onFailure: () => Effect.succeed(Either.left(a)),\n onSuccess: () => {\n // The `identifier` will only be `None` for `Options.Empty`, which\n // means the user would have had to purposefully compose\n // `Options.Empty | otherArgument`\n const leftUid = Option.getOrElse(getIdentifierInternal(self.left), () => \"???\");\n const rightUid = Option.getOrElse(getIdentifierInternal(self.right), () => \"???\");\n const error = InternalHelpDoc.p(\"Collision between two options detected - you can only specify \" + `one of either: ['${leftUid}', '${rightUid}']`);\n return Effect.fail(InternalValidationError.invalidValue(error));\n }\n }))\n }));\n }\n case \"Variadic\":\n {\n const min = Option.getOrElse(self.min, () => 0);\n const max = Option.getOrElse(self.max, () => Number.MAX_SAFE_INTEGER);\n const matchedArgument = Arr.filterMap(getNames(self), name => HashMap.get(args, name));\n const validateMinMax = values => {\n if (values.length < min) {\n const name = self.argumentOption.fullName;\n const error = `Expected at least ${min} value(s) for option: '${name}'`;\n return Effect.fail(InternalValidationError.invalidValue(InternalHelpDoc.p(error)));\n }\n if (values.length > max) {\n const name = self.argumentOption.fullName;\n const error = `Expected at most ${max} value(s) for option: '${name}'`;\n return Effect.fail(InternalValidationError.invalidValue(InternalHelpDoc.p(error)));\n }\n const primitive = self.argumentOption.primitiveType;\n const validatePrimitive = value => InternalPrimitive.validate(primitive, Option.some(value), config).pipe(Effect.mapError(e => InternalValidationError.invalidValue(InternalHelpDoc.p(e))));\n return Effect.forEach(values, value => validatePrimitive(value));\n };\n // If we did not receive any variadic arguments then perform the bounds\n // checks with an empty array\n if (Arr.every(matchedArgument, Arr.isEmptyReadonlyArray)) {\n return validateMinMax(Arr.empty());\n }\n return parseInternal(self.argumentOption, args, config).pipe(Effect.matchEffect({\n onFailure: error => InternalValidationError.isMultipleValuesDetected(error) ? validateMinMax(error.values) : Effect.fail(error),\n onSuccess: value => validateMinMax(Arr.of(value))\n }));\n }\n case \"WithDefault\":\n {\n return parseInternal(self.options, args, config).pipe(Effect.catchTag(\"MissingValue\", () => Effect.succeed(self.fallback)));\n }\n case \"WithFallback\":\n {\n return parseInternal(self.options, args, config).pipe(Effect.catchTag(\"MissingValue\", e => self.effect.pipe(Effect.catchAll(e2 => {\n if (Predicate.isTagged(e2, \"QuitException\")) {\n return Effect.die(e2);\n }\n if (ConfigError.isConfigError(e2) && !ConfigError.isMissingDataOnly(e2)) {\n const help = InternalHelpDoc.p(String(e2));\n const error = InternalValidationError.invalidValue(help);\n return Effect.fail(error);\n }\n return Effect.fail(e);\n }))));\n }\n }\n};\nconst wizardInternal = (self, config) => {\n switch (self._tag) {\n case \"Empty\":\n {\n return Effect.succeed(Arr.empty());\n }\n case \"Single\":\n {\n const help = getHelpInternal(self);\n return InternalPrimitive.wizard(self.primitiveType, help).pipe(Effect.flatMap(input => {\n // There will always be at least one name in names\n const args = Arr.make(getNames(self)[0], input);\n return parseCommandLine(self, args, config).pipe(Effect.as(args));\n }), Effect.zipLeft(Console.log()));\n }\n case \"KeyValueMap\":\n {\n const message = InternalHelpDoc.p(\"Enter `key=value` pairs separated by spaces\");\n return InternalListPrompt.list({\n message: InternalHelpDoc.toAnsiText(message).trim(),\n delimiter: \" \"\n }).pipe(Effect.flatMap(args => {\n const identifier = Option.getOrElse(getIdentifierInternal(self), () => \"\");\n return parseInternal(self, HashMap.make([identifier, args]), config).pipe(Effect.as(Arr.prepend(args, identifier)));\n }), Effect.zipLeft(Console.log()));\n }\n case \"Map\":\n {\n return wizardInternal(self.options, config);\n }\n case \"Both\":\n {\n return Effect.zipWith(wizardInternal(self.left, config), wizardInternal(self.right, config), (left, right) => Arr.appendAll(left, right));\n }\n case \"OrElse\":\n {\n const alternativeHelp = InternalHelpDoc.p(\"Select which option you would like to use\");\n const message = pipe(getHelpInternal(self), InternalHelpDoc.sequence(alternativeHelp));\n const makeChoice = (title, value) => ({\n title,\n value\n });\n const choices = Arr.getSomes([Option.map(getIdentifierInternal(self.left), title => makeChoice(title, self.left)), Option.map(getIdentifierInternal(self.right), title => makeChoice(title, self.right))]);\n return InternalSelectPrompt.select({\n message: InternalHelpDoc.toAnsiText(message).trimEnd(),\n choices\n }).pipe(Effect.flatMap(option => wizardInternal(option, config)));\n }\n case \"Variadic\":\n {\n const repeatHelp = InternalHelpDoc.p(\"How many times should this argument be repeated?\");\n const message = pipe(getHelpInternal(self), InternalHelpDoc.sequence(repeatHelp));\n return InternalNumberPrompt.integer({\n message: InternalHelpDoc.toAnsiText(message).trimEnd(),\n min: getMinSizeInternal(self),\n max: getMaxSizeInternal(self)\n }).pipe(Effect.flatMap(n => n <= 0 ? Effect.succeed(Arr.empty()) : Ref.make(Arr.empty()).pipe(Effect.flatMap(ref => wizardInternal(self.argumentOption, config).pipe(Effect.flatMap(args => Ref.update(ref, Arr.appendAll(args))), Effect.repeatN(n - 1), Effect.zipRight(Ref.get(ref)))))));\n }\n case \"WithDefault\":\n {\n if (isBoolInternal(self.options)) {\n return wizardInternal(self.options, config);\n }\n const defaultHelp = InternalHelpDoc.p(`This option is optional - use the default?`);\n const message = pipe(getHelpInternal(self.options), InternalHelpDoc.sequence(defaultHelp));\n return InternalSelectPrompt.select({\n message: InternalHelpDoc.toAnsiText(message).trimEnd(),\n choices: [{\n title: \"Yes\",\n value: true,\n description: `use the default ${Option.isOption(self.fallback) ? Option.match(self.fallback, {\n onNone: () => \"\",\n onSome: a => `(${JSON.stringify(a)})`\n }) : `(${JSON.stringify(self.fallback)})`}`\n }, {\n title: \"No\",\n value: false,\n description: \"use a custom value\"\n }]\n }).pipe(Effect.zipLeft(Console.log()), Effect.flatMap(useFallback => useFallback ? Effect.succeed(Arr.empty()) : wizardInternal(self.options, config)));\n }\n case \"WithFallback\":\n {\n if (isBoolInternal(self.options)) {\n return wizardInternal(self.options, config);\n }\n // TODO: should we use the prompt directly here?\n if (InternalPrompt.isPrompt(self.effect)) {\n return wizardInternal(self.options, config);\n }\n const defaultHelp = InternalHelpDoc.p(`Try load this option from the environment?`);\n const message = pipe(getHelpInternal(self.options), InternalHelpDoc.sequence(defaultHelp));\n return InternalSelectPrompt.select({\n message: InternalHelpDoc.toAnsiText(message).trimEnd(),\n choices: [{\n title: `Use environment variables`,\n value: true\n }, {\n title: \"Custom\",\n value: false\n }]\n }).pipe(Effect.zipLeft(Console.log()), Effect.flatMap(useFallback => useFallback ? Effect.succeed(Arr.empty()) : wizardInternal(self.options, config)));\n }\n }\n};\n// =============================================================================\n// Parsing Internals\n// =============================================================================\n/**\n * Returns a possible `ValidationError` when parsing the commands, leftover\n * arguments from `input` and a mapping between each flag and its values.\n */\nconst matchOptions = (input, options, config) => {\n if (Arr.isNonEmptyReadonlyArray(options)) {\n return findOptions(input, options, config).pipe(Effect.flatMap(([otherArgs, otherOptions, map1]) => {\n if (HashMap.isEmpty(map1)) {\n return Effect.succeed([Option.none(), input, map1]);\n }\n return matchOptions(otherArgs, otherOptions, config).pipe(Effect.map(([error, otherArgs, map2]) => [error, otherArgs, merge(map1, Arr.fromIterable(map2))]));\n }), Effect.catchAll(e => Effect.succeed([Option.some(e), input, HashMap.empty()])));\n }\n return Arr.isEmptyReadonlyArray(input) ? Effect.succeed([Option.none(), Arr.empty(), HashMap.empty()]) : Effect.succeed([Option.none(), input, HashMap.empty()]);\n};\n/**\n * Returns the leftover arguments, leftover options, and a mapping between the\n * first argument with its values if it corresponds to an option flag.\n */\nconst findOptions = (input, options, config) => Arr.matchLeft(options, {\n onEmpty: () => Effect.succeed([input, Arr.empty(), HashMap.empty()]),\n onNonEmpty: (head, tail) => parseCommandLine(head, input, config).pipe(Effect.flatMap(({\n leftover,\n parsed\n }) => Option.match(parsed, {\n onNone: () => findOptions(leftover, tail, config).pipe(Effect.map(([nextArgs, nextOptions, map]) => [nextArgs, Arr.prepend(nextOptions, head), map])),\n onSome: ({\n name,\n values\n }) => Effect.succeed([leftover, tail, HashMap.make([name, values])])\n })), Effect.catchTags({\n CorrectedFlag: e => findOptions(input, tail, config).pipe(Effect.catchSome(() => Option.some(Effect.fail(e))), Effect.flatMap(([otherArgs, otherOptions, map]) => Effect.fail(e).pipe(Effect.when(() => HashMap.isEmpty(map)), Effect.as([otherArgs, Arr.prepend(otherOptions, head), map])))),\n MissingFlag: () => findOptions(input, tail, config).pipe(Effect.map(([otherArgs, otherOptions, map]) => [otherArgs, Arr.prepend(otherOptions, head), map])),\n UnclusteredFlag: e => matchUnclustered(e.unclustered, e.rest, options, config).pipe(Effect.catchAll(() => Effect.fail(e)))\n }))\n});\nconst CLUSTERED_REGEX = /^-{1}([^-]{2,}$)/;\nconst FLAG_REGEX = /^(--[^=]+)(?:=(.+))?$/;\n/**\n * Normalizes the leading command-line argument by performing the following:\n * 1. If a clustered series of short command-line options is encountered,\n * uncluster the options and return a `ValidationError.UnclusteredFlag`\n * to be handled later on in the parsing algorithm\n * 2. If a long command-line option with a value is encountered, ensure that\n * the option and it's value are separated (i.e. `--option=value` becomes\n * [\"--option\", \"value\"])\n */\nconst processArgs = args => Arr.matchLeft(args, {\n onEmpty: () => Effect.succeed(Arr.empty()),\n onNonEmpty: (head, tail) => {\n const value = head.trim();\n // Attempt to match clustered short command-line arguments (i.e. `-abc`)\n if (CLUSTERED_REGEX.test(value)) {\n const unclustered = value.substring(1).split(\"\").map(c => `-${c}`);\n return Effect.fail(InternalValidationError.unclusteredFlag(InternalHelpDoc.empty, unclustered, tail));\n }\n // Attempt to match a long command-line argument and ensure the option and\n // it's value have been separated and added back to the arguments\n if (FLAG_REGEX.test(value)) {\n const result = FLAG_REGEX.exec(value);\n if (result !== null && result[2] !== undefined) {\n return Effect.succeed(Arr.appendAll([result[1], result[2]], tail));\n }\n }\n // Otherwise return the original command-line arguments\n return Effect.succeed(args);\n }\n});\n/**\n * Processes the command-line arguments for a parseable option, returning the\n * parsed command line results, which inclue:\n * - The name of the option and its associated value(s), if any\n * - Any leftover command-line arguments\n */\nconst parseCommandLine = (self, args, config) => {\n switch (self._tag) {\n case \"Single\":\n {\n return processArgs(args).pipe(Effect.flatMap(args => Arr.matchLeft(args, {\n onEmpty: () => {\n const error = InternalHelpDoc.p(`Expected to find option: '${self.fullName}'`);\n return Effect.fail(InternalValidationError.missingFlag(error));\n },\n onNonEmpty: (head, tail) => {\n const normalize = value => InternalCliConfig.normalizeCase(config, value);\n const normalizedHead = normalize(head);\n const normalizedNames = Arr.map(getNames(self), name => normalize(name));\n if (Arr.contains(normalizedNames, normalizedHead)) {\n if (InternalPrimitive.isBool(self.primitiveType)) {\n return Arr.matchLeft(tail, {\n onEmpty: () => {\n const parsed = Option.some({\n name: head,\n values: Arr.empty()\n });\n return Effect.succeed({\n parsed,\n leftover: tail\n });\n },\n onNonEmpty: (value, leftover) => {\n if (InternalPrimitive.isTrueValue(value)) {\n const parsed = Option.some({\n name: head,\n values: Arr.of(\"true\")\n });\n return Effect.succeed({\n parsed,\n leftover\n });\n }\n if (InternalPrimitive.isFalseValue(value)) {\n const parsed = Option.some({\n name: head,\n values: Arr.of(\"false\")\n });\n return Effect.succeed({\n parsed,\n leftover\n });\n }\n const parsed = Option.some({\n name: head,\n values: Arr.empty()\n });\n return Effect.succeed({\n parsed,\n leftover: tail\n });\n }\n });\n }\n return Arr.matchLeft(tail, {\n onEmpty: () => {\n const error = InternalHelpDoc.p(`Expected a value following option: '${self.fullName}'`);\n return Effect.fail(InternalValidationError.missingValue(error));\n },\n onNonEmpty: (value, leftover) => {\n const parsed = Option.some({\n name: head,\n values: Arr.of(value)\n });\n return Effect.succeed({\n parsed,\n leftover\n });\n }\n });\n }\n if (head.startsWith(\"-\")) {\n if (self.name.length > config.autoCorrectLimit + 1 && InternalAutoCorrect.levensteinDistance(head, self.fullName, config) <= config.autoCorrectLimit) {\n const error = InternalHelpDoc.p(`The flag '${head}' is not recognized. Did you mean '${self.fullName}'?`);\n return Effect.fail(InternalValidationError.correctedFlag(error));\n }\n const error = InternalHelpDoc.p(`Expected to find option: '${self.fullName}'`);\n return Effect.fail(InternalValidationError.missingFlag(error));\n }\n let optionIndex = -1;\n let equalsValue = undefined;\n for (let i = 0; i < tail.length; i++) {\n const arg = tail[i];\n const normalizedArg = normalize(arg);\n if (Arr.contains(normalizedNames, normalizedArg)) {\n optionIndex = i;\n break;\n }\n const flagMatch = FLAG_REGEX.exec(arg);\n if (flagMatch !== null) {\n const normalizedFlag = normalize(flagMatch[1]);\n if (Arr.contains(normalizedNames, normalizedFlag)) {\n optionIndex = i;\n equalsValue = flagMatch[2];\n break;\n }\n }\n }\n if (optionIndex === -1) {\n const error = InternalHelpDoc.p(`Expected to find option: '${self.fullName}'`);\n return Effect.fail(InternalValidationError.missingFlag(error));\n }\n const rawArg = tail[optionIndex];\n const optionName = equalsValue !== undefined ? FLAG_REGEX.exec(rawArg)[1] : rawArg;\n const beforeOption = Arr.prepend(tail.slice(0, optionIndex), head);\n const afterOption = tail.slice(optionIndex + 1);\n if (InternalPrimitive.isBool(self.primitiveType)) {\n if (equalsValue !== undefined) {\n if (InternalPrimitive.isTrueValue(equalsValue)) {\n const parsed = Option.some({\n name: optionName,\n values: Arr.of(\"true\")\n });\n const leftover = Arr.appendAll(beforeOption, afterOption);\n return Effect.succeed({\n parsed,\n leftover\n });\n }\n if (InternalPrimitive.isFalseValue(equalsValue)) {\n const parsed = Option.some({\n name: optionName,\n values: Arr.of(\"false\")\n });\n const leftover = Arr.appendAll(beforeOption, afterOption);\n return Effect.succeed({\n parsed,\n leftover\n });\n }\n }\n if (afterOption.length > 0) {\n const nextValue = afterOption[0];\n if (InternalPrimitive.isTrueValue(nextValue)) {\n const parsed = Option.some({\n name: optionName,\n values: Arr.of(\"true\")\n });\n const leftover = Arr.appendAll(beforeOption, afterOption.slice(1));\n return Effect.succeed({\n parsed,\n leftover\n });\n }\n if (InternalPrimitive.isFalseValue(nextValue)) {\n const parsed = Option.some({\n name: optionName,\n values: Arr.of(\"false\")\n });\n const leftover = Arr.appendAll(beforeOption, afterOption.slice(1));\n return Effect.succeed({\n parsed,\n leftover\n });\n }\n }\n const parsed = Option.some({\n name: optionName,\n values: Arr.empty()\n });\n const leftover = Arr.appendAll(beforeOption, afterOption);\n return Effect.succeed({\n parsed,\n leftover\n });\n }\n if (equalsValue !== undefined) {\n const parsed = Option.some({\n name: optionName,\n values: Arr.of(equalsValue)\n });\n const leftover = Arr.appendAll(beforeOption, afterOption);\n return Effect.succeed({\n parsed,\n leftover\n });\n }\n if (afterOption.length === 0) {\n const error = InternalHelpDoc.p(`Expected a value following option: '${self.fullName}'`);\n return Effect.fail(InternalValidationError.missingValue(error));\n }\n const optionValue = afterOption[0];\n const parsed = Option.some({\n name: optionName,\n values: Arr.of(optionValue)\n });\n const leftover = Arr.appendAll(beforeOption, afterOption.slice(1));\n return Effect.succeed({\n parsed,\n leftover\n });\n }\n })));\n }\n case \"KeyValueMap\":\n {\n const normalizedNames = Arr.map(getNames(self.argumentOption), name => InternalCliConfig.normalizeCase(config, name));\n return Arr.matchLeft(args, {\n onEmpty: () => Effect.succeed({\n parsed: Option.none(),\n leftover: args\n }),\n onNonEmpty: (head, tail) => {\n const loop = args => {\n let keyValues = Arr.empty();\n let leftover = args;\n while (Arr.isNonEmptyReadonlyArray(leftover)) {\n const name = Arr.headNonEmpty(leftover).trim();\n const normalizedName = InternalCliConfig.normalizeCase(config, name);\n // Can be in the form of \"--flag key1=value1 --flag key2=value2\"\n if (leftover.length >= 2 && Arr.contains(normalizedNames, normalizedName)) {\n const keyValue = leftover[1].trim();\n const [key, value] = keyValue.split(\"=\");\n if (key !== undefined && value !== undefined && value.length > 0) {\n keyValues = Arr.append(keyValues, keyValue);\n leftover = leftover.slice(2);\n continue;\n }\n }\n // Can be in the form of \"--flag key1=value1 key2=value2\")\n if (name.includes(\"=\")) {\n const [key, value] = name.split(\"=\");\n if (key !== undefined && value !== undefined && value.length > 0) {\n keyValues = Arr.append(keyValues, name);\n leftover = leftover.slice(1);\n continue;\n }\n }\n break;\n }\n return [keyValues, leftover];\n };\n const normalizedName = InternalCliConfig.normalizeCase(config, head);\n if (Arr.contains(normalizedNames, normalizedName)) {\n const [values, leftover] = loop(tail);\n return Effect.succeed({\n parsed: Option.some({\n name: head,\n values\n }),\n leftover\n });\n }\n if (head.startsWith(\"-\")) {\n return Effect.succeed({\n parsed: Option.none(),\n leftover: args\n });\n }\n let optionIndex = -1;\n for (let i = 0; i < tail.length; i++) {\n const arg = tail[i];\n const normalizedArg = InternalCliConfig.normalizeCase(config, arg);\n if (Arr.contains(normalizedNames, normalizedArg)) {\n optionIndex = i;\n break;\n }\n }\n if (optionIndex === -1) {\n return Effect.succeed({\n parsed: Option.none(),\n leftover: args\n });\n }\n const optionName = tail[optionIndex];\n const beforeOption = Arr.prepend(tail.slice(0, optionIndex), head);\n const afterOption = tail.slice(optionIndex + 1);\n const [values, remaining] = loop(afterOption);\n const leftover = Arr.appendAll(beforeOption, remaining);\n return Effect.succeed({\n parsed: Option.some({\n name: optionName,\n values\n }),\n leftover\n });\n }\n });\n }\n case \"Variadic\":\n {\n const normalizedNames = Arr.map(getNames(self.argumentOption), name => InternalCliConfig.normalizeCase(config, name));\n let optionName = undefined;\n let values = Arr.empty();\n let unparsed = args;\n let leftover = Arr.empty();\n while (Arr.isNonEmptyReadonlyArray(unparsed)) {\n const name = Arr.headNonEmpty(unparsed);\n const normalizedName = InternalCliConfig.normalizeCase(config, name);\n if (Arr.contains(normalizedNames, normalizedName)) {\n if (optionName === undefined) {\n optionName = name;\n }\n const value = unparsed[1];\n if (value !== undefined && value.length > 0) {\n values = Arr.append(values, value.trim());\n }\n unparsed = unparsed.slice(2);\n } else {\n leftover = Arr.append(leftover, Arr.headNonEmpty(unparsed));\n unparsed = unparsed.slice(1);\n }\n }\n const parsed = Option.fromNullable(optionName).pipe(Option.orElse(() => Option.some(self.argumentOption.fullName)), Option.map(name => ({\n name,\n values\n })));\n return Effect.succeed({\n parsed,\n leftover\n });\n }\n }\n};\nconst matchUnclustered = (input, tail, options, config) => {\n if (Arr.isNonEmptyReadonlyArray(input)) {\n const flag = Arr.headNonEmpty(input);\n const otherFlags = Arr.tailNonEmpty(input);\n return findOptions(Arr.of(flag), options, config).pipe(Effect.flatMap(([_, opts1, map1]) => {\n if (HashMap.isEmpty(map1)) {\n return Effect.fail(InternalValidationError.unclusteredFlag(InternalHelpDoc.empty, Arr.empty(), tail));\n }\n return matchUnclustered(otherFlags, tail, opts1, config).pipe(Effect.map(([_, opts2, map2]) => [tail, opts2, merge(map1, Arr.fromIterable(map2))]));\n }));\n }\n return Effect.succeed([tail, options, HashMap.empty()]);\n};\n/**\n * Sums the list associated with the same key.\n */\nconst merge = (map1, map2) => {\n if (Arr.isNonEmptyReadonlyArray(map2)) {\n const head = Arr.headNonEmpty(map2);\n const tail = Arr.tailNonEmpty(map2);\n const newMap = Option.match(HashMap.get(map1, head[0]), {\n onNone: () => HashMap.set(map1, head[0], head[1]),\n onSome: elems => HashMap.set(map1, head[0], Arr.appendAll(elems, head[1]))\n });\n return merge(newMap, tail);\n }\n return map1;\n};\n// =============================================================================\n// Completion Internals\n// =============================================================================\nconst escape = string => InternalCompletion.escapeSingleQuoted(string.replaceAll(\"\\\\\", \"\\\\\\\\\")).replaceAll(\"[\", \"\\\\[\").replaceAll(\"]\", \"\\\\]\").replaceAll(\":\", \"\\\\:\").replaceAll(\"$\", \"\\\\$\").replaceAll(\"`\", \"\\\\`\").replaceAll(\"(\", \"\\\\(\").replaceAll(\")\", \"\\\\)\");\nconst getShortDescription = self => {\n switch (self._tag) {\n case \"Empty\":\n case \"Both\":\n case \"OrElse\":\n {\n return \"\";\n }\n case \"Single\":\n {\n return InternalSpan.getText(InternalHelpDoc.getSpan(self.description));\n }\n case \"KeyValueMap\":\n case \"Variadic\":\n {\n return getShortDescription(self.argumentOption);\n }\n case \"Map\":\n case \"WithDefault\":\n case \"WithFallback\":\n {\n return getShortDescription(self.options);\n }\n }\n};\n/** @internal */\nexport const getBashCompletions = self => {\n switch (self._tag) {\n case \"Empty\":\n {\n return Arr.empty();\n }\n case \"Single\":\n {\n const names = getNames(self);\n const cases = Arr.join(names, \"|\");\n const compgen = InternalPrimitive.getBashCompletions(self.primitiveType);\n return Arr.make(`${cases})`, ` COMPREPLY=( ${compgen} )`, ` return 0`, ` ;;`);\n }\n case \"KeyValueMap\":\n case \"Variadic\":\n {\n return getBashCompletions(self.argumentOption);\n }\n case \"Map\":\n case \"WithDefault\":\n case \"WithFallback\":\n {\n return getBashCompletions(self.options);\n }\n case \"Both\":\n case \"OrElse\":\n {\n const left = getBashCompletions(self.left);\n const right = getBashCompletions(self.right);\n return Arr.appendAll(left, right);\n }\n }\n};\n/** @internal */\nexport const getFishCompletions = self => {\n switch (self._tag) {\n case \"Empty\":\n {\n return Arr.empty();\n }\n case \"Single\":\n {\n const description = getShortDescription(self);\n const order = Order.mapInput(Order.boolean, tuple => !tuple[0]);\n return pipe(Arr.prepend(self.aliases, self.name), Arr.map(name => [name.length === 1, name]), Arr.sort(order), Arr.flatMap(([isShort, name]) => Arr.make(isShort ? \"-s\" : \"-l\", name)), Arr.appendAll(InternalPrimitive.getFishCompletions(self.primitiveType)), Arr.appendAll(description.length === 0 ? Arr.empty() : Arr.of(`-d '${InternalCompletion.escapeSingleQuoted(description)}'`)), Arr.join(\" \"), Arr.of);\n }\n case \"KeyValueMap\":\n case \"Variadic\":\n {\n return getFishCompletions(self.argumentOption);\n }\n case \"Map\":\n case \"WithDefault\":\n case \"WithFallback\":\n {\n return getFishCompletions(self.options);\n }\n case \"Both\":\n case \"OrElse\":\n {\n return pipe(getFishCompletions(self.left), Arr.appendAll(getFishCompletions(self.right)));\n }\n }\n};\n/** @internal */\nexport const getZshCompletions = (self, state = {\n conflicts: Arr.empty(),\n multiple: false\n}) => {\n switch (self._tag) {\n case \"Empty\":\n {\n return Arr.empty();\n }\n case \"Single\":\n {\n const names = getNames(self);\n const description = getShortDescription(self);\n const possibleValues = InternalPrimitive.getZshCompletions(self.primitiveType);\n const multiple = state.multiple ? \"*\" : \"\";\n const conflicts = Arr.isNonEmptyReadonlyArray(state.conflicts) ? `(${Arr.join(state.conflicts, \" \")})` : \"\";\n return Arr.map(names, name => `${conflicts}${multiple}${name}[${escape(description)}]${possibleValues}`);\n }\n case \"KeyValueMap\":\n {\n return getZshCompletions(self.argumentOption, {\n ...state,\n multiple: true\n });\n }\n case \"Map\":\n case \"WithDefault\":\n case \"WithFallback\":\n {\n return getZshCompletions(self.options, state);\n }\n case \"Both\":\n {\n const left = getZshCompletions(self.left, state);\n const right = getZshCompletions(self.right, state);\n return Arr.appendAll(left, right);\n }\n case \"OrElse\":\n {\n const leftNames = getNames(self.left);\n const rightNames = getNames(self.right);\n const left = getZshCompletions(self.left, {\n ...state,\n conflicts: Arr.appendAll(state.conflicts, rightNames)\n });\n const right = getZshCompletions(self.right, {\n ...state,\n conflicts: Arr.appendAll(state.conflicts, leftNames)\n });\n return Arr.appendAll(left, right);\n }\n case \"Variadic\":\n {\n return Option.isSome(self.max) && self.max.value > 1 ? getZshCompletions(self.argumentOption, {\n ...state,\n multiple: true\n }) : getZshCompletions(self.argumentOption, state);\n }\n }\n};\n//# sourceMappingURL=options.js.map","import * as LogLevel from \"effect/LogLevel\";\nimport * as Option from \"effect/Option\";\nimport * as InternalOptions from \"./options.js\";\n/** @internal */\nexport const setLogLevel = level => ({\n _tag: \"SetLogLevel\",\n level\n});\n/** @internal */\nexport const showCompletions = shellType => ({\n _tag: \"ShowCompletions\",\n shellType\n});\n/** @internal */\nexport const showHelp = (usage, helpDoc) => ({\n _tag: \"ShowHelp\",\n usage,\n helpDoc\n});\n/** @internal */\nexport const showWizard = command => ({\n _tag: \"ShowWizard\",\n command\n});\n/** @internal */\nexport const showVersion = {\n _tag: \"ShowVersion\"\n};\n/** @internal */\nexport const isShowCompletions = self => self._tag === \"ShowCompletions\";\n/** @internal */\nexport const isShowHelp = self => self._tag === \"ShowHelp\";\n/** @internal */\nexport const isShowWizard = self => self._tag === \"ShowWizard\";\n/** @internal */\nexport const isShowVersion = self => self._tag === \"ShowVersion\";\n/** @internal */\nexport const completionsOptions = /*#__PURE__*/InternalOptions.choiceWithValue(\"completions\", [[\"sh\", \"bash\"], [\"bash\", \"bash\"], [\"fish\", \"fish\"], [\"zsh\", \"zsh\"]]).pipe(InternalOptions.optional, /*#__PURE__*/InternalOptions.withDescription(\"Generate a completion script for a specific shell.\"));\n/** @internal */\nexport const logLevelOptions = /*#__PURE__*/InternalOptions.choiceWithValue(\"log-level\", LogLevel.allLevels.map(level => [level._tag.toLowerCase(), level])).pipe(InternalOptions.optional, /*#__PURE__*/InternalOptions.withDescription(\"Sets the minimum log level for a command.\"));\n/** @internal */\nexport const helpOptions = /*#__PURE__*/InternalOptions.boolean(\"help\").pipe(/*#__PURE__*/InternalOptions.withAlias(\"h\"), /*#__PURE__*/InternalOptions.withDescription(\"Show the help documentation for a command.\"));\n/** @internal */\nexport const versionOptions = /*#__PURE__*/InternalOptions.boolean(\"version\").pipe(/*#__PURE__*/InternalOptions.withDescription(\"Show the version of the application.\"));\n/** @internal */\nexport const wizardOptions = /*#__PURE__*/InternalOptions.boolean(\"wizard\").pipe(/*#__PURE__*/InternalOptions.withDescription(\"Start wizard mode for a command.\"));\n/** @internal */\nexport const builtIns = /*#__PURE__*/InternalOptions.all({\n completions: completionsOptions,\n logLevel: logLevelOptions,\n help: helpOptions,\n wizard: wizardOptions,\n version: versionOptions\n});\n/** @internal */\nexport const builtInOptions = (command, usage, helpDoc) => InternalOptions.map(builtIns, builtIn => {\n if (Option.isSome(builtIn.completions)) {\n return Option.some(showCompletions(builtIn.completions.value));\n }\n if (Option.isSome(builtIn.logLevel)) {\n return Option.some(setLogLevel(builtIn.logLevel.value));\n }\n if (builtIn.help) {\n return Option.some(showHelp(usage, helpDoc));\n }\n if (builtIn.wizard) {\n return Option.some(showWizard(command));\n }\n if (builtIn.version) {\n return Option.some(showVersion);\n }\n return Option.none();\n});\n//# sourceMappingURL=builtInOptions.js.map","import * as InternalOptions from \"./internal/options.js\";\n/**\n * @since 1.0.0\n * @category symbols\n */\nexport const OptionsTypeId = InternalOptions.OptionsTypeId;\n// =============================================================================\n// Refinements\n// =============================================================================\n/**\n * @since 1.0.0\n * @category refinements\n */\nexport const isOptions = InternalOptions.isOptions;\n// =============================================================================\n// Constructors\n// =============================================================================\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const all = InternalOptions.all;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const boolean = InternalOptions.boolean;\n/**\n * Constructs command-line `Options` that represent a choice between several\n * inputs. The input will be mapped to it's associated value during parsing.\n *\n * **Example**\n *\n * ```ts\n * import * as Options from \"@effect/cli/Options\"\n *\n * export const animal: Options.Options<\"dog\" | \"cat\"> = Options.choice(\n * \"animal\",\n * [\"dog\", \"cat\"]\n * )\n * ```\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const choice = InternalOptions.choice;\n/**\n * Constructs command-line `Options` that represent a choice between several\n * inputs. The input will be mapped to it's associated value during parsing.\n *\n * **Example**\n *\n * ```ts\n * import * as Options from \"@effect/cli/Options\"\n * import * as Data from \"effect/Data\"\n *\n * export type Animal = Dog | Cat\n *\n * export interface Dog {\n * readonly _tag: \"Dog\"\n * }\n *\n * export const Dog = Data.tagged<Dog>(\"Dog\")\n *\n * export interface Cat {\n * readonly _tag: \"Cat\"\n * }\n *\n * export const Cat = Data.tagged<Cat>(\"Cat\")\n *\n * export const animal: Options.Options<Animal> = Options.choiceWithValue(\"animal\", [\n * [\"dog\", Dog()],\n * [\"cat\", Cat()],\n * ])\n * ```\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const choiceWithValue = InternalOptions.choiceWithValue;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const date = InternalOptions.date;\n/**\n * Creates a parameter expecting path to a directory.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const directory = InternalOptions.directory;\n/**\n * Creates a parameter expecting path to a file.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const file = InternalOptions.file;\n/**\n * Creates a parameter expecting path to a file and reads its contents.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const fileContent = InternalOptions.fileContent;\n/**\n * Creates a parameter expecting path to a file and parse its contents.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const fileParse = InternalOptions.fileParse;\n/**\n * Creates a parameter expecting path to a file, parse its contents and validate\n * it with a Schema.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const fileSchema = InternalOptions.fileSchema;\n/**\n * Creates a parameter expecting path to a file and reads its contents.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const fileText = InternalOptions.fileText;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const float = InternalOptions.float;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const getHelp = InternalOptions.getHelp;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const getIdentifier = InternalOptions.getIdentifier;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const getUsage = InternalOptions.getUsage;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const integer = InternalOptions.integer;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const keyValueMap = InternalOptions.keyValueMap;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const none = InternalOptions.none;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const redacted = InternalOptions.redacted;\n/**\n * @since 1.0.0\n * @category constructors\n * @deprecated\n */\nexport const secret = InternalOptions.secret;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const text = InternalOptions.text;\n// =============================================================================\n// Combinators\n// =============================================================================\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const atMost = InternalOptions.atMost;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const atLeast = InternalOptions.atLeast;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const between = InternalOptions.between;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const filterMap = InternalOptions.filterMap;\n/**\n * Returns `true` if the specified `Options` is a boolean flag, `false`\n * otherwise.\n *\n * @since 1.0.0\n * @category combinators\n */\nexport const isBool = InternalOptions.isBool;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const map = InternalOptions.map;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const mapEffect = InternalOptions.mapEffect;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const mapTryCatch = InternalOptions.mapTryCatch;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const optional = InternalOptions.optional;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const orElse = InternalOptions.orElse;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const orElseEither = InternalOptions.orElseEither;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const parse = InternalOptions.parse;\n/**\n * Indicates that the specified command-line option can be repeated `0` or more\n * times.\n *\n * **NOTE**: if the command-line option is not provided, and empty array will be\n * returned as the value for said option.\n *\n * @since 1.0.0\n * @category combinators\n */\nexport const repeated = InternalOptions.repeated;\n/**\n * Processes the provided command-line arguments, searching for the specified\n * `Options`.\n *\n * Returns an `Option<ValidationError>`, any leftover arguments, and the\n * constructed value of type `A`. The possible error inside\n * `Option<ValidationError>` would only be triggered if there is an error when\n * parsing the command-line arguments. This is because `ValidationError`s are\n * also used internally to control the end of the command-line arguments (i.e.\n * the command-line symbol `--`) corresponding to options.\n *\n * @since 1.0.0\n * @category combinators\n */\nexport const processCommandLine = InternalOptions.processCommandLine;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const withAlias = InternalOptions.withAlias;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const withDefault = InternalOptions.withDefault;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const withFallbackConfig = InternalOptions.withFallbackConfig;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const withFallbackPrompt = InternalOptions.withFallbackPrompt;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const withDescription = InternalOptions.withDescription;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const withPseudoName = InternalOptions.withPseudoName;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const withSchema = InternalOptions.withSchema;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const wizard = InternalOptions.wizard;\n//# sourceMappingURL=Options.js.map","import { dual } from \"effect/Function\";\n/** @internal */\nexport const builtIn = option => ({\n _tag: \"BuiltIn\",\n option\n});\n/** @internal */\nexport const userDefined = (leftover, value) => ({\n _tag: \"UserDefined\",\n leftover,\n value\n});\n/** @internal */\nexport const isBuiltIn = self => self._tag === \"BuiltIn\";\n/** @internal */\nexport const isUserDefined = self => self._tag === \"UserDefined\";\n/** @internal */\nexport const map = /*#__PURE__*/dual(2, (self, f) => isUserDefined(self) ? userDefined(self.leftover, f(self.value)) : self);\n//# sourceMappingURL=commandDirective.js.map","import * as Color from \"@effect/printer-ansi/Color\";\nimport * as Arr from \"effect/Array\";\nimport * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as Either from \"effect/Either\";\nimport { dual, pipe } from \"effect/Function\";\nimport * as HashMap from \"effect/HashMap\";\nimport * as HashSet from \"effect/HashSet\";\nimport * as Option from \"effect/Option\";\nimport * as Order from \"effect/Order\";\nimport { pipeArguments } from \"effect/Pipeable\";\nimport * as Ref from \"effect/Ref\";\nimport * as SynchronizedRef from \"effect/SynchronizedRef\";\nimport * as HelpDoc from \"../HelpDoc.js\";\nimport * as Options from \"../Options.js\";\nimport * as InternalArgs from \"./args.js\";\nimport * as InternalBuiltInOptions from \"./builtInOptions.js\";\nimport * as InternalCliConfig from \"./cliConfig.js\";\nimport * as InternalCommandDirective from \"./commandDirective.js\";\nimport * as InternalCompletion from \"./completion.js\";\nimport * as InternalHelpDoc from \"./helpDoc.js\";\nimport * as InternalSpan from \"./helpDoc/span.js\";\nimport * as InternalOptions from \"./options.js\";\nimport * as InternalPrompt from \"./prompt.js\";\nimport * as InternalSelectPrompt from \"./prompt/select.js\";\nimport * as InternalUsage from \"./usage.js\";\nimport * as InternalValidationError from \"./validationError.js\";\nconst CommandDescriptorSymbolKey = \"@effect/cli/CommandDescriptor\";\n/** @internal */\nexport const TypeId = /*#__PURE__*/Symbol.for(CommandDescriptorSymbolKey);\nconst proto = {\n [TypeId]: {\n _A: _ => _\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n// =============================================================================\n// Refinements\n// =============================================================================\n/** @internal */\nexport const isCommand = u => typeof u === \"object\" && u != null && TypeId in u;\n/** @internal */\nexport const isStandard = self => self._tag === \"Standard\";\n/** @internal */\nexport const isGetUserInput = self => self._tag === \"GetUserInput\";\n/** @internal */\nexport const isMap = self => self._tag === \"Map\";\n/** @internal */\nexport const isSubcommands = self => self._tag === \"Subcommands\";\n// =============================================================================\n// Constructors\n// =============================================================================\n/** @internal */\nexport const make = (name, options = InternalOptions.none, args = InternalArgs.none) => {\n const op = Object.create(proto);\n op._tag = \"Standard\";\n op.name = name;\n op.description = InternalHelpDoc.empty;\n op.options = options;\n op.args = args;\n return op;\n};\n/** @internal */\nexport const prompt = (name, prompt) => {\n const op = Object.create(proto);\n op._tag = \"GetUserInput\";\n op.name = name;\n op.description = InternalHelpDoc.empty;\n op.prompt = prompt;\n return op;\n};\n// =============================================================================\n// Combinators\n// =============================================================================\n/** @internal */\nexport const getHelp = (self, config) => getHelpInternal(self, config);\n/** @internal */\nexport const getNames = self => HashSet.fromIterable(getNamesInternal(self));\n/** @internal */\nexport const getBashCompletions = (self, executable) => getBashCompletionsInternal(self, executable);\n/** @internal */\nexport const getFishCompletions = (self, executable) => getFishCompletionsInternal(self, executable);\n/** @internal */\nexport const getZshCompletions = (self, executable) => getZshCompletionsInternal(self, executable);\n/** @internal */\nexport const getSubcommands = self => HashMap.fromIterable(getSubcommandsInternal(self));\n/** @internal */\nexport const getUsage = self => getUsageInternal(self);\n/** @internal */\nexport const map = /*#__PURE__*/dual(2, (self, f) => mapEffect(self, a => Either.right(f(a))));\n/** @internal */\nexport const mapEffect = /*#__PURE__*/dual(2, (self, f) => {\n const op = Object.create(proto);\n op._tag = \"Map\";\n op.command = self;\n op.f = f;\n return op;\n});\n/** @internal */\nexport const parse = /*#__PURE__*/dual(3, (self, args, config) => parseInternal(self, args, config));\n/** @internal */\nexport const withDescription = /*#__PURE__*/dual(2, (self, help) => withDescriptionInternal(self, help));\n/** @internal */\nexport const withSubcommands = /*#__PURE__*/dual(2, (self, subcommands) => {\n const op = Object.create(proto);\n op._tag = \"Subcommands\";\n op.parent = self;\n op.children = Arr.map(subcommands, ([id, command]) => map(command, a => [id, a]));\n return op;\n});\n/** @internal */\nexport const wizard = /*#__PURE__*/dual(3, (self, prefix, config) => wizardInternal(self, prefix, config));\n// =============================================================================\n// Internals\n// =============================================================================\nconst getHelpInternal = (self, config) => {\n switch (self._tag) {\n case \"Standard\":\n {\n const header = InternalHelpDoc.isEmpty(self.description) ? InternalHelpDoc.empty : InternalHelpDoc.sequence(InternalHelpDoc.h1(\"DESCRIPTION\"), self.description);\n const argsHelp = InternalArgs.getHelp(self.args);\n const argsSection = InternalHelpDoc.isEmpty(argsHelp) ? InternalHelpDoc.empty : InternalHelpDoc.sequence(InternalHelpDoc.h1(\"ARGUMENTS\"), argsHelp);\n const options = config.showBuiltIns ? Options.all([self.options, InternalBuiltInOptions.builtIns]) : self.options;\n const optionsHelp = InternalOptions.getHelp(options);\n const optionsSection = InternalHelpDoc.isEmpty(optionsHelp) ? InternalHelpDoc.empty : InternalHelpDoc.sequence(InternalHelpDoc.h1(\"OPTIONS\"), optionsHelp);\n return InternalHelpDoc.sequence(header, InternalHelpDoc.sequence(argsSection, optionsSection));\n }\n case \"GetUserInput\":\n {\n return InternalHelpDoc.isEmpty(self.description) ? InternalHelpDoc.empty : InternalHelpDoc.sequence(InternalHelpDoc.h1(\"DESCRIPTION\"), self.description);\n }\n case \"Map\":\n {\n return getHelpInternal(self.command, config);\n }\n case \"Subcommands\":\n {\n const getUsage = (command, preceding) => {\n switch (command._tag) {\n case \"Standard\":\n case \"GetUserInput\":\n {\n const usage = InternalHelpDoc.getSpan(InternalUsage.getHelp(getUsageInternal(command)));\n const usages = Arr.append(preceding, usage);\n const finalUsage = Arr.reduce(usages, InternalSpan.empty, (acc, next) => InternalSpan.isText(acc) && acc.value === \"\" ? next : InternalSpan.isText(next) && next.value === \"\" ? acc : InternalSpan.spans([acc, InternalSpan.space, next]));\n const description = InternalHelpDoc.getSpan(command.description);\n return Arr.of([finalUsage, description]);\n }\n case \"Map\":\n {\n return getUsage(command.command, preceding);\n }\n case \"Subcommands\":\n {\n const parentUsage = getUsage(command.parent, preceding);\n return Option.match(Arr.head(parentUsage), {\n onNone: () => Arr.flatMap(command.children, child => getUsage(child, preceding)),\n onSome: ([usage]) => {\n const childrenUsage = Arr.flatMap(command.children, child => getUsage(child, Arr.append(preceding, usage)));\n return Arr.appendAll(parentUsage, childrenUsage);\n }\n });\n }\n }\n };\n const printSubcommands = subcommands => {\n const maxUsageLength = Arr.reduceRight(subcommands, 0, (max, [usage]) => Math.max(InternalSpan.size(usage), max));\n const documents = Arr.map(subcommands, ([usage, desc]) => InternalHelpDoc.p(InternalSpan.spans([usage, InternalSpan.text(\" \".repeat(maxUsageLength - InternalSpan.size(usage) + 2)), desc])));\n if (Arr.isNonEmptyReadonlyArray(documents)) {\n return InternalHelpDoc.enumeration(documents);\n }\n throw new Error(\"[BUG]: Subcommands.usage - received empty list of subcommands to print\");\n };\n return InternalHelpDoc.sequence(getHelpInternal(self.parent, config), InternalHelpDoc.sequence(InternalHelpDoc.h1(\"COMMANDS\"), printSubcommands(Arr.flatMap(self.children, child => getUsage(child, Arr.empty())))));\n }\n }\n};\nconst getNamesInternal = self => {\n switch (self._tag) {\n case \"Standard\":\n case \"GetUserInput\":\n {\n return Arr.of(self.name);\n }\n case \"Map\":\n {\n return getNamesInternal(self.command);\n }\n case \"Subcommands\":\n {\n return getNamesInternal(self.parent);\n }\n }\n};\nconst getSubcommandsInternal = self => {\n const loop = (self, isSubcommand) => {\n switch (self._tag) {\n case \"Standard\":\n case \"GetUserInput\":\n {\n return Arr.of([self.name, self]);\n }\n case \"Map\":\n {\n return loop(self.command, isSubcommand);\n }\n case \"Subcommands\":\n {\n // Ensure that we only traverse the subcommands one level deep from the\n // parent command\n return isSubcommand ? loop(self.parent, false) : Arr.flatMap(self.children, child => loop(child, true));\n }\n }\n };\n return loop(self, false);\n};\nconst getUsageInternal = self => {\n switch (self._tag) {\n case \"Standard\":\n {\n return InternalUsage.concat(InternalUsage.named(Arr.of(self.name), Option.none()), InternalUsage.concat(InternalOptions.getUsage(self.options), InternalArgs.getUsage(self.args)));\n }\n case \"GetUserInput\":\n {\n return InternalUsage.named(Arr.of(self.name), Option.none());\n }\n case \"Map\":\n {\n return getUsageInternal(self.command);\n }\n case \"Subcommands\":\n {\n return InternalUsage.concat(getUsageInternal(self.parent), InternalUsage.mixed);\n }\n }\n};\nconst parseInternal = (self, args, config) => {\n const parseCommandLine = (self, args) => Arr.matchLeft(args, {\n onEmpty: () => {\n const error = InternalHelpDoc.p(`Missing command name: '${self.name}'`);\n return Effect.fail(InternalValidationError.commandMismatch(error));\n },\n onNonEmpty: (head, tail) => {\n const normalizedArgv0 = InternalCliConfig.normalizeCase(config, head);\n const normalizedCommandName = InternalCliConfig.normalizeCase(config, self.name);\n return Effect.succeed(tail).pipe(Effect.when(() => normalizedArgv0 === normalizedCommandName), Effect.flatten, Effect.catchTag(\"NoSuchElementException\", () => {\n const error = InternalHelpDoc.p(`Missing command name: '${self.name}'`);\n return Effect.fail(InternalValidationError.commandMismatch(error));\n }));\n }\n });\n switch (self._tag) {\n case \"Standard\":\n {\n const parseBuiltInArgs = args => Arr.matchLeft(args, {\n onEmpty: () => {\n const error = InternalHelpDoc.p(`Missing command name: '${self.name}'`);\n return Effect.fail(InternalValidationError.commandMismatch(error));\n },\n onNonEmpty: argv0 => {\n const normalizedArgv0 = InternalCliConfig.normalizeCase(config, argv0);\n const normalizedCommandName = InternalCliConfig.normalizeCase(config, self.name);\n if (normalizedArgv0 === normalizedCommandName) {\n const help = getHelpInternal(self, config);\n const usage = getUsageInternal(self);\n const options = InternalBuiltInOptions.builtInOptions(self, usage, help);\n const argsWithoutCommand = Arr.drop(args, 1);\n return InternalOptions.processCommandLine(options, argsWithoutCommand, config).pipe(Effect.flatMap(tuple => tuple[2]), Effect.catchTag(\"NoSuchElementException\", () => {\n const error = InternalHelpDoc.p(\"No built-in option was matched\");\n return Effect.fail(InternalValidationError.noBuiltInMatch(error));\n }), Effect.map(InternalCommandDirective.builtIn));\n }\n const error = InternalHelpDoc.p(`Missing command name: '${self.name}'`);\n return Effect.fail(InternalValidationError.commandMismatch(error));\n }\n });\n const parseUserDefinedArgs = args => parseCommandLine(self, args).pipe(Effect.flatMap(commandOptionsAndArgs => {\n const [optionsAndArgs, forcedCommandArgs] = splitForcedArgs(commandOptionsAndArgs);\n return InternalOptions.processCommandLine(self.options, optionsAndArgs, config).pipe(Effect.flatMap(([error, commandArgs, optionsType]) => InternalArgs.validate(self.args, Arr.appendAll(commandArgs, forcedCommandArgs), config).pipe(Effect.catchAll(e => Option.match(error, {\n onNone: () => Effect.fail(e),\n onSome: err => Effect.fail(err)\n })), Effect.map(([argsLeftover, argsType]) => InternalCommandDirective.userDefined(argsLeftover, {\n name: self.name,\n options: optionsType,\n args: argsType\n })))));\n }));\n const exhaustiveSearch = args => {\n if (Arr.contains(args, \"--help\") || Arr.contains(args, \"-h\")) {\n return parseBuiltInArgs(Arr.make(self.name, \"--help\"));\n }\n if (Arr.contains(args, \"--wizard\")) {\n return parseBuiltInArgs(Arr.make(self.name, \"--wizard\"));\n }\n if (Arr.contains(args, \"--version\")) {\n return parseBuiltInArgs(Arr.make(self.name, \"--version\"));\n }\n const error = InternalHelpDoc.p(`Missing command name: '${self.name}'`);\n return Effect.fail(InternalValidationError.commandMismatch(error));\n };\n return parseBuiltInArgs(args).pipe(Effect.orElse(() => parseUserDefinedArgs(args)), Effect.catchSome(e => {\n if (InternalValidationError.isValidationError(e)) {\n if (config.finalCheckBuiltIn) {\n return Option.some(exhaustiveSearch(args).pipe(Effect.catchSome(_ => InternalValidationError.isValidationError(_) ? Option.some(Effect.fail(e)) : Option.none())));\n }\n return Option.some(Effect.fail(e));\n }\n return Option.none();\n }));\n }\n case \"GetUserInput\":\n {\n return parseCommandLine(self, args).pipe(Effect.zipRight(InternalPrompt.run(self.prompt)), Effect.catchTag(\"QuitException\", e => Effect.die(e)), Effect.map(value => InternalCommandDirective.userDefined(Arr.drop(args, 1), {\n name: self.name,\n value\n })));\n }\n case \"Map\":\n {\n return parseInternal(self.command, args, config).pipe(Effect.flatMap(directive => {\n if (InternalCommandDirective.isUserDefined(directive)) {\n return self.f(directive.value).pipe(Effect.map(value => InternalCommandDirective.userDefined(directive.leftover, value)));\n }\n return Effect.succeed(directive);\n }));\n }\n case \"Subcommands\":\n {\n const names = getNamesInternal(self);\n const subcommands = getSubcommandsInternal(self);\n const [parentArgs, childArgs] = Arr.span(args, arg => !Arr.some(subcommands, ([name]) => name === arg));\n const parseChildrenWith = argsForChildren => Effect.suspend(() => {\n const iterator = self.children[Symbol.iterator]();\n const loop = next => {\n return parseInternal(next, argsForChildren, config).pipe(Effect.catchIf(InternalValidationError.isCommandMismatch, e => {\n const next = iterator.next();\n return next.done ? Effect.fail(e) : loop(next.value);\n }));\n };\n return loop(iterator.next().value);\n });\n const parseChildren = parseChildrenWith(childArgs);\n const helpDirectiveForParent = Effect.sync(() => {\n return InternalCommandDirective.builtIn(InternalBuiltInOptions.showHelp(getUsageInternal(self), getHelpInternal(self, config)));\n });\n const helpDirectiveForChild = parseChildren.pipe(Effect.flatMap(directive => {\n if (InternalCommandDirective.isBuiltIn(directive) && InternalBuiltInOptions.isShowHelp(directive.option)) {\n const parentName = Option.getOrElse(Arr.head(names), () => \"\");\n const newDirective = InternalCommandDirective.builtIn(InternalBuiltInOptions.showHelp(InternalUsage.concat(InternalUsage.named(Arr.of(parentName), Option.none()), directive.option.usage), directive.option.helpDoc));\n return Effect.succeed(newDirective);\n }\n return Effect.fail(InternalValidationError.invalidArgument(InternalHelpDoc.empty));\n }));\n const wizardDirectiveForParent = Effect.sync(() => InternalCommandDirective.builtIn(InternalBuiltInOptions.showWizard(self)));\n const wizardDirectiveForChild = parseChildren.pipe(Effect.flatMap(directive => {\n if (InternalCommandDirective.isBuiltIn(directive) && InternalBuiltInOptions.isShowWizard(directive.option)) {\n return Effect.succeed(directive);\n }\n return Effect.fail(InternalValidationError.invalidArgument(InternalHelpDoc.empty));\n }));\n return Effect.suspend(() => parseInternal(self.parent, parentArgs, config).pipe(Effect.flatMap(directive => {\n switch (directive._tag) {\n case \"BuiltIn\":\n {\n if (InternalBuiltInOptions.isShowHelp(directive.option)) {\n // We do not want to display the child help docs if there are\n // no arguments indicating the CLI command was for the child\n return Arr.isNonEmptyReadonlyArray(childArgs) ? Effect.orElse(helpDirectiveForChild, () => helpDirectiveForParent) : helpDirectiveForParent;\n }\n if (InternalBuiltInOptions.isShowWizard(directive.option)) {\n return Effect.orElse(wizardDirectiveForChild, () => wizardDirectiveForParent);\n }\n return Effect.succeed(directive);\n }\n case \"UserDefined\":\n {\n const args = Arr.appendAll(directive.leftover, childArgs);\n if (Arr.isNonEmptyReadonlyArray(args)) {\n return parseChildrenWith(args).pipe(Effect.flatMap(childDirective => {\n if (!InternalCommandDirective.isUserDefined(childDirective)) {\n return Effect.succeed(childDirective);\n }\n const childLeftover = childDirective.leftover;\n if (Arr.isEmptyReadonlyArray(childLeftover)) {\n return Effect.succeed(InternalCommandDirective.userDefined(childLeftover, {\n ...directive.value,\n subcommand: Option.some(childDirective.value)\n }));\n }\n const parentArgsWithLeftover = Arr.appendAll(parentArgs, childLeftover);\n return parseInternal(self.parent, parentArgsWithLeftover, config).pipe(Effect.flatMap(reParsedParentDirective => {\n if (!InternalCommandDirective.isUserDefined(reParsedParentDirective)) {\n return Effect.succeed(InternalCommandDirective.userDefined(childLeftover, {\n ...directive.value,\n subcommand: Option.some(childDirective.value)\n }));\n }\n return Effect.succeed(InternalCommandDirective.userDefined(reParsedParentDirective.leftover, {\n ...reParsedParentDirective.value,\n subcommand: Option.some(childDirective.value)\n }));\n }), Effect.catchAll(() => Effect.succeed(InternalCommandDirective.userDefined(childLeftover, {\n ...directive.value,\n subcommand: Option.some(childDirective.value)\n }))));\n }), Effect.catchAll(err => {\n if (InternalValidationError.isCommandMismatch(err)) {\n const parentName = Option.getOrElse(Arr.head(names), () => \"\");\n const childNames = Arr.map(subcommands, ([name]) => `'${name}'`);\n const oneOf = childNames.length === 1 ? \"\" : \" one of\";\n const error = InternalHelpDoc.p(`Invalid subcommand for ${parentName} - use${oneOf} ${Arr.join(childNames, \", \")}`);\n return Effect.fail(InternalValidationError.commandMismatch(error));\n }\n return Effect.fail(err);\n }));\n }\n return Effect.succeed(InternalCommandDirective.userDefined(directive.leftover, {\n ...directive.value,\n subcommand: Option.none()\n }));\n }\n }\n }), Effect.catchSome(() => Arr.isEmptyReadonlyArray(args) ? Option.some(helpDirectiveForParent) : Option.none())));\n }\n }\n};\nconst splitForcedArgs = args => {\n const [remainingArgs, forcedArgs] = Arr.span(args, str => str !== \"--\");\n return [remainingArgs, Arr.drop(forcedArgs, 1)];\n};\nconst withDescriptionInternal = (self, description) => {\n switch (self._tag) {\n case \"Standard\":\n {\n const helpDoc = typeof description === \"string\" ? HelpDoc.p(description) : description;\n const op = Object.create(proto);\n op._tag = \"Standard\";\n op.name = self.name;\n op.description = helpDoc;\n op.options = self.options;\n op.args = self.args;\n return op;\n }\n case \"GetUserInput\":\n {\n const helpDoc = typeof description === \"string\" ? HelpDoc.p(description) : description;\n const op = Object.create(proto);\n op._tag = \"GetUserInput\";\n op.name = self.name;\n op.description = helpDoc;\n op.prompt = self.prompt;\n return op;\n }\n case \"Map\":\n {\n return mapEffect(withDescriptionInternal(self.command, description), self.f);\n }\n case \"Subcommands\":\n {\n const op = Object.create(proto);\n op._tag = \"Subcommands\";\n op.parent = withDescriptionInternal(self.parent, description);\n op.children = self.children.slice();\n return op;\n }\n }\n};\nconst argsWizardHeader = /*#__PURE__*/InternalSpan.code(\"Args Wizard - \");\nconst optionsWizardHeader = /*#__PURE__*/InternalSpan.code(\"Options Wizard - \");\nconst wizardInternal = (self, prefix, config) => {\n const loop = (self, commandLineRef) => {\n switch (self._tag) {\n case \"GetUserInput\":\n case \"Standard\":\n {\n return Effect.gen(function* () {\n const logCurrentCommand = Ref.get(commandLineRef).pipe(Effect.flatMap(commandLine => {\n const currentCommand = InternalHelpDoc.p(pipe(InternalSpan.strong(InternalSpan.highlight(\"COMMAND:\", Color.cyan)), InternalSpan.concat(InternalSpan.space), InternalSpan.concat(InternalSpan.highlight(Arr.join(commandLine, \" \"), Color.magenta))));\n return Console.log(InternalHelpDoc.toAnsiText(currentCommand));\n }));\n if (isStandard(self)) {\n // Log the current command line arguments\n yield* logCurrentCommand;\n const commandName = InternalSpan.highlight(self.name, Color.magenta);\n // If the command has options, run the wizard for them\n if (!InternalOptions.isEmpty(self.options)) {\n const message = InternalHelpDoc.p(InternalSpan.concat(optionsWizardHeader, commandName));\n yield* Console.log(InternalHelpDoc.toAnsiText(message));\n const options = yield* InternalOptions.wizard(self.options, config);\n yield* Ref.updateAndGet(commandLineRef, Arr.appendAll(options));\n yield* logCurrentCommand;\n }\n // If the command has args, run the wizard for them\n if (!InternalArgs.isEmpty(self.args)) {\n const message = InternalHelpDoc.p(InternalSpan.concat(argsWizardHeader, commandName));\n yield* Console.log(InternalHelpDoc.toAnsiText(message));\n const options = yield* InternalArgs.wizard(self.args, config);\n yield* Ref.updateAndGet(commandLineRef, Arr.appendAll(options));\n yield* logCurrentCommand;\n }\n }\n return yield* Ref.get(commandLineRef);\n });\n }\n case \"Map\":\n {\n return loop(self.command, commandLineRef);\n }\n case \"Subcommands\":\n {\n const description = InternalHelpDoc.p(\"Select which command you would like to execute\");\n const message = InternalHelpDoc.toAnsiText(description).trimEnd();\n const makeChoice = (title, index) => ({\n title,\n value: [title, index]\n });\n const choices = pipe(getSubcommandsInternal(self), Arr.map(([name], index) => makeChoice(name, index)));\n return loop(self.parent, commandLineRef).pipe(Effect.zipRight(InternalSelectPrompt.select({\n message,\n choices\n }).pipe(Effect.tap(([name]) => Ref.update(commandLineRef, Arr.append(name))), Effect.zipLeft(Console.log()), Effect.flatMap(([, nextIndex]) => loop(self.children[nextIndex], commandLineRef)))));\n }\n }\n };\n return Ref.make(prefix).pipe(Effect.flatMap(commandLineRef => loop(self, commandLineRef).pipe(Effect.zipRight(Ref.get(commandLineRef)))));\n};\n// =============================================================================\n// Completion Internals\n// =============================================================================\nconst getShortDescription = self => {\n switch (self._tag) {\n case \"Standard\":\n {\n return InternalSpan.getText(InternalHelpDoc.getSpan(self.description));\n }\n case \"GetUserInput\":\n {\n return InternalSpan.getText(InternalHelpDoc.getSpan(self.description));\n }\n case \"Map\":\n {\n return getShortDescription(self.command);\n }\n case \"Subcommands\":\n {\n return \"\";\n }\n }\n};\n/**\n * Allows for linear traversal of a `Command` data structure, accumulating state\n * based on information acquired from the command.\n */\nconst traverseCommand = (self, initialState, f) => SynchronizedRef.make(initialState).pipe(Effect.flatMap(ref => {\n const loop = (self, parentCommands, subcommands, level) => {\n switch (self._tag) {\n case \"Standard\":\n {\n const info = {\n command: self,\n parentCommands,\n subcommands,\n level\n };\n return SynchronizedRef.updateEffect(ref, state => f(state, info));\n }\n case \"GetUserInput\":\n {\n const info = {\n command: self,\n parentCommands,\n subcommands,\n level\n };\n return SynchronizedRef.updateEffect(ref, state => f(state, info));\n }\n case \"Map\":\n {\n return loop(self.command, parentCommands, subcommands, level);\n }\n case \"Subcommands\":\n {\n const parentNames = getNamesInternal(self.parent);\n const nextSubcommands = getSubcommandsInternal(self);\n const nextParentCommands = Arr.appendAll(parentCommands, parentNames);\n // Traverse the parent command using old parent names and next subcommands\n return loop(self.parent, parentCommands, nextSubcommands, level).pipe(Effect.zipRight(Effect.forEach(self.children, child =>\n // Traverse the child command using next parent names and old subcommands\n loop(child, nextParentCommands, subcommands, level + 1))));\n }\n }\n };\n return Effect.suspend(() => loop(self, Arr.empty(), Arr.empty(), 0)).pipe(Effect.zipRight(SynchronizedRef.get(ref)));\n}));\nconst indentAll = /*#__PURE__*/dual(2, (self, indent) => {\n const indentation = Arr.allocate(indent + 1).join(\" \");\n return Arr.map(self, line => `${indentation}${line}`);\n});\nconst getBashCompletionsInternal = (self, executable) => traverseCommand(self, Arr.empty(), (state, info) => {\n const options = isStandard(info.command) ? Options.all([info.command.options, InternalBuiltInOptions.builtIns]) : InternalBuiltInOptions.builtIns;\n const optionNames = InternalOptions.getNames(options);\n const optionCases = isStandard(info.command) ? InternalOptions.getBashCompletions(info.command.options) : Arr.empty();\n const subcommandNames = pipe(info.subcommands, Arr.map(([name]) => name), Arr.sort(Order.string));\n const wordList = Arr.appendAll(optionNames, subcommandNames);\n const preformatted = Arr.isEmptyReadonlyArray(info.parentCommands) ? Arr.of(info.command.name) : pipe(info.parentCommands, Arr.append(info.command.name), Arr.map(command => command.replaceAll(\"-\", \"__\")));\n const caseName = Arr.join(preformatted, \",\");\n const funcName = Arr.join(preformatted, \"__\");\n const funcLines = Arr.isEmptyReadonlyArray(info.parentCommands) ? Arr.empty() : [`${caseName})`, ` cmd=\"${funcName}\"`, \" ;;\"];\n const cmdLines = [`${funcName})`, ` opts=\"${Arr.join(wordList, \" \")}\"`, ` if [[ \\${cur} == -* || \\${COMP_CWORD} -eq ${info.level + 1} ]] ; then`, \" COMPREPLY=( $(compgen -W \\\"${opts}\\\" -- \\\"${cur}\\\") )\", \" return 0\", \" fi\", \" case \\\"${prev}\\\" in\", ...indentAll(optionCases, 8), \" *)\", \" COMPREPLY=()\", \" ;;\", \" esac\", \" COMPREPLY=( $(compgen -W \\\"${opts}\\\" -- \\\"${cur}\\\") )\", \" return 0\", \" ;;\"];\n const lines = Arr.append(state, [funcLines, cmdLines]);\n return Effect.succeed(lines);\n}).pipe(Effect.map(lines => {\n const rootCommand = Arr.unsafeGet(getNamesInternal(self), 0);\n const scriptName = `_${rootCommand}_bash_completions`;\n const funcCases = Arr.flatMap(lines, ([funcLines]) => funcLines);\n const cmdCases = Arr.flatMap(lines, ([, cmdLines]) => cmdLines);\n return [`function ${scriptName}() {`, \" local i cur prev opts cmd\", \" COMPREPLY=()\", \" cur=\\\"${COMP_WORDS[COMP_CWORD]}\\\"\", \" prev=\\\"${COMP_WORDS[COMP_CWORD-1]}\\\"\", \" cmd=\\\"\\\"\", \" opts=\\\"\\\"\", \" for i in \\\"${COMP_WORDS[@]}\\\"; do\", \" case \\\"${cmd},${i}\\\" in\", \" \\\",$1\\\")\", ` cmd=\"${executable}\"`, \" ;;\", ...indentAll(funcCases, 12), \" *)\", \" ;;\", \" esac\", \" done\", \" case \\\"${cmd}\\\" in\", ...indentAll(cmdCases, 8), \" esac\", \"}\", `complete -F ${scriptName} -o nosort -o bashdefault -o default ${rootCommand}`];\n}));\nconst getFishCompletionsInternal = (self, executable) => traverseCommand(self, Arr.empty(), (state, info) => {\n const baseTemplate = Arr.make(\"complete\", \"-c\", executable);\n const options = isStandard(info.command) ? InternalOptions.all([InternalBuiltInOptions.builtIns, info.command.options]) : InternalBuiltInOptions.builtIns;\n const optionsCompletions = InternalOptions.getFishCompletions(options);\n const argsCompletions = isStandard(info.command) ? InternalArgs.getFishCompletions(info.command.args) : Arr.empty();\n const rootCompletions = conditionals => pipe(Arr.map(optionsCompletions, option => pipe(baseTemplate, Arr.appendAll(conditionals), Arr.append(option), Arr.join(\" \"))), Arr.appendAll(Arr.map(argsCompletions, option => pipe(baseTemplate, Arr.appendAll(conditionals), Arr.append(option), Arr.join(\" \")))));\n const subcommandCompletions = conditionals => Arr.map(info.subcommands, ([name, subcommand]) => {\n const description = getShortDescription(subcommand);\n return pipe(baseTemplate, Arr.appendAll(conditionals), Arr.appendAll(Arr.make(\"-f\", \"-a\", `\"${name}\"`)), Arr.appendAll(description.length === 0 ? Arr.empty() : Arr.make(\"-d\", `'${InternalCompletion.escapeSingleQuoted(description)}'`)), Arr.join(\" \"));\n });\n // If parent commands are empty, then the info is for the root command\n if (Arr.isEmptyReadonlyArray(info.parentCommands)) {\n const conditionals = Arr.make(\"-n\", \"\\\"__fish_use_subcommand\\\"\");\n return Effect.succeed(pipe(state, Arr.appendAll(rootCompletions(conditionals)), Arr.appendAll(subcommandCompletions(conditionals))));\n }\n // Otherwise the info is for a subcommand\n const parentConditionals = pipe(info.parentCommands,\n // Drop the root command name from the subcommand conditionals\n Arr.drop(1), Arr.append(info.command.name), Arr.map(command => `__fish_seen_subcommand_from ${command}`));\n const subcommandConditionals = Arr.map(info.subcommands, ([name]) => `not __fish_seen_subcommand_from ${name}`);\n const baseConditionals = pipe(Arr.appendAll(parentConditionals, subcommandConditionals), Arr.join(\"; and \"));\n const conditionals = Arr.make(\"-n\", `\"${baseConditionals}\"`);\n return Effect.succeed(pipe(state, Arr.appendAll(rootCompletions(conditionals)), Arr.appendAll(subcommandCompletions(conditionals))));\n});\nconst getZshCompletionsInternal = (self, executable) => traverseCommand(self, Arr.empty(), (state, info) => {\n const preformatted = Arr.isEmptyReadonlyArray(info.parentCommands) ? Arr.of(info.command.name) : pipe(info.parentCommands, Arr.append(info.command.name), Arr.map(command => command.replaceAll(\"-\", \"__\")));\n const underscoreName = Arr.join(preformatted, \"__\");\n const spaceName = Arr.join(preformatted, \" \");\n const subcommands = pipe(info.subcommands, Arr.map(([name, subcommand]) => {\n const desc = getShortDescription(subcommand);\n return `'${name}:${InternalCompletion.escapeSingleQuoted(desc)}' \\\\`;\n }));\n const commands = Arr.isEmptyReadonlyArray(subcommands) ? `commands=()` : `commands=(\\n${Arr.join(indentAll(subcommands, 8), \"\\n\")}\\n )`;\n const handlerLines = [`(( $+functions[_${underscoreName}_commands] )) ||`, `_${underscoreName}_commands() {`, ` local commands; ${commands}`, ` _describe -t commands '${spaceName} commands' commands \"$@\"`, \"}\"];\n return Effect.succeed(Arr.appendAll(state, handlerLines));\n}).pipe(Effect.map(handlers => {\n const rootCommand = Arr.unsafeGet(getNamesInternal(self), 0);\n const cases = getZshSubcommandCases(self, Arr.empty(), Arr.empty());\n const scriptName = `_${rootCommand}_zsh_completions`;\n return [`#compdef ${executable}`, \"\", \"autoload -U is-at-least\", \"\", `function ${scriptName}() {`, \" typeset -A opt_args\", \" typeset -a _arguments_options\", \" local ret=1\", \"\", \" if is-at-least 5.2; then\", \" _arguments_options=(-s -S -C)\", \" else\", \" _arguments_options=(-s -C)\", \" fi\", \"\", \" local context curcontext=\\\"$curcontext\\\" state line\", ...indentAll(cases, 4), \"}\", \"\", ...handlers, \"\", `if [ \"$funcstack[1]\" = \"${scriptName}\" ]; then`, ` ${scriptName} \"$@\"`, \"else\", ` compdef ${scriptName} ${rootCommand}`, \"fi\"];\n}));\nconst getZshSubcommandCases = (self, parentCommands, subcommands) => {\n switch (self._tag) {\n case \"Standard\":\n case \"GetUserInput\":\n {\n const options = isStandard(self) ? InternalOptions.all([InternalBuiltInOptions.builtIns, self.options]) : InternalBuiltInOptions.builtIns;\n const args = isStandard(self) ? self.args : InternalArgs.none;\n const optionCompletions = pipe(InternalOptions.getZshCompletions(options), Arr.map(completion => `'${completion}' \\\\`));\n const argCompletions = pipe(InternalArgs.getZshCompletions(args), Arr.map(completion => `'${completion}' \\\\`));\n if (Arr.isEmptyReadonlyArray(parentCommands)) {\n return [\"_arguments \\\"${_arguments_options[@]}\\\" \\\\\", ...indentAll(optionCompletions, 4), ...indentAll(argCompletions, 4), ` \":: :_${self.name}_commands\" \\\\`, ` \"*::: :->${self.name}\" \\\\`, \" && ret=0\"];\n }\n if (Arr.isEmptyReadonlyArray(subcommands)) {\n return [`(${self.name})`, \"_arguments \\\"${_arguments_options[@]}\\\" \\\\\", ...indentAll(optionCompletions, 4), ...indentAll(argCompletions, 4), \" && ret=0\", \";;\"];\n }\n return [`(${self.name})`, \"_arguments \\\"${_arguments_options[@]}\\\" \\\\\", ...indentAll(optionCompletions, 4), ...indentAll(argCompletions, 4), ` \":: :_${Arr.append(parentCommands, self.name).join(\"__\")}_commands\" \\\\`, ` \"*::: :->${self.name}\" \\\\`, \" && ret=0\"];\n }\n case \"Map\":\n {\n return getZshSubcommandCases(self.command, parentCommands, subcommands);\n }\n case \"Subcommands\":\n {\n const nextSubcommands = getSubcommandsInternal(self);\n const parentNames = getNamesInternal(self.parent);\n const parentLines = getZshSubcommandCases(self.parent, parentCommands, Arr.appendAll(subcommands, nextSubcommands));\n const childCases = pipe(self.children, Arr.flatMap(child => getZshSubcommandCases(child, Arr.appendAll(parentCommands, parentNames), subcommands)));\n const hyphenName = pipe(Arr.appendAll(parentCommands, parentNames), Arr.join(\"-\"));\n const childLines = pipe(parentNames, Arr.flatMap(parentName => [\"case $state in\", ` (${parentName})`, ` words=($line[1] \"\\${words[@]}\")`, \" (( CURRENT += 1 ))\", ` curcontext=\"\\${curcontext%:*:*}:${hyphenName}-command-$line[1]:\"`, ` case $line[1] in`, ...indentAll(childCases, 8), \" esac\", \" ;;\", \"esac\"]), Arr.appendAll(Arr.isEmptyReadonlyArray(parentCommands) ? Arr.empty() : Arr.of(\";;\")));\n return Arr.appendAll(parentLines, childLines);\n }\n }\n};\n// Circular with ValidationError\n/** @internal */\nexport const helpRequestedError = command => {\n const op = Object.create(InternalValidationError.proto);\n op._tag = \"HelpRequested\";\n op.error = InternalHelpDoc.empty;\n op.command = command;\n return op;\n};\n//# sourceMappingURL=commandDescriptor.js.map","import * as Terminal from \"@effect/platform/Terminal\";\nimport * as Color from \"@effect/printer-ansi/Color\";\nimport * as Arr from \"effect/Array\";\nimport * as Console from \"effect/Console\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport { dual, pipe } from \"effect/Function\";\nimport * as HashMap from \"effect/HashMap\";\nimport * as Logger from \"effect/Logger\";\nimport * as Option from \"effect/Option\";\nimport { pipeArguments } from \"effect/Pipeable\";\nimport * as Unify from \"effect/Unify\";\nimport * as InternalBuiltInOptions from \"./builtInOptions.js\";\nimport * as InternalCliConfig from \"./cliConfig.js\";\nimport * as InternalCommand from \"./commandDescriptor.js\";\nimport * as InternalHelpDoc from \"./helpDoc.js\";\nimport * as InternalSpan from \"./helpDoc/span.js\";\nimport * as InternalTogglePrompt from \"./prompt/toggle.js\";\nimport * as InternalUsage from \"./usage.js\";\nimport * as InternalValidationError from \"./validationError.js\";\nconst proto = {\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n// =============================================================================\n// Constructors\n// =============================================================================\n/** @internal */\nexport const make = config => {\n const op = Object.create(proto);\n op.name = config.name;\n op.version = config.version;\n op.executable = config.executable;\n op.command = config.command;\n op.summary = config.summary || InternalSpan.empty;\n op.footer = config.footer || InternalHelpDoc.empty;\n return op;\n};\n// =============================================================================\n// Combinators\n// =============================================================================\n/** @internal */\nexport const run = /*#__PURE__*/dual(3, (self, args, execute) => Effect.contextWithEffect(context => {\n // Attempt to parse the CliConfig from the environment, falling back to the\n // default CliConfig if none was provided\n const config = Option.getOrElse(Context.getOption(context, InternalCliConfig.Tag), () => InternalCliConfig.defaultConfig);\n // Remove the executable from the command line arguments\n const [executable, filteredArgs] = splitExecutable(self, args);\n // Prefix the command name to the command line arguments\n const prefixedArgs = Arr.appendAll(prefixCommand(self.command), filteredArgs);\n // Handle the command\n return Effect.matchEffect(InternalCommand.parse(self.command, prefixedArgs, config), {\n onFailure: e => Effect.zipRight(printDocs(e.error), Effect.fail(e)),\n onSuccess: Unify.unify(directive => {\n switch (directive._tag) {\n case \"UserDefined\":\n {\n return Arr.matchLeft(directive.leftover, {\n onEmpty: () => execute(directive.value).pipe(Effect.catchSome(e => InternalValidationError.isValidationError(e) && InternalValidationError.isHelpRequested(e) ? Option.some(handleBuiltInOption(self, executable, filteredArgs, InternalBuiltInOptions.showHelp(InternalCommand.getUsage(e.command), InternalCommand.getHelp(e.command, config)), execute, config, args)) : Option.none())),\n onNonEmpty: head => {\n const error = InternalHelpDoc.p(`Received unknown argument: '${head}'`);\n return Effect.zipRight(printDocs(error), Effect.fail(InternalValidationError.invalidValue(error)));\n }\n });\n }\n case \"BuiltIn\":\n {\n return handleBuiltInOption(self, executable, filteredArgs, directive.option, execute, config, args).pipe(Effect.catchSome(e => InternalValidationError.isValidationError(e) ? Option.some(Effect.zipRight(printDocs(e.error), Effect.fail(e))) : Option.none()));\n }\n }\n })\n });\n}));\n// =============================================================================\n// Internals\n// =============================================================================\nconst splitExecutable = (self, args) => {\n if (self.executable !== undefined) {\n return [self.executable, Arr.drop(args, 2)];\n }\n const [[runtime, script], optionsAndArgs] = Arr.splitAt(args, 2);\n return [`${runtime} ${script}`, optionsAndArgs];\n};\nconst printDocs = error => Console.error(InternalHelpDoc.toAnsiText(error));\nconst handleBuiltInOption = (self, executable, args, builtIn, execute, config, originalArgs) => {\n switch (builtIn._tag) {\n case \"SetLogLevel\":\n {\n // Use first 2 elements from originalArgs (runtime + script) to preserve paths with spaces\n // Filter out --log-level from args before re-executing\n const baseArgs = Arr.take(originalArgs, 2);\n const filteredArgs = [];\n for (let i = 0; i < args.length; i++) {\n if (isLogLevelArg(args[i]) || args[i - 1] === \"--log-level\") {\n continue;\n }\n filteredArgs.push(args[i]);\n }\n const nextArgs = Arr.appendAll(baseArgs, filteredArgs);\n return run(self, nextArgs, execute).pipe(Logger.withMinimumLogLevel(builtIn.level));\n }\n case \"ShowHelp\":\n {\n const banner = InternalHelpDoc.h1(InternalSpan.code(self.name));\n const header = InternalHelpDoc.p(InternalSpan.spans([InternalSpan.text(`${self.name} ${self.version}`), InternalSpan.isEmpty(self.summary) ? InternalSpan.empty : InternalSpan.spans([InternalSpan.space, InternalSpan.text(\"--\"), InternalSpan.space, self.summary])]));\n const usage = InternalHelpDoc.sequence(InternalHelpDoc.h1(\"USAGE\"), pipe(InternalUsage.enumerate(builtIn.usage, config), Arr.map(span => InternalHelpDoc.p(InternalSpan.concat(InternalSpan.text(\"$ \"), span))), Arr.reduceRight(InternalHelpDoc.empty, (left, right) => InternalHelpDoc.sequence(left, right))));\n const helpDoc = pipe(banner, InternalHelpDoc.sequence(header), InternalHelpDoc.sequence(usage), InternalHelpDoc.sequence(builtIn.helpDoc), InternalHelpDoc.sequence(self.footer));\n return Console.log(InternalHelpDoc.toAnsiText(helpDoc));\n }\n case \"ShowCompletions\":\n {\n const command = Arr.fromIterable(InternalCommand.getNames(self.command))[0];\n switch (builtIn.shellType) {\n case \"bash\":\n {\n return InternalCommand.getBashCompletions(self.command, command).pipe(Effect.flatMap(completions => Console.log(Arr.join(completions, \"\\n\"))));\n }\n case \"fish\":\n {\n return InternalCommand.getFishCompletions(self.command, command).pipe(Effect.flatMap(completions => Console.log(Arr.join(completions, \"\\n\"))));\n }\n case \"zsh\":\n return InternalCommand.getZshCompletions(self.command, command).pipe(Effect.flatMap(completions => Console.log(Arr.join(completions, \"\\n\"))));\n }\n }\n case \"ShowWizard\":\n {\n const summary = InternalSpan.isEmpty(self.summary) ? InternalSpan.empty : InternalSpan.spans([InternalSpan.space, InternalSpan.text(\"--\"), InternalSpan.space, self.summary]);\n const instructions = InternalHelpDoc.sequence(InternalHelpDoc.p(InternalSpan.spans([InternalSpan.text(\"The wizard mode will assist you with constructing commands for\"), InternalSpan.space, InternalSpan.code(`${self.name} (${self.version})`), InternalSpan.text(\".\")])), InternalHelpDoc.p(\"Please answer all prompts provided by the wizard.\"));\n const description = InternalHelpDoc.descriptionList([[InternalSpan.text(\"Instructions\"), instructions]]);\n const header = InternalHelpDoc.h1(InternalSpan.spans([InternalSpan.code(\"Wizard Mode for CLI Application:\"), InternalSpan.space, InternalSpan.code(self.name), InternalSpan.space, InternalSpan.code(`(${self.version})`), summary]));\n const help = InternalHelpDoc.sequence(header, description);\n const text = InternalHelpDoc.toAnsiText(help);\n const command = Arr.fromIterable(InternalCommand.getNames(self.command))[0];\n const wizardPrefix = getWizardPrefix(builtIn, command, args);\n return Console.log(text).pipe(Effect.zipRight(InternalCommand.wizard(builtIn.command, wizardPrefix, config)), Effect.tap(args => Console.log(InternalHelpDoc.toAnsiText(renderWizardArgs(args)))), Effect.flatMap(args => InternalTogglePrompt.toggle({\n message: \"Would you like to run the command?\",\n initial: true,\n active: \"yes\",\n inactive: \"no\"\n }).pipe(Effect.flatMap(shouldRunCommand => {\n // Use first 2 elements from originalArgs (runtime + script) to preserve paths with spaces\n // This mimics executable.split() behavior but without breaking Windows paths\n const baseArgs = Arr.take(originalArgs, 2);\n const wizardArgs = Arr.drop(args, 1);\n const finalArgs = Arr.appendAll(baseArgs, wizardArgs);\n return shouldRunCommand ? Console.log().pipe(Effect.zipRight(run(self, finalArgs, execute))) : Effect.void;\n }))), Effect.catchAll(e => {\n if (Terminal.isQuitException(e)) {\n const message = InternalHelpDoc.p(InternalSpan.error(\"\\n\\nQuitting wizard mode...\"));\n return Console.log(InternalHelpDoc.toAnsiText(message));\n }\n return Effect.fail(e);\n }));\n }\n case \"ShowVersion\":\n {\n const help = InternalHelpDoc.p(self.version);\n return Console.log(InternalHelpDoc.toAnsiText(help));\n }\n }\n};\nconst prefixCommand = self => {\n let command = self;\n let prefix = Arr.empty();\n while (command !== undefined) {\n switch (command._tag) {\n case \"Standard\":\n {\n prefix = Arr.of(command.name);\n command = undefined;\n break;\n }\n case \"GetUserInput\":\n {\n prefix = Arr.of(command.name);\n command = undefined;\n break;\n }\n case \"Map\":\n {\n command = command.command;\n break;\n }\n case \"Subcommands\":\n {\n command = command.parent;\n break;\n }\n }\n }\n return prefix;\n};\nconst getWizardPrefix = (builtIn, rootCommand, commandLineArgs) => {\n const subcommands = InternalCommand.getSubcommands(builtIn.command);\n const [parentArgs, childArgs] = Arr.span(commandLineArgs, name => !HashMap.has(subcommands, name));\n const args = Arr.matchLeft(childArgs, {\n onEmpty: () => Arr.filter(parentArgs, arg => arg !== \"--wizard\"),\n onNonEmpty: head => Arr.append(parentArgs, head)\n });\n return Arr.appendAll(rootCommand.split(/\\s+/), args);\n};\nconst renderWizardArgs = args => {\n const params = pipe(Arr.filter(args, param => param.length > 0), Arr.join(\" \"));\n const executeMsg = InternalSpan.text(\"You may now execute your command directly with the following options and arguments:\");\n return InternalHelpDoc.blocks([InternalHelpDoc.p(InternalSpan.strong(InternalSpan.code(\"Wizard Mode Complete!\"))), InternalHelpDoc.p(executeMsg), InternalHelpDoc.p(InternalSpan.concat(InternalSpan.text(\" \"), InternalSpan.highlight(params, Color.cyan)))]);\n};\nconst isLogLevelArg = arg => {\n return arg && (arg === \"--log-level\" || arg.startsWith(\"--log-level=\"));\n};\n//# sourceMappingURL=cliApp.js.map","import * as InternalCommand from \"./internal/commandDescriptor.js\";\nimport * as InternalValidationError from \"./internal/validationError.js\";\n/**\n * @since 1.0.0\n * @category symbols\n */\nexport const ValidationErrorTypeId = InternalValidationError.ValidationErrorTypeId;\n/**\n * @since 1.0.0\n * @category refinements\n */\nexport const isValidationError = InternalValidationError.isValidationError;\n/**\n * @since 1.0.0\n * @category refinements\n */\nexport const isCommandMismatch = InternalValidationError.isCommandMismatch;\n/**\n * @since 1.0.0\n * @category refinements\n */\nexport const isCorrectedFlag = InternalValidationError.isCorrectedFlag;\n/**\n * @since 1.0.0\n * @category refinements\n */\nexport const isHelpRequested = InternalValidationError.isHelpRequested;\n/**\n * @since 1.0.0\n * @category refinements\n */\nexport const isInvalidArgument = InternalValidationError.isInvalidArgument;\n/**\n * @since 1.0.0\n * @category refinements\n */\nexport const isInvalidValue = InternalValidationError.isInvalidValue;\n/**\n * @since 1.0.0\n * @category refinements\n */\nexport const isMultipleValuesDetected = InternalValidationError.isMultipleValuesDetected;\n/**\n * @since 1.0.0\n * @category refinements\n */\nexport const isMissingFlag = InternalValidationError.isMissingFlag;\n/**\n * @since 1.0.0\n * @category refinements\n */\nexport const isMissingValue = InternalValidationError.isMissingValue;\n/**\n * @since 1.0.0\n * @category refinements\n */\nexport const isMissingSubcommand = InternalValidationError.isMissingSubcommand;\n/**\n * @since 1.0.0\n * @category refinements\n */\nexport const isNoBuiltInMatch = InternalValidationError.isNoBuiltInMatch;\n/**\n * @since 1.0.0\n * @category refinements\n */\nexport const isUnclusteredFlag = InternalValidationError.isUnclusteredFlag;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const commandMismatch = InternalValidationError.commandMismatch;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const correctedFlag = InternalValidationError.correctedFlag;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const helpRequested = InternalCommand.helpRequestedError;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const invalidArgument = InternalValidationError.invalidArgument;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const invalidValue = InternalValidationError.invalidValue;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const keyValuesDetected = InternalValidationError.multipleValuesDetected;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const missingFlag = InternalValidationError.missingFlag;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const missingValue = InternalValidationError.missingValue;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const missingSubcommand = InternalValidationError.missingSubcommand;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const noBuiltInMatch = InternalValidationError.noBuiltInMatch;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const unclusteredFlag = InternalValidationError.unclusteredFlag;\n//# sourceMappingURL=ValidationError.js.map","import * as Arr from \"effect/Array\";\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Effectable from \"effect/Effectable\";\nimport { dual, identity } from \"effect/Function\";\nimport { globalValue } from \"effect/GlobalValue\";\nimport { pipeArguments } from \"effect/Pipeable\";\nimport * as ValidationError from \"../ValidationError.js\";\nimport * as InternalArgs from \"./args.js\";\nimport * as InternalCliApp from \"./cliApp.js\";\nimport * as InternalDescriptor from \"./commandDescriptor.js\";\nimport * as InternalOptions from \"./options.js\";\nconst CommandSymbolKey = \"@effect/cli/Command\";\n/** @internal */\nexport const TypeId = /*#__PURE__*/Symbol.for(CommandSymbolKey);\nconst parseConfig = config => {\n const args = [];\n let argsIndex = 0;\n const options = [];\n let optionsIndex = 0;\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 (Arr.isArray(value)) {\n return {\n _tag: \"Array\",\n children: Arr.map(value, parseValue)\n };\n } else if (InternalArgs.isArgs(value)) {\n args.push(value);\n return {\n _tag: \"Args\",\n index: argsIndex++\n };\n } else if (InternalOptions.isOptions(value)) {\n options.push(value);\n return {\n _tag: \"Options\",\n index: optionsIndex++\n };\n } else {\n return {\n _tag: \"ParsedConfig\",\n tree: parse(value)\n };\n }\n }\n return {\n args,\n options,\n tree: parse(config)\n };\n};\nconst reconstructConfigTree = (tree, args, options) => {\n const output = {};\n for (const key in tree) {\n output[key] = nodeValue(tree[key]);\n }\n return output;\n function nodeValue(node) {\n if (node._tag === \"Args\") {\n return args[node.index];\n } else if (node._tag === \"Options\") {\n return options[node.index];\n } else if (node._tag === \"Array\") {\n return Arr.map(node.children, nodeValue);\n } else {\n return reconstructConfigTree(node.tree, args, options);\n }\n }\n};\nconst Prototype = {\n ...Effectable.CommitPrototype,\n [TypeId]: TypeId,\n commit() {\n return this.tag;\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\nconst registeredDescriptors = /*#__PURE__*/globalValue(\"@effect/cli/Command/registeredDescriptors\", () => new WeakMap());\nconst getDescriptor = self => registeredDescriptors.get(self.tag) ?? self.descriptor;\nconst makeProto = (descriptor, handler, tag, transform = identity) => {\n const self = Object.create(Prototype);\n self.descriptor = descriptor;\n self.handler = handler;\n self.transform = transform;\n self.tag = tag;\n return self;\n};\nconst makeDerive = (self, options) => {\n const command = Object.create(Prototype);\n command.descriptor = options.descriptor ?? self.descriptor;\n command.handler = options.handler ?? self.handler;\n command.transform = options.transform ? (effect, opts) => options.transform(self.transform(effect, opts), opts) : self.transform;\n command.tag = self.tag;\n return command;\n};\n/** @internal */\nexport const fromDescriptor = /*#__PURE__*/dual(args => InternalDescriptor.isCommand(args[0]), (descriptor, handler) => {\n const self = makeProto(descriptor, handler ?? (_ => Effect.failSync(() => ValidationError.helpRequested(getDescriptor(self)))), Context.GenericTag(`@effect/cli/Command/(${Arr.fromIterable(InternalDescriptor.getNames(descriptor)).join(\"|\")})`));\n return self;\n});\nconst makeDescriptor = (name, config) => {\n const {\n args,\n options,\n tree\n } = parseConfig(config);\n return InternalDescriptor.map(InternalDescriptor.make(name, InternalOptions.all(options), InternalArgs.all(args)), ({\n args,\n options\n }) => reconstructConfigTree(tree, args, options));\n};\n/** @internal */\nexport const make = (name, config = {}, handler) => fromDescriptor(makeDescriptor(name, config), handler);\n/** @internal */\nexport const getHelp = (self, config) => InternalDescriptor.getHelp(self.descriptor, config);\n/** @internal */\nexport const getNames = self => InternalDescriptor.getNames(self.descriptor);\n/** @internal */\nexport const getBashCompletions = (self, programName) => InternalDescriptor.getBashCompletions(self.descriptor, programName);\n/** @internal */\nexport const getFishCompletions = (self, programName) => InternalDescriptor.getFishCompletions(self.descriptor, programName);\n/** @internal */\nexport const getZshCompletions = (self, programName) => InternalDescriptor.getZshCompletions(self.descriptor, programName);\n/** @internal */\nexport const getSubcommands = self => InternalDescriptor.getSubcommands(self.descriptor);\n/** @internal */\nexport const getUsage = self => InternalDescriptor.getUsage(self.descriptor);\nconst mapDescriptor = /*#__PURE__*/dual(2, (self, f) => makeDerive(self, {\n descriptor: f(self.descriptor)\n}));\n/** @internal */\nexport const prompt = (name, prompt, handler) => makeProto(InternalDescriptor.map(InternalDescriptor.prompt(name, prompt), _ => _.value), handler, Context.GenericTag(`@effect/cli/Prompt/${name}`));\n/** @internal */\nexport const withHandler = /*#__PURE__*/dual(2, (self, handler) => makeDerive(self, {\n handler,\n transform: identity\n}));\n/** @internal */\nexport const transformHandler = /*#__PURE__*/dual(2, (self, f) => makeDerive(self, {\n transform: f\n}));\n/** @internal */\nexport const provide = /*#__PURE__*/dual(2, (self, layer) => makeDerive(self, {\n transform: (effect, config) => Effect.provide(effect, typeof layer === \"function\" ? layer(config) : layer)\n}));\n/** @internal */\nexport const provideEffect = /*#__PURE__*/dual(3, (self, tag, effect_) => makeDerive(self, {\n transform: (self, config) => {\n const effect = typeof effect_ === \"function\" ? effect_(config) : effect_;\n return Effect.provideServiceEffect(self, tag, effect);\n }\n}));\n/** @internal */\nexport const provideEffectDiscard = /*#__PURE__*/dual(2, (self, effect_) => makeDerive(self, {\n transform: (self, config) => {\n const effect = typeof effect_ === \"function\" ? effect_(config) : effect_;\n return Effect.zipRight(effect, self);\n }\n}));\n/** @internal */\nexport const provideSync = /*#__PURE__*/dual(3, (self, tag, f) => makeDerive(self, {\n transform: (self, config) => {\n const service = typeof f === \"function\" ? f(config) : f;\n return Effect.provideService(self, tag, service);\n }\n}));\n/** @internal */\nexport const withDescription = /*#__PURE__*/dual(2, (self, help) => mapDescriptor(self, InternalDescriptor.withDescription(help)));\n/** @internal */\nexport const withSubcommands = /*#__PURE__*/dual(2, (self, subcommands) => {\n const command = InternalDescriptor.withSubcommands(self.descriptor, Arr.map(subcommands, _ => [_.tag, _.descriptor]));\n const subcommandMap = Arr.reduce(subcommands, new Map(), (handlers, subcommand) => {\n handlers.set(subcommand.tag, subcommand);\n registeredDescriptors.set(subcommand.tag, subcommand.descriptor);\n return handlers;\n });\n function handler(args) {\n if (args.subcommand._tag === \"Some\") {\n const [tag, value] = args.subcommand.value;\n const subcommand = subcommandMap.get(tag);\n const subcommandEffect = subcommand.transform(subcommand.handler(value), value);\n return Effect.provideService(subcommandEffect, self.tag, args);\n }\n return self.handler(args);\n }\n return makeDerive(self, {\n descriptor: command,\n handler\n });\n});\n/** @internal */\nexport const wizard = /*#__PURE__*/dual(3, (self, prefix, config) => InternalDescriptor.wizard(self.descriptor, prefix, config));\n/** @internal */\nexport const run = /*#__PURE__*/dual(2, (self, config) => {\n const app = InternalCliApp.make({\n ...config,\n command: self.descriptor\n });\n registeredDescriptors.set(self.tag, self.descriptor);\n const handler = args => self.transform(self.handler(args), args);\n return args => InternalCliApp.run(app, args, handler);\n});\n//# sourceMappingURL=command.js.map","import * as Internal from \"./internal/command.js\";\n/**\n * @since 1.0.0\n * @category type ids\n */\nexport const TypeId = Internal.TypeId;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const fromDescriptor = Internal.fromDescriptor;\n/**\n * @since 1.0.0\n * @category accessors\n */\nexport const getHelp = Internal.getHelp;\n/**\n * @since 1.0.0\n * @category accessors\n */\nexport const getNames = Internal.getNames;\n/**\n * @since 1.0.0\n * @category accessors\n */\nexport const getBashCompletions = Internal.getBashCompletions;\n/**\n * @since 1.0.0\n * @category accessors\n */\nexport const getFishCompletions = Internal.getFishCompletions;\n/**\n * @since 1.0.0\n * @category accessors\n */\nexport const getZshCompletions = Internal.getZshCompletions;\n/**\n * @since 1.0.0\n * @category accessors\n */\nexport const getSubcommands = Internal.getSubcommands;\n/**\n * @since 1.0.0\n * @category accessors\n */\nexport const getUsage = Internal.getUsage;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const make = Internal.make;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const prompt = Internal.prompt;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const provide = Internal.provide;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const provideEffect = Internal.provideEffect;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const provideEffectDiscard = Internal.provideEffectDiscard;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const provideSync = Internal.provideSync;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const transformHandler = Internal.transformHandler;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const withDescription = Internal.withDescription;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const withHandler = Internal.withHandler;\n/**\n * @since 1.0.0\n * @category combinators\n */\nexport const withSubcommands = Internal.withSubcommands;\n/**\n * @since 1.0.0\n * @category accessors\n */\nexport const wizard = Internal.wizard;\n/**\n * @since 1.0.0\n * @category conversions\n */\nexport const run = Internal.run;\n//# sourceMappingURL=Command.js.map","/**\n * @since 1.0.0\n */\nimport * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport { dual } from \"effect/Function\";\nimport * as Option from \"effect/Option\";\nimport * as ParseResult from \"effect/ParseResult\";\nimport * as Schema from \"effect/Schema\";\n/**\n * @since 1.0.0\n * @category tags\n */\nexport class Collector extends /*#__PURE__*/Context.Tag(\"@effect/platform/Transferable/Collector\")() {}\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const unsafeMakeCollector = () => {\n let tranferables = [];\n const unsafeAddAll = transfers => {\n // eslint-disable-next-line no-restricted-syntax\n tranferables.push(...transfers);\n };\n const unsafeRead = () => tranferables;\n const unsafeClear = () => {\n const prev = tranferables;\n tranferables = [];\n return prev;\n };\n return Collector.of({\n unsafeAddAll,\n addAll: transferables => Effect.sync(() => unsafeAddAll(transferables)),\n unsafeRead,\n read: Effect.sync(unsafeRead),\n unsafeClear,\n clear: Effect.sync(unsafeClear)\n });\n};\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const makeCollector = /*#__PURE__*/Effect.sync(unsafeMakeCollector);\n/**\n * @since 1.0.0\n * @category accessors\n */\nexport const addAll = tranferables => Effect.flatMap(Effect.serviceOption(Collector), Option.match({\n onNone: () => Effect.void,\n onSome: _ => _.addAll(tranferables)\n}));\n/**\n * @since 1.0.0\n * @category schema\n */\nexport const schema = /*#__PURE__*/dual(2, (self, f) => Schema.transformOrFail(Schema.encodedSchema(self), self, {\n strict: true,\n decode: ParseResult.succeed,\n encode: i => Effect.as(addAll(f(i)), i)\n}));\n/**\n * @since 1.0.0\n * @category schema\n */\nexport const ImageData = /*#__PURE__*/schema(Schema.Any, _ => [_.data.buffer]);\n/**\n * @since 1.0.0\n * @category schema\n */\nexport const MessagePort = /*#__PURE__*/schema(Schema.Any, _ => [_]);\n/**\n * @since 1.0.0\n * @category schema\n */\nexport const Uint8Array = /*#__PURE__*/schema(Schema.Uint8ArrayFromSelf, _ => [_.buffer]);\n//# sourceMappingURL=Transferable.js.map","/** @internal */\nexport const WorkerErrorTypeId = /*#__PURE__*/Symbol.for(\"@effect/platform/WorkerError\");\n//# sourceMappingURL=workerError.js.map","import * as Predicate from \"effect/Predicate\";\nimport * as Schema from \"effect/Schema\";\nimport * as internal from \"./internal/workerError.js\";\n/**\n * @since 1.0.0\n * @category type ids\n */\nexport const WorkerErrorTypeId = internal.WorkerErrorTypeId;\n/**\n * @since 1.0.0\n * @category predicates\n */\nexport const isWorkerError = u => Predicate.hasProperty(u, WorkerErrorTypeId);\n/**\n * @since 1.0.0\n * @category errors\n */\nexport class WorkerError extends /*#__PURE__*/Schema.TaggedError()(\"WorkerError\", {\n reason: /*#__PURE__*/Schema.Literal(\"spawn\", \"decode\", \"send\", \"unknown\", \"encode\"),\n cause: Schema.Defect\n}) {\n /**\n * @since 1.0.0\n */\n [WorkerErrorTypeId] = WorkerErrorTypeId;\n /**\n * @since 1.0.0\n */\n static Cause = /*#__PURE__*/Schema.Cause({\n error: this,\n defect: Schema.Defect\n });\n /**\n * @since 1.0.0\n */\n static encodeCause = /*#__PURE__*/Schema.encodeSync(this.Cause);\n /**\n * @since 1.0.0\n */\n static decodeCause = /*#__PURE__*/Schema.decodeSync(this.Cause);\n /**\n * @since 1.0.0\n */\n get message() {\n switch (this.reason) {\n case \"send\":\n return \"An error occurred calling .postMessage\";\n case \"spawn\":\n return \"An error occurred while spawning a worker\";\n case \"decode\":\n return \"An error occurred during decoding\";\n case \"encode\":\n return \"An error occurred during encoding\";\n case \"unknown\":\n return \"An unexpected error occurred\";\n }\n }\n}\n//# sourceMappingURL=WorkerError.js.map","import * as Channel from \"effect/Channel\";\nimport * as Context from \"effect/Context\";\nimport * as Deferred from \"effect/Deferred\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as FiberRef from \"effect/FiberRef\";\nimport * as FiberSet from \"effect/FiberSet\";\nimport { identity, pipe } from \"effect/Function\";\nimport * as Layer from \"effect/Layer\";\nimport * as Mailbox from \"effect/Mailbox\";\nimport * as Option from \"effect/Option\";\nimport * as Pool from \"effect/Pool\";\nimport * as Runtime from \"effect/Runtime\";\nimport * as Schedule from \"effect/Schedule\";\nimport * as Schema from \"effect/Schema\";\nimport * as Scope from \"effect/Scope\";\nimport * as Stream from \"effect/Stream\";\nimport * as Tracer from \"effect/Tracer\";\nimport * as Transferable from \"../Transferable.js\";\nimport { WorkerError } from \"../WorkerError.js\";\n/** @internal */\nexport const PlatformWorkerTypeId = /*#__PURE__*/Symbol.for(\"@effect/platform/Worker/PlatformWorker\");\n/** @internal */\nexport const PlatformWorker = /*#__PURE__*/Context.GenericTag(\"@effect/platform/Worker/PlatformWorker\");\n/** @internal */\nexport const WorkerManagerTypeId = /*#__PURE__*/Symbol.for(\"@effect/platform/Worker/WorkerManager\");\n/** @internal */\nexport const WorkerManager = /*#__PURE__*/Context.GenericTag(\"@effect/platform/Worker/WorkerManager\");\n/** @internal */\nexport const Spawner = /*#__PURE__*/Context.GenericTag(\"@effect/platform/Worker/Spawner\");\n/** @internal */\nexport const makeManager = /*#__PURE__*/Effect.gen(function* () {\n const platform = yield* PlatformWorker;\n let idCounter = 0;\n return WorkerManager.of({\n [WorkerManagerTypeId]: WorkerManagerTypeId,\n spawn({\n encode,\n initialMessage\n }) {\n return Effect.gen(function* () {\n const id = idCounter++;\n let requestIdCounter = 0;\n const requestMap = new Map();\n const collector = Transferable.unsafeMakeCollector();\n const wrappedEncode = encode ? message => Effect.zipRight(collector.clear, Effect.provideService(encode(message), Transferable.Collector, collector)) : Effect.succeed;\n const readyLatch = yield* Deferred.make();\n const backing = yield* platform.spawn(id);\n yield* backing.run(message => {\n if (message[0] === 0) {\n return Deferred.complete(readyLatch, Effect.void);\n }\n return handleMessage(message[1]);\n }).pipe(Effect.onError(cause => Effect.forEach(requestMap.values(), mailbox => Deferred.DeferredTypeId in mailbox ? Deferred.failCause(mailbox, cause) : mailbox.failCause(cause))), Effect.tapErrorCause(Effect.logWarning), Effect.retry(Schedule.spaced(1000)), Effect.annotateLogs({\n package: \"@effect/platform\",\n module: \"Worker\"\n }), Effect.interruptible, Effect.forkScoped);\n yield* Effect.addFinalizer(() => Effect.zipRight(Effect.forEach(requestMap.values(), mailbox => Deferred.DeferredTypeId in mailbox ? Deferred.interrupt(mailbox) : mailbox.end, {\n discard: true\n }), Effect.sync(() => requestMap.clear())));\n const handleMessage = response => Effect.suspend(() => {\n const mailbox = requestMap.get(response[0]);\n if (!mailbox) return Effect.void;\n switch (response[1]) {\n // data\n case 0:\n {\n return Deferred.DeferredTypeId in mailbox ? Deferred.succeed(mailbox, response[2][0]) : mailbox.offerAll(response[2]);\n }\n // end\n case 1:\n {\n if (response.length === 2) {\n return Deferred.DeferredTypeId in mailbox ? Deferred.interrupt(mailbox) : mailbox.end;\n }\n return Deferred.DeferredTypeId in mailbox ? Deferred.succeed(mailbox, response[2][0]) : Effect.zipRight(mailbox.offerAll(response[2]), mailbox.end);\n }\n // error / defect\n case 2:\n case 3:\n {\n if (response[1] === 2) {\n return Deferred.DeferredTypeId in mailbox ? Deferred.fail(mailbox, response[2]) : mailbox.fail(response[2]);\n }\n const cause = WorkerError.decodeCause(response[2]);\n return Deferred.DeferredTypeId in mailbox ? Deferred.failCause(mailbox, cause) : mailbox.failCause(cause);\n }\n }\n });\n const executeAcquire = (request, makeMailbox) => Effect.withFiberRuntime(fiber => {\n const context = fiber.getFiberRef(FiberRef.currentContext);\n const span = Context.getOption(context, Tracer.ParentSpan).pipe(Option.filter(span => span._tag === \"Span\"));\n const id = requestIdCounter++;\n return makeMailbox.pipe(Effect.tap(mailbox => {\n requestMap.set(id, mailbox);\n return wrappedEncode(request).pipe(Effect.tap(payload => backing.send([id, 0, payload, span._tag === \"Some\" ? [span.value.traceId, span.value.spanId, span.value.sampled] : undefined], collector.unsafeRead())), Effect.catchAllCause(cause => Mailbox.isMailbox(mailbox) ? mailbox.failCause(cause) : Deferred.failCause(mailbox, cause)));\n }), Effect.map(mailbox => ({\n id,\n mailbox\n })));\n });\n const executeRelease = ({\n id\n }, exit) => {\n const release = Effect.sync(() => requestMap.delete(id));\n return Exit.isFailure(exit) ? Effect.zipRight(Effect.orDie(backing.send([id, 1])), release) : release;\n };\n const execute = request => Stream.fromChannel(Channel.acquireUseRelease(executeAcquire(request, Mailbox.make()), ({\n mailbox\n }) => Mailbox.toChannel(mailbox), executeRelease));\n const executeEffect = request => Effect.acquireUseRelease(executeAcquire(request, Deferred.make()), ({\n mailbox\n }) => Deferred.await(mailbox), executeRelease);\n yield* Deferred.await(readyLatch);\n if (initialMessage) {\n yield* Effect.sync(initialMessage).pipe(Effect.flatMap(executeEffect), Effect.mapError(cause => new WorkerError({\n reason: \"spawn\",\n cause\n })));\n }\n return {\n id,\n execute,\n executeEffect\n };\n });\n }\n });\n});\n/** @internal */\nexport const layerManager = /*#__PURE__*/Layer.effect(WorkerManager, makeManager);\n/** @internal */\nexport const makePool = options => Effect.gen(function* () {\n const manager = yield* WorkerManager;\n const workers = new Set();\n const acquire = pipe(manager.spawn(options), Effect.tap(worker => Effect.acquireRelease(Effect.sync(() => workers.add(worker)), () => Effect.sync(() => workers.delete(worker)))), options.onCreate ? Effect.tap(options.onCreate) : identity);\n const backing = \"minSize\" in options ? yield* Pool.makeWithTTL({\n acquire,\n min: options.minSize,\n max: options.maxSize,\n concurrency: options.concurrency,\n targetUtilization: options.targetUtilization,\n timeToLive: options.timeToLive\n }) : yield* Pool.make({\n acquire,\n size: options.size,\n concurrency: options.concurrency,\n targetUtilization: options.targetUtilization\n });\n const pool = {\n backing,\n broadcast: message => Effect.forEach(workers, worker => worker.executeEffect(message), {\n concurrency: \"unbounded\",\n discard: true\n }),\n execute: message => Stream.unwrapScoped(Effect.map(backing.get, worker => worker.execute(message))),\n executeEffect: message => Effect.scoped(Effect.flatMap(backing.get, worker => worker.executeEffect(message)))\n };\n // report any spawn errors\n yield* Effect.scoped(backing.get);\n return pool;\n});\n/** @internal */\nexport const makePoolLayer = (tag, options) => Layer.scoped(tag, makePool(options));\n/** @internal */\nexport const makeSerialized = options => Effect.gen(function* () {\n const manager = yield* WorkerManager;\n const backing = yield* manager.spawn({\n ...options,\n encode(message) {\n return Effect.mapError(Schema.serialize(message), cause => new WorkerError({\n reason: \"encode\",\n cause\n }));\n }\n });\n const execute = message => {\n const parseSuccess = Schema.decode(Schema.successSchema(message));\n const parseFailure = Schema.decode(Schema.failureSchema(message));\n return pipe(backing.execute(message), Stream.catchAll(error => Effect.flatMap(parseFailure(error), Effect.fail)), Stream.mapEffect(parseSuccess));\n };\n const executeEffect = message => {\n const parseSuccess = Schema.decode(Schema.successSchema(message));\n const parseFailure = Schema.decode(Schema.failureSchema(message));\n return Effect.matchEffect(backing.executeEffect(message), {\n onFailure: error => Effect.flatMap(parseFailure(error), Effect.fail),\n onSuccess: parseSuccess\n });\n };\n return identity({\n id: backing.id,\n execute: execute,\n executeEffect: executeEffect\n });\n});\n/** @internal */\nexport const makePoolSerialized = options => Effect.gen(function* () {\n const manager = yield* WorkerManager;\n const workers = new Set();\n const acquire = pipe(makeSerialized(options), Effect.tap(worker => Effect.sync(() => workers.add(worker))), Effect.tap(worker => Effect.addFinalizer(() => Effect.sync(() => workers.delete(worker)))), options.onCreate ? Effect.tap(options.onCreate) : identity, Effect.provideService(WorkerManager, manager));\n const backing = yield* \"timeToLive\" in options ? Pool.makeWithTTL({\n acquire,\n min: options.minSize,\n max: options.maxSize,\n concurrency: options.concurrency,\n targetUtilization: options.targetUtilization,\n timeToLive: options.timeToLive\n }) : Pool.make({\n acquire,\n size: options.size,\n concurrency: options.concurrency,\n targetUtilization: options.targetUtilization\n });\n const pool = {\n backing,\n broadcast: message => Effect.forEach(workers, worker => worker.executeEffect(message), {\n concurrency: \"unbounded\",\n discard: true\n }),\n execute: message => Stream.unwrapScoped(Effect.map(backing.get, worker => worker.execute(message))),\n executeEffect: message => Effect.scoped(Effect.flatMap(backing.get, worker => worker.executeEffect(message)))\n };\n // report any spawn errors\n yield* Effect.scoped(backing.get);\n return pool;\n});\n/** @internal */\nexport const makePoolSerializedLayer = (tag, options) => Layer.scoped(tag, makePoolSerialized(options));\n/** @internal */\nexport const layerSpawner = spawner => Layer.succeed(Spawner, spawner);\n/** @internal */\nexport const makePlatform = () => options => PlatformWorker.of({\n [PlatformWorkerTypeId]: PlatformWorkerTypeId,\n spawn(id) {\n return Effect.gen(function* () {\n const spawn = yield* Spawner;\n let currentPort;\n const buffer = [];\n const run = handler => Effect.uninterruptibleMask(restore => Effect.gen(function* () {\n const scope = yield* Effect.scope;\n const port = yield* options.setup({\n worker: spawn(id),\n scope\n });\n currentPort = port;\n yield* Scope.addFinalizer(scope, Effect.sync(() => {\n currentPort = undefined;\n }));\n const runtime = (yield* Effect.runtime()).pipe(Runtime.updateContext(Context.omit(Scope.Scope)));\n const fiberSet = yield* FiberSet.make();\n const runFork = Runtime.runFork(runtime);\n yield* options.listen({\n port,\n scope,\n emit(data) {\n FiberSet.unsafeAdd(fiberSet, runFork(handler(data)));\n },\n deferred: fiberSet.deferred\n });\n if (buffer.length > 0) {\n for (const [message, transfers] of buffer) {\n port.postMessage([0, message], transfers);\n }\n buffer.length = 0;\n }\n return yield* restore(FiberSet.join(fiberSet));\n }).pipe(Effect.scoped));\n const send = (message, transfers) => Effect.try({\n try: () => {\n if (currentPort === undefined) {\n buffer.push([message, transfers]);\n } else {\n currentPort.postMessage([0, message], transfers);\n }\n },\n catch: cause => new WorkerError({\n reason: \"send\",\n cause\n })\n });\n return {\n run,\n send\n };\n });\n }\n});\n//# sourceMappingURL=worker.js.map","import * as internal from \"./internal/worker.js\";\n/**\n * @since 1.0.0\n * @category type ids\n */\nexport const PlatformWorkerTypeId = internal.PlatformWorkerTypeId;\n/**\n * @since 1.0.0\n */\nexport const makePlatform = internal.makePlatform;\n/**\n * @since 1.0.0\n * @category tags\n */\nexport const PlatformWorker = internal.PlatformWorker;\n/**\n * @since 1.0.0\n * @category tags\n */\nexport const Spawner = internal.Spawner;\n/**\n * @since 1.0.0\n * @category type ids\n */\nexport const WorkerManagerTypeId = internal.WorkerManagerTypeId;\n/**\n * @since 1.0.0\n * @category tags\n */\nexport const WorkerManager = internal.WorkerManager;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const makeManager = internal.makeManager;\n/**\n * @since 1.0.0\n * @category layers\n */\nexport const layerManager = internal.layerManager;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const makePool = internal.makePool;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const makePoolLayer = internal.makePoolLayer;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const makeSerialized = internal.makeSerialized;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const makePoolSerialized = internal.makePoolSerialized;\n/**\n * @since 1.0.0\n * @category layers\n */\nexport const makePoolSerializedLayer = internal.makePoolSerializedLayer;\n/**\n * @since 1.0.0\n * @category layers\n */\nexport const layerSpawner = internal.layerSpawner;\n//# sourceMappingURL=Worker.js.map","import * as Effect from \"effect/Effect\";\n/** @internal */\nexport const effectify = (fn, onError, onSyncError) => (...args) => Effect.async(resume => {\n try {\n fn(...args, (err, result) => {\n if (err) {\n resume(Effect.fail(onError ? onError(err, args) : err));\n } else {\n resume(Effect.succeed(result));\n }\n });\n } catch (err) {\n resume(onSyncError ? Effect.fail(onSyncError(err, args)) : Effect.die(err));\n }\n});\n//# sourceMappingURL=effectify.js.map","import * as internal from \"./internal/effectify.js\";\n/**\n * @since 1.0.0\n */\nexport const effectify = internal.effectify;\n//# sourceMappingURL=Effectify.js.map","import { SystemError } from \"@effect/platform/Error\";\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 new SystemError({\n reason,\n module,\n method,\n pathOrDescriptor: path,\n syscall: err.syscall,\n description: err.message,\n cause: err\n });\n};\n//# sourceMappingURL=error.js.map","import { effectify } from \"@effect/platform/Effectify\";\nimport * as Error from \"@effect/platform/Error\";\nimport * as FileSystem from \"@effect/platform/FileSystem\";\nimport * as Effect from \"effect/Effect\";\nimport { pipe } from \"effect/Function\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\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 \"./error.js\";\nconst handleBadArgument = method => cause => new Error.BadArgument({\n module: \"FileSystem\",\n method,\n cause\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// == 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 fd;\n append;\n [FileSystem.FileTypeId];\n semaphore = /*#__PURE__*/Effect.unsafeMakeSemaphore(1);\n position = 0n;\n constructor(fd, append) {\n this.fd = fd;\n this.append = append;\n this[FileSystem.FileTypeId] = FileSystem.FileTypeId;\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 this.semaphore.withPermits(1)(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 this.semaphore.withPermits(1)(Effect.map(Effect.suspend(() => nodeRead(this.fd, {\n buffer,\n position: this.position\n })), bytesRead => {\n const sizeRead = FileSystem.Size(bytesRead);\n this.position = this.position + sizeRead;\n return sizeRead;\n }));\n }\n readAlloc(size) {\n const sizeNumber = Number(size);\n return this.semaphore.withPermits(1)(Effect.flatMap(Effect.sync(() => Buffer.allocUnsafeSlow(sizeNumber)), buffer => Effect.map(nodeReadAlloc(this.fd, {\n buffer,\n position: this.position\n }), bytesRead => {\n if (bytesRead === 0) {\n return Option.none();\n }\n this.position = this.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 truncate(length) {\n return this.semaphore.withPermits(1)(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 this.semaphore.withPermits(1)(Effect.map(Effect.suspend(() => nodeWrite(this.fd, buffer, undefined, undefined, this.append ? undefined : Number(this.position))), bytesWritten => {\n const sizeWritten = FileSystem.Size(bytesWritten);\n if (!this.append) {\n this.position = this.position + sizeWritten;\n }\n return sizeWritten;\n }));\n }\n writeAllChunk(buffer) {\n return Effect.flatMap(Effect.suspend(() => nodeWriteAll(this.fd, buffer, undefined, undefined, this.append ? undefined : Number(this.position))), bytesWritten => {\n if (bytesWritten === 0) {\n return Effect.fail(new Error.SystemError({\n module: \"FileSystem\",\n method: \"writeAll\",\n reason: \"WriteZero\",\n pathOrDescriptor: this.fd,\n description: \"write returned 0 bytes written\"\n }));\n }\n if (!this.append) {\n this.position = this.position + BigInt(bytesWritten);\n }\n return bytesWritten < buffer.length ? this.writeAllChunk(buffer.subarray(bytesWritten)) : Effect.void;\n });\n }\n writeAll(buffer) {\n return this.semaphore.withPermits(1)(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 const open = openFactory(method);\n const randomHexString = bytes => Effect.sync(() => Crypto.randomBytes(bytes).toString(\"hex\"));\n return options => pipe(Effect.zip(makeDirectory(options), randomHexString(6)), Effect.map(([directory, random]) => Path.join(directory, random + (options?.suffix ?? \"\"))), Effect.tap(path => Effect.scoped(open(path, {\n flag: \"w+\"\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.async((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.fromNullable(stat.mtime),\n atime: Option.fromNullable(stat.atime),\n birthtime: Option.fromNullable(stat.birthtime),\n dev: stat.dev,\n rdev: Option.fromNullable(stat.rdev),\n ino: Option.fromNullable(stat.ino),\n mode: stat.mode,\n nlink: Option.fromNullable(stat.nlink),\n uid: Option.fromNullable(stat.uid),\n gid: Option.fromNullable(stat.gid),\n size: FileSystem.Size(stat.size),\n blksize: Option.map(Option.fromNullable(stat.blksize), FileSystem.Size),\n blocks: Option.fromNullable(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, options) => Stream.asyncScoped(emit => Effect.acquireRelease(Effect.sync(() => {\n const watcher = NFS.watch(path, {\n recursive: options?.recursive\n }, (event, path) => {\n if (!path) return;\n switch (event) {\n case \"rename\":\n {\n emit.fromEffect(Effect.matchEffect(stat(path), {\n onSuccess: _ => Effect.succeed(FileSystem.WatchEventCreate({\n path\n })),\n onFailure: err => err._tag === \"SystemError\" && err.reason === \"NotFound\" ? Effect.succeed(FileSystem.WatchEventRemove({\n path\n })) : Effect.fail(err)\n }));\n return;\n }\n case \"change\":\n {\n emit.single(FileSystem.WatchEventUpdate({\n path\n }));\n return;\n }\n }\n });\n watcher.on(\"error\", error => {\n emit.fail(new Error.SystemError({\n module: \"FileSystem\",\n reason: \"Unknown\",\n method: \"watch\",\n pathOrDescriptor: path,\n cause: error\n }));\n });\n watcher.on(\"close\", () => {\n emit.end();\n });\n return watcher;\n}), watcher => Effect.sync(() => watcher.close())));\nconst watch = (backend, path, options) => stat(path).pipe(Effect.map(stat => backend.pipe(Option.flatMap(_ => _.register(path, stat, options)), Option.getOrElse(() => watchNode(path, options)))), Stream.unwrap);\n// == writeFile\nconst writeFile = (path, data, options) => Effect.async((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 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, options) {\n return watch(backend, path, options);\n },\n writeFile\n}));\n/** @internal */\nexport const layer = /*#__PURE__*/Layer.effect(FileSystem.FileSystem, makeFileSystem);\n//# sourceMappingURL=fileSystem.js.map","/**\n * @since 1.0.0\n */\nimport * as internal from \"./internal/fileSystem.js\";\n/**\n * @since 1.0.0\n * @category layer\n */\nexport const layer = internal.layer;\n//# sourceMappingURL=NodeFileSystem.js.map","import { SystemError } from \"@effect/platform/Error\";\nimport * as Cause from \"effect/Cause\";\nimport * as Channel from \"effect/Channel\";\nimport * as Chunk from \"effect/Chunk\";\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 MutableRef from \"effect/MutableRef\";\nimport * as Runtime from \"effect/Runtime\";\nimport * as Stream from \"effect/Stream\";\nimport { Readable } from \"node:stream\";\n/** @internal */\nexport const fromReadable = (evaluate, onError, options) => Stream.fromChannel(fromReadableChannel(evaluate, onError, options));\n/** @internal */\nexport const toString = (readable, options) => {\n const maxBytesNumber = options.maxBytes ? Number(options.maxBytes) : undefined;\n return Effect.acquireUseRelease(Effect.sync(() => {\n const stream = readable();\n stream.setEncoding(options.encoding ?? \"utf8\");\n return stream;\n }), stream => Effect.async(resume => {\n let string = \"\";\n let bytes = 0;\n stream.once(\"error\", err => {\n resume(Effect.fail(options.onFailure(err)));\n });\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(options.onFailure(new Error(\"maxBytes exceeded\"))));\n }\n });\n }), stream => Effect.sync(() => {\n if (\"closed\" in stream && !stream.closed) {\n stream.destroy();\n }\n }));\n};\n/** @internal */\nexport const toUint8Array = (readable, options) => {\n const maxBytesNumber = options.maxBytes ? Number(options.maxBytes) : undefined;\n return Effect.acquireUseRelease(Effect.sync(readable), stream => Effect.async(resume => {\n let buffer = Buffer.alloc(0);\n let bytes = 0;\n stream.once(\"error\", err => {\n resume(Effect.fail(options.onFailure(err)));\n });\n stream.once(\"end\", () => {\n resume(Effect.succeed(buffer));\n });\n stream.on(\"data\", chunk => {\n buffer = Buffer.concat([buffer, chunk]);\n bytes += chunk.length;\n if (maxBytesNumber && bytes > maxBytesNumber) {\n resume(Effect.fail(options.onFailure(new Error(\"maxBytes exceeded\"))));\n }\n });\n }), stream => Effect.sync(() => {\n if (\"closed\" in stream && !stream.closed) {\n stream.destroy();\n }\n }));\n};\n/** @internal */\nexport const fromDuplex = (evaluate, onError, options) => Channel.suspend(() => {\n const duplex = evaluate();\n if (!duplex.readable) {\n return Channel.void;\n }\n const exit = MutableRef.make(undefined);\n return Channel.embedInput(unsafeReadableRead(duplex, onError, exit, options), writeInput(duplex, cause => Effect.sync(() => MutableRef.set(exit, Exit.failCause(cause))), options));\n});\n/** @internal */\nexport const pipeThroughDuplex = /*#__PURE__*/dual(args => Stream.StreamTypeId in args[0], (self, duplex, onError, options) => Stream.pipeThroughChannelOrFail(self, fromDuplex(duplex, onError, options)));\n/** @internal */\nexport const pipeThroughSimple = /*#__PURE__*/dual(2, (self, duplex) => Stream.pipeThroughChannelOrFail(self, fromDuplex(duplex, cause => new SystemError({\n module: \"Stream\",\n method: \"pipeThroughSimple\",\n reason: \"Unknown\",\n cause\n}))));\n/** @internal */\nexport const fromReadableChannel = (evaluate, onError, options) => Channel.suspend(() => unsafeReadableRead(evaluate(), onError, MutableRef.make(undefined), options));\n/** @internal */\nexport const writeInput = (writable, onFailure, {\n encoding,\n endOnDone = true\n} = {}, onDone = Effect.void) => {\n const write = writeEffect(writable, encoding);\n const close = endOnDone ? Effect.async(resume => {\n if (\"closed\" in writable && writable.closed) {\n resume(Effect.void);\n } else {\n writable.once(\"finish\", () => resume(Effect.void));\n writable.end();\n }\n }) : Effect.void;\n return {\n awaitRead: () => Effect.void,\n emit: write,\n error: cause => Effect.zipRight(close, onFailure(cause)),\n done: _ => Effect.zipRight(close, onDone)\n };\n};\n/** @internal */\nexport const writeEffect = (writable, encoding) => chunk => chunk.length === 0 ? Effect.void : Effect.async(resume => {\n const iterator = chunk[Symbol.iterator]();\n let next = iterator.next();\n function loop() {\n const item = next;\n next = iterator.next();\n const success = writable.write(item.value, encoding);\n if (next.done) {\n resume(Effect.void);\n } else if (success) {\n loop();\n } else {\n writable.once(\"drain\", loop);\n }\n }\n loop();\n});\nconst unsafeReadableRead = (readable, onError, exit, options) => {\n if (!readable.readable) {\n return Channel.void;\n }\n const latch = Effect.unsafeMakeLatch(false);\n function onReadable() {\n latch.unsafeOpen();\n }\n function onErr(err) {\n exit.current = Exit.fail(onError(err));\n latch.unsafeOpen();\n }\n function onEnd() {\n exit.current = Exit.void;\n latch.unsafeOpen();\n }\n readable.on(\"readable\", onReadable);\n readable.on(\"error\", onErr);\n readable.on(\"end\", onEnd);\n const chunkSize = options?.chunkSize ? Number(options.chunkSize) : undefined;\n const read = Channel.suspend(function loop() {\n let item = readable.read(chunkSize);\n if (item === null) {\n if (exit.current) {\n return Channel.fromEffect(exit.current);\n }\n latch.unsafeClose();\n return Channel.flatMap(latch.await, loop);\n }\n const arr = [item];\n while (true) {\n item = readable.read(chunkSize);\n if (item === null) {\n return Channel.flatMap(Channel.write(Chunk.unsafeFromArray(arr)), loop);\n }\n arr.push(item);\n }\n });\n return Channel.ensuring(read, Effect.sync(() => {\n readable.off(\"readable\", onReadable);\n readable.off(\"error\", onErr);\n readable.off(\"end\", onEnd);\n if (options?.closeOnDone !== false && \"closed\" in readable && !readable.closed) {\n readable.destroy();\n }\n }));\n};\nclass StreamAdapter extends Readable {\n readLatch;\n fiber = undefined;\n constructor(runtime, stream) {\n super({});\n this.readLatch = Effect.unsafeMakeLatch(false);\n this.fiber = Runtime.runFork(runtime)(this.readLatch.whenOpen(Stream.runForEachChunk(stream, chunk => this.readLatch.whenOpen(Effect.sync(() => {\n if (chunk.length === 0) return;\n this.readLatch.unsafeClose();\n for (const item of chunk) {\n if (typeof item === \"string\") {\n this.push(item, \"utf8\");\n } else {\n this.push(item);\n }\n }\n })))));\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.unsafeOpen();\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}\n/** @internal */\nexport const toReadable = stream => Effect.map(Effect.runtime(), runtime => new StreamAdapter(runtime, stream));\n/** @internal */\nexport const toReadableNever = stream => new StreamAdapter(Runtime.defaultRuntime, stream);\n//# sourceMappingURL=stream.js.map","import * as Channel from \"effect/Channel\";\nimport * as Deferred from \"effect/Deferred\";\nimport * as Effect from \"effect/Effect\";\nimport * as Sink from \"effect/Sink\";\nimport { writeInput } from \"./stream.js\";\n/** @internal */\nexport const fromWritable = (evaluate, onError, options) => Sink.fromChannel(fromWritableChannel(evaluate, onError, options));\n/** @internal */\nexport const fromWritableChannel = (writable, onError, options) => Channel.flatMap(Effect.zip(Effect.sync(() => writable()), Deferred.make()), ([writable, deferred]) => Channel.embedInput(writableOutput(writable, deferred, onError), writeInput(writable, cause => Deferred.failCause(deferred, cause), options, Deferred.complete(deferred, Effect.void))));\nconst writableOutput = (writable, deferred, onError) => Effect.suspend(() => {\n function handleError(err) {\n Deferred.unsafeDone(deferred, Effect.fail(onError(err)));\n }\n writable.on(\"error\", handleError);\n return Effect.ensuring(Deferred.await(deferred), Effect.sync(() => {\n writable.removeListener(\"error\", handleError);\n }));\n});\n//# sourceMappingURL=sink.js.map","import * as Brand from \"effect/Brand\";\nimport * as Chunk from \"effect/Chunk\";\nimport { GenericTag } from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport { pipe } from \"effect/Function\";\nimport * as Sink from \"effect/Sink\";\nimport * as Stream from \"effect/Stream\";\n/** @internal */\nexport const TypeId = /*#__PURE__*/Symbol.for(\"@effect/platform/CommandExecutor\");\n/** @internal */\nexport const ProcessTypeId = /*#__PURE__*/Symbol.for(\"@effect/platform/Process\");\n/** @internal */\nexport const ExitCode = /*#__PURE__*/Brand.nominal();\n/** @internal */\nexport const ProcessId = /*#__PURE__*/Brand.nominal();\n/** @internal */\nexport const CommandExecutor = /*#__PURE__*/GenericTag(\"@effect/platform/CommandExecutor\");\n/** @internal */\nexport const makeExecutor = start => {\n const stream = command => Stream.unwrapScoped(Effect.map(start(command), process => process.stdout));\n const streamLines = (command, encoding) => {\n const decoder = new TextDecoder(encoding);\n return Stream.splitLines(Stream.mapChunks(stream(command), Chunk.map(bytes => decoder.decode(bytes))));\n };\n return {\n [TypeId]: TypeId,\n start,\n exitCode: command => Effect.scoped(Effect.flatMap(start(command), process => process.exitCode)),\n stream,\n string: (command, encoding = \"utf-8\") => {\n const decoder = new TextDecoder(encoding);\n return pipe(start(command), Effect.flatMap(process => Stream.run(process.stdout, collectUint8Array)), Effect.map(bytes => decoder.decode(bytes)), Effect.scoped);\n },\n lines: (command, encoding = \"utf-8\") => {\n return pipe(streamLines(command, encoding), Stream.runCollect, Effect.map(Chunk.toArray));\n },\n streamLines\n };\n};\nconst collectUint8Array = /*#__PURE__*/Sink.foldLeftChunks(/*#__PURE__*/new Uint8Array(), (bytes, chunk) => Chunk.reduce(chunk, bytes, (acc, curr) => {\n const newArray = new Uint8Array(acc.length + curr.length);\n newArray.set(acc);\n newArray.set(curr, acc.length);\n return newArray;\n}));\n//# sourceMappingURL=commandExecutor.js.map","import * as Chunk from \"effect/Chunk\";\nimport * as Effect from \"effect/Effect\";\nimport { dual } from \"effect/Function\";\nimport * as HashMap from \"effect/HashMap\";\nimport * as Inspectable from \"effect/Inspectable\";\nimport * as Option from \"effect/Option\";\nimport { pipeArguments } from \"effect/Pipeable\";\nimport * as Stream from \"effect/Stream\";\nimport * as commandExecutor from \"./commandExecutor.js\";\n/** @internal */\nexport const CommandTypeId = /*#__PURE__*/Symbol.for(\"@effect/platform/Command\");\n/** @internal */\nexport const isCommand = u => typeof u === \"object\" && u != null && CommandTypeId in u;\n/** @internal */\nexport const env = /*#__PURE__*/dual(args => isCommand(args[0]), (self, environment, options) => {\n switch (self._tag) {\n case \"StandardCommand\":\n {\n return makeStandard({\n ...self,\n extendEnv: options?.extendEnv ?? self.extendEnv,\n env: HashMap.union(self.env, HashMap.fromIterable(Object.entries(environment).filter(([, value]) => value !== undefined)))\n });\n }\n case \"PipedCommand\":\n {\n return pipeTo(env(self.left, environment, options), env(self.right, environment, options));\n }\n }\n});\n/** @internal */\nexport const exitCode = self => Effect.flatMap(commandExecutor.CommandExecutor, executor => executor.exitCode(self));\n/** @internal */\nexport const feed = /*#__PURE__*/dual(2, (self, input) => stdin(self, Stream.fromChunk(Chunk.of(new TextEncoder().encode(input)))));\n/** @internal */\nexport const flatten = self => Array.from(flattenLoop(self));\n/** @internal */\nconst flattenLoop = self => {\n switch (self._tag) {\n case \"StandardCommand\":\n {\n return Chunk.of(self);\n }\n case \"PipedCommand\":\n {\n return Chunk.appendAll(flattenLoop(self.left), flattenLoop(self.right));\n }\n }\n};\n/** @internal */\nexport const runInShell = /*#__PURE__*/dual(2, (self, shell) => {\n switch (self._tag) {\n case \"StandardCommand\":\n {\n return makeStandard({\n ...self,\n shell\n });\n }\n case \"PipedCommand\":\n {\n return pipeTo(runInShell(self.left, shell), runInShell(self.right, shell));\n }\n }\n});\n/** @internal */\nexport const lines = (command, encoding = \"utf-8\") => Effect.flatMap(commandExecutor.CommandExecutor, executor => executor.lines(command, encoding));\nconst Proto = {\n [CommandTypeId]: CommandTypeId,\n pipe() {\n return pipeArguments(this, arguments);\n },\n ...Inspectable.BaseProto\n};\nconst StandardProto = {\n ...Proto,\n _tag: \"StandardCommand\",\n toJSON() {\n return {\n _id: \"@effect/platform/Command\",\n _tag: this._tag,\n command: this.command,\n args: this.args,\n env: Object.fromEntries(this.env),\n extendEnv: this.extendEnv,\n cwd: this.cwd.toJSON(),\n shell: this.shell,\n gid: this.gid.toJSON(),\n uid: this.uid.toJSON()\n };\n }\n};\nconst makeStandard = options => Object.assign(Object.create(StandardProto), options);\nconst PipedProto = {\n ...Proto,\n _tag: \"PipedCommand\",\n toJSON() {\n return {\n _id: \"@effect/platform/Command\",\n _tag: this._tag,\n left: this.left.toJSON(),\n right: this.right.toJSON()\n };\n }\n};\nconst makePiped = options => Object.assign(Object.create(PipedProto), options);\n/** @internal */\nexport const make = (command, ...args) => makeStandard({\n command,\n args,\n env: HashMap.empty(),\n extendEnv: true,\n cwd: Option.none(),\n shell: false,\n stdin: \"pipe\",\n stdout: \"pipe\",\n stderr: \"pipe\",\n gid: Option.none(),\n uid: Option.none()\n});\n/** @internal */\nexport const pipeTo = /*#__PURE__*/dual(2, (self, into) => makePiped({\n left: self,\n right: into\n}));\n/** @internal */\nexport const stderr = /*#__PURE__*/dual(2, (self, output) => {\n switch (self._tag) {\n case \"StandardCommand\":\n {\n return makeStandard({\n ...self,\n stderr: output\n });\n }\n // For piped commands it only makes sense to provide `stderr` for the\n // right-most command as the rest will be piped in.\n case \"PipedCommand\":\n {\n return makePiped({\n ...self,\n right: stderr(self.right, output)\n });\n }\n }\n});\n/** @internal */\nexport const stdin = /*#__PURE__*/dual(2, (self, input) => {\n switch (self._tag) {\n case \"StandardCommand\":\n {\n return makeStandard({\n ...self,\n stdin: input\n });\n }\n // For piped commands it only makes sense to provide `stdin` for the\n // left-most command as the rest will be piped in.\n case \"PipedCommand\":\n {\n return makePiped({\n ...self,\n left: stdin(self.left, input)\n });\n }\n }\n});\n/** @internal */\nexport const stdout = /*#__PURE__*/dual(2, (self, output) => {\n switch (self._tag) {\n case \"StandardCommand\":\n {\n return makeStandard({\n ...self,\n stdout: output\n });\n }\n // For piped commands it only makes sense to provide `stderr` for the\n // right-most command as the rest will be piped in.\n case \"PipedCommand\":\n {\n return makePiped({\n ...self,\n right: stdout(self.right, output)\n });\n }\n }\n});\n/** @internal */\nexport const start = command => Effect.flatMap(commandExecutor.CommandExecutor, executor => executor.start(command));\n/** @internal */\nexport const stream = command => Stream.flatMap(commandExecutor.CommandExecutor, executor => executor.stream(command));\n/** @internal */\nexport const streamLines = (command, encoding) => Stream.flatMap(commandExecutor.CommandExecutor, executor => executor.streamLines(command, encoding));\n/** @internal */\nexport const string = /*#__PURE__*/dual(args => isCommand(args[0]), (command, encoding) => Effect.flatMap(commandExecutor.CommandExecutor, executor => executor.string(command, encoding)));\n/** @internal */\nexport const workingDirectory = /*#__PURE__*/dual(2, (self, cwd) => {\n switch (self._tag) {\n case \"StandardCommand\":\n {\n return makeStandard({\n ...self,\n cwd: Option.some(cwd)\n });\n }\n case \"PipedCommand\":\n {\n return pipeTo(workingDirectory(self.left, cwd), workingDirectory(self.right, cwd));\n }\n }\n});\n//# sourceMappingURL=command.js.map","import * as internal from \"./internal/command.js\";\n/**\n * @since 1.0.0\n */\nexport const CommandTypeId = internal.CommandTypeId;\n/**\n * Returns `true` if the specified value is a `Command`, otherwise returns\n * `false`.\n *\n * @since 1.0.0\n * @category refinements\n */\nexport const isCommand = internal.isCommand;\n/**\n * Specify the environment variables that will be used when running this command.\n *\n * By default, the configured variables extend the parent process environment.\n * Set `extendEnv` to `false` to use only the configured variables.\n *\n * @since 1.0.0\n * @category combinators\n */\nexport const env = internal.env;\n/**\n * Returns the exit code of the command after the process has completed\n * execution.\n *\n * @since 1.0.0\n * @category execution\n */\nexport const exitCode = internal.exitCode;\n/**\n * Feed a string to standard input (default encoding of UTF-8).\n *\n * @since 1.0.0\n * @category combinators\n */\nexport const feed = internal.feed;\n/**\n * Flatten this command to a non-empty array of standard commands.\n *\n * For a `StandardCommand`, this simply returns a `1` element array\n * For a `PipedCommand`, all commands in the pipe will be extracted out into\n * a array from left to right\n *\n * @since 1.0.0\n * @category combinators\n */\nexport const flatten = internal.flatten;\n/**\n * Runs the command returning the output as an array of lines with the specified\n * encoding.\n *\n * @since 1.0.0\n * @category execution\n */\nexport const lines = internal.lines;\n/**\n * Create a command with the specified process name and an optional list of\n * arguments.\n *\n * @since 1.0.0\n * @category constructors\n */\nexport const make = internal.make;\n/**\n * Pipe one command to another command from left to right.\n *\n * Conceptually, the equivalent of piping one shell command to another:\n *\n * ```sh\n * command1 | command2\n * ```\n *\n * @since 1.0.0\n * @category combinators\n */\nexport const pipeTo = internal.pipeTo;\n/**\n * Allows for specifying whether or not a `Command` should be run inside a\n * shell.\n *\n * @since 1.0.0\n * @category combinators\n */\nexport const runInShell = internal.runInShell;\n/**\n * Start running the command and return a handle to the running process.\n *\n * @since 1.0.0\n * @category execution\n */\nexport const start = internal.start;\n/**\n * Start running the command and return the output as a `Stream`.\n *\n * @since 1.0.0\n * @category execution\n */\nexport const stream = internal.stream;\n/**\n * Runs the command returning the output as an stream of lines with the\n * specified encoding.\n *\n * @since 1.0.0\n * @category execution\n */\nexport const streamLines = internal.streamLines;\n/**\n * Runs the command returning the entire output as a string with the\n * specified encoding.\n *\n * If an encoding is not specified, the encoding will default to `utf-8`.\n *\n * @since 1.0.0\n * @category execution\n */\nexport const string = internal.string;\n/**\n * Specify the standard error stream for a command.\n *\n * @since 1.0.0\n * @category combinators\n */\nexport const stderr = internal.stderr;\n/**\n * Specify the standard input stream for a command.\n *\n * @since 1.0.0\n * @category combinators\n */\nexport const stdin = internal.stdin;\n/**\n * Specify the standard output stream for a command.\n *\n * @since 1.0.0\n * @category combinators\n */\nexport const stdout = internal.stdout;\n/**\n * Set the working directory that will be used when this command will be run.\n *\n * For piped commands, the working directory of each command will be set to the\n * specified working directory.\n *\n * @since 1.0.0\n * @category combinators\n */\nexport const workingDirectory = internal.workingDirectory;\n//# sourceMappingURL=Command.js.map","import * as internal from \"./internal/commandExecutor.js\";\n/**\n * @since 1.0.0\n * @category type ids\n */\nexport const TypeId = internal.TypeId;\n/**\n * @since 1.0.0\n * @category tags\n */\nexport const CommandExecutor = internal.CommandExecutor;\n/**\n * @since 1.0.0\n * @category symbols\n */\nexport const ProcessTypeId = internal.ProcessTypeId;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const ExitCode = internal.ExitCode;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const ProcessId = internal.ProcessId;\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const makeExecutor = internal.makeExecutor;\n//# sourceMappingURL=CommandExecutor.js.map","import * as Command from \"@effect/platform/Command\";\nimport * as CommandExecutor from \"@effect/platform/CommandExecutor\";\nimport * as FileSystem from \"@effect/platform/FileSystem\";\nimport * as Deferred from \"effect/Deferred\";\nimport * as Effect from \"effect/Effect\";\nimport { constUndefined, identity, pipe } from \"effect/Function\";\nimport * as Inspectable from \"effect/Inspectable\";\nimport * as Layer from \"effect/Layer\";\nimport * as Option from \"effect/Option\";\nimport * as Sink from \"effect/Sink\";\nimport * as Stream from \"effect/Stream\";\nimport * as ChildProcess from \"node:child_process\";\nimport { handleErrnoException } from \"./error.js\";\nimport { fromWritable } from \"./sink.js\";\nimport { fromReadable } from \"./stream.js\";\nconst inputToStdioOption = stdin => typeof stdin === \"string\" ? stdin : \"pipe\";\nconst outputToStdioOption = output => typeof output === \"string\" ? output : \"pipe\";\nconst toError = err => err instanceof globalThis.Error ? err : new globalThis.Error(String(err));\nconst toPlatformError = (method, error, command) => {\n const flattened = Command.flatten(command).reduce((acc, curr) => {\n const command = `${curr.command} ${curr.args.join(\" \")}`;\n return acc.length === 0 ? command : `${acc} | ${command}`;\n }, \"\");\n return handleErrnoException(\"Command\", method)(error, [flattened]);\n};\nconst ProcessProto = {\n [CommandExecutor.ProcessTypeId]: CommandExecutor.ProcessTypeId,\n ...Inspectable.BaseProto,\n toJSON() {\n return {\n _id: \"@effect/platform/CommandExecutor/Process\",\n pid: this.pid\n };\n }\n};\nconst runCommand = fileSystem => command => {\n switch (command._tag) {\n case \"StandardCommand\":\n {\n const spawn = Effect.flatMap(Deferred.make(), exitCode => Effect.async(resume => {\n const handle = ChildProcess.spawn(command.command, command.args, {\n stdio: [inputToStdioOption(command.stdin), outputToStdioOption(command.stdout), outputToStdioOption(command.stderr)],\n cwd: Option.getOrElse(command.cwd, constUndefined),\n shell: command.shell,\n env: command.extendEnv ? {\n ...process.env,\n ...Object.fromEntries(command.env)\n } : Object.fromEntries(command.env),\n detached: process.platform !== \"win32\"\n });\n handle.on(\"error\", err => {\n resume(Effect.fail(toPlatformError(\"spawn\", err, command)));\n });\n handle.on(\"exit\", (...args) => {\n Deferred.unsafeDone(exitCode, Effect.succeed(args));\n });\n handle.on(\"spawn\", () => {\n resume(Effect.succeed([handle, exitCode]));\n });\n return Effect.sync(() => {\n handle.kill(\"SIGTERM\");\n });\n }));\n const killProcessGroup = process.platform === \"win32\" ? (handle, _) => Effect.async(resume => {\n ChildProcess.exec(`taskkill /pid ${handle.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 }) : (handle, signal) => Effect.try({\n try: () => process.kill(-handle.pid, signal),\n catch: error => toPlatformError(\"kill\", toError(error), command)\n });\n const killProcess = (handle, signal) => Effect.suspend(() => handle.kill(signal) ? Effect.void : Effect.fail(toPlatformError(\"kill\", new globalThis.Error(\"Failed to kill process\"), command)));\n return pipe(\n // Validate that the directory is accessible\n Option.match(command.cwd, {\n onNone: () => Effect.void,\n onSome: dir => fileSystem.access(dir)\n }), Effect.zipRight(Effect.acquireRelease(spawn, ([handle, exitCode]) => Effect.flatMap(Deferred.isDone(exitCode), done => {\n if (!done) {\n // Process is still running, kill it\n return killProcessGroup(handle, \"SIGTERM\").pipe(Effect.orElse(() => killProcess(handle, \"SIGTERM\")), Effect.zipRight(Deferred.await(exitCode)), Effect.ignore);\n }\n // Process has already exited, check if we need to clean up children\n return Effect.flatMap(Deferred.await(exitCode), ([code]) => {\n if (code !== 0 && code !== null) {\n // Non-zero exit code, attempt to clean up process group\n return killProcessGroup(handle, \"SIGTERM\").pipe(Effect.ignore);\n }\n return Effect.void;\n });\n }))), Effect.map(([handle, exitCodeDeferred]) => {\n let stdin = Sink.drain;\n if (handle.stdin !== null) {\n stdin = fromWritable(() => handle.stdin, err => toPlatformError(\"toWritable\", toError(err), command));\n }\n const exitCode = Effect.flatMap(Deferred.await(exitCodeDeferred), ([code, signal]) => {\n if (code !== null) {\n return Effect.succeed(CommandExecutor.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 return Effect.fail(toPlatformError(\"exitCode\", new globalThis.Error(`Process interrupted due to receipt of signal: ${signal}`), command));\n });\n const isRunning = Effect.negate(Deferred.isDone(exitCodeDeferred));\n const kill = (signal = \"SIGTERM\") => killProcessGroup(handle, signal).pipe(Effect.orElse(() => killProcess(handle, signal)), Effect.zipRight(Effect.asVoid(Deferred.await(exitCodeDeferred))));\n const pid = CommandExecutor.ProcessId(handle.pid);\n const stderr = fromReadable(() => handle.stderr, err => toPlatformError(\"fromReadable(stderr)\", toError(err), command));\n let stdout = fromReadable(() => handle.stdout, err => toPlatformError(\"fromReadable(stdout)\", toError(err), command));\n // TODO: add Sink.isSink\n if (typeof command.stdout !== \"string\") {\n stdout = Stream.transduce(stdout, command.stdout);\n }\n return Object.assign(Object.create(ProcessProto), {\n pid,\n exitCode,\n isRunning,\n kill,\n stdin,\n stderr,\n stdout\n });\n }), typeof command.stdin === \"string\" ? identity : Effect.tap(process => Effect.forkDaemon(Stream.run(command.stdin, process.stdin))));\n }\n case \"PipedCommand\":\n {\n const flattened = Command.flatten(command);\n if (flattened.length === 1) {\n return pipe(flattened[0], runCommand(fileSystem));\n }\n const head = flattened[0];\n const tail = flattened.slice(1);\n const initial = tail.slice(0, tail.length - 1);\n const last = tail[tail.length - 1];\n const stream = initial.reduce((stdin, command) => pipe(Command.stdin(command, stdin), runCommand(fileSystem), Effect.map(process => process.stdout), Stream.unwrapScoped), pipe(runCommand(fileSystem)(head), Effect.map(process => process.stdout), Stream.unwrapScoped));\n return pipe(Command.stdin(last, stream), runCommand(fileSystem));\n }\n }\n};\n/** @internal */\nexport const layer = /*#__PURE__*/Layer.effect(CommandExecutor.CommandExecutor, /*#__PURE__*/pipe(FileSystem.FileSystem, /*#__PURE__*/Effect.map(fileSystem => CommandExecutor.makeExecutor(runCommand(fileSystem)))));\n//# sourceMappingURL=commandExecutor.js.map","import * as internal from \"./internal/commandExecutor.js\";\n/**\n * @since 1.0.0\n * @category layer\n */\nexport const layer = internal.layer;\n//# sourceMappingURL=NodeCommandExecutor.js.map","import { BadArgument } from \"@effect/platform/Error\";\nimport { Path, TypeId } from \"@effect/platform/Path\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\nimport * as NodePath from \"node:path\";\nimport * as NodeUrl from \"node:url\";\nconst fromFileUrl = url => Effect.try({\n try: () => NodeUrl.fileURLToPath(url),\n catch: error => new BadArgument({\n module: \"Path\",\n method: \"fromFileUrl\",\n description: `Invalid file URL: ${url}`,\n cause: error\n })\n});\nconst toFileUrl = path => Effect.try({\n try: () => NodeUrl.pathToFileURL(path),\n catch: error => new BadArgument({\n module: \"Path\",\n method: \"toFileUrl\",\n description: `Invalid path: ${path}`,\n cause: error\n })\n});\n/** @internal */\nexport const layerPosix = /*#__PURE__*/Layer.succeed(Path, /*#__PURE__*/Path.of({\n [TypeId]: TypeId,\n ...NodePath.posix,\n fromFileUrl,\n toFileUrl\n}));\n/** @internal */\nexport const layerWin32 = /*#__PURE__*/Layer.succeed(Path, /*#__PURE__*/Path.of({\n [TypeId]: TypeId,\n ...NodePath.win32,\n fromFileUrl,\n toFileUrl\n}));\n/** @internal */\nexport const layer = /*#__PURE__*/Layer.succeed(Path, /*#__PURE__*/Path.of({\n [TypeId]: TypeId,\n ...NodePath,\n fromFileUrl,\n toFileUrl\n}));\n//# sourceMappingURL=path.js.map","/**\n * @since 1.0.0\n */\nimport * as internal from \"./internal/path.js\";\n/**\n * @since 1.0.0\n * @category layer\n */\nexport const layer = internal.layer;\n/**\n * @since 1.0.0\n * @category layer\n */\nexport const layerPosix = internal.layerPosix;\n/**\n * @since 1.0.0\n * @category layer\n */\nexport const layerWin32 = internal.layerWin32;\n//# sourceMappingURL=NodePath.js.map","import * as Error from \"@effect/platform/Error\";\nimport * as Terminal from \"@effect/platform/Terminal\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Layer from \"effect/Layer\";\nimport * as Mailbox from \"effect/Mailbox\";\nimport * as Option from \"effect/Option\";\nimport * as RcRef from \"effect/RcRef\";\nimport * as readline from \"node:readline\";\nconst defaultShouldQuit = input => input.key.ctrl && (input.key.name === \"c\" || input.key.name === \"d\");\n/** @internal */\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 isTTY = Effect.sync(() => Boolean(stdout.isTTY));\n const readInput = Effect.gen(function* () {\n yield* RcRef.get(rlRef);\n const mailbox = yield* Mailbox.make();\n const handleKeypress = (s, k) => {\n const userInput = {\n input: Option.fromNullable(s),\n key: {\n name: k.name ?? \"\",\n ctrl: !!k.ctrl,\n meta: !!k.meta,\n shift: !!k.shift\n }\n };\n mailbox.unsafeOffer(userInput);\n if (shouldQuit(userInput)) {\n mailbox.unsafeDone(Exit.void);\n }\n };\n yield* Effect.addFinalizer(() => Effect.sync(() => stdin.off(\"keypress\", handleKeypress)));\n stdin.on(\"keypress\", handleKeypress);\n return mailbox;\n });\n const readLine = RcRef.get(rlRef).pipe(Effect.flatMap(readlineInterface => Effect.async(resume => {\n const onLine = line => resume(Effect.succeed(line));\n readlineInterface.once(\"line\", onLine);\n return Effect.sync(() => readlineInterface.off(\"line\", onLine));\n })), Effect.scoped);\n const display = prompt => Effect.uninterruptible(Effect.async(resume => {\n stdout.write(prompt, err => err ? resume(Effect.fail(new Error.BadArgument({\n module: \"Terminal\",\n method: \"display\",\n description: \"Failed to write prompt to stdout\",\n cause: err\n }))) : resume(Effect.void));\n }));\n return Terminal.Terminal.of({\n columns,\n rows,\n isTTY,\n readInput,\n readLine,\n display\n });\n});\n/** @internal */\nexport const layer = /*#__PURE__*/Layer.scoped(Terminal.Terminal, /*#__PURE__*/make(defaultShouldQuit));\n//# sourceMappingURL=terminal.js.map","import * as InternalTerminal from \"./internal/terminal.js\";\n/**\n * @since 1.0.0\n * @category constructors\n */\nexport const make = InternalTerminal.make;\n/**\n * @since 1.0.0\n * @category layer\n */\nexport const layer = InternalTerminal.layer;\n//# sourceMappingURL=NodeTerminal.js.map","import * as Worker from \"@effect/platform/Worker\";\nimport { WorkerError } from \"@effect/platform/WorkerError\";\nimport * as Deferred from \"effect/Deferred\";\nimport * as Effect from \"effect/Effect\";\nimport * as Exit from \"effect/Exit\";\nimport * as Layer from \"effect/Layer\";\nimport * as Scope from \"effect/Scope\";\nconst platformWorkerImpl = /*#__PURE__*/Worker.makePlatform()({\n setup({\n scope,\n worker\n }) {\n return Effect.flatMap(Deferred.make(), exitDeferred => {\n const thing = \"postMessage\" in worker ? {\n postMessage(msg, t) {\n worker.postMessage(msg, t);\n },\n kill: () => worker.terminate(),\n worker\n } : {\n postMessage(msg, _) {\n worker.send(msg);\n },\n kill: () => worker.kill(\"SIGKILL\"),\n worker\n };\n worker.on(\"exit\", () => {\n Deferred.unsafeDone(exitDeferred, Exit.void);\n });\n return Effect.as(Scope.addFinalizer(scope, Effect.suspend(() => {\n thing.postMessage([1]);\n return Deferred.await(exitDeferred);\n }).pipe(Effect.interruptible, Effect.timeout(5000), Effect.catchAllCause(() => Effect.sync(() => thing.kill())))), thing);\n });\n },\n listen({\n deferred,\n emit,\n port\n }) {\n port.worker.on(\"message\", message => {\n emit(message);\n });\n port.worker.on(\"messageerror\", cause => {\n Deferred.unsafeDone(deferred, new WorkerError({\n reason: \"decode\",\n cause\n }));\n });\n port.worker.on(\"error\", cause => {\n Deferred.unsafeDone(deferred, new WorkerError({\n reason: \"unknown\",\n cause\n }));\n });\n port.worker.on(\"exit\", code => {\n Deferred.unsafeDone(deferred, new WorkerError({\n reason: \"unknown\",\n cause: new Error(`exited with code ${code}`)\n }));\n });\n return Effect.void;\n }\n});\n/** @internal */\nexport const layerWorker = /*#__PURE__*/Layer.succeed(Worker.PlatformWorker, platformWorkerImpl);\n/** @internal */\nexport const layerManager = /*#__PURE__*/Layer.provide(Worker.layerManager, layerWorker);\n/** @internal */\nexport const layer = spawn => Layer.merge(layerManager, Worker.layerSpawner(spawn));\n/** @internal */\nexport const layerPlatform = spawn => Layer.merge(layerWorker, Worker.layerSpawner(spawn));\n//# sourceMappingURL=worker.js.map","import * as internal from \"./internal/worker.js\";\n/**\n * @since 1.0.0\n * @category layers\n */\nexport const layerManager = internal.layerManager;\n/**\n * @since 1.0.0\n * @category layers\n */\nexport const layerWorker = internal.layerWorker;\n/**\n * @since 1.0.0\n * @category layers\n */\nexport const layer = internal.layer;\n/**\n * @since 1.0.0\n * @category layers\n */\nexport const layerPlatform = internal.layerPlatform;\n//# sourceMappingURL=NodeWorker.js.map","/**\n * @since 1.0.0\n */\nimport * as NodeCommandExecutor from \"@effect/platform-node-shared/NodeCommandExecutor\";\nimport * as NodeFileSystem from \"@effect/platform-node-shared/NodeFileSystem\";\nimport * as NodePath from \"@effect/platform-node-shared/NodePath\";\nimport * as NodeTerminal from \"@effect/platform-node-shared/NodeTerminal\";\nimport { pipe } from \"effect/Function\";\nimport * as Layer from \"effect/Layer\";\nimport * as NodeWorker from \"./NodeWorker.js\";\n/**\n * @since 1.0.0\n * @category layer\n */\nexport const layer = /*#__PURE__*/pipe(/*#__PURE__*/Layer.mergeAll(NodePath.layer, NodeCommandExecutor.layer, NodeTerminal.layer, NodeWorker.layerManager), /*#__PURE__*/Layer.provideMerge(NodeFileSystem.layer));\n//# sourceMappingURL=NodeContext.js.map","import { readFile, readdir, stat } from 'node:fs/promises';\nimport { extname, resolve, sep } from 'node:path';\nimport type {\n CheckpointResult,\n EvalRegistry,\n JsonObject,\n RunSource,\n} from '@evalkit/core';\nimport {\n readRunManifest,\n readRunSummary,\n readTrialEvents,\n readTrialManifest,\n readTrialSummary,\n} from '@evalkit/runner';\n\nconst UUID_PATTERN =\n /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\n\nexport type LocalRun = {\n id: string;\n evalId: string;\n suiteId?: string;\n agent?: string;\n matrixId?: string;\n parameters?: JsonObject;\n status: 'running' | 'passed' | 'failed' | 'errored';\n startedAt: string;\n completedAt?: string;\n completedTrials: number;\n requestedTrials: number;\n score?: number;\n durationMs?: number;\n /** Set by `evalkit tidy` when the run's eval is no longer in the project. */\n archived?: boolean;\n /** Repository and commit the run's eval code came from (schema version 4+). */\n source?: RunSource;\n};\n\n/** Written into a run directory by `evalkit tidy`; deleting it restores the run. */\nexport const ARCHIVE_MARKER = 'archived.json';\n\ntype LocalScore = {\n name: string;\n kind?: 'predicate' | 'judge';\n value?: number;\n passed?: boolean;\n explanation?: string;\n durationMs: number;\n};\nexport type LocalTrial = {\n id: string;\n index: number;\n status: LocalRun['status'];\n score?: number;\n startedAt: string;\n completedAt?: string;\n durationMs?: number;\n scores: LocalScore[];\n checkpoints: CheckpointResult[];\n skippedScorers?: string[];\n};\n\nexport type ArtifactPath = {\n path: string;\n kind: 'file' | 'directory';\n size?: number;\n};\n\nfunction isMissing(error: unknown): boolean {\n return (error as NodeJS.ErrnoException).code === 'ENOENT';\n}\n\nasync function ifPresent<T>(\n operation: () => Promise<T>,\n): Promise<T | undefined> {\n try {\n return await operation();\n } catch (error) {\n if (isMissing(error)) return undefined;\n throw error;\n }\n}\n\nfunction assertUuid(id: string, label: string): void {\n if (!UUID_PATTERN.test(id)) throw new Error(`Invalid ${label}`);\n}\n\nfunction trialPath(root: string, runId: string, trialId: string): string {\n assertUuid(runId, 'run ID');\n assertUuid(trialId, 'trial ID');\n return resolve(root, runId, 'trials', trialId);\n}\n\nfunction runStatus(summary: {\n status: 'running' | 'completed' | 'failed' | 'cancelled';\n passed: number;\n failed: number;\n trialCount: number;\n}): LocalRun['status'] {\n if (summary.status === 'running') return 'running';\n if (summary.status !== 'completed') return 'errored';\n return summary.failed === 0 && summary.passed === summary.trialCount\n ? 'passed'\n : 'failed';\n}\n\nfunction trialStatus(summary: {\n status: 'running' | 'completed' | 'failed' | 'cancelled';\n scoring?: { passed?: boolean };\n}): LocalTrial['status'] {\n if (summary.status === 'running') return 'running';\n if (summary.status !== 'completed') return 'errored';\n return summary.scoring?.passed === true ? 'passed' : 'failed';\n}\n\nexport function fileContentType(file: string): string {\n return (\n (\n {\n '.css': 'text/css',\n '.html': 'text/html',\n '.js': 'text/javascript',\n } as Record<string, string>\n )[extname(file)] ?? 'application/octet-stream'\n );\n}\n\n/**\n * Read saved local reports. A missing summary means \"running\"; malformed reports are errors.\n * Runs written by an older EvalKit (manifest `schemaVersion` < 2) are skipped and counted.\n */\nexport function createDashboardReportReader(\n root: string,\n registry: EvalRegistry,\n) {\n const legacyRuns = new Set<string>();\n\n async function listRuns(): Promise<LocalRun[]> {\n const entries = await ifPresent(() =>\n readdir(root, { withFileTypes: true }),\n );\n if (!entries) return [];\n const ids = entries\n .filter((entry) => entry.isDirectory() && UUID_PATTERN.test(entry.name))\n .map((entry) => entry.name);\n const runs = await Promise.all(ids.map(readRun));\n return runs.filter((run): run is LocalRun => run !== undefined);\n }\n\n /** True for a run from a report format this version cannot read; never for corrupt JSON. */\n async function isLegacyRun(id: string): Promise<boolean> {\n const text = await ifPresent(() =>\n readFile(resolve(root, id, 'manifest.json'), 'utf8'),\n );\n if (text === undefined) return false;\n let version: unknown;\n try {\n version = (JSON.parse(text) as { schemaVersion?: unknown }).schemaVersion;\n } catch {\n return false; // Corrupt: let the strict decoder report it.\n }\n return typeof version === 'number' && version < 2;\n }\n\n async function readRun(id: string): Promise<LocalRun | undefined> {\n if (await isLegacyRun(id)) {\n legacyRuns.add(id);\n return undefined;\n }\n // A newly created run directory may not have a manifest yet.\n const manifest = await ifPresent(() => readRunManifest(root, id));\n if (!manifest) return undefined;\n const summary = await ifPresent(() => readRunSummary(root, id));\n const trialIds = await ifPresent(() =>\n readdir(resolve(root, id, 'trials')),\n );\n const trials = await Promise.all(\n (trialIds ?? []).map((trialId) =>\n ifPresent(() => readTrialSummary(root, id, trialId)),\n ),\n );\n const scores = trials.flatMap((trial) =>\n trial?.scoring?.overall === undefined ? [] : [trial.scoring.overall],\n );\n const archived = await ifPresent(() =>\n stat(resolve(root, id, ARCHIVE_MARKER)),\n );\n return {\n id,\n ...(archived ? { archived: true } : {}),\n ...(manifest.source ? { source: manifest.source } : {}),\n evalId: manifest.evalId,\n ...(manifest.suiteId ? { suiteId: manifest.suiteId } : {}),\n ...(manifest.matrix\n ? {\n matrixId: manifest.matrix.id,\n cellKey: manifest.matrix.cellKey,\n }\n : {}),\n ...(manifest.parameters ? { parameters: manifest.parameters } : {}),\n ...(manifest.aut\n ? {\n agent: [manifest.aut.kind, manifest.aut.id, manifest.aut.version]\n .filter(Boolean)\n .join(' / '),\n }\n : {}),\n status: summary ? runStatus(summary) : 'running',\n startedAt: manifest.startedAt,\n ...(summary?.endedAt ? { completedAt: summary.endedAt } : {}),\n ...(summary?.durationMs !== undefined\n ? { durationMs: summary.durationMs }\n : {}),\n completedTrials: summary?.trialCount ?? trials.filter(Boolean).length,\n requestedTrials:\n summary?.trialCount ??\n registry.get(manifest.evalId)?.policy?.trials ??\n 1,\n ...(scores.length\n ? {\n score:\n scores.reduce((sum, score) => sum + score, 0) / scores.length,\n }\n : {}),\n };\n }\n\n async function listTrials(runId: string): Promise<LocalTrial[]> {\n assertUuid(runId, 'run ID');\n const ids = await ifPresent(() => readdir(resolve(root, runId, 'trials')));\n if (!ids) return [];\n const trials = await Promise.all(\n ids.map(async (id) => {\n const manifest = await readTrialManifest(root, runId, id);\n const summary = await ifPresent(() =>\n readTrialSummary(root, runId, id),\n );\n return {\n id,\n index: manifest.trialIndex,\n status: summary ? trialStatus(summary) : 'running',\n startedAt: manifest.startedAt,\n ...(summary?.endedAt ? { completedAt: summary.endedAt } : {}),\n ...(summary?.durationMs !== undefined\n ? { durationMs: summary.durationMs }\n : {}),\n ...(summary?.scoring?.overall === undefined\n ? {}\n : { score: summary.scoring.overall }),\n scores: summary?.scoring?.results ?? [],\n checkpoints: summary?.scoring?.checkpoints ?? [],\n ...(summary?.scoring?.skippedScorers\n ? { skippedScorers: summary.scoring.skippedScorers }\n : {}),\n };\n }),\n );\n return trials.sort((left, right) => left.index - right.index);\n }\n\n async function trialDetail(runId: string, trialId: string) {\n trialPath(root, runId, trialId);\n return {\n manifest: await readTrialManifest(root, runId, trialId),\n summary: (await ifPresent(() =>\n readTrialSummary(root, runId, trialId),\n )) ?? { status: 'running' },\n };\n }\n\n async function listArtifacts(\n runId: string,\n trialId: string,\n ): Promise<ArtifactPath[]> {\n return walkArtifacts(resolve(trialPath(root, runId, trialId), 'artifacts'));\n }\n\n async function listCandidateWorkspace(\n runId: string,\n trialId: string,\n ): Promise<ArtifactPath[]> {\n return walkArtifacts(\n resolve(trialPath(root, runId, trialId), 'artifacts', 'candidate'),\n );\n }\n\n async function candidateFile(\n runId: string,\n trialId: string,\n relativePath: string,\n ): Promise<Response> {\n const candidateRoot = resolve(\n trialPath(root, runId, trialId),\n 'artifacts',\n 'candidate',\n );\n const file = resolve(candidateRoot, relativePath);\n if (file !== candidateRoot && !file.startsWith(`${candidateRoot}${sep}`))\n throw new Error('Invalid workspace path');\n const info = await stat(file);\n if (!info.isFile()) throw new Error('Workspace path is not a file');\n return new Response(await Bun.file(file).arrayBuffer(), {\n headers: { 'content-type': fileContentType(file) },\n });\n }\n\n async function trajectory(runId: string, trialId: string) {\n trialPath(root, runId, trialId);\n return (await ifPresent(() => readTrialEvents(root, runId, trialId))) ?? [];\n }\n\n return {\n listRuns,\n /** Run IDs skipped by the last `listRuns()` because an older EvalKit wrote them. */\n legacyRunIds: () => [...legacyRuns],\n listTrials,\n trialDetail,\n listArtifacts,\n listCandidateWorkspace,\n candidateFile,\n trajectory,\n };\n}\n\n/** Both artifact endpoints walk a specific root; never broaden the candidate-file read root. */\nasync function walkArtifacts(root: string): Promise<ArtifactPath[]> {\n const result: ArtifactPath[] = [];\n async function visit(directory: string, prefix: string): Promise<void> {\n for (const entry of await readdir(directory, { withFileTypes: true })) {\n const path = prefix ? `${prefix}/${entry.name}` : entry.name;\n if (entry.isDirectory()) {\n result.push({ path, kind: 'directory' });\n await visit(resolve(directory, entry.name), path);\n } else {\n result.push({\n path,\n kind: 'file',\n size: Bun.file(resolve(directory, entry.name)).size,\n });\n }\n }\n }\n await ifPresent(() => visit(root, ''));\n return result;\n}\n","import {\n cp,\n mkdir,\n readdir,\n readFile,\n rm,\n stat,\n writeFile,\n} from 'node:fs/promises';\nimport { dirname, resolve, sep } from 'node:path';\nimport { authoringId, type EvalRegistry } from '@evalkit/core';\nimport { dashboardIndex } from '@evalkit/share';\nimport { createDashboardReportReader } from './dashboard-reports.js';\n\n/** Marks a directory as EvalKit-owned so a rebuild may safely replace it. */\nconst MARKER = '.evalkit-dashboard';\n\nexport type DashboardBuildResult = {\n outDir: string;\n runs: number;\n trials: number;\n files: number;\n /** Runs written by an older EvalKit, which this version cannot read. */\n skipped: number;\n /** Runs archived by `evalkit tidy`; never included in a snapshot. */\n archived: number;\n};\n\n/**\n * Write a read-only static dashboard: the bundled UI plus JSON snapshots of\n * the catalog and local reports, and each trial's candidate artifact files.\n * Evaluator workspaces are never copied; reports may still contain sensitive\n * messages, scores, or evidence, so review the output before sharing it.\n */\n/** Runs one named phase of the build; the CLI uses it to time and display progress. */\nexport type BuildStep = <T>(\n label: string,\n work: (progress: (detail: string) => void) => Promise<T>,\n describe: (value: T) => string,\n) => Promise<T>;\n\nconst quietStep: BuildStep = (_label, work) => work(() => {});\n\nexport async function buildDashboard(\n options: {\n registry: EvalRegistry;\n reportRoot: string;\n dashboardRoot: string;\n outDir: string;\n },\n step: BuildStep = quietStep,\n): Promise<DashboardBuildResult> {\n const { registry, reportRoot, dashboardRoot, outDir } = options;\n const template = await readFile(resolve(dashboardRoot, 'index.html'), 'utf8');\n const data = resolve(outDir, 'data');\n const write = async (path: string, value: unknown) => {\n const file = resolve(data, path);\n await mkdir(dirname(file), { recursive: true });\n await writeFile(file, `${JSON.stringify(value)}\\n`);\n };\n\n await step(\n 'Dashboard assets',\n async () => {\n await prepareOutDir(outDir);\n await cp(dashboardRoot, outDir, { recursive: true });\n await writeFile(\n resolve(outDir, MARKER),\n 'Generated by `evalkit build`.\\n',\n );\n await writeFile(\n resolve(outDir, 'index.html'),\n dashboardIndex(template, { base: './' }),\n );\n },\n () => 'read-only UI with relative assets',\n );\n\n await step(\n 'Eval catalog',\n async () => {\n await write('catalog.json', { evals: registry.catalog() });\n await write('evals.json', { evals: registry.metadata() });\n await write('suites.json', { suites: registry.suiteMetadata() });\n return { evals: registry.evals.length, suites: registry.suites.length };\n },\n ({ evals, suites }) =>\n `${count(evals, 'eval')} · ${count(suites, 'suite')}`,\n );\n\n const reports = createDashboardReportReader(reportRoot, registry);\n const snapshot = await step(\n 'Run reports',\n async (progress) => {\n const all = await reports.listRuns();\n const runs = all.filter((run) => !run.archived);\n await write('runs.json', { runs });\n let trials = 0;\n let files = 0;\n const trialIds: string[] = [];\n for (const [index, run] of runs.entries()) {\n progress(`run ${index + 1}/${runs.length} · ${run.id.slice(0, 8)}`);\n const written = await snapshotRun(\n reports,\n run.id,\n directorySink(resolve(data, 'runs', run.id)),\n );\n trials += written.trialIds.length;\n files += written.files;\n trialIds.push(...written.trialIds);\n }\n return {\n runs: runs.length,\n trials,\n files,\n skipped: reports.legacyRunIds().length,\n archived: all.length - runs.length,\n runIds: runs.map((run) => run.id),\n trialIds,\n };\n },\n ({ runs, trials, files, skipped, archived }) =>\n `${count(runs, 'run')} · ${count(trials, 'trial')} · ${count(files, 'candidate file')}` +\n (archived ? ` · ${archived} archived excluded` : '') +\n (skipped ? ` · ${skipped} older-format skipped` : ''),\n );\n await step(\n 'Route pages',\n async () => {\n const routes = staticRoutes({\n suites: registry.suites.map(authoringId),\n evals: registry.catalog().map((entry) => entry.path),\n runs: snapshot.runIds,\n trials: snapshot.trialIds,\n });\n for (const route of routes) {\n const file = resolve(outDir, `${route}.html`);\n await mkdir(dirname(file), { recursive: true });\n await writeFile(\n file,\n dashboardIndex(template, { base: baseFor(route) }),\n );\n }\n // Hosts that serve 404.html for unknown paths get a working root-mounted app.\n await writeFile(\n resolve(outDir, '404.html'),\n dashboardIndex(template, { base: '/' }),\n );\n return routes.length;\n },\n (pages) => `${count(pages, 'page')} with clean /path URLs`,\n );\n const { runIds: _runs, trialIds: _trials, ...summary } = snapshot;\n return { outDir, ...summary };\n}\n\n/**\n * Every dashboard URL known at build time, as file paths without `.html`.\n * Static hosts serve `/runs/abc` from `runs/abc.html`, so links and reloads\n * work without SPA rewrite rules. IDs that cannot be a safe file name are\n * skipped; those pages still open by navigating inside the app.\n */\nexport function staticRoutes(ids: {\n suites: readonly string[];\n evals: readonly string[];\n runs: readonly string[];\n trials: readonly string[];\n}): string[] {\n const safe = (id: string) =>\n id.length > 0 && !/[/\\\\\\0]/.test(id) && id !== '.' && id !== '..';\n const under = (prefix: string, values: readonly string[]) =>\n values.filter(safe).map((id) => `${prefix}/${id}`);\n return [\n 'suites',\n 'agents',\n 'fixtures',\n 'runs',\n ...under('suites', ids.suites),\n ...under('evals', ids.evals),\n ...under('runs', ids.runs),\n ...under('trials', ids.trials),\n ...under('workspaces', ids.trials),\n ];\n}\n\n/** `runs/abc.html` is served at `<mount>/runs/abc`; its base is one level up. */\nfunction baseFor(route: string): string {\n const depth = route.split('/').length - 1;\n return depth ? '../'.repeat(depth) : './';\n}\n\nfunction count(value: number, noun: string): string {\n return `${value} ${noun}${value === 1 ? '' : 's'}`;\n}\n\n/** Receives one run's snapshot files, at paths relative to the run. */\nexport type SnapshotSink = {\n json(path: string, value: unknown): Promise<void>;\n bytes(path: string, data: Uint8Array): Promise<void>;\n};\n\n/** Writes a run's snapshot below `root` (static builds). */\nexport function directorySink(root: string): SnapshotSink {\n const target = (path: string) => {\n const file = resolve(root, path);\n if (!file.startsWith(`${resolve(root)}${sep}`))\n throw new Error(`Invalid snapshot path: ${path}`);\n return file;\n };\n return {\n async json(path, value) {\n const file = target(path);\n await mkdir(dirname(file), { recursive: true });\n await writeFile(file, `${JSON.stringify(value)}\\n`);\n },\n async bytes(path, data) {\n const file = target(path);\n await mkdir(dirname(file), { recursive: true });\n await writeFile(file, data);\n },\n };\n}\n\n/**\n * One run's snapshot, shared by `evalkit build` (files on disk) and\n * `evalkit share` (an upload bundle): `trials.json`, then per trial\n * `detail.json`, `events.json`, `artifacts.json`, `workspace.json`, and the\n * candidate files under `workspace/`. Evaluator workspaces are never read.\n */\nexport async function snapshotRun(\n reports: ReturnType<typeof createDashboardReportReader>,\n runId: string,\n sink: SnapshotSink,\n options: { workspaceFiles?: boolean } = {},\n): Promise<{ trialIds: string[]; files: number }> {\n const trials = await reports.listTrials(runId);\n await sink.json('trials.json', { trials });\n let files = 0;\n for (const trial of trials) {\n const base = `trials/${trial.id}`;\n await sink.json(\n `${base}/detail.json`,\n await reports.trialDetail(runId, trial.id),\n );\n await sink.json(`${base}/events.json`, {\n events: await reports.trajectory(runId, trial.id),\n });\n await sink.json(`${base}/artifacts.json`, {\n artifacts: await reports.listArtifacts(runId, trial.id),\n });\n const workspace = await reports.listCandidateWorkspace(runId, trial.id);\n await sink.json(`${base}/workspace.json`, workspace);\n if (options.workspaceFiles === false) continue;\n for (const entry of workspace) {\n if (entry.kind !== 'file') continue;\n const response = await reports.candidateFile(runId, trial.id, entry.path);\n await sink.bytes(\n `${base}/workspace/${entry.path}`,\n new Uint8Array(await response.arrayBuffer()),\n );\n files += 1;\n }\n }\n return { trialIds: trials.map((trial) => trial.id), files };\n}\n\n/** Total size and file count of a directory, for the build summary. */\nexport async function directorySize(\n root: string,\n): Promise<{ bytes: number; files: number }> {\n let bytes = 0;\n let files = 0;\n for (const entry of await readdir(root, {\n withFileTypes: true,\n recursive: true,\n })) {\n if (!entry.isFile()) continue;\n bytes += (await stat(resolve(entry.parentPath, entry.name))).size;\n files += 1;\n }\n return { bytes, files };\n}\n\nasync function prepareOutDir(outDir: string): Promise<void> {\n let entries: string[];\n try {\n if (!(await stat(outDir)).isDirectory())\n throw new Error(`Output path is not a directory: ${outDir}`);\n entries = await readdir(outDir);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error;\n await mkdir(outDir, { recursive: true });\n return;\n }\n if (!entries.length) return;\n // Never delete a directory EvalKit did not create.\n if (!entries.includes(MARKER))\n throw new Error(\n `Refusing to overwrite ${outDir}: it is not empty and was not created by evalkit build`,\n );\n await rm(outDir, { recursive: true, force: true });\n await mkdir(outDir, { recursive: true });\n}\n","import {\n canonicalParameters,\n type EvalMatrix,\n type EvalMatrixCell,\n} from '@evalkit/core';\n\nexport type CellQuery = {\n evalIds: string[];\n query: string;\n offset: number;\n limit: number;\n sort: string;\n direction: 'asc' | 'desc';\n};\n\nconst MAX_SCAN = 100_000;\n\nfunction display(value: unknown): string {\n return typeof value === 'string'\n ? value\n : (JSON.stringify(value) ?? String(value));\n}\n\n/** Bounded report projection; both count and rows come from the core eligible-cell iterator. */\nexport function listMatrixCells(matrix: EvalMatrix, input: CellQuery) {\n if (\n !Number.isSafeInteger(input.offset) ||\n input.offset < 0 ||\n !Number.isSafeInteger(input.limit) ||\n input.limit < 1 ||\n input.limit > 100\n )\n throw new Error(\n 'Matrix page requires offset >= 0 and limit between 1 and 100',\n );\n const dimensions = [\n ...Object.keys(matrix.cases?.[0] ?? {}),\n ...Object.keys(matrix.parameters),\n ];\n if (\n ![\n 'eval',\n 'agent',\n 'trials',\n ...dimensions.map((key) => `axis:${key}`),\n ].includes(input.sort)\n )\n throw new Error(`Unknown matrix sort: ${input.sort}`);\n const selection = input.evalIds.length ? { evals: input.evalIds } : {};\n const planned = matrix.count(selection);\n if (planned > MAX_SCAN)\n throw new Error(\n `Matrix has ${planned} eligible cells; narrow the selection in the CLI (dashboard limit ${MAX_SCAN})`,\n );\n const terms = input.query.trim().toLowerCase().split(/\\s+/).filter(Boolean);\n const cells = [...matrix.cells(selection)].filter((cell) => {\n const fields = [\n cell.eval.id,\n cell.eval.name,\n cell.eval.agent?.identity?.name,\n cell.eval.agent?.identity?.kind,\n ...Object.entries(cell.parameters).flatMap(([key, value]) => [\n key,\n display(value),\n ]),\n ];\n const haystack = fields.map(display).join(' ').toLowerCase();\n return terms.every((term) => haystack.includes(term));\n });\n function value(cell: EvalMatrixCell) {\n if (input.sort.startsWith('axis:')) {\n const parameter = cell.parameters[input.sort.slice(5)];\n return typeof parameter === 'number'\n ? parameter\n : canonicalParameters(parameter!);\n }\n if (input.sort === 'eval') return cell.eval.name ?? cell.eval.id;\n if (input.sort === 'agent')\n return (\n cell.eval.agent?.identity?.name ?? cell.eval.agent?.identity?.kind ?? ''\n );\n return cell.eval.policy?.trials ?? 1;\n }\n cells.sort((left, right) => {\n const a = value(left);\n const b = value(right);\n const comparison =\n typeof a === 'number' && typeof b === 'number'\n ? a - b\n : String(a).localeCompare(String(b), undefined, {\n numeric: true,\n sensitivity: 'base',\n });\n return (\n (input.direction === 'asc' ? comparison : -comparison) ||\n left.key.localeCompare(right.key)\n );\n });\n return {\n total: cells.length,\n planned,\n cells: cells\n .slice(input.offset, input.offset + input.limit)\n .map((cell) => ({\n evalId: cell.eval.id,\n key: cell.key,\n parameters: cell.parameters,\n })),\n };\n}\n","import {\n canonicalParameters,\n type EvalMatrix,\n type MatrixSelection,\n} from '@evalkit/core';\n\n/** Dashboard submissions are intentionally one explicit, configured cell at a time. */\nexport function selectDashboardCell(\n matrix: EvalMatrix,\n evalId: string,\n parameters: unknown,\n): MatrixSelection {\n if (\n !parameters ||\n typeof parameters !== 'object' ||\n Array.isArray(parameters)\n )\n throw new Error('Select one value for every matrix axis');\n const provided = parameters as Record<string, unknown>;\n const axes = [\n ...Object.keys(matrix.parameters),\n ...Object.keys(matrix.cases?.[0] ?? {}),\n ];\n if (\n Object.keys(provided).length !== axes.length ||\n axes.some((axis) => !Object.hasOwn(provided, axis))\n )\n throw new Error('Select one value for every matrix axis');\n const selected: Record<string, unknown[]> = {};\n for (const axis of axes) {\n const value = provided[axis];\n // JSON from the request must match a declared choice; arrays are values, not selections.\n const choices =\n matrix.parameters[axis] ??\n matrix.cases!.map((assignment) => assignment[axis]!);\n if (\n !choices.some(\n (choice) =>\n canonicalParameters(choice) === canonicalParameters(value as never),\n )\n )\n throw new Error(`Unknown ${axis} value`);\n selected[axis] = [value];\n }\n const selection = {\n evals: [evalId],\n parameters: selected,\n } as MatrixSelection;\n if (matrix.count(selection) !== 1)\n throw new Error('Selection must contain exactly one eligible cell');\n return selection;\n}\n","import { readdir, stat } from 'node:fs/promises';\nimport { resolve, dirname, relative, sep } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport {\n defineEvalMatrix,\n registerEvals,\n authoringId,\n type EvalDefinition,\n type EvalkitConfig,\n type EvalRegistry,\n} from '@evalkit/core';\n\nconst defaultInclude = ['**/*.eval.ts', '**/*.eval.js'];\nconst defaultExclude = ['**/node_modules/**', '**/.git/**', '**/_evalkit-*/**'];\nasync function exists(file: string) {\n try {\n return (await stat(file)).isFile();\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return false;\n throw error;\n }\n}\nfunction evaluation(value: unknown, source: string): EvalDefinition {\n if (!value || typeof value !== 'object')\n throw new Error(\n `${source} must default-export defineEval(...) or an array of evals`,\n );\n const candidate = value as EvalDefinition;\n authoringId(candidate);\n if (\n typeof candidate.agent?.start !== 'function' ||\n !Array.isArray(candidate.transcript) ||\n !Array.isArray(candidate.scoring)\n )\n throw new Error(`Invalid eval exported by ${source}`);\n return candidate;\n}\nasync function discover(\n root: string,\n config: EvalkitConfig,\n): Promise<EvalDefinition[]> {\n const directory = resolve(root, config.testDir ?? 'evals');\n const includes = (config.include ?? defaultInclude).map(\n (pattern) => new Bun.Glob(pattern),\n );\n const excludes = [...defaultExclude, ...(config.exclude ?? [])].map(\n (pattern) => new Bun.Glob(pattern),\n );\n const paths: string[] = [];\n async function walk(dir: string) {\n const entries = await readdir(dir, { withFileTypes: true });\n for (const entry of entries) {\n const file = resolve(dir, entry.name);\n const rel = relative(directory, file).split(sep).join('/');\n if (\n entry.isSymbolicLink() ||\n entry.name === 'node_modules' ||\n entry.name === '.git' ||\n entry.name.startsWith('_evalkit-')\n )\n continue;\n if (\n excludes.some(\n (glob) =>\n glob.match(rel) || (entry.isDirectory() && glob.match(`${rel}/`)),\n )\n )\n continue;\n if (entry.isDirectory()) await walk(file);\n else if (entry.isFile() && includes.some((glob) => glob.match(rel)))\n paths.push(file);\n }\n }\n try {\n await walk(directory);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT')\n throw new Error(`Eval directory not found: ${directory}`);\n throw error;\n }\n const evals: EvalDefinition[] = [];\n for (const file of paths.sort()) {\n const module = await import(pathToFileURL(file).href);\n for (const value of Array.isArray(module.default)\n ? module.default\n : [module.default])\n evals.push(evaluation(value, file));\n }\n if (!evals.length) throw new Error(`No eval files found in ${directory}`);\n return evals;\n}\n\nexport type LoadedProject = {\n root: string;\n config: EvalkitConfig;\n registry: EvalRegistry;\n};\nexport async function loadProject(\n cwd: string,\n configPath?: string,\n): Promise<LoadedProject> {\n const candidates = configPath\n ? [resolve(cwd, configPath)]\n : ['evalkit.config.ts', 'evalkit.config.js', 'evalkit.config.mjs'].map(\n (name) => resolve(cwd, name),\n );\n const present: string[] = [];\n for (const file of candidates) if (await exists(file)) present.push(file);\n if (configPath && !present.length)\n throw new Error(`Config not found: ${configPath}`);\n if (present.length > 1)\n throw new Error('Multiple EvalKit configs found; select one with --config');\n const file = present[0];\n const root = file ? dirname(file) : resolve(cwd);\n const config: EvalkitConfig = file\n ? (await import(pathToFileURL(file).href)).default\n : {};\n if (!config || typeof config !== 'object' || Array.isArray(config))\n throw new Error('Config must default-export defineConfig({...})');\n for (const [key, value] of Object.entries(config.execution ?? {})) {\n if (value !== undefined && (!Number.isSafeInteger(value) || value < 1))\n throw new Error(`execution.${key} must be a positive integer`);\n }\n let registry = config.registry;\n if (\n !file &&\n !configPath &&\n (await exists(resolve(root, 'src/registry.ts')))\n ) {\n registry = (\n await import(pathToFileURL(resolve(root, 'src/registry.ts')).href)\n ).default;\n }\n if (!registry)\n registry = registerEvals(config.evals ?? (await discover(root, config)));\n if (!registry?.evals || !registry.get)\n throw new Error('Invalid explicit eval registry');\n const ids = new Set<string>();\n for (const e of registry.evals) {\n const id = authoringId(e);\n if (ids.has(id)) throw new Error(`Duplicate eval ID: ${id}`);\n ids.add(id);\n }\n if (config.matrix) {\n const matrix = defineEvalMatrix({\n ...config.matrix,\n id: config.matrix.id ?? 'default',\n evals: registry.evals,\n });\n if (registry.matrices.some((m) => authoringId(m) === authoringId(matrix)))\n throw new Error(`Duplicate matrix ID: ${authoringId(matrix)}`);\n registry = { ...registry, matrices: [...registry.matrices, matrix] };\n }\n return { root, config, registry };\n}\n","import type { EvalMatrixCell, RunResult } from '@evalkit/core';\nimport { authoringId } from '@evalkit/core';\nimport { Effect, Logger, LogLevel } from 'effect';\n\n/** Human CLI output. Colors and live progress only appear on an interactive terminal. */\nconst interactive = Boolean(process.stdout.isTTY);\nconst colored =\n interactive && !process.env.NO_COLOR && process.env.TERM !== 'dumb';\n\nconst paint = (code: number, reset: number) => (text: string) =>\n colored ? `\\x1b[${code}m${text}\\x1b[${reset}m` : text;\nexport const bold = paint(1, 22);\nexport const dim = paint(2, 22);\nexport const red = paint(31, 39);\nexport const green = paint(32, 39);\nexport const yellow = paint(33, 39);\nexport const cyan = paint(36, 39);\n\nexport function banner(command: string, version: string): void {\n console.log(\n `\\n ${bold(cyan('EvalKit'))} ${bold(command)} ${dim(`v${version}`)}\\n`,\n );\n}\n\nexport function duration(ms: number): string {\n return ms < 1000 ? `${Math.round(ms)}ms` : `${(ms / 1000).toFixed(2)}s`;\n}\n\nexport function bytes(size: number): string {\n if (size < 1024) return `${size} B`;\n if (size < 1024 ** 2) return `${(size / 1024).toFixed(1)} kB`;\n return `${(size / 1024 ** 2).toFixed(1)} MB`;\n}\n\nexport function plural(count: number, noun: string): string {\n return `${count} ${noun}${count === 1 ? '' : 's'}`;\n}\n\n/** Times one build step, showing a live line while it runs. */\nexport async function step<T>(\n label: string,\n work: (progress: (detail: string) => void) => Promise<T>,\n describe: (value: T) => string,\n): Promise<T> {\n const started = performance.now();\n const progress = (detail: string) => {\n if (interactive)\n process.stdout.write(\n `\\r\\x1b[2K ${cyan('◇')} ${label.padEnd(20)} ${dim(detail)}`,\n );\n };\n progress('…');\n try {\n const value = await work(progress);\n const elapsed = duration(performance.now() - started);\n if (interactive) process.stdout.write('\\r\\x1b[2K');\n console.log(\n ` ${green('✓')} ${label.padEnd(20)} ${describe(value)} ${dim(elapsed)}`,\n );\n return value;\n } catch (error) {\n if (interactive) process.stdout.write('\\r\\x1b[2K');\n console.log(` ${red('✗')} ${label}`);\n throw error;\n }\n}\n\nfunction clock(): string {\n return dim(new Date().toTimeString().slice(0, 8));\n}\n\nfunction cellLabel(name: string, parameters: object): string {\n const shown = Object.entries(parameters)\n .map(\n ([key, value]) =>\n `${key}=${typeof value === 'string' ? value : JSON.stringify(value)}`,\n )\n .join(' ');\n return shown ? `${bold(name)} ${dim(shown)}` : bold(name);\n}\n\nexport function passed(result: RunResult): boolean {\n return (\n result.status === 'completed' &&\n (result.aggregateScoring?.passRate === 1 || Boolean(result.scoring?.passed))\n );\n}\n\n/** Live log for runs launched from the `evalkit dev` dashboard. */\nexport const runLog = {\n started(name: string, parameters: object = {}, suiteId?: string): void {\n const suite = suiteId ? dim(` (suite ${suiteId})`) : '';\n console.log(\n `${clock()} ${cyan('▶ run ')} ${cellLabel(name, parameters)}${suite}`,\n );\n },\n finished(\n name: string,\n parameters: object,\n result: RunResult,\n ms: number,\n ): void {\n const ok = passed(result);\n const trials = result.trials?.length ?? 1;\n const passedTrials = result.aggregateScoring?.passed ?? (ok ? trials : 0);\n const status =\n result.status === 'completed'\n ? ok\n ? green('✓ pass')\n : red('✗ fail')\n : red(`✗ ${result.status}`);\n console.log(\n `${clock()} ${status} ${cellLabel(name, parameters)} ${dim(`${passedTrials}/${trials} trials · ${duration(ms)}`)}`,\n );\n console.log(` ${dim(`report ${result.reportLocation}`)}`);\n },\n cell(cell: EvalMatrixCell, result: RunResult, ms: number): void {\n runLog.finished(\n cell.eval.name ?? authoringId(cell.eval),\n cell.parameters,\n result,\n ms,\n );\n },\n failed(name: string, error: unknown): void {\n console.log(\n `${clock()} ${red('✗ error')} ${bold(name)} ${error instanceof Error ? error.message : String(error)}`,\n );\n },\n};\n\n/**\n * The runner logs structured Effect lines; the CLI prints its own summaries, so\n * only warnings show by default. `EVALKIT_LOG_LEVEL=info` (or `debug`) restores them.\n */\nexport function runnerLogs<A, E, R>(\n effect: Effect.Effect<A, E, R>,\n): Effect.Effect<A, E, R> {\n const requested = process.env.EVALKIT_LOG_LEVEL?.toLowerCase();\n const level =\n LogLevel.allLevels.find((item) => item.label.toLowerCase() === requested) ??\n LogLevel.Warning;\n return effect.pipe(Logger.withMinimumLogLevel(level));\n}\n\n/** True when a person can answer a prompt (not CI, pipes, or redirected input). */\nexport function canPrompt(): boolean {\n return Boolean(process.stdin.isTTY && process.stdout.isTTY);\n}\n\nexport async function confirm(question: string): Promise<boolean> {\n const { createInterface } = await import('node:readline/promises');\n const prompt = createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n try {\n const answer = await prompt.question(\n ` ${cyan('?')} ${question} ${dim('(y/N)')} `,\n );\n return /^y(es)?$/i.test(answer.trim());\n } catch {\n // Ctrl+D or closed input answers \"no\".\n console.log('');\n return false;\n } finally {\n prompt.close();\n }\n}\n","import { execFile } from 'node:child_process';\nimport { realpath } from 'node:fs/promises';\nimport { basename, join, relative, sep } from 'node:path';\nimport { promisify } from 'node:util';\nimport type { EvalRegistry, RunCatalog, RunSource } from '@evalkit/core';\n\nconst exec = promisify(execFile);\ntype Env = Record<string, string | undefined>;\n\n/**\n * Normalize a git remote to a stable repository key: lowercase host, no\n * credentials, port, scheme, `.git`, or trailing slash.\n *\n * git@GitLab.example.com:group/sub/repo.git → gitlab.example.com/group/sub/repo\n * https://user:token@github.com/o/r/ → github.com/o/r\n * /srv/repos/thing.git (no host) → local/thing\n */\nexport function normalizeRepoUrl(url: string): string {\n const trimmed = url\n .trim()\n .replace(/\\/+$/, '')\n .replace(/\\.git$/, '');\n const scp = /^(?:[^@/]+@)?([^:/]+):(?!\\/)(.+)$/.exec(trimmed);\n if (scp && !/^[a-z]+:\\/\\//i.test(trimmed))\n return `${scp[1]!.toLowerCase()}/${scp[2]!.replace(/^\\/+/, '')}`;\n try {\n const parsed = new URL(trimmed);\n if (parsed.protocol !== 'file:' && parsed.hostname)\n return `${parsed.hostname.toLowerCase()}${parsed.pathname.replace(/\\/+$/, '')}`;\n } catch {\n // Not a URL: a local path.\n }\n return `local/${basename(trimmed)}`;\n}\n\nasync function git(\n cwd: string,\n ...args: string[]\n): Promise<string | undefined> {\n try {\n const { stdout } = await exec('git', ['-C', cwd, ...args], {\n timeout: 10_000,\n });\n return stdout.trim() || undefined;\n } catch {\n return undefined;\n }\n}\n\nconst posix = (path: string) => path.split(sep).join('/');\nconst projectPath = (root: string | undefined, projectRoot: string) =>\n root ? posix(relative(root, projectRoot)) : '';\n\nfunction ciSource(\n env: Env,\n projectRoot: string,\n): Omit<RunSource, 'dirty'> | undefined {\n if (env.EVALKIT_SOURCE_REPO && env.EVALKIT_SOURCE_COMMIT)\n return {\n repo: normalizeRepoUrl(env.EVALKIT_SOURCE_REPO),\n project: env.EVALKIT_SOURCE_PROJECT ?? '',\n commit: env.EVALKIT_SOURCE_COMMIT,\n ...(env.EVALKIT_SOURCE_REF ? { ref: env.EVALKIT_SOURCE_REF } : {}),\n ...(env.EVALKIT_SOURCE_COMMITTED_AT\n ? { committedAt: env.EVALKIT_SOURCE_COMMITTED_AT }\n : {}),\n };\n if (env.GITLAB_CI === 'true' && env.CI_PROJECT_URL && env.CI_COMMIT_SHA)\n return {\n repo: normalizeRepoUrl(env.CI_PROJECT_URL),\n project: projectPath(env.CI_PROJECT_DIR, projectRoot),\n commit: env.CI_COMMIT_SHA,\n ...((env.CI_MERGE_REQUEST_SOURCE_BRANCH_NAME ?? env.CI_COMMIT_REF_NAME)\n ? {\n ref:\n env.CI_MERGE_REQUEST_SOURCE_BRANCH_NAME ?? env.CI_COMMIT_REF_NAME,\n }\n : {}),\n ...(env.CI_COMMIT_TIMESTAMP\n ? { committedAt: env.CI_COMMIT_TIMESTAMP }\n : {}),\n ci: {\n provider: 'gitlab',\n ...(env.CI_PIPELINE_ID ? { pipeline: env.CI_PIPELINE_ID } : {}),\n ...(env.CI_JOB_ID ? { job: env.CI_JOB_ID } : {}),\n ...(env.CI_JOB_URL ? { url: env.CI_JOB_URL } : {}),\n },\n };\n if (\n env.GITHUB_ACTIONS === 'true' &&\n env.GITHUB_REPOSITORY &&\n env.GITHUB_SHA\n ) {\n const server = env.GITHUB_SERVER_URL ?? 'https://github.com';\n return {\n repo: normalizeRepoUrl(`${server}/${env.GITHUB_REPOSITORY}`),\n project: projectPath(env.GITHUB_WORKSPACE, projectRoot),\n commit: env.GITHUB_SHA,\n ...(env.GITHUB_HEAD_REF || env.GITHUB_REF_NAME\n ? { ref: env.GITHUB_HEAD_REF || env.GITHUB_REF_NAME }\n : {}),\n ci: {\n provider: 'github',\n ...(env.GITHUB_RUN_ID ? { pipeline: env.GITHUB_RUN_ID } : {}),\n ...(env.GITHUB_JOB ? { job: env.GITHUB_JOB } : {}),\n ...(env.GITHUB_RUN_ID\n ? {\n url: `${server}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}`,\n }\n : {}),\n },\n };\n }\n return undefined;\n}\n\n/**\n * Determine which repository and commit this project's eval code comes from.\n * Order: EVALKIT_SOURCE_* variables, GitLab/GitHub CI variables, then git.\n * Returns undefined outside git with no CI variables (\"untracked\" results).\n *\n * `outputDirs` (results, sandbox, snapshot) never make the tree dirty, even\n * when a project forgot to ignore them.\n */\nexport async function detectSource(\n givenRoot: string,\n options: { env?: Env; outputDirs?: readonly string[] } = {},\n): Promise<RunSource | undefined> {\n const env = options.env ?? process.env;\n // git reports resolved paths (macOS: /var → /private/var); compare like with like.\n const projectRoot = await realpath(givenRoot).catch(() => givenRoot);\n const top = await git(projectRoot, 'rev-parse', '--show-toplevel');\n const excludes = top\n ? (options.outputDirs ?? [])\n .map((dir) => join(projectRoot, relative(givenRoot, dir)))\n .map((dir) => posix(relative(top, dir)))\n .filter((dir) => dir && !dir.startsWith('..'))\n .map((dir) => `:(exclude)${dir}`)\n : [];\n const dirty = top\n ? Boolean(await git(top, 'status', '--porcelain', '--', '.', ...excludes))\n : false;\n const fromCi = ciSource(env, projectRoot);\n if (fromCi)\n return {\n ...fromCi,\n ...(top && !env.EVALKIT_SOURCE_PROJECT\n ? { project: projectPath(top, projectRoot) }\n : {}),\n dirty,\n };\n if (!top) return undefined;\n const commit = await git(top, 'rev-parse', 'HEAD');\n if (!commit) return undefined; // A repository with no commits yet.\n const remote =\n (await git(top, 'config', '--get', 'remote.origin.url')) ??\n (await git(top, 'remote'))\n ?.split('\\n')\n .map((name) => name.trim())\n .find(Boolean);\n const remoteUrl =\n remote && !remote.includes('/') && !remote.includes(':')\n ? await git(top, 'config', '--get', `remote.${remote}.url`)\n : remote;\n const ref = await git(top, 'symbolic-ref', '--short', '-q', 'HEAD');\n const committedAt = await git(top, 'show', '-s', '--format=%cI', 'HEAD');\n return {\n repo: normalizeRepoUrl(remoteUrl ?? top),\n project: projectPath(top, projectRoot),\n commit,\n ...(ref ? { ref } : {}),\n ...(committedAt ? { committedAt } : {}),\n dirty,\n };\n}\n\n/** The project's evals and suites, saved with each run (`catalog.json`). */\nexport function runCatalog(registry: EvalRegistry): RunCatalog {\n return {\n catalog: registry.catalog(),\n evals: registry.metadata(),\n suites: registry.suiteMetadata(),\n };\n}\n\n/** `abc1234` or `abc1234+dirty`. */\nexport function shortSource(source: RunSource): string {\n return `${source.commit.slice(0, 7)}${source.dirty ? '+dirty' : ''}`;\n}\n","import { parseArgs } from 'node:util';\nimport { resolve } from 'node:path';\nimport { Effect } from 'effect';\nimport {\n authoringId,\n defineEvalMatrix,\n type JsonObject,\n type JsonValue,\n type MatrixSelection,\n} from '@evalkit/core';\nimport { localReportStore, runMatrix } from '@evalkit/runner';\nimport { runnerLogs } from './terminal.js';\nimport { detectSource, runCatalog, shortSource } from './source.js';\nimport { loadProject } from './project.js';\n\nexport function parseRunArgs(args: string[]) {\n const { values, positionals } = parseArgs({\n args,\n allowPositionals: true,\n strict: true,\n options: {\n config: { type: 'string' },\n eval: { type: 'string', multiple: true },\n suite: { type: 'string' },\n matrix: { type: 'string' },\n model: { type: 'string', multiple: true },\n mode: { type: 'string', multiple: true },\n select: { type: 'string', multiple: true },\n param: { type: 'string', multiple: true },\n 'max-tokens': { type: 'string' },\n 'chat-timeout-ms': { type: 'string' },\n 'turn-budget': { type: 'string' },\n concurrency: { type: 'string' },\n trials: { type: 'string' },\n json: { type: 'boolean' },\n 'dry-run': { type: 'boolean' },\n all: { type: 'boolean' },\n local: { type: 'boolean' },\n },\n });\n return normalizeRunOptions(values, positionals);\n}\n\n/** Domain validation shared by the Effect CLI and programmatic argument parsing. */\nexport function normalizeRunOptions(\n values: {\n config?: string;\n eval?: string[];\n suite?: string;\n matrix?: string;\n model?: string[];\n mode?: string[];\n select?: string[];\n param?: string[];\n 'max-tokens'?: string;\n 'chat-timeout-ms'?: string;\n 'turn-budget'?: string;\n concurrency?: string;\n trials?: string;\n json?: boolean;\n 'dry-run'?: boolean;\n all?: boolean;\n local?: boolean;\n },\n positionals: string[],\n) {\n const parameters: JsonObject = {};\n function integer(name: keyof typeof values): number | undefined {\n const value = values[name];\n if (value === undefined) return undefined;\n const number = Number(value);\n if (!Number.isSafeInteger(number) || number < 1)\n throw new Error(`--${name} must be a positive integer`);\n return number;\n }\n for (const [flag, key] of [\n ['max-tokens', 'maxTokens'],\n ['chat-timeout-ms', 'chatTimeoutMs'],\n ['turn-budget', 'turnBudget'],\n ] as const) {\n const value = integer(flag);\n if (value !== undefined) parameters[key] = value;\n }\n const selection: Record<string, JsonValue[]> = {};\n for (const key of ['model', 'mode'] as const) {\n if (values[key]?.length)\n selection[key] = values[key].flatMap((value) => value.split(','));\n }\n for (const value of values.select ?? []) {\n const index = value.indexOf('=');\n if (index < 1) throw new Error('--select requires axis=value');\n const axis = value.slice(0, index);\n let choice: JsonValue;\n try {\n choice = JSON.parse(value.slice(index + 1));\n } catch {\n choice = value.slice(index + 1);\n }\n (selection[axis] ??= []).push(choice);\n }\n for (const value of values.param ?? []) {\n const index = value.indexOf('=');\n if (index < 1) throw new Error('--param requires name=JSON');\n parameters[value.slice(0, index)] = JSON.parse(value.slice(index + 1));\n }\n if (values.suite && values.matrix)\n throw new Error('--suite and --matrix cannot be used together');\n if ((values.suite || values.matrix) && positionals.length)\n throw new Error('Use --eval to select evals with --suite or --matrix');\n return {\n values,\n positionals,\n parameters,\n selection,\n concurrency: integer('concurrency'),\n trials: integer('trials'),\n };\n}\n\nexport async function runProjectCommand(\n args: string[],\n cwd = process.cwd(),\n parsed = parseRunArgs(args),\n): Promise<void> {\n const { values, positionals, parameters } = parsed;\n const project = await loadProject(cwd, values.config);\n // Fixture src paths are relative to the config project, even when invoked elsewhere.\n process.chdir(project.root);\n const registry = project.registry;\n const requestedEvals =\n values.eval?.flatMap((value) => value.split(',')) ?? [];\n let matrix;\n let suiteId: string | undefined;\n if (values.suite) {\n const suite = registry.suites.find((item) => item.id === values.suite);\n if (!suite) throw new Error(`Unknown suite: ${values.suite}`);\n suiteId = authoringId(suite);\n matrix = defineEvalMatrix({\n id: 'default',\n evals: suite.evals,\n parameters: project.config.matrix?.parameters ?? {},\n defaults: project.config.matrix?.defaults,\n cases: project.config.matrix?.cases,\n exclude: project.config.matrix?.exclude,\n });\n } else if (values.matrix) {\n matrix = registry.matrices.find((item) => item.id === values.matrix);\n if (!matrix) throw new Error(`Unknown matrix: ${values.matrix}`);\n } else {\n requestedEvals.push(...positionals.flatMap((value) => value.split(',')));\n matrix = project.config.matrix\n ? registry.matrices.at(-1)!\n : defineEvalMatrix({\n id: 'default',\n evals: registry.evals,\n parameters: {},\n });\n }\n const selection: MatrixSelection = {\n parameters: {},\n overrides: { ...parameters },\n ...(requestedEvals.length ? { evals: requestedEvals } : {}),\n };\n for (const [axis, choices] of Object.entries(parsed.selection)) {\n if (\n axis in matrix.parameters ||\n matrix.cases?.some((assignment) => Object.hasOwn(assignment, axis))\n )\n (selection.parameters as Record<string, JsonValue[]>)[axis] = choices;\n else if (\n (axis === 'model' || axis === 'mode') &&\n choices.length === 1 &&\n !project.config.matrix &&\n !values.matrix\n )\n selection.overrides![axis] = choices[0]!;\n else throw new Error(`Unknown matrix axis: ${axis}`);\n }\n const cells = matrix.count(selection);\n if (!cells)\n throw new Error(\n 'Selection contains no eligible cells; check cases and exclusions',\n );\n const trials = parsed.trials ?? project.config.execution?.trials;\n const plan = {\n matrix: authoringId(matrix),\n evals: requestedEvals,\n cells,\n parameters: selection.parameters,\n overrides: selection.overrides,\n trials: trials ?? 'eval policy',\n };\n if (values['dry-run']) {\n console.log(JSON.stringify(plan, null, 2));\n return;\n }\n if (cells > (project.config.execution?.maxCells ?? 100) && !values.all)\n throw new Error(\n `Selected ${cells} cells. Narrow the selection, inspect --dry-run, or pass --all.`,\n );\n const reportDir = resolve(\n project.root,\n project.config.reportDir ?? '_evalkit-results',\n );\n const sandboxDir = resolve(\n project.root,\n project.config.sandboxDir ?? '_evalkit-sandbox',\n );\n const source = await detectSource(project.root, {\n outputDirs: [\n reportDir,\n sandboxDir,\n resolve(project.root, '_evalkit-dashboard'),\n ],\n });\n if (!values.json)\n console.log(\n `Running ${cells} cell(s) from ${plan.matrix}` +\n (source\n ? ` at ${shortSource(source)}${source.ref ? ` (${source.ref})` : ''}`\n : ' (untracked: not in a git repository)'),\n );\n const summary = await Effect.runPromise(\n runnerLogs(\n runMatrix(matrix, {\n selection,\n concurrency:\n parsed.concurrency ?? project.config.execution?.concurrency ?? 4,\n trials,\n ...(suiteId ? { suiteId } : {}),\n ...(values.local ? { runtime: 'local' as const } : {}),\n ...(source ? { source } : {}),\n catalog: runCatalog(registry),\n report: localReportStore(reportDir),\n workspaceRoot: sandboxDir,\n onResult: (cell, result) => {\n if (values.json)\n console.log(\n JSON.stringify({\n cell: {\n key: cell.key,\n eval: authoringId(cell.eval),\n parameters: cell.parameters,\n },\n result,\n }),\n );\n else {\n const passed =\n result.status === 'completed' &&\n (result.aggregateScoring?.passRate === 1 ||\n result.scoring?.passed);\n console.log(\n `${passed ? 'PASS' : 'FAIL'} ${cell.eval.name ?? authoringId(cell.eval)} ${JSON.stringify(cell.parameters)}\\n report: ${result.reportLocation}`,\n );\n for (const trial of result.trials ?? [result]) {\n for (const checkpoint of trial.scoring?.checkpoints ?? [])\n console.log(\n ` step ${checkpoint.step} ${checkpoint.kind} ${checkpoint.name}: ${checkpoint.status}${checkpoint.value === undefined ? '' : ` (${checkpoint.value})`}`,\n );\n for (const score of trial.scoring?.results ?? [])\n console.log(\n ` ${score.kind} ${score.name}: ${score.value ?? 'error'} ${score.explanation ?? ''}`,\n );\n }\n }\n },\n }),\n ),\n );\n if (summary.failed) process.exitCode = 1;\n}\n","import { rm, writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { authoringId, type EvalRegistry } from '@evalkit/core';\nimport {\n ARCHIVE_MARKER,\n createDashboardReportReader,\n} from './dashboard-reports.js';\n\nexport type TidyResult = {\n /** Runs newly archived because their eval left the project. */\n archived: { runId: string; evalId: string }[];\n /** Previously archived runs whose eval is back in the project. */\n restored: { runId: string; evalId: string }[];\n /** Runs left archived from an earlier tidy. */\n stillArchived: number;\n /** Runs whose eval is still in the project. */\n current: number;\n};\n\n/**\n * Every eval the project can run: standalone, in suites, or only in matrices.\n * A run is archived only when its eval is in none of these.\n */\nexport function projectEvalIds(registry: EvalRegistry): Set<string> {\n return new Set(\n [\n ...registry.evals,\n ...registry.suites.flatMap((suite) => suite.evals),\n ...registry.matrices.flatMap((matrix) => matrix.evals),\n ].map(authoringId),\n );\n}\n\n/**\n * Mark runs of removed evals as archived, and restore runs whose eval returned.\n * Reports are never deleted: archiving writes a marker file beside the manifest.\n */\nexport async function tidyReports(options: {\n registry: EvalRegistry;\n reportRoot: string;\n}): Promise<TidyResult> {\n const known = projectEvalIds(options.registry);\n const reports = createDashboardReportReader(\n options.reportRoot,\n options.registry,\n );\n const result: TidyResult = {\n archived: [],\n restored: [],\n stillArchived: 0,\n current: 0,\n };\n for (const run of await reports.listRuns()) {\n const marker = resolve(options.reportRoot, run.id, ARCHIVE_MARKER);\n const entry = { runId: run.id, evalId: run.evalId };\n if (known.has(run.evalId)) {\n result.current += 1;\n if (run.archived) {\n await rm(marker, { force: true });\n result.restored.push(entry);\n }\n } else if (run.archived) {\n result.stillArchived += 1;\n } else {\n await writeFile(\n marker,\n `${JSON.stringify({\n archivedAt: new Date().toISOString(),\n reason: `Eval \"${run.evalId}\" is no longer in the project`,\n })}\\n`,\n );\n result.archived.push(entry);\n }\n }\n return result;\n}\n","import { readFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport type {\n EvalRegistry,\n RunSource,\n ShareConfig,\n ShareHeaders,\n} from '@evalkit/core';\nimport { encodeBundle, repoKey, type BundleFile } from '@evalkit/share';\nimport { snapshotRun, type BuildStep } from './dashboard-build.js';\nimport {\n createDashboardReportReader,\n type LocalRun,\n} from './dashboard-reports.js';\nimport { runCatalog, shortSource } from './source.js';\nimport { plural } from './terminal.js';\n\nexport type ShareSelection = {\n selected: (LocalRun & { source: RunSource })[];\n untracked: number;\n otherCommits: number;\n dirty: number;\n archived: number;\n /** Still running: a shared run is immutable, so it must be finished. */\n running: number;\n};\n\n/**\n * Which local runs `evalkit share` uploads: finished runs with a source, at\n * HEAD (or any commit with `all`), not dirty (unless `allowDirty`), not archived.\n */\nexport function selectRuns(\n runs: readonly LocalRun[],\n head: RunSource,\n options: { all?: boolean; allowDirty?: boolean },\n): ShareSelection {\n const result: ShareSelection = {\n selected: [],\n untracked: 0,\n otherCommits: 0,\n dirty: 0,\n archived: 0,\n running: 0,\n };\n for (const run of runs) {\n const { source } = run;\n if (!source) result.untracked += 1;\n else if (\n !options.all &&\n (source.commit !== head.commit || repoKey(source) !== repoKey(head))\n )\n result.otherCommits += 1;\n else if (source.dirty && !options.allowDirty) result.dirty += 1;\n else if (run.archived) result.archived += 1;\n else if (run.status === 'running') result.running += 1;\n else result.selected.push({ ...run, source });\n }\n return result;\n}\n\n/** One line for the Runs step: what will be shared and what was skipped. */\nexport function selectionSummary(\n selection: ShareSelection,\n options: { all?: boolean },\n): string {\n return [\n `${plural(selection.selected.length, 'run')} to share`,\n selection.otherCommits && !options.all\n ? `${selection.otherCommits} from other commits`\n : '',\n selection.running ? `${selection.running} still running skipped` : '',\n selection.dirty ? `${selection.dirty} dirty skipped` : '',\n selection.untracked ? `${selection.untracked} untracked skipped` : '',\n selection.archived ? `${selection.archived} archived skipped` : '',\n ]\n .filter(Boolean)\n .join(' · ');\n}\n\n/** Why nothing was selected, and what to do about it. */\nexport function noRunsMessage(\n selection: ShareSelection,\n head: RunSource,\n options: { all?: boolean },\n): string {\n const at = shortSource(head);\n if (selection.dirty)\n return `No committed runs for ${at}: ${plural(selection.dirty, 'run')} came from uncommitted changes. Commit and rerun \\`evalkit run\\`, or pass --allow-dirty.`;\n if (selection.running)\n return `No finished runs for ${at}: ${plural(selection.running, 'run')} still running. Share again when they finish.`;\n return `No runs for ${at}. Run \\`evalkit run\\` first${options.all ? '' : ', or pass --all to share runs from other commits'}.`;\n}\n\n/** Where to look after sharing: the commit, or the repository if several commits were shared. */\nexport function shareTarget(\n serverUrl: string,\n head: RunSource,\n runs: readonly { source: RunSource }[],\n): string {\n const commits = new Set(runs.map((run) => run.source.commit));\n const commit = commits.size === 1 ? `/-/${[...commits][0]}` : '';\n return new URL(`/${repoKey(head)}${commit}`, serverUrl).href;\n}\n\n/** Build one run's upload bundle: run.json, catalog.json, and its snapshot. */\nexport async function runBundle(options: {\n reports: ReturnType<typeof createDashboardReportReader>;\n reportRoot: string;\n registry: EvalRegistry;\n run: LocalRun;\n workspaceFiles: boolean;\n}): Promise<Uint8Array> {\n const files: BundleFile[] = [];\n const encode = (value: unknown) =>\n new TextEncoder().encode(`${JSON.stringify(value)}\\n`);\n files.push({ path: 'run.json', data: encode(options.run) });\n // Runs from schema version 4 save the catalog they ran with.\n const saved = await readFile(\n resolve(options.reportRoot, options.run.id, 'catalog.json'),\n ).catch(() => undefined);\n files.push({\n path: 'catalog.json',\n data: saved ? new Uint8Array(saved) : encode(runCatalog(options.registry)),\n });\n await snapshotRun(\n options.reports,\n options.run.id,\n {\n async json(path, value) {\n files.push({ path, data: encode(value) });\n },\n async bytes(path, data) {\n files.push({ path, data });\n },\n },\n { workspaceFiles: options.workspaceFiles },\n );\n return encodeBundle(files);\n}\n\nexport type UploadResult = { status: 'created' | 'exists'; url: string };\n\n/** The server refused this bundle (4xx): retrying it cannot help. */\nclass UploadRejected extends Error {}\n\n/**\n * The URL does not answer as an EvalKit share server (a redirect, an HTML page,\n * an auth proxy). Every upload would fail the same way, so sharing stops.\n */\nexport class ShareServerError extends Error {}\n\n/** `share.headers` from the config: called once, checked, never printed. */\nexport async function resolveShareHeaders(\n headers: ShareConfig['headers'],\n): Promise<ShareHeaders> {\n let value: unknown;\n try {\n value = typeof headers === 'function' ? await headers() : (headers ?? {});\n } catch (error) {\n throw new Error(\n `share.headers failed: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n if (!value || typeof value !== 'object' || Array.isArray(value))\n throw new Error(\n 'share.headers must be an object of header names to values',\n );\n const entries = Object.entries(value);\n for (const [name, item] of entries)\n if (typeof item !== 'string' || !item)\n throw new Error(`share.headers \"${name}\" must be a non-empty string`);\n return Object.fromEntries(entries) as ShareHeaders;\n}\n\n/** Check that the URL is an EvalKit share server and the headers get through. */\nexport async function checkShareServer(\n serverUrl: string,\n headers: ShareHeaders,\n): Promise<void> {\n const response = await fetch(new URL('/api/v1/repos', serverUrl), {\n headers,\n redirect: 'manual',\n });\n await expectShareServer(response, serverUrl);\n await response.body?.cancel();\n}\n\n/** POST one bundle, retrying network errors and 5xx responses. */\nexport async function uploadBundle(\n serverUrl: string,\n bundle: Uint8Array,\n options: { attempts?: number; delayMs?: number; headers?: ShareHeaders } = {},\n): Promise<UploadResult> {\n const attempts = options.attempts ?? 3;\n let lastError: unknown;\n for (let attempt = 1; attempt <= attempts; attempt++) {\n try {\n return await postBundle(serverUrl, bundle, options.headers ?? {});\n } catch (error) {\n if (error instanceof UploadRejected || error instanceof ShareServerError)\n throw error;\n lastError = error;\n }\n if (attempt < attempts)\n await Bun.sleep((options.delayMs ?? 500) * 2 ** (attempt - 1));\n }\n throw lastError instanceof Error\n ? lastError\n : new Error(`Upload failed: ${String(lastError)}`);\n}\n\nasync function postBundle(\n serverUrl: string,\n bundle: Uint8Array,\n headers: ShareHeaders,\n): Promise<UploadResult> {\n const response = await fetch(new URL('/api/v1/uploads', serverUrl), {\n method: 'POST',\n headers: { ...headers, 'content-type': 'application/octet-stream' },\n body: bundle as BodyInit,\n redirect: 'manual',\n });\n await expectShareServer(response, serverUrl);\n if (response.ok) return parseUploadResult(await response.json());\n const reason = await response.text();\n if (response.status < 500)\n throw new UploadRejected(`Share server rejected the upload: ${reason}`);\n throw new Error(`Share server error ${response.status}: ${reason}`);\n}\n\nfunction parseUploadResult(value: unknown): UploadResult {\n const result = value as Partial<UploadResult> | null;\n if (\n (result?.status === 'created' || result?.status === 'exists') &&\n typeof result.url === 'string'\n )\n return { status: result.status, url: result.url };\n throw new ShareServerError(\n `Unexpected share server response: ${JSON.stringify(value)}`,\n );\n}\n\n/** Redirects and non-JSON answers come from something in front of the server. */\nasync function expectShareServer(\n response: Response,\n serverUrl: string,\n): Promise<void> {\n if (response.status >= 300 && response.status < 400) {\n const location = response.headers.get('location');\n const target = location ? new URL(location, serverUrl).host : 'elsewhere';\n throw new ShareServerError(\n `${new URL(serverUrl).host} redirected to ${target} instead of answering. ` +\n 'If an auth proxy is in front of the share server, set share.headers in evalkit.config.ts.',\n );\n }\n const type = response.headers.get('content-type') ?? '';\n const denied = response.status === 401 || response.status === 403;\n // 5xx answers (often HTML from a proxy) are retried by the caller.\n if (denied || (response.ok && !type.includes('json')))\n throw new ShareServerError(\n `${new URL(serverUrl).host} did not answer as an EvalKit share server ` +\n `(${response.status}${type ? `, ${type.split(';')[0]}` : ''}). ` +\n (denied ? 'Check share.headers.' : 'Check share.url.'),\n );\n}\n\nexport type ShareResult = {\n created: number;\n exists: number;\n failed: { runId: string; error: string }[];\n bytes: number;\n};\n\nexport async function shareRuns(options: {\n serverUrl: string;\n headers: ShareHeaders;\n reportRoot: string;\n registry: EvalRegistry;\n runs: readonly LocalRun[];\n workspaceFiles: boolean;\n step: BuildStep;\n}): Promise<ShareResult> {\n const reports = createDashboardReportReader(\n options.reportRoot,\n options.registry,\n );\n return options.step(\n 'Uploading',\n async (progress) => {\n const result: ShareResult = {\n created: 0,\n exists: 0,\n failed: [],\n bytes: 0,\n };\n for (const [index, run] of options.runs.entries()) {\n progress(\n `run ${index + 1}/${options.runs.length} · ${formatBytes(result.bytes)}`,\n );\n try {\n const bundle = await runBundle({\n reports,\n reportRoot: options.reportRoot,\n registry: options.registry,\n run,\n workspaceFiles: options.workspaceFiles,\n });\n const uploaded = await uploadBundle(options.serverUrl, bundle, {\n headers: options.headers,\n });\n result.bytes += bundle.byteLength;\n result[uploaded.status] += 1;\n } catch (error) {\n if (error instanceof ShareServerError) throw error;\n result.failed.push({\n runId: run.id,\n error: error instanceof Error ? error.message : String(error),\n });\n }\n }\n return result;\n },\n (result) =>\n `${result.created} new · ${result.exists} already shared` +\n (result.failed.length ? ` · ${result.failed.length} failed` : '') +\n ` · ${formatBytes(result.bytes)}`,\n );\n}\n\nfunction formatBytes(size: number): string {\n if (size < 1024) return `${size} B`;\n if (size < 1024 ** 2) return `${(size / 1024).toFixed(1)} kB`;\n return `${(size / 1024 ** 2).toFixed(1)} MB`;\n}\n","/** Provider-free example: one fixture, agent, scorer, and a two-cell matrix. */\nexport const starterFiles: Record<string, string> = {\n 'tsconfig.json': `${JSON.stringify(\n {\n compilerOptions: {\n target: 'ES2022',\n module: 'ESNext',\n moduleResolution: 'Bundler',\n strict: true,\n noEmit: true,\n types: ['bun'],\n },\n include: [\n 'agents/**/*.ts',\n 'evals/**/*.ts',\n 'judges/**/*.ts',\n 'evalkit.config.ts',\n ],\n },\n null,\n 2,\n )}\\n`,\n 'evalkit.config.ts': `import { defineConfig } from '@leostera/evalkit';\n\nexport default defineConfig({\n // Default-exported evals in evals/*.eval.ts are discovered automatically.\n matrix: {\n id: 'styles',\n parameters: { style: ['plain', 'shout'] },\n },\n execution: { concurrency: 2, maxCells: 20 },\n});\n`,\n 'fixtures/greeting.txt': 'Hello\\n',\n 'agents/greeting-agent.ts': `import { readFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { defineAgent } from '@leostera/evalkit';\n\n// Replace this in-process example with an adapter for your own agent.\nexport const greetingAgent = defineAgent({\n identity: { id: 'greeting-agent', kind: 'in-process' },\n runtimes: { local: { kind: 'in-process' } },\n async start({ context, onEvent }) {\n return {\n async send(message: string) {\n // Fixtures copied to the candidate workspace are visible to the AUT.\n const prefix = (await readFile(join(context.workspace.root, 'greeting.txt'), 'utf8')).trim();\n const style = context.parameters?.style;\n if (style !== 'plain' && style !== 'shout')\n throw new Error(\\`Unknown style: \\${String(style)}\\`);\n const greeting = \\`\\${prefix}, \\${message}!\\`;\n await onEvent({\n kind: 'message', role: 'assistant',\n content: style === 'shout' ? greeting.toUpperCase() : greeting,\n timestamp: new Date().toISOString(),\n });\n },\n async close() {},\n };\n },\n});\n`,\n 'judges/matches-greeting.ts': `import { predicate } from '@leostera/evalkit';\n\n// Deterministic scorers need no judge model; add a separate judge agent for judge(...) rules.\nexport const matchesGreeting = predicate('matches greeting and style', ({ context, trajectory }) => {\n const reply = trajectory.events.filter(\n (event) => event.source === 'aut' && event.kind === 'message' && event.role === 'assistant',\n ).at(-1);\n const expected = context.parameters?.style === 'shout' ? 'HELLO, ADA!' : 'Hello, Ada!';\n return {\n value: reply?.kind === 'message' && reply.content === expected ? 1 : 0,\n explanation: \\`Expected \\${expected}\\`,\n };\n});\n`,\n 'evals/greeting.eval.ts': `import { defineEval, file, user } from '@leostera/evalkit';\nimport { greetingAgent } from '../agents/greeting-agent.js';\nimport { matchesGreeting } from '../judges/matches-greeting.js';\n\nexport default defineEval({\n id: 'greeting',\n agent: greetingAgent,\n fixtures: [file('fixtures/greeting.txt', { dst: 'greeting.txt', visibility: 'candidate' })],\n transcript: [user('Ada')],\n scoring: [matchesGreeting],\n});\n`,\n};\n\nexport function starterReadme(name: string): string {\n return `# ${name}\n\nA local EvalKit project. Each default-exported eval in \\`evals/\\` is discovered automatically.\nStart with \\`evals/greeting.eval.ts\\`: it imports an in-process agent from \\`agents/\\`,\na deterministic scorer from \\`judges/\\`, and a candidate-visible file from \\`fixtures/\\`.\nReplace these examples with your own agent, tasks, and checks.\n\n\\`evalkit.config.ts\\` defines a provider-free \\`styles\\` matrix; the example agent reads\n\\`context.parameters.style\\`. Run:\n\n\\`\\`\\`sh\nbun install\nbun run check # type-check your eval, agent, scorer, and config\nbun run evalkit run # run the example across both styles\nbun run evalkit run --matrix styles --dry-run # inspect the matrix without running it\nbun run evalkit dev # inspect local reports and launch runs\nbun run evalkit build # write a read-only, shareable snapshot\n\\`\\`\\`\n\nEvalKit installs from npm. Reports, trial workspaces, and dashboard snapshots stay local\nand are ignored by Git. A snapshot in \\`_evalkit-dashboard/\\` contains report messages,\nscores, evidence, and candidate files (never evaluator workspaces): review it before sharing.\n`;\n}\n","import { mkdir, readFile, stat, writeFile } from 'node:fs/promises';\nimport { basename, resolve } from 'node:path';\nimport { starterFiles, starterReadme } from './new-project-template.js';\n\nconst npmDependency = '^0.5.0';\nconst ignored = [\n 'node_modules/',\n '_evalkit-results/',\n '_evalkit-sandbox/',\n '_evalkit-dashboard/',\n '_evalkit-share/',\n];\n\nconst readIfExists = async (path: string): Promise<string | undefined> => {\n try {\n return await readFile(path, 'utf8');\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return undefined;\n throw error;\n }\n};\n\nconst exists = async (path: string): Promise<boolean> => {\n try {\n await stat(path);\n return true;\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return false;\n throw error;\n }\n};\n\n/** Create a standalone project, or initialize an existing project in place with `new .`. */\nexport async function newProject(\n args: string[],\n cwd = process.cwd(),\n): Promise<string> {\n const { root, name, inPlace } = projectTarget(args, cwd);\n await prepareDirectory(root, inPlace);\n const packagePath = resolve(root, 'package.json');\n const pkg = await preparePackage(packagePath, name);\n await writeStarterFiles(root, inPlace);\n await updateGitignore(root);\n await writeStarterReadme(root, name, inPlace);\n // Persist metadata last; never replace an existing dependency or script.\n await writeFile(packagePath, `${JSON.stringify(pkg, null, 2)}\\n`);\n return root;\n}\n\nfunction projectTarget(args: string[], cwd: string) {\n const inPlace = args.length === 1 && (args[0] === '.' || args[0] === './');\n const match =\n args.length === 1\n ? /^(?:\\.\\/)?([a-z][a-z0-9]*(?:-[a-z0-9]+)*)$/.exec(args[0]!)\n : null;\n if (!inPlace && !match)\n throw new Error('Usage: evalkit new <lowercase-kebab-case-directory|.>');\n const root = inPlace ? resolve(cwd) : resolve(cwd, match![1]!);\n const name = inPlace\n ? basename(root)\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-|-$/g, '') || 'evalkit-evals'\n : match![1]!;\n return { root, name, inPlace };\n}\n\nasync function prepareDirectory(root: string, inPlace: boolean): Promise<void> {\n if (inPlace) {\n if (!(await stat(root)).isDirectory())\n throw new Error(`Not a directory: ${root}`);\n await checkExistingScaffold(root);\n } else {\n // Atomic mkdir refuses to replace any existing project, even an empty one.\n try {\n await mkdir(root);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'EEXIST')\n throw new Error(`Directory already exists: ${root}`);\n throw error;\n }\n }\n}\n\nasync function checkExistingScaffold(root: string): Promise<void> {\n // Validate everything before touching an existing project.\n for (const path of Object.keys(starterFiles).filter(\n (path) => path !== 'tsconfig.json',\n ))\n if (await exists(resolve(root, path)))\n throw new Error(`Scaffold file already exists: ${resolve(root, path)}`);\n for (const extension of ['js', 'mjs'])\n if (await exists(resolve(root, `evalkit.config.${extension}`)))\n throw new Error(\n `EvalKit config already exists: evalkit.config.${extension}`,\n );\n for (const directory of ['agents', 'fixtures', 'evals', 'judges']) {\n const path = resolve(root, directory);\n if ((await exists(path)) && !(await stat(path)).isDirectory())\n throw new Error(`Scaffold directory is not a directory: ${path}`);\n }\n}\n\nasync function preparePackage(\n packagePath: string,\n name: string,\n): Promise<Record<string, unknown>> {\n const originalPackage = await readIfExists(packagePath);\n const pkg = originalPackage\n ? (JSON.parse(originalPackage) as Record<string, unknown>)\n : ({ name, private: true, type: 'module' } as Record<string, unknown>);\n if (!pkg || Array.isArray(pkg) || typeof pkg !== 'object')\n throw new Error(`Invalid package.json: ${packagePath}`);\n const scripts = (pkg.scripts ?? {}) as Record<string, string>;\n const dependencies = (pkg.dependencies ?? {}) as Record<string, string>;\n const devDependencies = (pkg.devDependencies ?? {}) as Record<string, string>;\n if (\n !scripts ||\n typeof scripts !== 'object' ||\n Array.isArray(scripts) ||\n !dependencies ||\n typeof dependencies !== 'object' ||\n Array.isArray(dependencies) ||\n !devDependencies ||\n typeof devDependencies !== 'object' ||\n Array.isArray(devDependencies)\n )\n throw new Error(\n `Invalid package.json scripts/dependencies: ${packagePath}`,\n );\n scripts.check ??= 'tsc --noEmit';\n if (\n !dependencies['@leostera/evalkit'] &&\n !devDependencies['@leostera/evalkit']\n )\n dependencies['@leostera/evalkit'] = npmDependency;\n if (!dependencies.typescript && !devDependencies.typescript)\n devDependencies.typescript = '^6.0.0';\n if (!dependencies['@types/bun'] && !devDependencies['@types/bun'])\n devDependencies['@types/bun'] = '^1.4.0';\n pkg.scripts = scripts;\n pkg.dependencies = dependencies;\n pkg.devDependencies = devDependencies;\n return pkg;\n}\n\nasync function writeStarterFiles(\n root: string,\n inPlace: boolean,\n): Promise<void> {\n for (const [path, contents] of Object.entries(starterFiles)) {\n const target = resolve(root, path);\n if (inPlace && path === 'tsconfig.json' && (await exists(target))) continue;\n await mkdir(resolve(target, '..'), { recursive: true });\n await writeFile(target, contents, { flag: 'wx' });\n }\n}\n\nasync function updateGitignore(root: string): Promise<void> {\n const ignorePath = resolve(root, '.gitignore');\n const existingIgnore = (await readIfExists(ignorePath)) ?? '';\n const missing = ignored.filter(\n (entry) => !existingIgnore.split(/\\r?\\n/).includes(entry),\n );\n if (missing.length)\n await writeFile(\n ignorePath,\n `${existingIgnore}${existingIgnore && !existingIgnore.endsWith('\\n') ? '\\n' : ''}${missing.join('\\n')}\\n`,\n );\n}\n\nasync function writeStarterReadme(\n root: string,\n name: string,\n inPlace: boolean,\n): Promise<void> {\n const readmePath = resolve(root, 'README.md');\n if (!inPlace && !(await exists(readmePath)))\n await writeFile(readmePath, starterReadme(name));\n}\n","#!/usr/bin/env bun\n\nimport { existsSync } from 'node:fs';\nimport { extname, relative, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { Effect, Option } from 'effect';\nimport { Args, Command, Options } from '@effect/cli';\nimport { NodeContext } from '@effect/platform-node';\nimport { Hono } from 'hono';\nimport {\n authoringId,\n type EvalDefinition,\n type EvalRegistry,\n type AgentRuntimeName,\n} from '@evalkit/core';\nimport { localReportStore, runEval, runMatrix } from '@evalkit/runner';\nimport { buildDashboard, directorySize } from './dashboard-build.js';\nimport { listMatrixCells } from './dashboard-cells.js';\nimport {\n createDashboardReportReader,\n fileContentType,\n} from './dashboard-reports.js';\nimport { selectDashboardCell } from './dashboard-matrix.js';\nimport { loadProject } from './project.js';\nimport {\n normalizeRunOptions,\n parseRunArgs,\n runProjectCommand,\n} from './run-command.js';\nimport { tidyReports } from './tidy.js';\nimport { detectSource, runCatalog, shortSource } from './source.js';\nimport {\n checkShareServer,\n noRunsMessage,\n resolveShareHeaders,\n selectionSummary,\n selectRuns,\n shareRuns,\n shareTarget,\n} from './share-command.js';\nimport { createDirectoryShareApp, repoKey } from '@evalkit/share';\nimport { newProject } from './new-project.js';\nimport {\n banner,\n bold,\n canPrompt,\n confirm,\n bytes,\n cyan,\n dim,\n duration,\n plural,\n runLog,\n runnerLogs,\n step,\n yellow,\n} from './terminal.js';\n\nconst VERSION = '0.5.0';\n\nlet projectRoot = process.cwd();\nlet reportRoot = resolve(projectRoot, '_evalkit-results');\nconst sandboxRoot = resolve(projectRoot, '_evalkit-sandbox');\nlet project: Awaited<ReturnType<typeof loadProject>> | undefined;\n\nasync function loadRegistry(): Promise<EvalRegistry> {\n project ??= await loadProject(projectRoot);\n return project.registry;\n}\n\nfunction runtimeFor(evaluation: EvalDefinition): AgentRuntimeName | undefined {\n for (const runtime of ['local', 'remote', 'sandbox'] as const) {\n if (evaluation.agent.runtimes?.[runtime]) return runtime;\n }\n return undefined;\n}\n\nasync function runEvals(options: {\n evalIds: string[];\n suiteId?: string;\n concurrency: number;\n}): Promise<void> {\n const registry = await loadRegistry();\n const evaluations = options.evalIds.map((id) => registry.get(id));\n if (evaluations.some((e) => !e)) throw new Error('Unknown eval');\n const provenance = await runProvenance(registry);\n await Effect.runPromise(\n runnerLogs(\n Effect.all(\n evaluations.map((evaluation) => {\n const name = evaluation!.name ?? authoringId(evaluation!);\n const started = performance.now();\n return Effect.sync(() =>\n runLog.started(name, {}, options.suiteId),\n ).pipe(\n Effect.andThen(\n runEval(evaluation!, {\n report: localReportStore(reportRoot),\n workspaceRoot: sandboxRoot,\n suiteId: options.suiteId,\n runtime: runtimeFor(evaluation!),\n concurrency: options.concurrency,\n ...provenance,\n }),\n ),\n Effect.tap((result) =>\n runLog.finished(name, {}, result, performance.now() - started),\n ),\n Effect.tapError((error) =>\n Effect.sync(() => runLog.failed(name, error)),\n ),\n );\n }),\n { concurrency: options.concurrency },\n ),\n ),\n );\n}\n\n/** Detected per launch: `evalkit dev` keeps running while commits change. */\nasync function runProvenance(registry: EvalRegistry) {\n const source = await detectSource(projectRoot, {\n outputDirs: [\n reportRoot,\n sandboxRoot,\n resolve(projectRoot, '_evalkit-dashboard'),\n ],\n });\n return { ...(source ? { source } : {}), catalog: runCatalog(registry) };\n}\n\nfunction registerMatrixRoutes(\n app: Hono,\n registry: EvalRegistry,\n dashboardMatrix: EvalRegistry['matrices'][number] | undefined,\n trials?: number,\n): void {\n let matrixRunning = false;\n app.get('/v1/matrix', (context) =>\n context.json({\n matrix: dashboardMatrix\n ? {\n id: dashboardMatrix.id,\n parameters: dashboardMatrix.parameters,\n ...(dashboardMatrix.cases?.length || dashboardMatrix.exclude?.length\n ? {\n dimensions: [\n ...Object.keys(dashboardMatrix.cases?.[0] ?? {}),\n ...Object.keys(dashboardMatrix.parameters),\n ],\n }\n : {}),\n ...(dashboardMatrix.cases?.length || dashboardMatrix.exclude?.length\n ? { constrained: true }\n : {}),\n ...(trials ? { trials } : {}),\n }\n : null,\n }),\n );\n app.get('/v1/matrix/cells', (context) => {\n if (!dashboardMatrix) return context.text('Project has no matrix', 404);\n const url = new URL(context.req.url);\n try {\n return context.json(\n listMatrixCells(dashboardMatrix, {\n evalIds: url.searchParams.getAll('eval'),\n query: url.searchParams.get('q') ?? '',\n offset: Number(url.searchParams.get('offset') ?? '0'),\n limit: Number(url.searchParams.get('limit') ?? '50'),\n sort: url.searchParams.get('sort') ?? 'eval',\n direction:\n url.searchParams.get('direction') === 'desc' ? 'desc' : 'asc',\n }),\n );\n } catch (error) {\n return context.text(\n error instanceof Error ? error.message : 'Unable to list cells',\n 400,\n );\n }\n });\n app.post('/v1/runs', async (context) => {\n const body = (await context.req.json().catch(() => null)) as {\n path?: unknown;\n parameters?: unknown;\n } | null;\n if (!body || typeof body.path !== 'string')\n return context.text('path is required', 400);\n const [suiteId, evalId] = body.path.includes('#')\n ? body.path.split('#', 2)\n : [undefined, body.path];\n const evaluation = registry.get(evalId!);\n const registeredSuite = suiteId ? registry.getSuite(suiteId) : undefined;\n if (\n !evaluation ||\n (suiteId && !registeredSuite?.evals.includes(evaluation))\n )\n return context.text('Unknown eval', 404);\n if (dashboardMatrix) {\n let selection;\n try {\n selection = selectDashboardCell(\n dashboardMatrix,\n authoringId(evaluation),\n body.parameters,\n );\n } catch (error) {\n return context.text(\n error instanceof Error ? error.message : 'Invalid selection',\n 400,\n );\n }\n if (matrixRunning)\n return context.text('A dashboard matrix cell is already running', 409);\n matrixRunning = true;\n const name = evaluation.name ?? authoringId(evaluation);\n const started = performance.now();\n runLog.started(name, (body.parameters ?? {}) as object, suiteId);\n void runProvenance(registry)\n .then((provenance) =>\n Effect.runPromise(\n runnerLogs(\n runMatrix(dashboardMatrix, {\n selection,\n concurrency: 1,\n trials,\n ...(suiteId ? { suiteId } : {}),\n report: localReportStore(reportRoot),\n workspaceRoot: sandboxRoot,\n ...provenance,\n onResult: (cell, result) =>\n runLog.cell(cell, result, performance.now() - started),\n }),\n ),\n ),\n )\n .catch((error) => runLog.failed(name, error))\n .finally(() => {\n matrixRunning = false;\n });\n } else {\n if (body.parameters !== undefined)\n return context.text('Project has no matrix', 400);\n void runEvals({\n evalIds: [authoringId(evaluation)],\n suiteId,\n concurrency: 32,\n }).catch(() => {\n /* already reported by runLog */\n });\n }\n return context.json({ accepted: true }, 202);\n });\n app.post('/v1/suites/:suiteId/runs', async (context) => {\n if (dashboardMatrix)\n return context.text('Select a single eval and matrix cell', 400);\n const suite = registry.getSuite(context.req.param('suiteId'));\n if (!suite) return context.text('Unknown suite', 404);\n void runEvals({\n evalIds: suite.evals.map(authoringId),\n suiteId: authoringId(suite),\n concurrency: 32,\n }).catch(() => {\n /* already reported by runLog */\n });\n return context.json({ accepted: true }, 202);\n });\n}\n\nfunction registerReportRoutes(\n app: Hono,\n registry: EvalRegistry,\n reports: ReturnType<typeof createDashboardReportReader>,\n): void {\n app.get('/v1/catalog', (context) =>\n context.json({ evals: registry.catalog() }),\n );\n app.get('/v1/evals', (context) =>\n context.json({ evals: registry.metadata() }),\n );\n app.get('/v1/suites', (context) =>\n context.json({ suites: registry.suiteMetadata() }),\n );\n app.get('/v1/runs', async (context) =>\n context.json({ runs: await reports.listRuns() }),\n );\n app.get('/v1/runs/:runId/trials', async (context) => {\n try {\n return context.json({\n trials: await reports.listTrials(context.req.param('runId')),\n });\n } catch (error) {\n return context.text(\n error instanceof Error ? error.message : 'Bad request',\n 400,\n );\n }\n });\n app.get('/v1/runs/:runId/trials/:trialId', async (context) => {\n try {\n return context.json(\n await reports.trialDetail(\n context.req.param('runId'),\n context.req.param('trialId'),\n ),\n );\n } catch (error) {\n return context.text(\n error instanceof Error ? error.message : 'Not found',\n 404,\n );\n }\n });\n app.get('/v1/runs/:runId/trials/:trialId/workspace', async (context) => {\n try {\n return context.json(\n await reports.listCandidateWorkspace(\n context.req.param('runId'),\n context.req.param('trialId'),\n ),\n );\n } catch (error) {\n return context.text(\n error instanceof Error ? error.message : 'Unable to list workspace',\n 400,\n );\n }\n });\n app.get('/v1/runs/:runId/trials/:trialId/workspace/*', async (context) => {\n try {\n return await reports.candidateFile(\n context.req.param('runId'),\n context.req.param('trialId'),\n context.req.param('*') ?? '',\n );\n } catch (error) {\n return context.text(\n error instanceof Error\n ? error.message\n : 'Unable to read workspace file',\n 400,\n );\n }\n });\n app.get('/v1/runs/:runId/trials/:trialId/artifacts', async (context) => {\n try {\n return context.json({\n artifacts: await reports.listArtifacts(\n context.req.param('runId'),\n context.req.param('trialId'),\n ),\n });\n } catch (error) {\n return context.text(\n error instanceof Error ? error.message : 'Not found',\n 404,\n );\n }\n });\n app.get('/v1/runs/:runId/trials/:trialId/events', async (context) => {\n try {\n return context.json({\n events: await reports.trajectory(\n context.req.param('runId'),\n context.req.param('trialId'),\n ),\n });\n } catch (error) {\n return context.text(\n error instanceof Error ? error.message : 'Not found',\n 404,\n );\n }\n });\n}\n\nfunction registerDashboardAssets(app: Hono, dashboardRoot: string): void {\n app.all('*', async (context) => {\n const url = new URL(context.req.url);\n const pathname = url.pathname === '/' ? '/index.html' : url.pathname;\n const file = resolve(dashboardRoot, `.${pathname}`);\n if (!file.startsWith(dashboardRoot)) return context.text('Not found', 404);\n let content = Bun.file(file);\n let servedFile = file;\n if (!(await content.exists())) {\n // React Router owns browser routes, so refreshes must receive the SPA\n // entry point instead of being treated as missing static files.\n if (extname(pathname)) return context.text('Not found', 404);\n servedFile = resolve(dashboardRoot, 'index.html');\n content = Bun.file(servedFile);\n }\n return new Response(content, {\n headers: { 'content-type': fileContentType(servedFile) },\n });\n });\n}\n\n/** The npm package bundles the UI beside cli.mjs; the monorepo uses its Vite build. */\nfunction dashboardAssets(): string {\n const bundledDashboard = new URL('./dashboard/', import.meta.url);\n const root = fileURLToPath(\n existsSync(bundledDashboard)\n ? bundledDashboard\n : new URL('../../dashboard/dist/', import.meta.url),\n );\n if (!existsSync(resolve(root, 'index.html')))\n throw new Error(\n `Dashboard assets not found at ${root}; run \\`bun run build\\` in the EvalKit repository`,\n );\n return root;\n}\n\nasync function useProject(configPath: string | undefined): Promise<void> {\n project = await loadProject(projectRoot, configPath);\n projectRoot = project.root;\n reportRoot = resolve(\n projectRoot,\n project.config.reportDir ?? '_evalkit-results',\n );\n}\n\nasync function serveDashboard(): Promise<void> {\n const registry = await loadRegistry();\n const dashboardRoot = dashboardAssets();\n const app = new Hono();\n const dashboardMatrix = project?.config.matrix\n ? registry.matrices.at(-1)\n : undefined;\n registerMatrixRoutes(\n app,\n registry,\n dashboardMatrix,\n project?.config.execution?.trials,\n );\n registerReportRoutes(\n app,\n registry,\n createDashboardReportReader(reportRoot, registry),\n );\n registerDashboardAssets(app, dashboardRoot);\n const port = Number(process.env.PORT ?? 4317);\n let server: ReturnType<typeof Bun.serve>;\n try {\n server = Bun.serve({ port, fetch: app.fetch });\n } catch (error) {\n if ((error as { code?: string }).code === 'EADDRINUSE')\n throw new Error(\n `Port ${port} is already in use. Stop the other server or choose another port: PORT=4318 evalkit dev`,\n );\n throw error;\n }\n const url = `http://localhost:${server.port}`;\n const reader = createDashboardReportReader(reportRoot, registry);\n const runs = (await reader.listRuns()).length;\n const legacy = reader.legacyRunIds().length;\n const matrixCells = dashboardMatrix?.count({ parameters: {} });\n const row = (label: string, value: string) =>\n console.log(` ${cyan('➜')} ${bold(label.padEnd(9))}${value}`);\n banner('dev', VERSION);\n row('Local:', cyan(url));\n row(\n 'Project:',\n `${plural(registry.evals.length, 'eval')} · ${plural(registry.suites.length, 'suite')}` +\n (dashboardMatrix\n ? ` · matrix ${authoringId(dashboardMatrix)} (${plural(matrixCells!, 'cell')})`\n : ''),\n );\n row(\n 'Reports:',\n `${relative(process.cwd(), reportRoot) || '.'} ${dim(`(${plural(runs, 'run')}${legacy ? `, ${legacy} from an older EvalKit hidden` : ''})`)}`,\n );\n console.log(\n `\\n ${dim('Runs started from the dashboard are logged below. Press Ctrl+C to stop.')}\\n`,\n );\n if (process.env.EVALKIT_NO_OPEN !== '1') {\n const opener =\n process.platform === 'darwin'\n ? 'open'\n : process.platform === 'win32'\n ? 'start'\n : 'xdg-open';\n try {\n Bun.spawn([opener, url], { stdout: 'ignore', stderr: 'ignore' });\n } catch {\n // Opening a browser is best-effort; the printed URL remains authoritative.\n }\n }\n}\n\n/* The command tree and its option/argument parsing are owned by @effect/cli. */\nconst config = Options.text('config').pipe(Options.optional);\nconst runOptions = {\n config,\n eval: Options.text('eval').pipe(Options.repeated),\n suite: Options.text('suite').pipe(Options.optional),\n matrix: Options.text('matrix').pipe(Options.optional),\n model: Options.text('model').pipe(Options.repeated),\n mode: Options.text('mode').pipe(Options.repeated),\n select: Options.text('select').pipe(Options.repeated),\n param: Options.text('param').pipe(Options.repeated),\n maxTokens: Options.text('max-tokens').pipe(Options.optional),\n chatTimeout: Options.text('chat-timeout-ms').pipe(Options.optional),\n turnBudget: Options.text('turn-budget').pipe(Options.optional),\n concurrency: Options.text('concurrency').pipe(Options.optional),\n trials: Options.text('trials').pipe(Options.optional),\n json: Options.boolean('json'),\n dryRun: Options.boolean('dry-run'),\n all: Options.boolean('all'),\n local: Options.boolean('local'),\n};\ntype RunOptions = {\n config: Option.Option<string>;\n eval: string[];\n suite: Option.Option<string>;\n matrix: Option.Option<string>;\n model: string[];\n mode: string[];\n select: string[];\n param: string[];\n maxTokens: Option.Option<string>;\n chatTimeout: Option.Option<string>;\n turnBudget: Option.Option<string>;\n concurrency: Option.Option<string>;\n trials: Option.Option<string>;\n json: boolean;\n dryRun: boolean;\n all: boolean;\n local: boolean;\n};\nfunction runInput(options: RunOptions, positionals: string[]) {\n const unexpected = positionals.find((value) => value.startsWith('-'));\n if (unexpected) throw new Error(`Unknown option: ${unexpected}`);\n return normalizeRunOptions(\n {\n config: Option.getOrUndefined(options.config),\n eval: options.eval,\n suite: Option.getOrUndefined(options.suite),\n matrix: Option.getOrUndefined(options.matrix),\n model: options.model,\n mode: options.mode,\n select: options.select,\n param: options.param,\n 'max-tokens': Option.getOrUndefined(options.maxTokens),\n 'chat-timeout-ms': Option.getOrUndefined(options.chatTimeout),\n 'turn-budget': Option.getOrUndefined(options.turnBudget),\n concurrency: Option.getOrUndefined(options.concurrency),\n trials: Option.getOrUndefined(options.trials),\n json: options.json,\n 'dry-run': options.dryRun,\n all: options.all,\n local: options.local,\n },\n positionals,\n );\n}\nconst execute = (input: ReturnType<typeof normalizeRunOptions>) =>\n Effect.tryPromise({\n try: () => runProjectCommand([], process.cwd(), input),\n catch: (error) => error,\n });\nconst runCommand = Command.make(\n 'run',\n {\n ...runOptions,\n evalIds: Args.text({ name: 'eval-id' }).pipe(Args.repeated),\n },\n ({ evalIds, ...options }) => execute(runInput(options, evalIds)),\n);\nconst newCommand = Command.make(\n 'new',\n {\n directory: Args.text({ name: 'directory' }),\n },\n ({ directory }) =>\n Effect.tryPromise({\n try: async () => {\n const root = await newProject([directory]);\n console.log(\n `Created EvalKit project at ${root}\\nRun cd ${root} && bun install && bun run evalkit run.`,\n );\n },\n catch: (error) => error,\n }),\n);\nconst devCommand = Command.make('dev', { config }, ({ config }) =>\n Effect.tryPromise({\n try: async () => {\n await useProject(Option.getOrUndefined(config));\n await serveDashboard();\n },\n catch: (error) => error,\n }),\n);\nconst buildCommand = Command.make(\n 'build',\n {\n config,\n out: Options.text('out').pipe(Options.optional),\n run: Options.boolean('run'),\n noRun: Options.boolean('no-run'),\n },\n ({ config, out, run, noRun }) =>\n Effect.tryPromise({\n try: async () => {\n if (run && noRun) throw new Error('Choose either --run or --no-run');\n const started = performance.now();\n const configPath = Option.getOrUndefined(config);\n banner('build', VERSION);\n await loadProjectStep(configPath);\n if (await shouldRunEvals({ run, noRun })) await runAllEvals(configPath);\n const result = await buildDashboard(\n {\n registry: project!.registry,\n reportRoot,\n dashboardRoot: dashboardAssets(),\n outDir: resolve(\n projectRoot,\n Option.getOrElse(out, () => '_evalkit-dashboard'),\n ),\n },\n step,\n );\n const size = await directorySize(result.outDir);\n const shown = relative(process.cwd(), result.outDir) || '.';\n console.log(\n `\\n ${bold(`${shown}/`)} ${dim(`${bytes(size.bytes)} · ${plural(size.files, 'file')}`)}`,\n );\n console.log(\n `\\n ${bold('Built read-only dashboard')} in ${duration(performance.now() - started)}\\n`,\n );\n console.log(` ${cyan('➜')} ${bold('Preview:')} bunx serve ${shown}`);\n console.log(\n ` ${yellow('⚠')} Contains transcripts, scores, evidence, and candidate files\\n` +\n ` (never evaluator workspaces). Review before sharing.\\n`,\n );\n },\n catch: (error) => error,\n }),\n);\n\nasync function loadProjectStep(configPath: string | undefined): Promise<void> {\n await step(\n 'Eval project',\n () => useProject(configPath),\n () => {\n const where = relative(process.cwd(), projectRoot);\n return `${plural(project!.registry.evals.length, 'eval')} loaded${where ? ` from ${where}` : ''}`;\n },\n );\n}\n\n/**\n * A snapshot needs data: with no current results, run the evals. Otherwise ask,\n * or keep the existing results when no one can answer (CI, pipes).\n */\nasync function shouldRunEvals(flags: {\n run: boolean;\n noRun: boolean;\n}): Promise<boolean> {\n if (flags.run) return true;\n if (flags.noRun) return false;\n const runs = (\n await createDashboardReportReader(reportRoot, project!.registry).listRuns()\n ).filter((entry) => !entry.archived).length;\n if (!runs) {\n console.log(\n ` ${cyan('◇')} No results yet, so running the evals to have data to build.`,\n );\n return true;\n }\n if (!canPrompt()) {\n console.log(\n ` ${dim(`Using ${plural(runs, 'existing run')}; pass --run to run the evals first.`)}`,\n );\n return false;\n }\n return confirm(\n `Run the evals before building? ${dim(`(${plural(runs, 'existing run')})`)}`,\n );\n}\n\nasync function runAllEvals(configPath: string | undefined): Promise<void> {\n const started = performance.now();\n console.log(`\\n ${cyan('▶')} ${bold('Running evals')}\\n`);\n await runProjectCommand(\n [],\n process.cwd(),\n parseRunArgs(configPath ? ['--config', configPath] : []),\n );\n const failed = process.exitCode === 1;\n console.log(\n `\\n ${failed ? yellow('⚠') : cyan('✓')} ${bold('Evals finished')} in ${duration(performance.now() - started)}` +\n (failed ? dim(' (some failed; building with their results)') : '') +\n '\\n',\n );\n}\n\nconst tidyCommand = Command.make('tidy', { config }, ({ config }) =>\n Effect.tryPromise({\n try: async () => {\n banner('tidy', VERSION);\n await loadProjectStep(Option.getOrUndefined(config));\n const result = await step(\n 'Run reports',\n () => tidyReports({ registry: project!.registry, reportRoot }),\n (value) =>\n `${plural(value.current + value.archived.length + value.stillArchived, 'run')} checked`,\n );\n const byEval = (entries: { evalId: string }[]) =>\n [\n ...entries\n .reduce(\n (groups, entry) =>\n groups.set(entry.evalId, (groups.get(entry.evalId) ?? 0) + 1),\n new Map<string, number>(),\n )\n .entries(),\n ]\n .map(\n ([id, total]) =>\n ` ${bold(id)} ${dim(`(${plural(total, 'run')})`)}`,\n )\n .join('\\n');\n console.log('');\n if (result.archived.length)\n console.log(\n ` ${yellow('◆')} Archived ${plural(result.archived.length, 'run')} of evals no longer in the project:\\n${byEval(result.archived)}`,\n );\n if (result.restored.length)\n console.log(\n ` ${cyan('◆')} Restored ${plural(result.restored.length, 'run')} whose eval is back:\\n${byEval(result.restored)}`,\n );\n if (!result.archived.length && !result.restored.length)\n console.log(` ${cyan('✓')} Nothing new to tidy.`);\n const totalArchived = result.archived.length + result.stillArchived;\n if (totalArchived)\n console.log(\n `\\n ${dim(`Archived runs (${totalArchived}) are hidden in \\`evalkit dev\\` (filter \"Show archived\")`)}\\n` +\n ` ${dim('and left out of `evalkit build`. Nothing was deleted.')}`,\n );\n console.log('');\n },\n catch: (error) => error,\n }),\n);\nconst shareServeCommand = Command.make(\n 'serve',\n {\n dir: Options.text('dir').pipe(Options.withDefault('_evalkit-share')),\n port: Options.integer('port').pipe(Options.withDefault(4318)),\n },\n ({ dir, port }) =>\n Effect.tryPromise({\n try: async () => {\n const root = resolve(process.cwd(), dir);\n const app = await createDirectoryShareApp({\n dir: root,\n dashboardRoot: dashboardAssets(),\n });\n let server: ReturnType<typeof Bun.serve>;\n try {\n server = Bun.serve({ port, fetch: app.fetch });\n } catch (error) {\n if ((error as { code?: string }).code === 'EADDRINUSE')\n throw new Error(\n `Port ${port} is already in use. Choose another: evalkit share serve --port 4319`,\n );\n throw error;\n }\n banner('share serve', VERSION);\n console.log(\n ` ${cyan('➜')} ${bold('Local:'.padEnd(9))}${cyan(`http://localhost:${server.port}`)}`,\n );\n console.log(\n ` ${cyan('➜')} ${bold('Storage:'.padEnd(9))}${relative(process.cwd(), root) || '.'}`,\n );\n console.log(\n `\\n ${dim(`Upload with share.url = \"http://localhost:${server.port}\". No authentication: keep it private.`)}\\n`,\n );\n },\n catch: (error) => error,\n }),\n);\n\nconst shareCommand = Command.make(\n 'share',\n {\n config,\n all: Options.boolean('all'),\n allowDirty: Options.boolean('allow-dirty'),\n noWorkspace: Options.boolean('no-workspace'),\n },\n ({ config, all, allowDirty, noWorkspace }) =>\n Effect.tryPromise({\n try: async () => {\n const started = performance.now();\n banner('share', VERSION);\n await loadProjectStep(Option.getOrUndefined(config));\n const serverUrl =\n process.env.EVALKIT_SHARE_URL ?? project!.config.share?.url;\n if (!serverUrl)\n throw new Error(\n 'No share server configured. Set share: { url } in evalkit.config.ts or EVALKIT_SHARE_URL.',\n );\n const head = await step(\n 'Source',\n () =>\n detectSource(projectRoot, {\n outputDirs: [\n reportRoot,\n sandboxRoot,\n resolve(projectRoot, '_evalkit-dashboard'),\n ],\n }),\n (source) =>\n source\n ? `${repoKey(source)} @ ${shortSource(source)}${source.ref ? ` (${source.ref})` : ''}`\n : 'not a git repository',\n );\n if (!head)\n throw new Error(\n 'evalkit share needs to know the commit: run it inside a git repository or set EVALKIT_SOURCE_REPO and EVALKIT_SOURCE_COMMIT. `evalkit build` works without one.',\n );\n const registry = project!.registry;\n const selection = await step(\n 'Runs',\n async () =>\n selectRuns(\n await createDashboardReportReader(\n reportRoot,\n registry,\n ).listRuns(),\n head,\n { all, allowDirty },\n ),\n (value) => selectionSummary(value, { all }),\n );\n if (!selection.selected.length)\n throw new Error(noRunsMessage(selection, head, { all }));\n const shareHeaders = await step(\n 'Server',\n async () => {\n const headers = await resolveShareHeaders(\n project!.config.share?.headers,\n );\n await checkShareServer(serverUrl, headers);\n return headers;\n },\n (headers) => {\n const names = Object.keys(headers);\n return `${new URL(serverUrl).host}${names.length ? dim(` with ${names.join(', ')}`) : ''}`;\n },\n );\n const result = await shareRuns({\n serverUrl,\n headers: shareHeaders,\n reportRoot,\n registry,\n runs: selection.selected,\n workspaceFiles: !noWorkspace,\n step,\n });\n for (const failure of result.failed)\n console.log(\n ` ${yellow('✗')} ${failure.runId.slice(0, 8)} ${dim(failure.error)}`,\n );\n const target = shareTarget(serverUrl, head, selection.selected);\n console.log(\n `\\n ${bold(result.failed.length ? 'Shared with errors' : 'Shared')} in ${duration(performance.now() - started)}\\n`,\n );\n console.log(` ${cyan('➜')} ${cyan(target)}\\n`);\n if (result.failed.length) process.exitCode = 1;\n },\n catch: (error) => error,\n }),\n).pipe(Command.withSubcommands([shareServeCommand]));\n\nconst app = Command.make('evalkit').pipe(\n Command.withSubcommands([\n newCommand,\n runCommand,\n devCommand,\n buildCommand,\n tidyCommand,\n shareCommand,\n ]),\n);\nconst cli = Command.run(app, { name: 'EvalKit', version: VERSION });\nconst argv = process.argv.slice();\nif (argv[2] === 'help') argv.splice(2, 1, '--help');\n// Preserve the CLI's existing help spelling while letting @effect/cli render it.\nif (argv.at(-2) === '--' && argv.at(-1) === '--help') argv.splice(-2, 1);\ntry {\n await Effect.runPromise(cli(argv).pipe(Effect.provide(NodeContext.layer)));\n} catch (error) {\n console.error(error instanceof Error ? error.message : String(error));\n process.exitCode = 1;\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,44,45,46,47,48,49,50,51,52,53,54,55,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