@shipi/cli 0.0.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.
@@ -0,0 +1,63 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../node_modules/.bun/commander@13.1.0/node_modules/commander/lib/error.js", "../../../node_modules/.bun/commander@13.1.0/node_modules/commander/lib/argument.js", "../../../node_modules/.bun/commander@13.1.0/node_modules/commander/lib/help.js", "../../../node_modules/.bun/commander@13.1.0/node_modules/commander/lib/option.js", "../../../node_modules/.bun/commander@13.1.0/node_modules/commander/lib/suggestSimilar.js", "../../../node_modules/.bun/commander@13.1.0/node_modules/commander/lib/command.js", "../../../node_modules/.bun/commander@13.1.0/node_modules/commander/index.js", "../../../node_modules/.bun/cli-spinners@2.9.2/node_modules/cli-spinners/index.js", "../../../node_modules/.bun/emoji-regex@10.6.0/node_modules/emoji-regex/index.js", "../../../node_modules/.bun/picocolors@1.1.1/node_modules/picocolors/picocolors.js", "../../../node_modules/.bun/commander@13.1.0/node_modules/commander/esm.mjs", "../src/commands/login.ts", "../../../node_modules/.bun/open@10.2.0/node_modules/open/index.js", "../../../node_modules/.bun/wsl-utils@0.1.0/node_modules/wsl-utils/index.js", "../../../node_modules/.bun/is-wsl@3.1.0/node_modules/is-wsl/index.js", "../../../node_modules/.bun/is-inside-container@1.0.0/node_modules/is-inside-container/index.js", "../../../node_modules/.bun/is-docker@3.0.0/node_modules/is-docker/index.js", "../../../node_modules/.bun/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js", "../../../node_modules/.bun/default-browser@5.4.0/node_modules/default-browser/index.js", "../../../node_modules/.bun/default-browser-id@5.0.1/node_modules/default-browser-id/index.js", "../../../node_modules/.bun/run-applescript@7.1.0/node_modules/run-applescript/index.js", "../../../node_modules/.bun/bundle-name@4.1.0/node_modules/bundle-name/index.js", "../../../node_modules/.bun/default-browser@5.4.0/node_modules/default-browser/windows.js", "../../../node_modules/.bun/ora@8.2.0/node_modules/ora/index.js", "../../../node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js", "../../../node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js", "../../../node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/utilities.js", "../../../node_modules/.bun/chalk@5.6.2/node_modules/chalk/source/index.js", "../../../node_modules/.bun/cli-cursor@5.0.0/node_modules/cli-cursor/index.js", "../../../node_modules/.bun/restore-cursor@5.1.0/node_modules/restore-cursor/index.js", "../../../node_modules/.bun/mimic-function@5.0.1/node_modules/mimic-function/index.js", "../../../node_modules/.bun/onetime@7.0.0/node_modules/onetime/index.js", "../../../node_modules/.bun/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js", "../../../node_modules/.bun/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js", "../../../node_modules/.bun/is-unicode-supported@1.3.0/node_modules/is-unicode-supported/index.js", "../../../node_modules/.bun/log-symbols@6.0.0/node_modules/log-symbols/index.js", "../../../node_modules/.bun/ansi-regex@6.2.2/node_modules/ansi-regex/index.js", "../../../node_modules/.bun/strip-ansi@7.1.2/node_modules/strip-ansi/index.js", "../../../node_modules/.bun/get-east-asian-width@1.4.0/node_modules/get-east-asian-width/lookup.js", "../../../node_modules/.bun/get-east-asian-width@1.4.0/node_modules/get-east-asian-width/index.js", "../../../node_modules/.bun/string-width@7.2.0/node_modules/string-width/index.js", "../../../node_modules/.bun/is-interactive@2.0.0/node_modules/is-interactive/index.js", "../../../node_modules/.bun/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js", "../../../node_modules/.bun/stdin-discarder@0.2.2/node_modules/stdin-discarder/index.js", "../src/utils/config.ts", "../src/utils/session.ts", "../src/commands/logout.ts", "../src/commands/whoami.ts", "../src/commands/usage.ts", "../src/commands/generate.ts", "../src/utils/git.ts", "../src/utils/context.ts", "../src/commands/init.ts", "../src/index.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * CommanderError class\n */\nclass CommanderError extends Error {\n /**\n * Constructs the CommanderError class\n * @param {number} exitCode suggested exit code which could be used with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n */\n constructor(exitCode, code, message) {\n super(message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n this.code = code;\n this.exitCode = exitCode;\n this.nestedError = undefined;\n }\n}\n\n/**\n * InvalidArgumentError class\n */\nclass InvalidArgumentError extends CommanderError {\n /**\n * Constructs the InvalidArgumentError class\n * @param {string} [message] explanation of why argument is invalid\n */\n constructor(message) {\n super(1, 'commander.invalidArgument', message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n }\n}\n\nexports.CommanderError = CommanderError;\nexports.InvalidArgumentError = InvalidArgumentError;\n",
6
+ "const { InvalidArgumentError } = require('./error.js');\n\nclass Argument {\n /**\n * Initialize a new command argument with the given name and description.\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @param {string} name\n * @param {string} [description]\n */\n\n constructor(name, description) {\n this.description = description || '';\n this.variadic = false;\n this.parseArg = undefined;\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.argChoices = undefined;\n\n switch (name[0]) {\n case '<': // e.g. <required>\n this.required = true;\n this._name = name.slice(1, -1);\n break;\n case '[': // e.g. [optional]\n this.required = false;\n this._name = name.slice(1, -1);\n break;\n default:\n this.required = true;\n this._name = name;\n break;\n }\n\n if (this._name.length > 3 && this._name.slice(-3) === '...') {\n this.variadic = true;\n this._name = this._name.slice(0, -3);\n }\n }\n\n /**\n * Return argument name.\n *\n * @return {string}\n */\n\n name() {\n return this._name;\n }\n\n /**\n * @package\n */\n\n _concatValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n return previous.concat(value);\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Argument}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n *\n * @param {Function} [fn]\n * @return {Argument}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Only allow argument value to be one of choices.\n *\n * @param {string[]} values\n * @return {Argument}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._concatValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Make argument required.\n *\n * @returns {Argument}\n */\n argRequired() {\n this.required = true;\n return this;\n }\n\n /**\n * Make argument optional.\n *\n * @returns {Argument}\n */\n argOptional() {\n this.required = false;\n return this;\n }\n}\n\n/**\n * Takes an argument and returns its human readable equivalent for help usage.\n *\n * @param {Argument} arg\n * @return {string}\n * @private\n */\n\nfunction humanReadableArgName(arg) {\n const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');\n\n return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']';\n}\n\nexports.Argument = Argument;\nexports.humanReadableArgName = humanReadableArgName;\n",
7
+ "const { humanReadableArgName } = require('./argument.js');\n\n/**\n * TypeScript import types for JSDoc, used by Visual Studio Code IntelliSense and `npm run typescript-checkJS`\n * https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types\n * @typedef { import(\"./argument.js\").Argument } Argument\n * @typedef { import(\"./command.js\").Command } Command\n * @typedef { import(\"./option.js\").Option } Option\n */\n\n// Although this is a class, methods are static in style to allow override using subclass or just functions.\nclass Help {\n constructor() {\n this.helpWidth = undefined;\n this.minWidthToWrap = 40;\n this.sortSubcommands = false;\n this.sortOptions = false;\n this.showGlobalOptions = false;\n }\n\n /**\n * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`\n * and just before calling `formatHelp()`.\n *\n * Commander just uses the helpWidth and the rest is provided for optional use by more complex subclasses.\n *\n * @param {{ error?: boolean, helpWidth?: number, outputHasColors?: boolean }} contextOptions\n */\n prepareContext(contextOptions) {\n this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;\n }\n\n /**\n * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.\n *\n * @param {Command} cmd\n * @returns {Command[]}\n */\n\n visibleCommands(cmd) {\n const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);\n const helpCommand = cmd._getHelpCommand();\n if (helpCommand && !helpCommand._hidden) {\n visibleCommands.push(helpCommand);\n }\n if (this.sortSubcommands) {\n visibleCommands.sort((a, b) => {\n // @ts-ignore: because overloaded return type\n return a.name().localeCompare(b.name());\n });\n }\n return visibleCommands;\n }\n\n /**\n * Compare options for sort.\n *\n * @param {Option} a\n * @param {Option} b\n * @returns {number}\n */\n compareOptions(a, b) {\n const getSortKey = (option) => {\n // WYSIWYG for order displayed in help. Short used for comparison if present. No special handling for negated.\n return option.short\n ? option.short.replace(/^-/, '')\n : option.long.replace(/^--/, '');\n };\n return getSortKey(a).localeCompare(getSortKey(b));\n }\n\n /**\n * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleOptions(cmd) {\n const visibleOptions = cmd.options.filter((option) => !option.hidden);\n // Built-in help option.\n const helpOption = cmd._getHelpOption();\n if (helpOption && !helpOption.hidden) {\n // Automatically hide conflicting flags. Bit dubious but a historical behaviour that is convenient for single-command programs.\n const removeShort = helpOption.short && cmd._findOption(helpOption.short);\n const removeLong = helpOption.long && cmd._findOption(helpOption.long);\n if (!removeShort && !removeLong) {\n visibleOptions.push(helpOption); // no changes needed\n } else if (helpOption.long && !removeLong) {\n visibleOptions.push(\n cmd.createOption(helpOption.long, helpOption.description),\n );\n } else if (helpOption.short && !removeShort) {\n visibleOptions.push(\n cmd.createOption(helpOption.short, helpOption.description),\n );\n }\n }\n if (this.sortOptions) {\n visibleOptions.sort(this.compareOptions);\n }\n return visibleOptions;\n }\n\n /**\n * Get an array of the visible global options. (Not including help.)\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleGlobalOptions(cmd) {\n if (!this.showGlobalOptions) return [];\n\n const globalOptions = [];\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n const visibleOptions = ancestorCmd.options.filter(\n (option) => !option.hidden,\n );\n globalOptions.push(...visibleOptions);\n }\n if (this.sortOptions) {\n globalOptions.sort(this.compareOptions);\n }\n return globalOptions;\n }\n\n /**\n * Get an array of the arguments if any have a description.\n *\n * @param {Command} cmd\n * @returns {Argument[]}\n */\n\n visibleArguments(cmd) {\n // Side effect! Apply the legacy descriptions before the arguments are displayed.\n if (cmd._argsDescription) {\n cmd.registeredArguments.forEach((argument) => {\n argument.description =\n argument.description || cmd._argsDescription[argument.name()] || '';\n });\n }\n\n // If there are any arguments with a description then return all the arguments.\n if (cmd.registeredArguments.find((argument) => argument.description)) {\n return cmd.registeredArguments;\n }\n return [];\n }\n\n /**\n * Get the command term to show in the list of subcommands.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandTerm(cmd) {\n // Legacy. Ignores custom usage string, and nested commands.\n const args = cmd.registeredArguments\n .map((arg) => humanReadableArgName(arg))\n .join(' ');\n return (\n cmd._name +\n (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +\n (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option\n (args ? ' ' + args : '')\n );\n }\n\n /**\n * Get the option term to show in the list of options.\n *\n * @param {Option} option\n * @returns {string}\n */\n\n optionTerm(option) {\n return option.flags;\n }\n\n /**\n * Get the argument term to show in the list of arguments.\n *\n * @param {Argument} argument\n * @returns {string}\n */\n\n argumentTerm(argument) {\n return argument.name();\n }\n\n /**\n * Get the longest command term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestSubcommandTermLength(cmd, helper) {\n return helper.visibleCommands(cmd).reduce((max, command) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleSubcommandTerm(helper.subcommandTerm(command)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the longest option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestOptionTermLength(cmd, helper) {\n return helper.visibleOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest global option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestGlobalOptionTermLength(cmd, helper) {\n return helper.visibleGlobalOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest argument term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestArgumentTermLength(cmd, helper) {\n return helper.visibleArguments(cmd).reduce((max, argument) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the command usage to be displayed at the top of the built-in help.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandUsage(cmd) {\n // Usage\n let cmdName = cmd._name;\n if (cmd._aliases[0]) {\n cmdName = cmdName + '|' + cmd._aliases[0];\n }\n let ancestorCmdNames = '';\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames;\n }\n return ancestorCmdNames + cmdName + ' ' + cmd.usage();\n }\n\n /**\n * Get the description for the command.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.description();\n }\n\n /**\n * Get the subcommand summary to show in the list of subcommands.\n * (Fallback to description for backwards compatibility.)\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.summary() || cmd.description();\n }\n\n /**\n * Get the option description to show in the list of options.\n *\n * @param {Option} option\n * @return {string}\n */\n\n optionDescription(option) {\n const extraInfo = [];\n\n if (option.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (option.defaultValue !== undefined) {\n // default for boolean and negated more for programmer than end user,\n // but show true/false for boolean option as may be for hand-rolled env or config processing.\n const showDefault =\n option.required ||\n option.optional ||\n (option.isBoolean() && typeof option.defaultValue === 'boolean');\n if (showDefault) {\n extraInfo.push(\n `default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`,\n );\n }\n }\n // preset for boolean and negated are more for programmer than end user\n if (option.presetArg !== undefined && option.optional) {\n extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);\n }\n if (option.envVar !== undefined) {\n extraInfo.push(`env: ${option.envVar}`);\n }\n if (extraInfo.length > 0) {\n return `${option.description} (${extraInfo.join(', ')})`;\n }\n\n return option.description;\n }\n\n /**\n * Get the argument description to show in the list of arguments.\n *\n * @param {Argument} argument\n * @return {string}\n */\n\n argumentDescription(argument) {\n const extraInfo = [];\n if (argument.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (argument.defaultValue !== undefined) {\n extraInfo.push(\n `default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`,\n );\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (argument.description) {\n return `${argument.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n return argument.description;\n }\n\n /**\n * Generate the built-in help text.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {string}\n */\n\n formatHelp(cmd, helper) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth ?? 80; // in case prepareContext() was not called\n\n function callFormatItem(term, description) {\n return helper.formatItem(term, termWidth, description, helper);\n }\n\n // Usage\n let output = [\n `${helper.styleTitle('Usage:')} ${helper.styleUsage(helper.commandUsage(cmd))}`,\n '',\n ];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([\n helper.boxWrap(\n helper.styleCommandDescription(commandDescription),\n helpWidth,\n ),\n '',\n ]);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument) => {\n return callFormatItem(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n helper.styleArgumentDescription(helper.argumentDescription(argument)),\n );\n });\n if (argumentList.length > 0) {\n output = output.concat([\n helper.styleTitle('Arguments:'),\n ...argumentList,\n '',\n ]);\n }\n\n // Options\n const optionList = helper.visibleOptions(cmd).map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n if (optionList.length > 0) {\n output = output.concat([\n helper.styleTitle('Options:'),\n ...optionList,\n '',\n ]);\n }\n\n if (helper.showGlobalOptions) {\n const globalOptionList = helper\n .visibleGlobalOptions(cmd)\n .map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n if (globalOptionList.length > 0) {\n output = output.concat([\n helper.styleTitle('Global Options:'),\n ...globalOptionList,\n '',\n ]);\n }\n }\n\n // Commands\n const commandList = helper.visibleCommands(cmd).map((cmd) => {\n return callFormatItem(\n helper.styleSubcommandTerm(helper.subcommandTerm(cmd)),\n helper.styleSubcommandDescription(helper.subcommandDescription(cmd)),\n );\n });\n if (commandList.length > 0) {\n output = output.concat([\n helper.styleTitle('Commands:'),\n ...commandList,\n '',\n ]);\n }\n\n return output.join('\\n');\n }\n\n /**\n * Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations.\n *\n * @param {string} str\n * @returns {number}\n */\n displayWidth(str) {\n return stripColor(str).length;\n }\n\n /**\n * Style the title for displaying in the help. Called with 'Usage:', 'Options:', etc.\n *\n * @param {string} str\n * @returns {string}\n */\n styleTitle(str) {\n return str;\n }\n\n styleUsage(str) {\n // Usage has lots of parts the user might like to color separately! Assume default usage string which is formed like:\n // command subcommand [options] [command] <foo> [bar]\n return str\n .split(' ')\n .map((word) => {\n if (word === '[options]') return this.styleOptionText(word);\n if (word === '[command]') return this.styleSubcommandText(word);\n if (word[0] === '[' || word[0] === '<')\n return this.styleArgumentText(word);\n return this.styleCommandText(word); // Restrict to initial words?\n })\n .join(' ');\n }\n styleCommandDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleOptionDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleSubcommandDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleArgumentDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleDescriptionText(str) {\n return str;\n }\n styleOptionTerm(str) {\n return this.styleOptionText(str);\n }\n styleSubcommandTerm(str) {\n // This is very like usage with lots of parts! Assume default string which is formed like:\n // subcommand [options] <foo> [bar]\n return str\n .split(' ')\n .map((word) => {\n if (word === '[options]') return this.styleOptionText(word);\n if (word[0] === '[' || word[0] === '<')\n return this.styleArgumentText(word);\n return this.styleSubcommandText(word); // Restrict to initial words?\n })\n .join(' ');\n }\n styleArgumentTerm(str) {\n return this.styleArgumentText(str);\n }\n styleOptionText(str) {\n return str;\n }\n styleArgumentText(str) {\n return str;\n }\n styleSubcommandText(str) {\n return str;\n }\n styleCommandText(str) {\n return str;\n }\n\n /**\n * Calculate the pad width from the maximum term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n padWidth(cmd, helper) {\n return Math.max(\n helper.longestOptionTermLength(cmd, helper),\n helper.longestGlobalOptionTermLength(cmd, helper),\n helper.longestSubcommandTermLength(cmd, helper),\n helper.longestArgumentTermLength(cmd, helper),\n );\n }\n\n /**\n * Detect manually wrapped and indented strings by checking for line break followed by whitespace.\n *\n * @param {string} str\n * @returns {boolean}\n */\n preformatted(str) {\n return /\\n[^\\S\\r\\n]/.test(str);\n }\n\n /**\n * Format the \"item\", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.\n *\n * So \"TTT\", 5, \"DDD DDDD DD DDD\" might be formatted for this.helpWidth=17 like so:\n * TTT DDD DDDD\n * DD DDD\n *\n * @param {string} term\n * @param {number} termWidth\n * @param {string} description\n * @param {Help} helper\n * @returns {string}\n */\n formatItem(term, termWidth, description, helper) {\n const itemIndent = 2;\n const itemIndentStr = ' '.repeat(itemIndent);\n if (!description) return itemIndentStr + term;\n\n // Pad the term out to a consistent width, so descriptions are aligned.\n const paddedTerm = term.padEnd(\n termWidth + term.length - helper.displayWidth(term),\n );\n\n // Format the description.\n const spacerWidth = 2; // between term and description\n const helpWidth = this.helpWidth ?? 80; // in case prepareContext() was not called\n const remainingWidth = helpWidth - termWidth - spacerWidth - itemIndent;\n let formattedDescription;\n if (\n remainingWidth < this.minWidthToWrap ||\n helper.preformatted(description)\n ) {\n formattedDescription = description;\n } else {\n const wrappedDescription = helper.boxWrap(description, remainingWidth);\n formattedDescription = wrappedDescription.replace(\n /\\n/g,\n '\\n' + ' '.repeat(termWidth + spacerWidth),\n );\n }\n\n // Construct and overall indent.\n return (\n itemIndentStr +\n paddedTerm +\n ' '.repeat(spacerWidth) +\n formattedDescription.replace(/\\n/g, `\\n${itemIndentStr}`)\n );\n }\n\n /**\n * Wrap a string at whitespace, preserving existing line breaks.\n * Wrapping is skipped if the width is less than `minWidthToWrap`.\n *\n * @param {string} str\n * @param {number} width\n * @returns {string}\n */\n boxWrap(str, width) {\n if (width < this.minWidthToWrap) return str;\n\n const rawLines = str.split(/\\r\\n|\\n/);\n // split up text by whitespace\n const chunkPattern = /[\\s]*[^\\s]+/g;\n const wrappedLines = [];\n rawLines.forEach((line) => {\n const chunks = line.match(chunkPattern);\n if (chunks === null) {\n wrappedLines.push('');\n return;\n }\n\n let sumChunks = [chunks.shift()];\n let sumWidth = this.displayWidth(sumChunks[0]);\n chunks.forEach((chunk) => {\n const visibleWidth = this.displayWidth(chunk);\n // Accumulate chunks while they fit into width.\n if (sumWidth + visibleWidth <= width) {\n sumChunks.push(chunk);\n sumWidth += visibleWidth;\n return;\n }\n wrappedLines.push(sumChunks.join(''));\n\n const nextChunk = chunk.trimStart(); // trim space at line break\n sumChunks = [nextChunk];\n sumWidth = this.displayWidth(nextChunk);\n });\n wrappedLines.push(sumChunks.join(''));\n });\n\n return wrappedLines.join('\\n');\n }\n}\n\n/**\n * Strip style ANSI escape sequences from the string. In particular, SGR (Select Graphic Rendition) codes.\n *\n * @param {string} str\n * @returns {string}\n * @package\n */\n\nfunction stripColor(str) {\n // eslint-disable-next-line no-control-regex\n const sgrPattern = /\\x1b\\[\\d*(;\\d*)*m/g;\n return str.replace(sgrPattern, '');\n}\n\nexports.Help = Help;\nexports.stripColor = stripColor;\n",
8
+ "const { InvalidArgumentError } = require('./error.js');\n\nclass Option {\n /**\n * Initialize a new `Option` with the given `flags` and `description`.\n *\n * @param {string} flags\n * @param {string} [description]\n */\n\n constructor(flags, description) {\n this.flags = flags;\n this.description = description || '';\n\n this.required = flags.includes('<'); // A value must be supplied when the option is specified.\n this.optional = flags.includes('['); // A value is optional when the option is specified.\n // variadic test ignores <value,...> et al which might be used to describe custom splitting of single argument\n this.variadic = /\\w\\.\\.\\.[>\\]]$/.test(flags); // The option can take multiple values.\n this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.\n const optionFlags = splitOptionFlags(flags);\n this.short = optionFlags.shortFlag; // May be a short flag, undefined, or even a long flag (if option has two long flags).\n this.long = optionFlags.longFlag;\n this.negate = false;\n if (this.long) {\n this.negate = this.long.startsWith('--no-');\n }\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.presetArg = undefined;\n this.envVar = undefined;\n this.parseArg = undefined;\n this.hidden = false;\n this.argChoices = undefined;\n this.conflictsWith = [];\n this.implied = undefined;\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Option}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Preset to use when option used without option-argument, especially optional but also boolean and negated.\n * The custom processing (parseArg) is called.\n *\n * @example\n * new Option('--color').default('GREYSCALE').preset('RGB');\n * new Option('--donate [amount]').preset('20').argParser(parseFloat);\n *\n * @param {*} arg\n * @return {Option}\n */\n\n preset(arg) {\n this.presetArg = arg;\n return this;\n }\n\n /**\n * Add option name(s) that conflict with this option.\n * An error will be displayed if conflicting options are found during parsing.\n *\n * @example\n * new Option('--rgb').conflicts('cmyk');\n * new Option('--js').conflicts(['ts', 'jsx']);\n *\n * @param {(string | string[])} names\n * @return {Option}\n */\n\n conflicts(names) {\n this.conflictsWith = this.conflictsWith.concat(names);\n return this;\n }\n\n /**\n * Specify implied option values for when this option is set and the implied options are not.\n *\n * The custom processing (parseArg) is not called on the implied values.\n *\n * @example\n * program\n * .addOption(new Option('--log', 'write logging information to file'))\n * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));\n *\n * @param {object} impliedOptionValues\n * @return {Option}\n */\n implies(impliedOptionValues) {\n let newImplied = impliedOptionValues;\n if (typeof impliedOptionValues === 'string') {\n // string is not documented, but easy mistake and we can do what user probably intended.\n newImplied = { [impliedOptionValues]: true };\n }\n this.implied = Object.assign(this.implied || {}, newImplied);\n return this;\n }\n\n /**\n * Set environment variable to check for option value.\n *\n * An environment variable is only used if when processed the current option value is\n * undefined, or the source of the current value is 'default' or 'config' or 'env'.\n *\n * @param {string} name\n * @return {Option}\n */\n\n env(name) {\n this.envVar = name;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI option arguments into option values.\n *\n * @param {Function} [fn]\n * @return {Option}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Whether the option is mandatory and must have a value after parsing.\n *\n * @param {boolean} [mandatory=true]\n * @return {Option}\n */\n\n makeOptionMandatory(mandatory = true) {\n this.mandatory = !!mandatory;\n return this;\n }\n\n /**\n * Hide option in help.\n *\n * @param {boolean} [hide=true]\n * @return {Option}\n */\n\n hideHelp(hide = true) {\n this.hidden = !!hide;\n return this;\n }\n\n /**\n * @package\n */\n\n _concatValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n return previous.concat(value);\n }\n\n /**\n * Only allow option value to be one of choices.\n *\n * @param {string[]} values\n * @return {Option}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._concatValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Return option name.\n *\n * @return {string}\n */\n\n name() {\n if (this.long) {\n return this.long.replace(/^--/, '');\n }\n return this.short.replace(/^-/, '');\n }\n\n /**\n * Return option name, in a camelcase format that can be used\n * as an object attribute key.\n *\n * @return {string}\n */\n\n attributeName() {\n if (this.negate) {\n return camelcase(this.name().replace(/^no-/, ''));\n }\n return camelcase(this.name());\n }\n\n /**\n * Check if `arg` matches the short or long flag.\n *\n * @param {string} arg\n * @return {boolean}\n * @package\n */\n\n is(arg) {\n return this.short === arg || this.long === arg;\n }\n\n /**\n * Return whether a boolean option.\n *\n * Options are one of boolean, negated, required argument, or optional argument.\n *\n * @return {boolean}\n * @package\n */\n\n isBoolean() {\n return !this.required && !this.optional && !this.negate;\n }\n}\n\n/**\n * This class is to make it easier to work with dual options, without changing the existing\n * implementation. We support separate dual options for separate positive and negative options,\n * like `--build` and `--no-build`, which share a single option value. This works nicely for some\n * use cases, but is tricky for others where we want separate behaviours despite\n * the single shared option value.\n */\nclass DualOptions {\n /**\n * @param {Option[]} options\n */\n constructor(options) {\n this.positiveOptions = new Map();\n this.negativeOptions = new Map();\n this.dualOptions = new Set();\n options.forEach((option) => {\n if (option.negate) {\n this.negativeOptions.set(option.attributeName(), option);\n } else {\n this.positiveOptions.set(option.attributeName(), option);\n }\n });\n this.negativeOptions.forEach((value, key) => {\n if (this.positiveOptions.has(key)) {\n this.dualOptions.add(key);\n }\n });\n }\n\n /**\n * Did the value come from the option, and not from possible matching dual option?\n *\n * @param {*} value\n * @param {Option} option\n * @returns {boolean}\n */\n valueFromOption(value, option) {\n const optionKey = option.attributeName();\n if (!this.dualOptions.has(optionKey)) return true;\n\n // Use the value to deduce if (probably) came from the option.\n const preset = this.negativeOptions.get(optionKey).presetArg;\n const negativeValue = preset !== undefined ? preset : false;\n return option.negate === (negativeValue === value);\n }\n}\n\n/**\n * Convert string from kebab-case to camelCase.\n *\n * @param {string} str\n * @return {string}\n * @private\n */\n\nfunction camelcase(str) {\n return str.split('-').reduce((str, word) => {\n return str + word[0].toUpperCase() + word.slice(1);\n });\n}\n\n/**\n * Split the short and long flag out of something like '-m,--mixed <value>'\n *\n * @private\n */\n\nfunction splitOptionFlags(flags) {\n let shortFlag;\n let longFlag;\n // short flag, single dash and single character\n const shortFlagExp = /^-[^-]$/;\n // long flag, double dash and at least one character\n const longFlagExp = /^--[^-]/;\n\n const flagParts = flags.split(/[ |,]+/).concat('guard');\n // Normal is short and/or long.\n if (shortFlagExp.test(flagParts[0])) shortFlag = flagParts.shift();\n if (longFlagExp.test(flagParts[0])) longFlag = flagParts.shift();\n // Long then short. Rarely used but fine.\n if (!shortFlag && shortFlagExp.test(flagParts[0]))\n shortFlag = flagParts.shift();\n // Allow two long flags, like '--ws, --workspace'\n // This is the supported way to have a shortish option flag.\n if (!shortFlag && longFlagExp.test(flagParts[0])) {\n shortFlag = longFlag;\n longFlag = flagParts.shift();\n }\n\n // Check for unprocessed flag. Fail noisily rather than silently ignore.\n if (flagParts[0].startsWith('-')) {\n const unsupportedFlag = flagParts[0];\n const baseError = `option creation failed due to '${unsupportedFlag}' in option flags '${flags}'`;\n if (/^-[^-][^-]/.test(unsupportedFlag))\n throw new Error(\n `${baseError}\n- a short flag is a single dash and a single character\n - either use a single dash and a single character (for a short flag)\n - or use a double dash for a long option (and can have two, like '--ws, --workspace')`,\n );\n if (shortFlagExp.test(unsupportedFlag))\n throw new Error(`${baseError}\n- too many short flags`);\n if (longFlagExp.test(unsupportedFlag))\n throw new Error(`${baseError}\n- too many long flags`);\n\n throw new Error(`${baseError}\n- unrecognised flag format`);\n }\n if (shortFlag === undefined && longFlag === undefined)\n throw new Error(\n `option creation failed due to no flags found in '${flags}'.`,\n );\n\n return { shortFlag, longFlag };\n}\n\nexports.Option = Option;\nexports.DualOptions = DualOptions;\n",
9
+ "const maxDistance = 3;\n\nfunction editDistance(a, b) {\n // https://en.wikipedia.org/wiki/Damerau–Levenshtein_distance\n // Calculating optimal string alignment distance, no substring is edited more than once.\n // (Simple implementation.)\n\n // Quick early exit, return worst case.\n if (Math.abs(a.length - b.length) > maxDistance)\n return Math.max(a.length, b.length);\n\n // distance between prefix substrings of a and b\n const d = [];\n\n // pure deletions turn a into empty string\n for (let i = 0; i <= a.length; i++) {\n d[i] = [i];\n }\n // pure insertions turn empty string into b\n for (let j = 0; j <= b.length; j++) {\n d[0][j] = j;\n }\n\n // fill matrix\n for (let j = 1; j <= b.length; j++) {\n for (let i = 1; i <= a.length; i++) {\n let cost = 1;\n if (a[i - 1] === b[j - 1]) {\n cost = 0;\n } else {\n cost = 1;\n }\n d[i][j] = Math.min(\n d[i - 1][j] + 1, // deletion\n d[i][j - 1] + 1, // insertion\n d[i - 1][j - 1] + cost, // substitution\n );\n // transposition\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);\n }\n }\n }\n\n return d[a.length][b.length];\n}\n\n/**\n * Find close matches, restricted to same number of edits.\n *\n * @param {string} word\n * @param {string[]} candidates\n * @returns {string}\n */\n\nfunction suggestSimilar(word, candidates) {\n if (!candidates || candidates.length === 0) return '';\n // remove possible duplicates\n candidates = Array.from(new Set(candidates));\n\n const searchingOptions = word.startsWith('--');\n if (searchingOptions) {\n word = word.slice(2);\n candidates = candidates.map((candidate) => candidate.slice(2));\n }\n\n let similar = [];\n let bestDistance = maxDistance;\n const minSimilarity = 0.4;\n candidates.forEach((candidate) => {\n if (candidate.length <= 1) return; // no one character guesses\n\n const distance = editDistance(word, candidate);\n const length = Math.max(word.length, candidate.length);\n const similarity = (length - distance) / length;\n if (similarity > minSimilarity) {\n if (distance < bestDistance) {\n // better edit distance, throw away previous worse matches\n bestDistance = distance;\n similar = [candidate];\n } else if (distance === bestDistance) {\n similar.push(candidate);\n }\n }\n });\n\n similar.sort((a, b) => a.localeCompare(b));\n if (searchingOptions) {\n similar = similar.map((candidate) => `--${candidate}`);\n }\n\n if (similar.length > 1) {\n return `\\n(Did you mean one of ${similar.join(', ')}?)`;\n }\n if (similar.length === 1) {\n return `\\n(Did you mean ${similar[0]}?)`;\n }\n return '';\n}\n\nexports.suggestSimilar = suggestSimilar;\n",
10
+ "const EventEmitter = require('node:events').EventEmitter;\nconst childProcess = require('node:child_process');\nconst path = require('node:path');\nconst fs = require('node:fs');\nconst process = require('node:process');\n\nconst { Argument, humanReadableArgName } = require('./argument.js');\nconst { CommanderError } = require('./error.js');\nconst { Help, stripColor } = require('./help.js');\nconst { Option, DualOptions } = require('./option.js');\nconst { suggestSimilar } = require('./suggestSimilar');\n\nclass Command extends EventEmitter {\n /**\n * Initialize a new `Command`.\n *\n * @param {string} [name]\n */\n\n constructor(name) {\n super();\n /** @type {Command[]} */\n this.commands = [];\n /** @type {Option[]} */\n this.options = [];\n this.parent = null;\n this._allowUnknownOption = false;\n this._allowExcessArguments = false;\n /** @type {Argument[]} */\n this.registeredArguments = [];\n this._args = this.registeredArguments; // deprecated old name\n /** @type {string[]} */\n this.args = []; // cli args with options removed\n this.rawArgs = [];\n this.processedArgs = []; // like .args but after custom processing and collecting variadic\n this._scriptPath = null;\n this._name = name || '';\n this._optionValues = {};\n this._optionValueSources = {}; // default, env, cli etc\n this._storeOptionsAsProperties = false;\n this._actionHandler = null;\n this._executableHandler = false;\n this._executableFile = null; // custom name for executable\n this._executableDir = null; // custom search directory for subcommands\n this._defaultCommandName = null;\n this._exitCallback = null;\n this._aliases = [];\n this._combineFlagAndOptionalValue = true;\n this._description = '';\n this._summary = '';\n this._argsDescription = undefined; // legacy\n this._enablePositionalOptions = false;\n this._passThroughOptions = false;\n this._lifeCycleHooks = {}; // a hash of arrays\n /** @type {(boolean | string)} */\n this._showHelpAfterError = false;\n this._showSuggestionAfterError = true;\n this._savedState = null; // used in save/restoreStateBeforeParse\n\n // see configureOutput() for docs\n this._outputConfiguration = {\n writeOut: (str) => process.stdout.write(str),\n writeErr: (str) => process.stderr.write(str),\n outputError: (str, write) => write(str),\n getOutHelpWidth: () =>\n process.stdout.isTTY ? process.stdout.columns : undefined,\n getErrHelpWidth: () =>\n process.stderr.isTTY ? process.stderr.columns : undefined,\n getOutHasColors: () =>\n useColor() ?? (process.stdout.isTTY && process.stdout.hasColors?.()),\n getErrHasColors: () =>\n useColor() ?? (process.stderr.isTTY && process.stderr.hasColors?.()),\n stripColor: (str) => stripColor(str),\n };\n\n this._hidden = false;\n /** @type {(Option | null | undefined)} */\n this._helpOption = undefined; // Lazy created on demand. May be null if help option is disabled.\n this._addImplicitHelpCommand = undefined; // undecided whether true or false yet, not inherited\n /** @type {Command} */\n this._helpCommand = undefined; // lazy initialised, inherited\n this._helpConfiguration = {};\n }\n\n /**\n * Copy settings that are useful to have in common across root command and subcommands.\n *\n * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)\n *\n * @param {Command} sourceCommand\n * @return {Command} `this` command for chaining\n */\n copyInheritedSettings(sourceCommand) {\n this._outputConfiguration = sourceCommand._outputConfiguration;\n this._helpOption = sourceCommand._helpOption;\n this._helpCommand = sourceCommand._helpCommand;\n this._helpConfiguration = sourceCommand._helpConfiguration;\n this._exitCallback = sourceCommand._exitCallback;\n this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;\n this._combineFlagAndOptionalValue =\n sourceCommand._combineFlagAndOptionalValue;\n this._allowExcessArguments = sourceCommand._allowExcessArguments;\n this._enablePositionalOptions = sourceCommand._enablePositionalOptions;\n this._showHelpAfterError = sourceCommand._showHelpAfterError;\n this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;\n\n return this;\n }\n\n /**\n * @returns {Command[]}\n * @private\n */\n\n _getCommandAndAncestors() {\n const result = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n for (let command = this; command; command = command.parent) {\n result.push(command);\n }\n return result;\n }\n\n /**\n * Define a command.\n *\n * There are two styles of command: pay attention to where to put the description.\n *\n * @example\n * // Command implemented using action handler (description is supplied separately to `.command`)\n * program\n * .command('clone <source> [destination]')\n * .description('clone a repository into a newly created directory')\n * .action((source, destination) => {\n * console.log('clone command called');\n * });\n *\n * // Command implemented using separate executable file (description is second parameter to `.command`)\n * program\n * .command('start <service>', 'start named service')\n * .command('stop [service]', 'stop named service, or all if no name supplied');\n *\n * @param {string} nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`\n * @param {(object | string)} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)\n * @param {object} [execOpts] - configuration options (for executable)\n * @return {Command} returns new command for action handler, or `this` for executable command\n */\n\n command(nameAndArgs, actionOptsOrExecDesc, execOpts) {\n let desc = actionOptsOrExecDesc;\n let opts = execOpts;\n if (typeof desc === 'object' && desc !== null) {\n opts = desc;\n desc = null;\n }\n opts = opts || {};\n const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);\n\n const cmd = this.createCommand(name);\n if (desc) {\n cmd.description(desc);\n cmd._executableHandler = true;\n }\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden\n cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor\n if (args) cmd.arguments(args);\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd.copyInheritedSettings(this);\n\n if (desc) return this;\n return cmd;\n }\n\n /**\n * Factory routine to create a new unattached command.\n *\n * See .command() for creating an attached subcommand, which uses this routine to\n * create the command. You can override createCommand to customise subcommands.\n *\n * @param {string} [name]\n * @return {Command} new command\n */\n\n createCommand(name) {\n return new Command(name);\n }\n\n /**\n * You can customise the help with a subclass of Help by overriding createHelp,\n * or by overriding Help properties using configureHelp().\n *\n * @return {Help}\n */\n\n createHelp() {\n return Object.assign(new Help(), this.configureHelp());\n }\n\n /**\n * You can customise the help by overriding Help properties using configureHelp(),\n * or with a subclass of Help by overriding createHelp().\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureHelp(configuration) {\n if (configuration === undefined) return this._helpConfiguration;\n\n this._helpConfiguration = configuration;\n return this;\n }\n\n /**\n * The default output goes to stdout and stderr. You can customise this for special\n * applications. You can also customise the display of errors by overriding outputError.\n *\n * The configuration properties are all functions:\n *\n * // change how output being written, defaults to stdout and stderr\n * writeOut(str)\n * writeErr(str)\n * // change how output being written for errors, defaults to writeErr\n * outputError(str, write) // used for displaying errors and not used for displaying help\n * // specify width for wrapping help\n * getOutHelpWidth()\n * getErrHelpWidth()\n * // color support, currently only used with Help\n * getOutHasColors()\n * getErrHasColors()\n * stripColor() // used to remove ANSI escape codes if output does not have colors\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureOutput(configuration) {\n if (configuration === undefined) return this._outputConfiguration;\n\n Object.assign(this._outputConfiguration, configuration);\n return this;\n }\n\n /**\n * Display the help or a custom message after an error occurs.\n *\n * @param {(boolean|string)} [displayHelp]\n * @return {Command} `this` command for chaining\n */\n showHelpAfterError(displayHelp = true) {\n if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;\n this._showHelpAfterError = displayHelp;\n return this;\n }\n\n /**\n * Display suggestion of similar commands for unknown commands, or options for unknown options.\n *\n * @param {boolean} [displaySuggestion]\n * @return {Command} `this` command for chaining\n */\n showSuggestionAfterError(displaySuggestion = true) {\n this._showSuggestionAfterError = !!displaySuggestion;\n return this;\n }\n\n /**\n * Add a prepared subcommand.\n *\n * See .command() for creating an attached subcommand which inherits settings from its parent.\n *\n * @param {Command} cmd - new subcommand\n * @param {object} [opts] - configuration options\n * @return {Command} `this` command for chaining\n */\n\n addCommand(cmd, opts) {\n if (!cmd._name) {\n throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`);\n }\n\n opts = opts || {};\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation\n\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd._checkForBrokenPassThrough();\n\n return this;\n }\n\n /**\n * Factory routine to create a new unattached argument.\n *\n * See .argument() for creating an attached argument, which uses this routine to\n * create the argument. You can override createArgument to return a custom argument.\n *\n * @param {string} name\n * @param {string} [description]\n * @return {Argument} new argument\n */\n\n createArgument(name, description) {\n return new Argument(name, description);\n }\n\n /**\n * Define argument syntax for command.\n *\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @example\n * program.argument('<input-file>');\n * program.argument('[output-file]');\n *\n * @param {string} name\n * @param {string} [description]\n * @param {(Function|*)} [fn] - custom argument processing function\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n argument(name, description, fn, defaultValue) {\n const argument = this.createArgument(name, description);\n if (typeof fn === 'function') {\n argument.default(defaultValue).argParser(fn);\n } else {\n argument.default(fn);\n }\n this.addArgument(argument);\n return this;\n }\n\n /**\n * Define argument syntax for command, adding multiple at once (without descriptions).\n *\n * See also .argument().\n *\n * @example\n * program.arguments('<cmd> [env]');\n *\n * @param {string} names\n * @return {Command} `this` command for chaining\n */\n\n arguments(names) {\n names\n .trim()\n .split(/ +/)\n .forEach((detail) => {\n this.argument(detail);\n });\n return this;\n }\n\n /**\n * Define argument syntax for command, adding a prepared argument.\n *\n * @param {Argument} argument\n * @return {Command} `this` command for chaining\n */\n addArgument(argument) {\n const previousArgument = this.registeredArguments.slice(-1)[0];\n if (previousArgument && previousArgument.variadic) {\n throw new Error(\n `only the last argument can be variadic '${previousArgument.name()}'`,\n );\n }\n if (\n argument.required &&\n argument.defaultValue !== undefined &&\n argument.parseArg === undefined\n ) {\n throw new Error(\n `a default value for a required argument is never used: '${argument.name()}'`,\n );\n }\n this.registeredArguments.push(argument);\n return this;\n }\n\n /**\n * Customise or override default help command. By default a help command is automatically added if your command has subcommands.\n *\n * @example\n * program.helpCommand('help [cmd]');\n * program.helpCommand('help [cmd]', 'show help');\n * program.helpCommand(false); // suppress default help command\n * program.helpCommand(true); // add help command even if no subcommands\n *\n * @param {string|boolean} enableOrNameAndArgs - enable with custom name and/or arguments, or boolean to override whether added\n * @param {string} [description] - custom description\n * @return {Command} `this` command for chaining\n */\n\n helpCommand(enableOrNameAndArgs, description) {\n if (typeof enableOrNameAndArgs === 'boolean') {\n this._addImplicitHelpCommand = enableOrNameAndArgs;\n return this;\n }\n\n enableOrNameAndArgs = enableOrNameAndArgs ?? 'help [command]';\n const [, helpName, helpArgs] = enableOrNameAndArgs.match(/([^ ]+) *(.*)/);\n const helpDescription = description ?? 'display help for command';\n\n const helpCommand = this.createCommand(helpName);\n helpCommand.helpOption(false);\n if (helpArgs) helpCommand.arguments(helpArgs);\n if (helpDescription) helpCommand.description(helpDescription);\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n\n return this;\n }\n\n /**\n * Add prepared custom help command.\n *\n * @param {(Command|string|boolean)} helpCommand - custom help command, or deprecated enableOrNameAndArgs as for `.helpCommand()`\n * @param {string} [deprecatedDescription] - deprecated custom description used with custom name only\n * @return {Command} `this` command for chaining\n */\n addHelpCommand(helpCommand, deprecatedDescription) {\n // If not passed an object, call through to helpCommand for backwards compatibility,\n // as addHelpCommand was originally used like helpCommand is now.\n if (typeof helpCommand !== 'object') {\n this.helpCommand(helpCommand, deprecatedDescription);\n return this;\n }\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n return this;\n }\n\n /**\n * Lazy create help command.\n *\n * @return {(Command|null)}\n * @package\n */\n _getHelpCommand() {\n const hasImplicitHelpCommand =\n this._addImplicitHelpCommand ??\n (this.commands.length &&\n !this._actionHandler &&\n !this._findCommand('help'));\n\n if (hasImplicitHelpCommand) {\n if (this._helpCommand === undefined) {\n this.helpCommand(undefined, undefined); // use default name and description\n }\n return this._helpCommand;\n }\n return null;\n }\n\n /**\n * Add hook for life cycle event.\n *\n * @param {string} event\n * @param {Function} listener\n * @return {Command} `this` command for chaining\n */\n\n hook(event, listener) {\n const allowedValues = ['preSubcommand', 'preAction', 'postAction'];\n if (!allowedValues.includes(event)) {\n throw new Error(`Unexpected value for event passed to hook : '${event}'.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n if (this._lifeCycleHooks[event]) {\n this._lifeCycleHooks[event].push(listener);\n } else {\n this._lifeCycleHooks[event] = [listener];\n }\n return this;\n }\n\n /**\n * Register callback to use as replacement for calling process.exit.\n *\n * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing\n * @return {Command} `this` command for chaining\n */\n\n exitOverride(fn) {\n if (fn) {\n this._exitCallback = fn;\n } else {\n this._exitCallback = (err) => {\n if (err.code !== 'commander.executeSubCommandAsync') {\n throw err;\n } else {\n // Async callback from spawn events, not useful to throw.\n }\n };\n }\n return this;\n }\n\n /**\n * Call process.exit, and _exitCallback if defined.\n *\n * @param {number} exitCode exit code for using with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n * @return never\n * @private\n */\n\n _exit(exitCode, code, message) {\n if (this._exitCallback) {\n this._exitCallback(new CommanderError(exitCode, code, message));\n // Expecting this line is not reached.\n }\n process.exit(exitCode);\n }\n\n /**\n * Register callback `fn` for the command.\n *\n * @example\n * program\n * .command('serve')\n * .description('start service')\n * .action(function() {\n * // do work here\n * });\n *\n * @param {Function} fn\n * @return {Command} `this` command for chaining\n */\n\n action(fn) {\n const listener = (args) => {\n // The .action callback takes an extra parameter which is the command or options.\n const expectedArgsCount = this.registeredArguments.length;\n const actionArgs = args.slice(0, expectedArgsCount);\n if (this._storeOptionsAsProperties) {\n actionArgs[expectedArgsCount] = this; // backwards compatible \"options\"\n } else {\n actionArgs[expectedArgsCount] = this.opts();\n }\n actionArgs.push(this);\n\n return fn.apply(this, actionArgs);\n };\n this._actionHandler = listener;\n return this;\n }\n\n /**\n * Factory routine to create a new unattached option.\n *\n * See .option() for creating an attached option, which uses this routine to\n * create the option. You can override createOption to return a custom option.\n *\n * @param {string} flags\n * @param {string} [description]\n * @return {Option} new option\n */\n\n createOption(flags, description) {\n return new Option(flags, description);\n }\n\n /**\n * Wrap parseArgs to catch 'commander.invalidArgument'.\n *\n * @param {(Option | Argument)} target\n * @param {string} value\n * @param {*} previous\n * @param {string} invalidArgumentMessage\n * @private\n */\n\n _callParseArg(target, value, previous, invalidArgumentMessage) {\n try {\n return target.parseArg(value, previous);\n } catch (err) {\n if (err.code === 'commander.invalidArgument') {\n const message = `${invalidArgumentMessage} ${err.message}`;\n this.error(message, { exitCode: err.exitCode, code: err.code });\n }\n throw err;\n }\n }\n\n /**\n * Check for option flag conflicts.\n * Register option if no conflicts found, or throw on conflict.\n *\n * @param {Option} option\n * @private\n */\n\n _registerOption(option) {\n const matchingOption =\n (option.short && this._findOption(option.short)) ||\n (option.long && this._findOption(option.long));\n if (matchingOption) {\n const matchingFlag =\n option.long && this._findOption(option.long)\n ? option.long\n : option.short;\n throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'\n- already used by option '${matchingOption.flags}'`);\n }\n\n this.options.push(option);\n }\n\n /**\n * Check for command name and alias conflicts with existing commands.\n * Register command if no conflicts found, or throw on conflict.\n *\n * @param {Command} command\n * @private\n */\n\n _registerCommand(command) {\n const knownBy = (cmd) => {\n return [cmd.name()].concat(cmd.aliases());\n };\n\n const alreadyUsed = knownBy(command).find((name) =>\n this._findCommand(name),\n );\n if (alreadyUsed) {\n const existingCmd = knownBy(this._findCommand(alreadyUsed)).join('|');\n const newCmd = knownBy(command).join('|');\n throw new Error(\n `cannot add command '${newCmd}' as already have command '${existingCmd}'`,\n );\n }\n\n this.commands.push(command);\n }\n\n /**\n * Add an option.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addOption(option) {\n this._registerOption(option);\n\n const oname = option.name();\n const name = option.attributeName();\n\n // store default value\n if (option.negate) {\n // --no-foo is special and defaults foo to true, unless a --foo option is already defined\n const positiveLongFlag = option.long.replace(/^--no-/, '--');\n if (!this._findOption(positiveLongFlag)) {\n this.setOptionValueWithSource(\n name,\n option.defaultValue === undefined ? true : option.defaultValue,\n 'default',\n );\n }\n } else if (option.defaultValue !== undefined) {\n this.setOptionValueWithSource(name, option.defaultValue, 'default');\n }\n\n // handler for cli and env supplied values\n const handleOptionValue = (val, invalidValueMessage, valueSource) => {\n // val is null for optional option used without an optional-argument.\n // val is undefined for boolean and negated option.\n if (val == null && option.presetArg !== undefined) {\n val = option.presetArg;\n }\n\n // custom processing\n const oldValue = this.getOptionValue(name);\n if (val !== null && option.parseArg) {\n val = this._callParseArg(option, val, oldValue, invalidValueMessage);\n } else if (val !== null && option.variadic) {\n val = option._concatValue(val, oldValue);\n }\n\n // Fill-in appropriate missing values. Long winded but easy to follow.\n if (val == null) {\n if (option.negate) {\n val = false;\n } else if (option.isBoolean() || option.optional) {\n val = true;\n } else {\n val = ''; // not normal, parseArg might have failed or be a mock function for testing\n }\n }\n this.setOptionValueWithSource(name, val, valueSource);\n };\n\n this.on('option:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'cli');\n });\n\n if (option.envVar) {\n this.on('optionEnv:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'env');\n });\n }\n\n return this;\n }\n\n /**\n * Internal implementation shared by .option() and .requiredOption()\n *\n * @return {Command} `this` command for chaining\n * @private\n */\n _optionEx(config, flags, description, fn, defaultValue) {\n if (typeof flags === 'object' && flags instanceof Option) {\n throw new Error(\n 'To add an Option object use addOption() instead of option() or requiredOption()',\n );\n }\n const option = this.createOption(flags, description);\n option.makeOptionMandatory(!!config.mandatory);\n if (typeof fn === 'function') {\n option.default(defaultValue).argParser(fn);\n } else if (fn instanceof RegExp) {\n // deprecated\n const regex = fn;\n fn = (val, def) => {\n const m = regex.exec(val);\n return m ? m[0] : def;\n };\n option.default(defaultValue).argParser(fn);\n } else {\n option.default(fn);\n }\n\n return this.addOption(option);\n }\n\n /**\n * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required\n * option-argument is indicated by `<>` and an optional option-argument by `[]`.\n *\n * See the README for more details, and see also addOption() and requiredOption().\n *\n * @example\n * program\n * .option('-p, --pepper', 'add pepper')\n * .option('--pt, --pizza-type <TYPE>', 'type of pizza') // required option-argument\n * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default\n * .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n option(flags, description, parseArg, defaultValue) {\n return this._optionEx({}, flags, description, parseArg, defaultValue);\n }\n\n /**\n * Add a required option which must have a value after parsing. This usually means\n * the option must be specified on the command line. (Otherwise the same as .option().)\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n requiredOption(flags, description, parseArg, defaultValue) {\n return this._optionEx(\n { mandatory: true },\n flags,\n description,\n parseArg,\n defaultValue,\n );\n }\n\n /**\n * Alter parsing of short flags with optional values.\n *\n * @example\n * // for `.option('-f,--flag [value]'):\n * program.combineFlagAndOptionalValue(true); // `-f80` is treated like `--flag=80`, this is the default behaviour\n * program.combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`\n *\n * @param {boolean} [combine] - if `true` or omitted, an optional value can be specified directly after the flag.\n * @return {Command} `this` command for chaining\n */\n combineFlagAndOptionalValue(combine = true) {\n this._combineFlagAndOptionalValue = !!combine;\n return this;\n }\n\n /**\n * Allow unknown options on the command line.\n *\n * @param {boolean} [allowUnknown] - if `true` or omitted, no error will be thrown for unknown options.\n * @return {Command} `this` command for chaining\n */\n allowUnknownOption(allowUnknown = true) {\n this._allowUnknownOption = !!allowUnknown;\n return this;\n }\n\n /**\n * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.\n *\n * @param {boolean} [allowExcess] - if `true` or omitted, no error will be thrown for excess arguments.\n * @return {Command} `this` command for chaining\n */\n allowExcessArguments(allowExcess = true) {\n this._allowExcessArguments = !!allowExcess;\n return this;\n }\n\n /**\n * Enable positional options. Positional means global options are specified before subcommands which lets\n * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.\n * The default behaviour is non-positional and global options may appear anywhere on the command line.\n *\n * @param {boolean} [positional]\n * @return {Command} `this` command for chaining\n */\n enablePositionalOptions(positional = true) {\n this._enablePositionalOptions = !!positional;\n return this;\n }\n\n /**\n * Pass through options that come after command-arguments rather than treat them as command-options,\n * so actual command-options come before command-arguments. Turning this on for a subcommand requires\n * positional options to have been enabled on the program (parent commands).\n * The default behaviour is non-positional and options may appear before or after command-arguments.\n *\n * @param {boolean} [passThrough] for unknown options.\n * @return {Command} `this` command for chaining\n */\n passThroughOptions(passThrough = true) {\n this._passThroughOptions = !!passThrough;\n this._checkForBrokenPassThrough();\n return this;\n }\n\n /**\n * @private\n */\n\n _checkForBrokenPassThrough() {\n if (\n this.parent &&\n this._passThroughOptions &&\n !this.parent._enablePositionalOptions\n ) {\n throw new Error(\n `passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`,\n );\n }\n }\n\n /**\n * Whether to store option values as properties on command object,\n * or store separately (specify false). In both cases the option values can be accessed using .opts().\n *\n * @param {boolean} [storeAsProperties=true]\n * @return {Command} `this` command for chaining\n */\n\n storeOptionsAsProperties(storeAsProperties = true) {\n if (this.options.length) {\n throw new Error('call .storeOptionsAsProperties() before adding options');\n }\n if (Object.keys(this._optionValues).length) {\n throw new Error(\n 'call .storeOptionsAsProperties() before setting option values',\n );\n }\n this._storeOptionsAsProperties = !!storeAsProperties;\n return this;\n }\n\n /**\n * Retrieve option value.\n *\n * @param {string} key\n * @return {object} value\n */\n\n getOptionValue(key) {\n if (this._storeOptionsAsProperties) {\n return this[key];\n }\n return this._optionValues[key];\n }\n\n /**\n * Store option value.\n *\n * @param {string} key\n * @param {object} value\n * @return {Command} `this` command for chaining\n */\n\n setOptionValue(key, value) {\n return this.setOptionValueWithSource(key, value, undefined);\n }\n\n /**\n * Store option value and where the value came from.\n *\n * @param {string} key\n * @param {object} value\n * @param {string} source - expected values are default/config/env/cli/implied\n * @return {Command} `this` command for chaining\n */\n\n setOptionValueWithSource(key, value, source) {\n if (this._storeOptionsAsProperties) {\n this[key] = value;\n } else {\n this._optionValues[key] = value;\n }\n this._optionValueSources[key] = source;\n return this;\n }\n\n /**\n * Get source of option value.\n * Expected values are default | config | env | cli | implied\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSource(key) {\n return this._optionValueSources[key];\n }\n\n /**\n * Get source of option value. See also .optsWithGlobals().\n * Expected values are default | config | env | cli | implied\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSourceWithGlobals(key) {\n // global overwrites local, like optsWithGlobals\n let source;\n this._getCommandAndAncestors().forEach((cmd) => {\n if (cmd.getOptionValueSource(key) !== undefined) {\n source = cmd.getOptionValueSource(key);\n }\n });\n return source;\n }\n\n /**\n * Get user arguments from implied or explicit arguments.\n * Side-effects: set _scriptPath if args included script. Used for default program name, and subcommand searches.\n *\n * @private\n */\n\n _prepareUserArgs(argv, parseOptions) {\n if (argv !== undefined && !Array.isArray(argv)) {\n throw new Error('first parameter to parse must be array or undefined');\n }\n parseOptions = parseOptions || {};\n\n // auto-detect argument conventions if nothing supplied\n if (argv === undefined && parseOptions.from === undefined) {\n if (process.versions?.electron) {\n parseOptions.from = 'electron';\n }\n // check node specific options for scenarios where user CLI args follow executable without scriptname\n const execArgv = process.execArgv ?? [];\n if (\n execArgv.includes('-e') ||\n execArgv.includes('--eval') ||\n execArgv.includes('-p') ||\n execArgv.includes('--print')\n ) {\n parseOptions.from = 'eval'; // internal usage, not documented\n }\n }\n\n // default to using process.argv\n if (argv === undefined) {\n argv = process.argv;\n }\n this.rawArgs = argv.slice();\n\n // extract the user args and scriptPath\n let userArgs;\n switch (parseOptions.from) {\n case undefined:\n case 'node':\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n break;\n case 'electron':\n // @ts-ignore: because defaultApp is an unknown property\n if (process.defaultApp) {\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n } else {\n userArgs = argv.slice(1);\n }\n break;\n case 'user':\n userArgs = argv.slice(0);\n break;\n case 'eval':\n userArgs = argv.slice(1);\n break;\n default:\n throw new Error(\n `unexpected parse option { from: '${parseOptions.from}' }`,\n );\n }\n\n // Find default name for program from arguments.\n if (!this._name && this._scriptPath)\n this.nameFromFilename(this._scriptPath);\n this._name = this._name || 'program';\n\n return userArgs;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Use parseAsync instead of parse if any of your action handlers are async.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * program.parse(); // parse process.argv and auto-detect electron and special node flags\n * program.parse(process.argv); // assume argv[0] is app and argv[1] is script\n * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv] - optional, defaults to process.argv\n * @param {object} [parseOptions] - optionally specify style of options with from: node/user/electron\n * @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron'\n * @return {Command} `this` command for chaining\n */\n\n parse(argv, parseOptions) {\n this._prepareForParse();\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n this._parseCommand([], userArgs);\n\n return this;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags\n * await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script\n * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv]\n * @param {object} [parseOptions]\n * @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron'\n * @return {Promise}\n */\n\n async parseAsync(argv, parseOptions) {\n this._prepareForParse();\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n await this._parseCommand([], userArgs);\n\n return this;\n }\n\n _prepareForParse() {\n if (this._savedState === null) {\n this.saveStateBeforeParse();\n } else {\n this.restoreStateBeforeParse();\n }\n }\n\n /**\n * Called the first time parse is called to save state and allow a restore before subsequent calls to parse.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state saved.\n */\n saveStateBeforeParse() {\n this._savedState = {\n // name is stable if supplied by author, but may be unspecified for root command and deduced during parsing\n _name: this._name,\n // option values before parse have default values (including false for negated options)\n // shallow clones\n _optionValues: { ...this._optionValues },\n _optionValueSources: { ...this._optionValueSources },\n };\n }\n\n /**\n * Restore state before parse for calls after the first.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state restored.\n */\n restoreStateBeforeParse() {\n if (this._storeOptionsAsProperties)\n throw new Error(`Can not call parse again when storeOptionsAsProperties is true.\n- either make a new Command for each call to parse, or stop storing options as properties`);\n\n // clear state from _prepareUserArgs\n this._name = this._savedState._name;\n this._scriptPath = null;\n this.rawArgs = [];\n // clear state from setOptionValueWithSource\n this._optionValues = { ...this._savedState._optionValues };\n this._optionValueSources = { ...this._savedState._optionValueSources };\n // clear state from _parseCommand\n this.args = [];\n // clear state from _processArguments\n this.processedArgs = [];\n }\n\n /**\n * Throw if expected executable is missing. Add lots of help for author.\n *\n * @param {string} executableFile\n * @param {string} executableDir\n * @param {string} subcommandName\n */\n _checkForMissingExecutable(executableFile, executableDir, subcommandName) {\n if (fs.existsSync(executableFile)) return;\n\n const executableDirMessage = executableDir\n ? `searched for local subcommand relative to directory '${executableDir}'`\n : 'no directory for search for local subcommand, use .executableDir() to supply a custom directory';\n const executableMissing = `'${executableFile}' does not exist\n - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${executableDirMessage}`;\n throw new Error(executableMissing);\n }\n\n /**\n * Execute a sub-command executable.\n *\n * @private\n */\n\n _executeSubCommand(subcommand, args) {\n args = args.slice();\n let launchWithNode = false; // Use node for source targets so do not need to get permissions correct, and on Windows.\n const sourceExt = ['.js', '.ts', '.tsx', '.mjs', '.cjs'];\n\n function findFile(baseDir, baseName) {\n // Look for specified file\n const localBin = path.resolve(baseDir, baseName);\n if (fs.existsSync(localBin)) return localBin;\n\n // Stop looking if candidate already has an expected extension.\n if (sourceExt.includes(path.extname(baseName))) return undefined;\n\n // Try all the extensions.\n const foundExt = sourceExt.find((ext) =>\n fs.existsSync(`${localBin}${ext}`),\n );\n if (foundExt) return `${localBin}${foundExt}`;\n\n return undefined;\n }\n\n // Not checking for help first. Unlikely to have mandatory and executable, and can't robustly test for help flags in external command.\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // executableFile and executableDir might be full path, or just a name\n let executableFile =\n subcommand._executableFile || `${this._name}-${subcommand._name}`;\n let executableDir = this._executableDir || '';\n if (this._scriptPath) {\n let resolvedScriptPath; // resolve possible symlink for installed npm binary\n try {\n resolvedScriptPath = fs.realpathSync(this._scriptPath);\n } catch {\n resolvedScriptPath = this._scriptPath;\n }\n executableDir = path.resolve(\n path.dirname(resolvedScriptPath),\n executableDir,\n );\n }\n\n // Look for a local file in preference to a command in PATH.\n if (executableDir) {\n let localFile = findFile(executableDir, executableFile);\n\n // Legacy search using prefix of script name instead of command name\n if (!localFile && !subcommand._executableFile && this._scriptPath) {\n const legacyName = path.basename(\n this._scriptPath,\n path.extname(this._scriptPath),\n );\n if (legacyName !== this._name) {\n localFile = findFile(\n executableDir,\n `${legacyName}-${subcommand._name}`,\n );\n }\n }\n executableFile = localFile || executableFile;\n }\n\n launchWithNode = sourceExt.includes(path.extname(executableFile));\n\n let proc;\n if (process.platform !== 'win32') {\n if (launchWithNode) {\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n\n proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });\n } else {\n proc = childProcess.spawn(executableFile, args, { stdio: 'inherit' });\n }\n } else {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });\n }\n\n if (!proc.killed) {\n // testing mainly to avoid leak warnings during unit tests with mocked spawn\n const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];\n signals.forEach((signal) => {\n process.on(signal, () => {\n if (proc.killed === false && proc.exitCode === null) {\n // @ts-ignore because signals not typed to known strings\n proc.kill(signal);\n }\n });\n });\n }\n\n // By default terminate process when spawned process terminates.\n const exitCallback = this._exitCallback;\n proc.on('close', (code) => {\n code = code ?? 1; // code is null if spawned process terminated due to a signal\n if (!exitCallback) {\n process.exit(code);\n } else {\n exitCallback(\n new CommanderError(\n code,\n 'commander.executeSubCommandAsync',\n '(close)',\n ),\n );\n }\n });\n proc.on('error', (err) => {\n // @ts-ignore: because err.code is an unknown property\n if (err.code === 'ENOENT') {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n // @ts-ignore: because err.code is an unknown property\n } else if (err.code === 'EACCES') {\n throw new Error(`'${executableFile}' not executable`);\n }\n if (!exitCallback) {\n process.exit(1);\n } else {\n const wrappedError = new CommanderError(\n 1,\n 'commander.executeSubCommandAsync',\n '(error)',\n );\n wrappedError.nestedError = err;\n exitCallback(wrappedError);\n }\n });\n\n // Store the reference to the child process\n this.runningCommand = proc;\n }\n\n /**\n * @private\n */\n\n _dispatchSubcommand(commandName, operands, unknown) {\n const subCommand = this._findCommand(commandName);\n if (!subCommand) this.help({ error: true });\n\n subCommand._prepareForParse();\n let promiseChain;\n promiseChain = this._chainOrCallSubCommandHook(\n promiseChain,\n subCommand,\n 'preSubcommand',\n );\n promiseChain = this._chainOrCall(promiseChain, () => {\n if (subCommand._executableHandler) {\n this._executeSubCommand(subCommand, operands.concat(unknown));\n } else {\n return subCommand._parseCommand(operands, unknown);\n }\n });\n return promiseChain;\n }\n\n /**\n * Invoke help directly if possible, or dispatch if necessary.\n * e.g. help foo\n *\n * @private\n */\n\n _dispatchHelpCommand(subcommandName) {\n if (!subcommandName) {\n this.help();\n }\n const subCommand = this._findCommand(subcommandName);\n if (subCommand && !subCommand._executableHandler) {\n subCommand.help();\n }\n\n // Fallback to parsing the help flag to invoke the help.\n return this._dispatchSubcommand(\n subcommandName,\n [],\n [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? '--help'],\n );\n }\n\n /**\n * Check this.args against expected this.registeredArguments.\n *\n * @private\n */\n\n _checkNumberOfArguments() {\n // too few\n this.registeredArguments.forEach((arg, i) => {\n if (arg.required && this.args[i] == null) {\n this.missingArgument(arg.name());\n }\n });\n // too many\n if (\n this.registeredArguments.length > 0 &&\n this.registeredArguments[this.registeredArguments.length - 1].variadic\n ) {\n return;\n }\n if (this.args.length > this.registeredArguments.length) {\n this._excessArguments(this.args);\n }\n }\n\n /**\n * Process this.args using this.registeredArguments and save as this.processedArgs!\n *\n * @private\n */\n\n _processArguments() {\n const myParseArg = (argument, value, previous) => {\n // Extra processing for nice error message on parsing failure.\n let parsedValue = value;\n if (value !== null && argument.parseArg) {\n const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;\n parsedValue = this._callParseArg(\n argument,\n value,\n previous,\n invalidValueMessage,\n );\n }\n return parsedValue;\n };\n\n this._checkNumberOfArguments();\n\n const processedArgs = [];\n this.registeredArguments.forEach((declaredArg, index) => {\n let value = declaredArg.defaultValue;\n if (declaredArg.variadic) {\n // Collect together remaining arguments for passing together as an array.\n if (index < this.args.length) {\n value = this.args.slice(index);\n if (declaredArg.parseArg) {\n value = value.reduce((processed, v) => {\n return myParseArg(declaredArg, v, processed);\n }, declaredArg.defaultValue);\n }\n } else if (value === undefined) {\n value = [];\n }\n } else if (index < this.args.length) {\n value = this.args[index];\n if (declaredArg.parseArg) {\n value = myParseArg(declaredArg, value, declaredArg.defaultValue);\n }\n }\n processedArgs[index] = value;\n });\n this.processedArgs = processedArgs;\n }\n\n /**\n * Once we have a promise we chain, but call synchronously until then.\n *\n * @param {(Promise|undefined)} promise\n * @param {Function} fn\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCall(promise, fn) {\n // thenable\n if (promise && promise.then && typeof promise.then === 'function') {\n // already have a promise, chain callback\n return promise.then(() => fn());\n }\n // callback might return a promise\n return fn();\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallHooks(promise, event) {\n let result = promise;\n const hooks = [];\n this._getCommandAndAncestors()\n .reverse()\n .filter((cmd) => cmd._lifeCycleHooks[event] !== undefined)\n .forEach((hookedCommand) => {\n hookedCommand._lifeCycleHooks[event].forEach((callback) => {\n hooks.push({ hookedCommand, callback });\n });\n });\n if (event === 'postAction') {\n hooks.reverse();\n }\n\n hooks.forEach((hookDetail) => {\n result = this._chainOrCall(result, () => {\n return hookDetail.callback(hookDetail.hookedCommand, this);\n });\n });\n return result;\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {Command} subCommand\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallSubCommandHook(promise, subCommand, event) {\n let result = promise;\n if (this._lifeCycleHooks[event] !== undefined) {\n this._lifeCycleHooks[event].forEach((hook) => {\n result = this._chainOrCall(result, () => {\n return hook(this, subCommand);\n });\n });\n }\n return result;\n }\n\n /**\n * Process arguments in context of this command.\n * Returns action result, in case it is a promise.\n *\n * @private\n */\n\n _parseCommand(operands, unknown) {\n const parsed = this.parseOptions(unknown);\n this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env\n this._parseOptionsImplied();\n operands = operands.concat(parsed.operands);\n unknown = parsed.unknown;\n this.args = operands.concat(unknown);\n\n if (operands && this._findCommand(operands[0])) {\n return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);\n }\n if (\n this._getHelpCommand() &&\n operands[0] === this._getHelpCommand().name()\n ) {\n return this._dispatchHelpCommand(operands[1]);\n }\n if (this._defaultCommandName) {\n this._outputHelpIfRequested(unknown); // Run the help for default command from parent rather than passing to default command\n return this._dispatchSubcommand(\n this._defaultCommandName,\n operands,\n unknown,\n );\n }\n if (\n this.commands.length &&\n this.args.length === 0 &&\n !this._actionHandler &&\n !this._defaultCommandName\n ) {\n // probably missing subcommand and no handler, user needs help (and exit)\n this.help({ error: true });\n }\n\n this._outputHelpIfRequested(parsed.unknown);\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // We do not always call this check to avoid masking a \"better\" error, like unknown command.\n const checkForUnknownOptions = () => {\n if (parsed.unknown.length > 0) {\n this.unknownOption(parsed.unknown[0]);\n }\n };\n\n const commandEvent = `command:${this.name()}`;\n if (this._actionHandler) {\n checkForUnknownOptions();\n this._processArguments();\n\n let promiseChain;\n promiseChain = this._chainOrCallHooks(promiseChain, 'preAction');\n promiseChain = this._chainOrCall(promiseChain, () =>\n this._actionHandler(this.processedArgs),\n );\n if (this.parent) {\n promiseChain = this._chainOrCall(promiseChain, () => {\n this.parent.emit(commandEvent, operands, unknown); // legacy\n });\n }\n promiseChain = this._chainOrCallHooks(promiseChain, 'postAction');\n return promiseChain;\n }\n if (this.parent && this.parent.listenerCount(commandEvent)) {\n checkForUnknownOptions();\n this._processArguments();\n this.parent.emit(commandEvent, operands, unknown); // legacy\n } else if (operands.length) {\n if (this._findCommand('*')) {\n // legacy default command\n return this._dispatchSubcommand('*', operands, unknown);\n }\n if (this.listenerCount('command:*')) {\n // skip option check, emit event for possible misspelling suggestion\n this.emit('command:*', operands, unknown);\n } else if (this.commands.length) {\n this.unknownCommand();\n } else {\n checkForUnknownOptions();\n this._processArguments();\n }\n } else if (this.commands.length) {\n checkForUnknownOptions();\n // This command has subcommands and nothing hooked up at this level, so display help (and exit).\n this.help({ error: true });\n } else {\n checkForUnknownOptions();\n this._processArguments();\n // fall through for caller to handle after calling .parse()\n }\n }\n\n /**\n * Find matching command.\n *\n * @private\n * @return {Command | undefined}\n */\n _findCommand(name) {\n if (!name) return undefined;\n return this.commands.find(\n (cmd) => cmd._name === name || cmd._aliases.includes(name),\n );\n }\n\n /**\n * Return an option matching `arg` if any.\n *\n * @param {string} arg\n * @return {Option}\n * @package\n */\n\n _findOption(arg) {\n return this.options.find((option) => option.is(arg));\n }\n\n /**\n * Display an error message if a mandatory option does not have a value.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n\n _checkForMissingMandatoryOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd.options.forEach((anOption) => {\n if (\n anOption.mandatory &&\n cmd.getOptionValue(anOption.attributeName()) === undefined\n ) {\n cmd.missingMandatoryOptionValue(anOption);\n }\n });\n });\n }\n\n /**\n * Display an error message if conflicting options are used together in this.\n *\n * @private\n */\n _checkForConflictingLocalOptions() {\n const definedNonDefaultOptions = this.options.filter((option) => {\n const optionKey = option.attributeName();\n if (this.getOptionValue(optionKey) === undefined) {\n return false;\n }\n return this.getOptionValueSource(optionKey) !== 'default';\n });\n\n const optionsWithConflicting = definedNonDefaultOptions.filter(\n (option) => option.conflictsWith.length > 0,\n );\n\n optionsWithConflicting.forEach((option) => {\n const conflictingAndDefined = definedNonDefaultOptions.find((defined) =>\n option.conflictsWith.includes(defined.attributeName()),\n );\n if (conflictingAndDefined) {\n this._conflictingOption(option, conflictingAndDefined);\n }\n });\n }\n\n /**\n * Display an error message if conflicting options are used together.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n _checkForConflictingOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd._checkForConflictingLocalOptions();\n });\n }\n\n /**\n * Parse options from `argv` removing known options,\n * and return argv split into operands and unknown arguments.\n *\n * Side effects: modifies command by storing options. Does not reset state if called again.\n *\n * Examples:\n *\n * argv => operands, unknown\n * --known kkk op => [op], []\n * op --known kkk => [op], []\n * sub --unknown uuu op => [sub], [--unknown uuu op]\n * sub -- --unknown uuu op => [sub --unknown uuu op], []\n *\n * @param {string[]} argv\n * @return {{operands: string[], unknown: string[]}}\n */\n\n parseOptions(argv) {\n const operands = []; // operands, not options or values\n const unknown = []; // first unknown option and remaining unknown args\n let dest = operands;\n const args = argv.slice();\n\n function maybeOption(arg) {\n return arg.length > 1 && arg[0] === '-';\n }\n\n // parse options\n let activeVariadicOption = null;\n while (args.length) {\n const arg = args.shift();\n\n // literal\n if (arg === '--') {\n if (dest === unknown) dest.push(arg);\n dest.push(...args);\n break;\n }\n\n if (activeVariadicOption && !maybeOption(arg)) {\n this.emit(`option:${activeVariadicOption.name()}`, arg);\n continue;\n }\n activeVariadicOption = null;\n\n if (maybeOption(arg)) {\n const option = this._findOption(arg);\n // recognised option, call listener to assign value with possible custom processing\n if (option) {\n if (option.required) {\n const value = args.shift();\n if (value === undefined) this.optionMissingArgument(option);\n this.emit(`option:${option.name()}`, value);\n } else if (option.optional) {\n let value = null;\n // historical behaviour is optional value is following arg unless an option\n if (args.length > 0 && !maybeOption(args[0])) {\n value = args.shift();\n }\n this.emit(`option:${option.name()}`, value);\n } else {\n // boolean flag\n this.emit(`option:${option.name()}`);\n }\n activeVariadicOption = option.variadic ? option : null;\n continue;\n }\n }\n\n // Look for combo options following single dash, eat first one if known.\n if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {\n const option = this._findOption(`-${arg[1]}`);\n if (option) {\n if (\n option.required ||\n (option.optional && this._combineFlagAndOptionalValue)\n ) {\n // option with value following in same argument\n this.emit(`option:${option.name()}`, arg.slice(2));\n } else {\n // boolean option, emit and put back remainder of arg for further processing\n this.emit(`option:${option.name()}`);\n args.unshift(`-${arg.slice(2)}`);\n }\n continue;\n }\n }\n\n // Look for known long flag with value, like --foo=bar\n if (/^--[^=]+=/.test(arg)) {\n const index = arg.indexOf('=');\n const option = this._findOption(arg.slice(0, index));\n if (option && (option.required || option.optional)) {\n this.emit(`option:${option.name()}`, arg.slice(index + 1));\n continue;\n }\n }\n\n // Not a recognised option by this command.\n // Might be a command-argument, or subcommand option, or unknown option, or help command or option.\n\n // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.\n if (maybeOption(arg)) {\n dest = unknown;\n }\n\n // If using positionalOptions, stop processing our options at subcommand.\n if (\n (this._enablePositionalOptions || this._passThroughOptions) &&\n operands.length === 0 &&\n unknown.length === 0\n ) {\n if (this._findCommand(arg)) {\n operands.push(arg);\n if (args.length > 0) unknown.push(...args);\n break;\n } else if (\n this._getHelpCommand() &&\n arg === this._getHelpCommand().name()\n ) {\n operands.push(arg);\n if (args.length > 0) operands.push(...args);\n break;\n } else if (this._defaultCommandName) {\n unknown.push(arg);\n if (args.length > 0) unknown.push(...args);\n break;\n }\n }\n\n // If using passThroughOptions, stop processing options at first command-argument.\n if (this._passThroughOptions) {\n dest.push(arg);\n if (args.length > 0) dest.push(...args);\n break;\n }\n\n // add arg\n dest.push(arg);\n }\n\n return { operands, unknown };\n }\n\n /**\n * Return an object containing local option values as key-value pairs.\n *\n * @return {object}\n */\n opts() {\n if (this._storeOptionsAsProperties) {\n // Preserve original behaviour so backwards compatible when still using properties\n const result = {};\n const len = this.options.length;\n\n for (let i = 0; i < len; i++) {\n const key = this.options[i].attributeName();\n result[key] =\n key === this._versionOptionName ? this._version : this[key];\n }\n return result;\n }\n\n return this._optionValues;\n }\n\n /**\n * Return an object containing merged local and global option values as key-value pairs.\n *\n * @return {object}\n */\n optsWithGlobals() {\n // globals overwrite locals\n return this._getCommandAndAncestors().reduce(\n (combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()),\n {},\n );\n }\n\n /**\n * Display error message and exit (or call exitOverride).\n *\n * @param {string} message\n * @param {object} [errorOptions]\n * @param {string} [errorOptions.code] - an id string representing the error\n * @param {number} [errorOptions.exitCode] - used with process.exit\n */\n error(message, errorOptions) {\n // output handling\n this._outputConfiguration.outputError(\n `${message}\\n`,\n this._outputConfiguration.writeErr,\n );\n if (typeof this._showHelpAfterError === 'string') {\n this._outputConfiguration.writeErr(`${this._showHelpAfterError}\\n`);\n } else if (this._showHelpAfterError) {\n this._outputConfiguration.writeErr('\\n');\n this.outputHelp({ error: true });\n }\n\n // exit handling\n const config = errorOptions || {};\n const exitCode = config.exitCode || 1;\n const code = config.code || 'commander.error';\n this._exit(exitCode, code, message);\n }\n\n /**\n * Apply any option related environment variables, if option does\n * not have a value from cli or client code.\n *\n * @private\n */\n _parseOptionsEnv() {\n this.options.forEach((option) => {\n if (option.envVar && option.envVar in process.env) {\n const optionKey = option.attributeName();\n // Priority check. Do not overwrite cli or options from unknown source (client-code).\n if (\n this.getOptionValue(optionKey) === undefined ||\n ['default', 'config', 'env'].includes(\n this.getOptionValueSource(optionKey),\n )\n ) {\n if (option.required || option.optional) {\n // option can take a value\n // keep very simple, optional always takes value\n this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);\n } else {\n // boolean\n // keep very simple, only care that envVar defined and not the value\n this.emit(`optionEnv:${option.name()}`);\n }\n }\n }\n });\n }\n\n /**\n * Apply any implied option values, if option is undefined or default value.\n *\n * @private\n */\n _parseOptionsImplied() {\n const dualHelper = new DualOptions(this.options);\n const hasCustomOptionValue = (optionKey) => {\n return (\n this.getOptionValue(optionKey) !== undefined &&\n !['default', 'implied'].includes(this.getOptionValueSource(optionKey))\n );\n };\n this.options\n .filter(\n (option) =>\n option.implied !== undefined &&\n hasCustomOptionValue(option.attributeName()) &&\n dualHelper.valueFromOption(\n this.getOptionValue(option.attributeName()),\n option,\n ),\n )\n .forEach((option) => {\n Object.keys(option.implied)\n .filter((impliedKey) => !hasCustomOptionValue(impliedKey))\n .forEach((impliedKey) => {\n this.setOptionValueWithSource(\n impliedKey,\n option.implied[impliedKey],\n 'implied',\n );\n });\n });\n }\n\n /**\n * Argument `name` is missing.\n *\n * @param {string} name\n * @private\n */\n\n missingArgument(name) {\n const message = `error: missing required argument '${name}'`;\n this.error(message, { code: 'commander.missingArgument' });\n }\n\n /**\n * `Option` is missing an argument.\n *\n * @param {Option} option\n * @private\n */\n\n optionMissingArgument(option) {\n const message = `error: option '${option.flags}' argument missing`;\n this.error(message, { code: 'commander.optionMissingArgument' });\n }\n\n /**\n * `Option` does not have a value, and is a mandatory option.\n *\n * @param {Option} option\n * @private\n */\n\n missingMandatoryOptionValue(option) {\n const message = `error: required option '${option.flags}' not specified`;\n this.error(message, { code: 'commander.missingMandatoryOptionValue' });\n }\n\n /**\n * `Option` conflicts with another option.\n *\n * @param {Option} option\n * @param {Option} conflictingOption\n * @private\n */\n _conflictingOption(option, conflictingOption) {\n // The calling code does not know whether a negated option is the source of the\n // value, so do some work to take an educated guess.\n const findBestOptionFromValue = (option) => {\n const optionKey = option.attributeName();\n const optionValue = this.getOptionValue(optionKey);\n const negativeOption = this.options.find(\n (target) => target.negate && optionKey === target.attributeName(),\n );\n const positiveOption = this.options.find(\n (target) => !target.negate && optionKey === target.attributeName(),\n );\n if (\n negativeOption &&\n ((negativeOption.presetArg === undefined && optionValue === false) ||\n (negativeOption.presetArg !== undefined &&\n optionValue === negativeOption.presetArg))\n ) {\n return negativeOption;\n }\n return positiveOption || option;\n };\n\n const getErrorMessage = (option) => {\n const bestOption = findBestOptionFromValue(option);\n const optionKey = bestOption.attributeName();\n const source = this.getOptionValueSource(optionKey);\n if (source === 'env') {\n return `environment variable '${bestOption.envVar}'`;\n }\n return `option '${bestOption.flags}'`;\n };\n\n const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;\n this.error(message, { code: 'commander.conflictingOption' });\n }\n\n /**\n * Unknown option `flag`.\n *\n * @param {string} flag\n * @private\n */\n\n unknownOption(flag) {\n if (this._allowUnknownOption) return;\n let suggestion = '';\n\n if (flag.startsWith('--') && this._showSuggestionAfterError) {\n // Looping to pick up the global options too\n let candidateFlags = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n do {\n const moreFlags = command\n .createHelp()\n .visibleOptions(command)\n .filter((option) => option.long)\n .map((option) => option.long);\n candidateFlags = candidateFlags.concat(moreFlags);\n command = command.parent;\n } while (command && !command._enablePositionalOptions);\n suggestion = suggestSimilar(flag, candidateFlags);\n }\n\n const message = `error: unknown option '${flag}'${suggestion}`;\n this.error(message, { code: 'commander.unknownOption' });\n }\n\n /**\n * Excess arguments, more than expected.\n *\n * @param {string[]} receivedArgs\n * @private\n */\n\n _excessArguments(receivedArgs) {\n if (this._allowExcessArguments) return;\n\n const expected = this.registeredArguments.length;\n const s = expected === 1 ? '' : 's';\n const forSubcommand = this.parent ? ` for '${this.name()}'` : '';\n const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;\n this.error(message, { code: 'commander.excessArguments' });\n }\n\n /**\n * Unknown command.\n *\n * @private\n */\n\n unknownCommand() {\n const unknownName = this.args[0];\n let suggestion = '';\n\n if (this._showSuggestionAfterError) {\n const candidateNames = [];\n this.createHelp()\n .visibleCommands(this)\n .forEach((command) => {\n candidateNames.push(command.name());\n // just visible alias\n if (command.alias()) candidateNames.push(command.alias());\n });\n suggestion = suggestSimilar(unknownName, candidateNames);\n }\n\n const message = `error: unknown command '${unknownName}'${suggestion}`;\n this.error(message, { code: 'commander.unknownCommand' });\n }\n\n /**\n * Get or set the program version.\n *\n * This method auto-registers the \"-V, --version\" option which will print the version number.\n *\n * You can optionally supply the flags and description to override the defaults.\n *\n * @param {string} [str]\n * @param {string} [flags]\n * @param {string} [description]\n * @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments\n */\n\n version(str, flags, description) {\n if (str === undefined) return this._version;\n this._version = str;\n flags = flags || '-V, --version';\n description = description || 'output the version number';\n const versionOption = this.createOption(flags, description);\n this._versionOptionName = versionOption.attributeName();\n this._registerOption(versionOption);\n\n this.on('option:' + versionOption.name(), () => {\n this._outputConfiguration.writeOut(`${str}\\n`);\n this._exit(0, 'commander.version', str);\n });\n return this;\n }\n\n /**\n * Set the description.\n *\n * @param {string} [str]\n * @param {object} [argsDescription]\n * @return {(string|Command)}\n */\n description(str, argsDescription) {\n if (str === undefined && argsDescription === undefined)\n return this._description;\n this._description = str;\n if (argsDescription) {\n this._argsDescription = argsDescription;\n }\n return this;\n }\n\n /**\n * Set the summary. Used when listed as subcommand of parent.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n summary(str) {\n if (str === undefined) return this._summary;\n this._summary = str;\n return this;\n }\n\n /**\n * Set an alias for the command.\n *\n * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.\n *\n * @param {string} [alias]\n * @return {(string|Command)}\n */\n\n alias(alias) {\n if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility\n\n /** @type {Command} */\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n if (\n this.commands.length !== 0 &&\n this.commands[this.commands.length - 1]._executableHandler\n ) {\n // assume adding alias for last added executable subcommand, rather than this\n command = this.commands[this.commands.length - 1];\n }\n\n if (alias === command._name)\n throw new Error(\"Command alias can't be the same as its name\");\n const matchingCommand = this.parent?._findCommand(alias);\n if (matchingCommand) {\n // c.f. _registerCommand\n const existingCmd = [matchingCommand.name()]\n .concat(matchingCommand.aliases())\n .join('|');\n throw new Error(\n `cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`,\n );\n }\n\n command._aliases.push(alias);\n return this;\n }\n\n /**\n * Set aliases for the command.\n *\n * Only the first alias is shown in the auto-generated help.\n *\n * @param {string[]} [aliases]\n * @return {(string[]|Command)}\n */\n\n aliases(aliases) {\n // Getter for the array of aliases is the main reason for having aliases() in addition to alias().\n if (aliases === undefined) return this._aliases;\n\n aliases.forEach((alias) => this.alias(alias));\n return this;\n }\n\n /**\n * Set / get the command usage `str`.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n usage(str) {\n if (str === undefined) {\n if (this._usage) return this._usage;\n\n const args = this.registeredArguments.map((arg) => {\n return humanReadableArgName(arg);\n });\n return []\n .concat(\n this.options.length || this._helpOption !== null ? '[options]' : [],\n this.commands.length ? '[command]' : [],\n this.registeredArguments.length ? args : [],\n )\n .join(' ');\n }\n\n this._usage = str;\n return this;\n }\n\n /**\n * Get or set the name of the command.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n name(str) {\n if (str === undefined) return this._name;\n this._name = str;\n return this;\n }\n\n /**\n * Set the name of the command from script filename, such as process.argv[1],\n * or require.main.filename, or __filename.\n *\n * (Used internally and public although not documented in README.)\n *\n * @example\n * program.nameFromFilename(require.main.filename);\n *\n * @param {string} filename\n * @return {Command}\n */\n\n nameFromFilename(filename) {\n this._name = path.basename(filename, path.extname(filename));\n\n return this;\n }\n\n /**\n * Get or set the directory for searching for executable subcommands of this command.\n *\n * @example\n * program.executableDir(__dirname);\n * // or\n * program.executableDir('subcommands');\n *\n * @param {string} [path]\n * @return {(string|null|Command)}\n */\n\n executableDir(path) {\n if (path === undefined) return this._executableDir;\n this._executableDir = path;\n return this;\n }\n\n /**\n * Return program help documentation.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout\n * @return {string}\n */\n\n helpInformation(contextOptions) {\n const helper = this.createHelp();\n const context = this._getOutputContext(contextOptions);\n helper.prepareContext({\n error: context.error,\n helpWidth: context.helpWidth,\n outputHasColors: context.hasColors,\n });\n const text = helper.formatHelp(this, helper);\n if (context.hasColors) return text;\n return this._outputConfiguration.stripColor(text);\n }\n\n /**\n * @typedef HelpContext\n * @type {object}\n * @property {boolean} error\n * @property {number} helpWidth\n * @property {boolean} hasColors\n * @property {function} write - includes stripColor if needed\n *\n * @returns {HelpContext}\n * @private\n */\n\n _getOutputContext(contextOptions) {\n contextOptions = contextOptions || {};\n const error = !!contextOptions.error;\n let baseWrite;\n let hasColors;\n let helpWidth;\n if (error) {\n baseWrite = (str) => this._outputConfiguration.writeErr(str);\n hasColors = this._outputConfiguration.getErrHasColors();\n helpWidth = this._outputConfiguration.getErrHelpWidth();\n } else {\n baseWrite = (str) => this._outputConfiguration.writeOut(str);\n hasColors = this._outputConfiguration.getOutHasColors();\n helpWidth = this._outputConfiguration.getOutHelpWidth();\n }\n const write = (str) => {\n if (!hasColors) str = this._outputConfiguration.stripColor(str);\n return baseWrite(str);\n };\n return { error, write, hasColors, helpWidth };\n }\n\n /**\n * Output help information for this command.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n outputHelp(contextOptions) {\n let deprecatedCallback;\n if (typeof contextOptions === 'function') {\n deprecatedCallback = contextOptions;\n contextOptions = undefined;\n }\n\n const outputContext = this._getOutputContext(contextOptions);\n /** @type {HelpTextEventContext} */\n const eventContext = {\n error: outputContext.error,\n write: outputContext.write,\n command: this,\n };\n\n this._getCommandAndAncestors()\n .reverse()\n .forEach((command) => command.emit('beforeAllHelp', eventContext));\n this.emit('beforeHelp', eventContext);\n\n let helpInformation = this.helpInformation({ error: outputContext.error });\n if (deprecatedCallback) {\n helpInformation = deprecatedCallback(helpInformation);\n if (\n typeof helpInformation !== 'string' &&\n !Buffer.isBuffer(helpInformation)\n ) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n }\n outputContext.write(helpInformation);\n\n if (this._getHelpOption()?.long) {\n this.emit(this._getHelpOption().long); // deprecated\n }\n this.emit('afterHelp', eventContext);\n this._getCommandAndAncestors().forEach((command) =>\n command.emit('afterAllHelp', eventContext),\n );\n }\n\n /**\n * You can pass in flags and a description to customise the built-in help option.\n * Pass in false to disable the built-in help option.\n *\n * @example\n * program.helpOption('-?, --help' 'show help'); // customise\n * program.helpOption(false); // disable\n *\n * @param {(string | boolean)} flags\n * @param {string} [description]\n * @return {Command} `this` command for chaining\n */\n\n helpOption(flags, description) {\n // Support disabling built-in help option.\n if (typeof flags === 'boolean') {\n // true is not an expected value. Do something sensible but no unit-test.\n // istanbul ignore if\n if (flags) {\n this._helpOption = this._helpOption ?? undefined; // preserve existing option\n } else {\n this._helpOption = null; // disable\n }\n return this;\n }\n\n // Customise flags and description.\n flags = flags ?? '-h, --help';\n description = description ?? 'display help for command';\n this._helpOption = this.createOption(flags, description);\n\n return this;\n }\n\n /**\n * Lazy create help option.\n * Returns null if has been disabled with .helpOption(false).\n *\n * @returns {(Option | null)} the help option\n * @package\n */\n _getHelpOption() {\n // Lazy create help option on demand.\n if (this._helpOption === undefined) {\n this.helpOption(undefined, undefined);\n }\n return this._helpOption;\n }\n\n /**\n * Supply your own option to use for the built-in help option.\n * This is an alternative to using helpOption() to customise the flags and description etc.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addHelpOption(option) {\n this._helpOption = option;\n return this;\n }\n\n /**\n * Output help information and exit.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n help(contextOptions) {\n this.outputHelp(contextOptions);\n let exitCode = Number(process.exitCode ?? 0); // process.exitCode does allow a string or an integer, but we prefer just a number\n if (\n exitCode === 0 &&\n contextOptions &&\n typeof contextOptions !== 'function' &&\n contextOptions.error\n ) {\n exitCode = 1;\n }\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(exitCode, 'commander.help', '(outputHelp)');\n }\n\n /**\n * // Do a little typing to coordinate emit and listener for the help text events.\n * @typedef HelpTextEventContext\n * @type {object}\n * @property {boolean} error\n * @property {Command} command\n * @property {function} write\n */\n\n /**\n * Add additional text to be displayed with the built-in help.\n *\n * Position is 'before' or 'after' to affect just this command,\n * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.\n *\n * @param {string} position - before or after built-in help\n * @param {(string | Function)} text - string to add, or a function returning a string\n * @return {Command} `this` command for chaining\n */\n\n addHelpText(position, text) {\n const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];\n if (!allowedValues.includes(position)) {\n throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n\n const helpEvent = `${position}Help`;\n this.on(helpEvent, (/** @type {HelpTextEventContext} */ context) => {\n let helpStr;\n if (typeof text === 'function') {\n helpStr = text({ error: context.error, command: context.command });\n } else {\n helpStr = text;\n }\n // Ignore falsy value when nothing to output.\n if (helpStr) {\n context.write(`${helpStr}\\n`);\n }\n });\n return this;\n }\n\n /**\n * Output help information if help flags specified\n *\n * @param {Array} args - array of options to search for help flags\n * @private\n */\n\n _outputHelpIfRequested(args) {\n const helpOption = this._getHelpOption();\n const helpRequested = helpOption && args.find((arg) => helpOption.is(arg));\n if (helpRequested) {\n this.outputHelp();\n // (Do not have all displayed text available so only passing placeholder.)\n this._exit(0, 'commander.helpDisplayed', '(outputHelp)');\n }\n }\n}\n\n/**\n * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).\n *\n * @param {string[]} args - array of arguments from node.execArgv\n * @returns {string[]}\n * @private\n */\n\nfunction incrementNodeInspectorPort(args) {\n // Testing for these options:\n // --inspect[=[host:]port]\n // --inspect-brk[=[host:]port]\n // --inspect-port=[host:]port\n return args.map((arg) => {\n if (!arg.startsWith('--inspect')) {\n return arg;\n }\n let debugOption;\n let debugHost = '127.0.0.1';\n let debugPort = '9229';\n let match;\n if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {\n // e.g. --inspect\n debugOption = match[1];\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null\n ) {\n debugOption = match[1];\n if (/^\\d+$/.test(match[3])) {\n // e.g. --inspect=1234\n debugPort = match[3];\n } else {\n // e.g. --inspect=localhost\n debugHost = match[3];\n }\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\\d+)$/)) !== null\n ) {\n // e.g. --inspect=localhost:1234\n debugOption = match[1];\n debugHost = match[3];\n debugPort = match[4];\n }\n\n if (debugOption && debugPort !== '0') {\n return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;\n }\n return arg;\n });\n}\n\n/**\n * @returns {boolean | undefined}\n * @package\n */\nfunction useColor() {\n // Test for common conventions.\n // NB: the observed behaviour is in combination with how author adds color! For example:\n // - we do not test NODE_DISABLE_COLORS, but util:styletext does\n // - we do test NO_COLOR, but Chalk does not\n //\n // References:\n // https://no-color.org\n // https://bixense.com/clicolors/\n // https://github.com/nodejs/node/blob/0a00217a5f67ef4a22384cfc80eb6dd9a917fdc1/lib/internal/tty.js#L109\n // https://github.com/chalk/supports-color/blob/c214314a14bcb174b12b3014b2b0a8de375029ae/index.js#L33\n // (https://force-color.org recent web page from 2023, does not match major javascript implementations)\n\n if (\n process.env.NO_COLOR ||\n process.env.FORCE_COLOR === '0' ||\n process.env.FORCE_COLOR === 'false'\n )\n return false;\n if (process.env.FORCE_COLOR || process.env.CLICOLOR_FORCE !== undefined)\n return true;\n return undefined;\n}\n\nexports.Command = Command;\nexports.useColor = useColor; // exporting for tests\n",
11
+ "const { Argument } = require('./lib/argument.js');\nconst { Command } = require('./lib/command.js');\nconst { CommanderError, InvalidArgumentError } = require('./lib/error.js');\nconst { Help } = require('./lib/help.js');\nconst { Option } = require('./lib/option.js');\n\nexports.program = new Command();\n\nexports.createCommand = (name) => new Command(name);\nexports.createOption = (flags, description) => new Option(flags, description);\nexports.createArgument = (name, description) => new Argument(name, description);\n\n/**\n * Expose classes\n */\n\nexports.Command = Command;\nexports.Option = Option;\nexports.Argument = Argument;\nexports.Help = Help;\n\nexports.CommanderError = CommanderError;\nexports.InvalidArgumentError = InvalidArgumentError;\nexports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated\n",
12
+ "'use strict';\n\nconst spinners = Object.assign({}, require('./spinners.json')); // eslint-disable-line import/extensions\n\nconst spinnersList = Object.keys(spinners);\n\nObject.defineProperty(spinners, 'random', {\n\tget() {\n\t\tconst randomIndex = Math.floor(Math.random() * spinnersList.length);\n\t\tconst spinnerName = spinnersList[randomIndex];\n\t\treturn spinners[spinnerName];\n\t}\n});\n\nmodule.exports = spinners;\n",
13
+ "module.exports = () => {\n\t// https://mths.be/emoji\n\treturn /[#*0-9]\\uFE0F?\\u20E3|[\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23ED-\\u23EF\\u23F1\\u23F2\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A7\\u26AA\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C8\\u26CF\\u26D1\\u26E9\\u26F0-\\u26F5\\u26F7\\u26F8\\u26FA\\u2702\\u2708\\u2709\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2733\\u2734\\u2744\\u2747\\u2757\\u2763\\u27A1\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B55\\u3030\\u303D\\u3297\\u3299]\\uFE0F?|[\\u261D\\u270C\\u270D](?:\\uD83C[\\uDFFB-\\uDFFF]|\\uFE0F)?|[\\u270A\\u270B](?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u2693\\u26A1\\u26AB\\u26C5\\u26CE\\u26D4\\u26EA\\u26FD\\u2705\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2795-\\u2797\\u27B0\\u27BF\\u2B50]|\\u26D3\\uFE0F?(?:\\u200D\\uD83D\\uDCA5)?|\\u26F9(?:\\uD83C[\\uDFFB-\\uDFFF]|\\uFE0F)?(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|\\u2764\\uFE0F?(?:\\u200D(?:\\uD83D\\uDD25|\\uD83E\\uDE79))?|\\uD83C(?:[\\uDC04\\uDD70\\uDD71\\uDD7E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A8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDC68\\uDC69]\\u200D\\uD83D(?:\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?)|[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?)|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]))|\\uD83C(?:\\uDFFB(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFC-\\uDFFF])|\\uD83E(?:[\\uDD1D\\uDEEF]\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFC-\\uDFFF]|[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3])))?|\\uDFFC(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83E(?:[\\uDD1D\\uDEEF]\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFD-\\uDFFF]|[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3])))?|\\uDFFD(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83E(?:[\\uDD1D\\uDEEF]\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF]|[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3])))?|\\uDFFE(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83E(?:[\\uDD1D\\uDEEF]\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFD\\uDFFF]|[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3])))?|\\uDFFF(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?\\uDC68\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFE])|\\uD83E(?:[\\uDD1D\\uDEEF]\\u200D\\uD83D\\uDC68\\uD83C[\\uDFFB-\\uDFFE]|[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3])))?))?|\\uDC69(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:\\uDC8B\\u200D\\uD83D)?[\\uDC68\\uDC69]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?|\\uDC69\\u200D\\uD83D(?:\\uDC66(?:\\u200D\\uD83D\\uDC66)?|\\uDC67(?:\\u200D\\uD83D[\\uDC66\\uDC67])?))|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]))|\\uD83C(?:\\uDFFB(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFC-\\uDFFF])|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFC-\\uDFFF]|\\uDEEF\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFC-\\uDFFF])))?|\\uDFFC(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB\\uDFFD-\\uDFFF]|\\uDEEF\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])))?|\\uDFFD(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF]|\\uDEEF\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])))?|\\uDFFE(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFD\\uDFFF]|\\uDEEF\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])))?|\\uDFFF(?:\\u200D(?:[\\u2695\\u2696\\u2708]\\uFE0F?|\\u2764\\uFE0F?\\u200D\\uD83D(?:[\\uDC68\\uDC69]|\\uDC8B\\u200D\\uD83D[\\uDC68\\uDC69])\\uD83C[\\uDFFB-\\uDFFF]|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D(?:[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uDC30\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB-\\uDFFE])|\\uD83E(?:[\\uDDAF\\uDDBC\\uDDBD](?:\\u200D\\u27A1\\uFE0F?)?|[\\uDDB0-\\uDDB3]|\\uDD1D\\u200D\\uD83D[\\uDC68\\uDC69]\\uD83C[\\uDFFB-\\uDFFE]|\\uDEEF\\u200D\\uD83D\\uDC69\\uD83C[\\uDFFB-\\uDFFE])))?))?|\\uDD75(?:\\uD83C[\\uDFFB-\\uDFFF]|\\uFE0F)?(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|\\uDE2E(?:\\u200D\\uD83D\\uDCA8)?|\\uDE35(?:\\u200D\\uD83D\\uDCAB)?|\\uDE36(?:\\u200D\\uD83C\\uDF2B\\uFE0F?)?|\\uDE42(?:\\u200D[\\u2194\\u2195]\\uFE0F?)?|\\uDEB6(?:\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D(?:[\\u2640\\u2642]\\uFE0F?(?:\\u200D\\u27A1\\uFE0F?)?|\\u27A1\\uFE0F?))?)|\\uD83E(?:[\\uDD0C\\uDD0F\\uDD18-\\uDD1F\\uDD30-\\uDD34\\uDD36\\uDD77\\uDDB5\\uDDB6\\uDDBB\\uDDD2\\uDDD3\\uDDD5\\uDEC3-\\uDEC5\\uDEF0\\uDEF2-\\uDEF8](?:\\uD83C[\\uDFFB-\\uDFFF])?|[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3C-\\uDD3E\\uDDB8\\uDDB9\\uDDCD\\uDDCF\\uDDD4\\uDDD6-\\uDDDD](?:\\uD83C[\\uDFFB-\\uDFFF])?(?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|[\\uDDDE\\uDDDF](?:\\u200D[\\u2640\\u2642]\\uFE0F?)?|[\\uDD0D\\uDD0E\\uDD10-\\uDD17\\uDD20-\\uDD25\\uDD27-\\uDD2F\\uDD3A\\uDD3F-\\uDD45\\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\\uD83C(?:\\uDFFB(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFC-\\uDFFF])?|\\uDFFC(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])?|\\uDFFD(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])?|\\uDFFE(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])?|\\uDFFF(?:\\u200D\\uD83E\\uDEF2\\uD83C[\\uDFFB-\\uDFFE])?))?)/g;\n};\n",
14
+ "let p = process || {}, argv = p.argv || [], env = p.env || {}\nlet isColorSupported =\n\t!(!!env.NO_COLOR || argv.includes(\"--no-color\")) &&\n\t(!!env.FORCE_COLOR || argv.includes(\"--color\") || p.platform === \"win32\" || ((p.stdout || {}).isTTY && env.TERM !== \"dumb\") || !!env.CI)\n\nlet formatter = (open, close, replace = open) =>\n\tinput => {\n\t\tlet string = \"\" + input, index = string.indexOf(close, open.length)\n\t\treturn ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close\n\t}\n\nlet replaceClose = (string, close, replace, index) => {\n\tlet result = \"\", cursor = 0\n\tdo {\n\t\tresult += string.substring(cursor, index) + replace\n\t\tcursor = index + close.length\n\t\tindex = string.indexOf(close, cursor)\n\t} while (~index)\n\treturn result + string.substring(cursor)\n}\n\nlet createColors = (enabled = isColorSupported) => {\n\tlet f = enabled ? formatter : () => String\n\treturn {\n\t\tisColorSupported: enabled,\n\t\treset: f(\"\\x1b[0m\", \"\\x1b[0m\"),\n\t\tbold: f(\"\\x1b[1m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[1m\"),\n\t\tdim: f(\"\\x1b[2m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[2m\"),\n\t\titalic: f(\"\\x1b[3m\", \"\\x1b[23m\"),\n\t\tunderline: f(\"\\x1b[4m\", \"\\x1b[24m\"),\n\t\tinverse: f(\"\\x1b[7m\", \"\\x1b[27m\"),\n\t\thidden: f(\"\\x1b[8m\", \"\\x1b[28m\"),\n\t\tstrikethrough: f(\"\\x1b[9m\", \"\\x1b[29m\"),\n\n\t\tblack: f(\"\\x1b[30m\", \"\\x1b[39m\"),\n\t\tred: f(\"\\x1b[31m\", \"\\x1b[39m\"),\n\t\tgreen: f(\"\\x1b[32m\", \"\\x1b[39m\"),\n\t\tyellow: f(\"\\x1b[33m\", \"\\x1b[39m\"),\n\t\tblue: f(\"\\x1b[34m\", \"\\x1b[39m\"),\n\t\tmagenta: f(\"\\x1b[35m\", \"\\x1b[39m\"),\n\t\tcyan: f(\"\\x1b[36m\", \"\\x1b[39m\"),\n\t\twhite: f(\"\\x1b[37m\", \"\\x1b[39m\"),\n\t\tgray: f(\"\\x1b[90m\", \"\\x1b[39m\"),\n\n\t\tbgBlack: f(\"\\x1b[40m\", \"\\x1b[49m\"),\n\t\tbgRed: f(\"\\x1b[41m\", \"\\x1b[49m\"),\n\t\tbgGreen: f(\"\\x1b[42m\", \"\\x1b[49m\"),\n\t\tbgYellow: f(\"\\x1b[43m\", \"\\x1b[49m\"),\n\t\tbgBlue: f(\"\\x1b[44m\", \"\\x1b[49m\"),\n\t\tbgMagenta: f(\"\\x1b[45m\", \"\\x1b[49m\"),\n\t\tbgCyan: f(\"\\x1b[46m\", \"\\x1b[49m\"),\n\t\tbgWhite: f(\"\\x1b[47m\", \"\\x1b[49m\"),\n\n\t\tblackBright: f(\"\\x1b[90m\", \"\\x1b[39m\"),\n\t\tredBright: f(\"\\x1b[91m\", \"\\x1b[39m\"),\n\t\tgreenBright: f(\"\\x1b[92m\", \"\\x1b[39m\"),\n\t\tyellowBright: f(\"\\x1b[93m\", \"\\x1b[39m\"),\n\t\tblueBright: f(\"\\x1b[94m\", \"\\x1b[39m\"),\n\t\tmagentaBright: f(\"\\x1b[95m\", \"\\x1b[39m\"),\n\t\tcyanBright: f(\"\\x1b[96m\", \"\\x1b[39m\"),\n\t\twhiteBright: f(\"\\x1b[97m\", \"\\x1b[39m\"),\n\n\t\tbgBlackBright: f(\"\\x1b[100m\", \"\\x1b[49m\"),\n\t\tbgRedBright: f(\"\\x1b[101m\", \"\\x1b[49m\"),\n\t\tbgGreenBright: f(\"\\x1b[102m\", \"\\x1b[49m\"),\n\t\tbgYellowBright: f(\"\\x1b[103m\", \"\\x1b[49m\"),\n\t\tbgBlueBright: f(\"\\x1b[104m\", \"\\x1b[49m\"),\n\t\tbgMagentaBright: f(\"\\x1b[105m\", \"\\x1b[49m\"),\n\t\tbgCyanBright: f(\"\\x1b[106m\", \"\\x1b[49m\"),\n\t\tbgWhiteBright: f(\"\\x1b[107m\", \"\\x1b[49m\"),\n\t}\n}\n\nmodule.exports = createColors()\nmodule.exports.createColors = createColors\n",
15
+ "import commander from './index.js';\n\n// wrapper to provide named exports for ESM.\nexport const {\n program,\n createCommand,\n createArgument,\n createOption,\n CommanderError,\n InvalidArgumentError,\n InvalidOptionArgumentError, // deprecated old name\n Command,\n Argument,\n Option,\n Help,\n} = commander;\n",
16
+ "import { randomUUID } from \"node:crypto\";\nimport open from \"open\";\nimport ora from \"ora\";\nimport pc from \"picocolors\";\nimport { SHIPI_BASE_URL } from \"../utils/config.ts\";\nimport { saveSession, loadSession } from \"../utils/session.ts\";\n\ninterface VerifyResponse {\n success: boolean;\n user?: {\n id: string;\n email: string;\n name: string | null;\n apiKey: string;\n };\n}\n\nexport async function loginCommand(): Promise<void> {\n console.log(pc.bold(\"\\n🚀 Login to Shipi\\n\"));\n\n // Check if already logged in\n const existingSession = loadSession();\n if (existingSession) {\n console.log(\n pc.yellow(`Already logged in as ${pc.bold(existingSession.email)}`)\n );\n console.log(pc.dim(\"Run 'shipi logout' first to log in as a different user.\\n\"));\n return;\n }\n\n const loginId = randomUUID();\n const loginUrl = `${SHIPI_BASE_URL}/auth/cli/${loginId}`;\n\n console.log(pc.dim(\"Opening browser for authentication...\\n\"));\n\n // Open browser\n try {\n await open(loginUrl);\n console.log(pc.green(\"✓ Browser opened\"));\n } catch {\n console.log(pc.yellow(\"Could not open browser automatically.\"));\n console.log(pc.dim(\"Please open this URL manually:\"));\n console.log(pc.cyan(loginUrl));\n }\n\n console.log();\n\n const spinner = ora(\"Waiting for authentication...\").start();\n\n // Poll for authentication\n const maxAttempts = 40; // 2 minutes (40 * 3 seconds)\n const pollInterval = 3000;\n\n for (let attempt = 0; attempt < maxAttempts; attempt++) {\n try {\n const response = await fetch(\n `${SHIPI_BASE_URL}/auth/cli/${loginId}/verify`\n );\n\n if (response.ok) {\n const data = (await response.json()) as VerifyResponse;\n\n if (data.success && data.user) {\n spinner.succeed(pc.green(\"Authentication successful!\"));\n\n saveSession({\n id: data.user.id,\n email: data.user.email,\n name: data.user.name,\n apiKey: data.user.apiKey,\n });\n\n console.log();\n console.log(pc.bold(`Welcome, ${data.user.name || data.user.email}!`));\n console.log(pc.dim(`\\nCredentials saved to ~/.shipi`));\n console.log();\n return;\n }\n }\n } catch {\n // Network error, continue polling\n }\n\n await new Promise((resolve) => setTimeout(resolve, pollInterval));\n }\n\n spinner.fail(pc.red(\"Authentication timed out\"));\n console.log(pc.dim(\"\\nPlease try again with 'shipi login'\\n\"));\n process.exit(1);\n}\n",
17
+ "import process from 'node:process';\nimport {Buffer} from 'node:buffer';\nimport path from 'node:path';\nimport {fileURLToPath} from 'node:url';\nimport {promisify} from 'node:util';\nimport childProcess from 'node:child_process';\nimport fs, {constants as fsConstants} from 'node:fs/promises';\nimport {isWsl, powerShellPath} from 'wsl-utils';\nimport defineLazyProperty from 'define-lazy-prop';\nimport defaultBrowser from 'default-browser';\nimport isInsideContainer from 'is-inside-container';\n\nconst execFile = promisify(childProcess.execFile);\n\n// Path to included `xdg-open`.\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\nconst localXdgOpenPath = path.join(__dirname, 'xdg-open');\n\nconst {platform, arch} = process;\n\n/**\nGet the default browser name in Windows from WSL.\n\n@returns {Promise<string>} Browser name.\n*/\nasync function getWindowsDefaultBrowserFromWsl() {\n\tconst powershellPath = await powerShellPath();\n\tconst rawCommand = String.raw`(Get-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice\").ProgId`;\n\tconst encodedCommand = Buffer.from(rawCommand, 'utf16le').toString('base64');\n\n\tconst {stdout} = await execFile(\n\t\tpowershellPath,\n\t\t[\n\t\t\t'-NoProfile',\n\t\t\t'-NonInteractive',\n\t\t\t'-ExecutionPolicy',\n\t\t\t'Bypass',\n\t\t\t'-EncodedCommand',\n\t\t\tencodedCommand,\n\t\t],\n\t\t{encoding: 'utf8'},\n\t);\n\n\tconst progId = stdout.trim();\n\n\t// Map ProgId to browser IDs\n\tconst browserMap = {\n\t\tChromeHTML: 'com.google.chrome',\n\t\tBraveHTML: 'com.brave.Browser',\n\t\tMSEdgeHTM: 'com.microsoft.edge',\n\t\tFirefoxURL: 'org.mozilla.firefox',\n\t};\n\n\treturn browserMap[progId] ? {id: browserMap[progId]} : {};\n}\n\nconst pTryEach = async (array, mapper) => {\n\tlet latestError;\n\n\tfor (const item of array) {\n\t\ttry {\n\t\t\treturn await mapper(item); // eslint-disable-line no-await-in-loop\n\t\t} catch (error) {\n\t\t\tlatestError = error;\n\t\t}\n\t}\n\n\tthrow latestError;\n};\n\n// eslint-disable-next-line complexity\nconst baseOpen = async options => {\n\toptions = {\n\t\twait: false,\n\t\tbackground: false,\n\t\tnewInstance: false,\n\t\tallowNonzeroExitCode: false,\n\t\t...options,\n\t};\n\n\tif (Array.isArray(options.app)) {\n\t\treturn pTryEach(options.app, singleApp => baseOpen({\n\t\t\t...options,\n\t\t\tapp: singleApp,\n\t\t}));\n\t}\n\n\tlet {name: app, arguments: appArguments = []} = options.app ?? {};\n\tappArguments = [...appArguments];\n\n\tif (Array.isArray(app)) {\n\t\treturn pTryEach(app, appName => baseOpen({\n\t\t\t...options,\n\t\t\tapp: {\n\t\t\t\tname: appName,\n\t\t\t\targuments: appArguments,\n\t\t\t},\n\t\t}));\n\t}\n\n\tif (app === 'browser' || app === 'browserPrivate') {\n\t\t// IDs from default-browser for macOS and windows are the same\n\t\tconst ids = {\n\t\t\t'com.google.chrome': 'chrome',\n\t\t\t'google-chrome.desktop': 'chrome',\n\t\t\t'com.brave.Browser': 'brave',\n\t\t\t'org.mozilla.firefox': 'firefox',\n\t\t\t'firefox.desktop': 'firefox',\n\t\t\t'com.microsoft.msedge': 'edge',\n\t\t\t'com.microsoft.edge': 'edge',\n\t\t\t'com.microsoft.edgemac': 'edge',\n\t\t\t'microsoft-edge.desktop': 'edge',\n\t\t};\n\n\t\t// Incognito flags for each browser in `apps`.\n\t\tconst flags = {\n\t\t\tchrome: '--incognito',\n\t\t\tbrave: '--incognito',\n\t\t\tfirefox: '--private-window',\n\t\t\tedge: '--inPrivate',\n\t\t};\n\n\t\tconst browser = isWsl ? await getWindowsDefaultBrowserFromWsl() : await defaultBrowser();\n\t\tif (browser.id in ids) {\n\t\t\tconst browserName = ids[browser.id];\n\n\t\t\tif (app === 'browserPrivate') {\n\t\t\t\tappArguments.push(flags[browserName]);\n\t\t\t}\n\n\t\t\treturn baseOpen({\n\t\t\t\t...options,\n\t\t\t\tapp: {\n\t\t\t\t\tname: apps[browserName],\n\t\t\t\t\targuments: appArguments,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\tthrow new Error(`${browser.name} is not supported as a default browser`);\n\t}\n\n\tlet command;\n\tconst cliArguments = [];\n\tconst childProcessOptions = {};\n\n\tif (platform === 'darwin') {\n\t\tcommand = 'open';\n\n\t\tif (options.wait) {\n\t\t\tcliArguments.push('--wait-apps');\n\t\t}\n\n\t\tif (options.background) {\n\t\t\tcliArguments.push('--background');\n\t\t}\n\n\t\tif (options.newInstance) {\n\t\t\tcliArguments.push('--new');\n\t\t}\n\n\t\tif (app) {\n\t\t\tcliArguments.push('-a', app);\n\t\t}\n\t} else if (platform === 'win32' || (isWsl && !isInsideContainer() && !app)) {\n\t\tcommand = await powerShellPath();\n\n\t\tcliArguments.push(\n\t\t\t'-NoProfile',\n\t\t\t'-NonInteractive',\n\t\t\t'-ExecutionPolicy',\n\t\t\t'Bypass',\n\t\t\t'-EncodedCommand',\n\t\t);\n\n\t\tif (!isWsl) {\n\t\t\tchildProcessOptions.windowsVerbatimArguments = true;\n\t\t}\n\n\t\tconst encodedArguments = ['Start'];\n\n\t\tif (options.wait) {\n\t\t\tencodedArguments.push('-Wait');\n\t\t}\n\n\t\tif (app) {\n\t\t\t// Double quote with double quotes to ensure the inner quotes are passed through.\n\t\t\t// Inner quotes are delimited for PowerShell interpretation with backticks.\n\t\t\tencodedArguments.push(`\"\\`\"${app}\\`\"\"`);\n\t\t\tif (options.target) {\n\t\t\t\tappArguments.push(options.target);\n\t\t\t}\n\t\t} else if (options.target) {\n\t\t\tencodedArguments.push(`\"${options.target}\"`);\n\t\t}\n\n\t\tif (appArguments.length > 0) {\n\t\t\tappArguments = appArguments.map(argument => `\"\\`\"${argument}\\`\"\"`);\n\t\t\tencodedArguments.push('-ArgumentList', appArguments.join(','));\n\t\t}\n\n\t\t// Using Base64-encoded command, accepted by PowerShell, to allow special characters.\n\t\toptions.target = Buffer.from(encodedArguments.join(' '), 'utf16le').toString('base64');\n\t} else {\n\t\tif (app) {\n\t\t\tcommand = app;\n\t\t} else {\n\t\t\t// When bundled by Webpack, there's no actual package file path and no local `xdg-open`.\n\t\t\tconst isBundled = !__dirname || __dirname === '/';\n\n\t\t\t// Check if local `xdg-open` exists and is executable.\n\t\t\tlet exeLocalXdgOpen = false;\n\t\t\ttry {\n\t\t\t\tawait fs.access(localXdgOpenPath, fsConstants.X_OK);\n\t\t\t\texeLocalXdgOpen = true;\n\t\t\t} catch {}\n\n\t\t\tconst useSystemXdgOpen = process.versions.electron\n\t\t\t\t?? (platform === 'android' || isBundled || !exeLocalXdgOpen);\n\t\t\tcommand = useSystemXdgOpen ? 'xdg-open' : localXdgOpenPath;\n\t\t}\n\n\t\tif (appArguments.length > 0) {\n\t\t\tcliArguments.push(...appArguments);\n\t\t}\n\n\t\tif (!options.wait) {\n\t\t\t// `xdg-open` will block the process unless stdio is ignored\n\t\t\t// and it's detached from the parent even if it's unref'd.\n\t\t\tchildProcessOptions.stdio = 'ignore';\n\t\t\tchildProcessOptions.detached = true;\n\t\t}\n\t}\n\n\tif (platform === 'darwin' && appArguments.length > 0) {\n\t\tcliArguments.push('--args', ...appArguments);\n\t}\n\n\t// This has to come after `--args`.\n\tif (options.target) {\n\t\tcliArguments.push(options.target);\n\t}\n\n\tconst subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);\n\n\tif (options.wait) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tsubprocess.once('error', reject);\n\n\t\t\tsubprocess.once('close', exitCode => {\n\t\t\t\tif (!options.allowNonzeroExitCode && exitCode > 0) {\n\t\t\t\t\treject(new Error(`Exited with code ${exitCode}`));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tresolve(subprocess);\n\t\t\t});\n\t\t});\n\t}\n\n\tsubprocess.unref();\n\n\treturn subprocess;\n};\n\nconst open = (target, options) => {\n\tif (typeof target !== 'string') {\n\t\tthrow new TypeError('Expected a `target`');\n\t}\n\n\treturn baseOpen({\n\t\t...options,\n\t\ttarget,\n\t});\n};\n\nexport const openApp = (name, options) => {\n\tif (typeof name !== 'string' && !Array.isArray(name)) {\n\t\tthrow new TypeError('Expected a valid `name`');\n\t}\n\n\tconst {arguments: appArguments = []} = options ?? {};\n\tif (appArguments !== undefined && appArguments !== null && !Array.isArray(appArguments)) {\n\t\tthrow new TypeError('Expected `appArguments` as Array type');\n\t}\n\n\treturn baseOpen({\n\t\t...options,\n\t\tapp: {\n\t\t\tname,\n\t\t\targuments: appArguments,\n\t\t},\n\t});\n};\n\nfunction detectArchBinary(binary) {\n\tif (typeof binary === 'string' || Array.isArray(binary)) {\n\t\treturn binary;\n\t}\n\n\tconst {[arch]: archBinary} = binary;\n\n\tif (!archBinary) {\n\t\tthrow new Error(`${arch} is not supported`);\n\t}\n\n\treturn archBinary;\n}\n\nfunction detectPlatformBinary({[platform]: platformBinary}, {wsl}) {\n\tif (wsl && isWsl) {\n\t\treturn detectArchBinary(wsl);\n\t}\n\n\tif (!platformBinary) {\n\t\tthrow new Error(`${platform} is not supported`);\n\t}\n\n\treturn detectArchBinary(platformBinary);\n}\n\nexport const apps = {};\n\ndefineLazyProperty(apps, 'chrome', () => detectPlatformBinary({\n\tdarwin: 'google chrome',\n\twin32: 'chrome',\n\tlinux: ['google-chrome', 'google-chrome-stable', 'chromium'],\n}, {\n\twsl: {\n\t\tia32: '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe',\n\t\tx64: ['/mnt/c/Program Files/Google/Chrome/Application/chrome.exe', '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'],\n\t},\n}));\n\ndefineLazyProperty(apps, 'brave', () => detectPlatformBinary({\n\tdarwin: 'brave browser',\n\twin32: 'brave',\n\tlinux: ['brave-browser', 'brave'],\n}, {\n\twsl: {\n\t\tia32: '/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe',\n\t\tx64: ['/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe', '/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe'],\n\t},\n}));\n\ndefineLazyProperty(apps, 'firefox', () => detectPlatformBinary({\n\tdarwin: 'firefox',\n\twin32: String.raw`C:\\Program Files\\Mozilla Firefox\\firefox.exe`,\n\tlinux: 'firefox',\n}, {\n\twsl: '/mnt/c/Program Files/Mozilla Firefox/firefox.exe',\n}));\n\ndefineLazyProperty(apps, 'edge', () => detectPlatformBinary({\n\tdarwin: 'microsoft edge',\n\twin32: 'msedge',\n\tlinux: ['microsoft-edge', 'microsoft-edge-dev'],\n}, {\n\twsl: '/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe',\n}));\n\ndefineLazyProperty(apps, 'browser', () => 'browser');\n\ndefineLazyProperty(apps, 'browserPrivate', () => 'browserPrivate');\n\nexport default open;\n",
18
+ "import process from 'node:process';\nimport fs, {constants as fsConstants} from 'node:fs/promises';\nimport isWsl from 'is-wsl';\n\nexport const wslDrivesMountPoint = (() => {\n\t// Default value for \"root\" param\n\t// according to https://docs.microsoft.com/en-us/windows/wsl/wsl-config\n\tconst defaultMountPoint = '/mnt/';\n\n\tlet mountPoint;\n\n\treturn async function () {\n\t\tif (mountPoint) {\n\t\t\t// Return memoized mount point value\n\t\t\treturn mountPoint;\n\t\t}\n\n\t\tconst configFilePath = '/etc/wsl.conf';\n\n\t\tlet isConfigFileExists = false;\n\t\ttry {\n\t\t\tawait fs.access(configFilePath, fsConstants.F_OK);\n\t\t\tisConfigFileExists = true;\n\t\t} catch {}\n\n\t\tif (!isConfigFileExists) {\n\t\t\treturn defaultMountPoint;\n\t\t}\n\n\t\tconst configContent = await fs.readFile(configFilePath, {encoding: 'utf8'});\n\t\tconst configMountPoint = /(?<!#.*)root\\s*=\\s*(?<mountPoint>.*)/g.exec(configContent);\n\n\t\tif (!configMountPoint) {\n\t\t\treturn defaultMountPoint;\n\t\t}\n\n\t\tmountPoint = configMountPoint.groups.mountPoint.trim();\n\t\tmountPoint = mountPoint.endsWith('/') ? mountPoint : `${mountPoint}/`;\n\n\t\treturn mountPoint;\n\t};\n})();\n\nexport const powerShellPathFromWsl = async () => {\n\tconst mountPoint = await wslDrivesMountPoint();\n\treturn `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;\n};\n\nexport const powerShellPath = async () => {\n\tif (isWsl) {\n\t\treturn powerShellPathFromWsl();\n\t}\n\n\treturn `${process.env.SYSTEMROOT || process.env.windir || String.raw`C:\\Windows`}\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe`;\n};\n\nexport {default as isWsl} from 'is-wsl';\n",
19
+ "import process from 'node:process';\nimport os from 'node:os';\nimport fs from 'node:fs';\nimport isInsideContainer from 'is-inside-container';\n\nconst isWsl = () => {\n\tif (process.platform !== 'linux') {\n\t\treturn false;\n\t}\n\n\tif (os.release().toLowerCase().includes('microsoft')) {\n\t\tif (isInsideContainer()) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\ttry {\n\t\treturn fs.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft')\n\t\t\t? !isInsideContainer() : false;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\nexport default process.env.__IS_WSL_TEST__ ? isWsl : isWsl();\n",
20
+ "import fs from 'node:fs';\nimport isDocker from 'is-docker';\n\nlet cachedResult;\n\n// Podman detection\nconst hasContainerEnv = () => {\n\ttry {\n\t\tfs.statSync('/run/.containerenv');\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\nexport default function isInsideContainer() {\n\t// TODO: Use `??=` when targeting Node.js 16.\n\tif (cachedResult === undefined) {\n\t\tcachedResult = hasContainerEnv() || isDocker();\n\t}\n\n\treturn cachedResult;\n}\n",
21
+ "import fs from 'node:fs';\n\nlet isDockerCached;\n\nfunction hasDockerEnv() {\n\ttry {\n\t\tfs.statSync('/.dockerenv');\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction hasDockerCGroup() {\n\ttry {\n\t\treturn fs.readFileSync('/proc/self/cgroup', 'utf8').includes('docker');\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport default function isDocker() {\n\t// TODO: Use `??=` when targeting Node.js 16.\n\tif (isDockerCached === undefined) {\n\t\tisDockerCached = hasDockerEnv() || hasDockerCGroup();\n\t}\n\n\treturn isDockerCached;\n}\n",
22
+ "export default function defineLazyProperty(object, propertyName, valueGetter) {\n\tconst define = value => Object.defineProperty(object, propertyName, {value, enumerable: true, writable: true});\n\n\tObject.defineProperty(object, propertyName, {\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t\tget() {\n\t\t\tconst result = valueGetter();\n\t\t\tdefine(result);\n\t\t\treturn result;\n\t\t},\n\t\tset(value) {\n\t\t\tdefine(value);\n\t\t}\n\t});\n\n\treturn object;\n}\n",
23
+ "import {promisify} from 'node:util';\nimport process from 'node:process';\nimport {execFile} from 'node:child_process';\nimport defaultBrowserId from 'default-browser-id';\nimport bundleName from 'bundle-name';\nimport windows from './windows.js';\n\nexport {_windowsBrowserProgIdMap} from './windows.js';\n\nconst execFileAsync = promisify(execFile);\n\n// Inlined: https://github.com/sindresorhus/titleize/blob/main/index.js\nconst titleize = string => string.toLowerCase().replaceAll(/(?:^|\\s|-)\\S/g, x => x.toUpperCase());\n\nexport default async function defaultBrowser() {\n\tif (process.platform === 'darwin') {\n\t\tconst id = await defaultBrowserId();\n\t\tconst name = await bundleName(id);\n\t\treturn {name, id};\n\t}\n\n\tif (process.platform === 'linux') {\n\t\tconst {stdout} = await execFileAsync('xdg-mime', ['query', 'default', 'x-scheme-handler/http']);\n\t\tconst id = stdout.trim();\n\t\tconst name = titleize(id.replace(/.desktop$/, '').replace('-', ' '));\n\t\treturn {name, id};\n\t}\n\n\tif (process.platform === 'win32') {\n\t\treturn windows();\n\t}\n\n\tthrow new Error('Only macOS, Linux, and Windows are supported');\n}\n",
24
+ "import {promisify} from 'node:util';\nimport process from 'node:process';\nimport {execFile} from 'node:child_process';\n\nconst execFileAsync = promisify(execFile);\n\nexport default async function defaultBrowserId() {\n\tif (process.platform !== 'darwin') {\n\t\tthrow new Error('macOS only');\n\t}\n\n\tconst {stdout} = await execFileAsync('defaults', ['read', 'com.apple.LaunchServices/com.apple.launchservices.secure', 'LSHandlers']);\n\n\t// `(?!-)` is to prevent matching `LSHandlerRoleAll = \"-\";`.\n\tconst match = /LSHandlerRoleAll = \"(?!-)(?<id>[^\"]+?)\";\\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);\n\n\tconst browserId = match?.groups.id ?? 'com.apple.Safari';\n\n\t// Correct the case for Safari's bundle identifier\n\tif (browserId === 'com.apple.safari') {\n\t\treturn 'com.apple.Safari';\n\t}\n\n\treturn browserId;\n}\n",
25
+ "import process from 'node:process';\nimport {promisify} from 'node:util';\nimport {execFile, execFileSync} from 'node:child_process';\n\nconst execFileAsync = promisify(execFile);\n\nexport async function runAppleScript(script, {humanReadableOutput = true, signal} = {}) {\n\tif (process.platform !== 'darwin') {\n\t\tthrow new Error('macOS only');\n\t}\n\n\tconst outputArguments = humanReadableOutput ? [] : ['-ss'];\n\n\tconst execOptions = {};\n\tif (signal) {\n\t\texecOptions.signal = signal;\n\t}\n\n\tconst {stdout} = await execFileAsync('osascript', ['-e', script, outputArguments], execOptions);\n\treturn stdout.trim();\n}\n\nexport function runAppleScriptSync(script, {humanReadableOutput = true} = {}) {\n\tif (process.platform !== 'darwin') {\n\t\tthrow new Error('macOS only');\n\t}\n\n\tconst outputArguments = humanReadableOutput ? [] : ['-ss'];\n\n\tconst stdout = execFileSync('osascript', ['-e', script, ...outputArguments], {\n\t\tencoding: 'utf8',\n\t\tstdio: ['ignore', 'pipe', 'ignore'],\n\t\ttimeout: 500,\n\t});\n\n\treturn stdout.trim();\n}\n",
26
+ "import {runAppleScript} from 'run-applescript';\n\nexport default async function bundleName(bundleId) {\n\treturn runAppleScript(`tell application \"Finder\" to set app_path to application file id \"${bundleId}\" as string\\ntell application \"System Events\" to get value of property list item \"CFBundleName\" of property list file (app_path & \":Contents:Info.plist\")`);\n}\n",
27
+ "import {promisify} from 'node:util';\nimport {execFile} from 'node:child_process';\n\nconst execFileAsync = promisify(execFile);\n\n// TODO: Fix the casing of bundle identifiers in the next major version.\n\n// Windows doesn't have browser IDs in the same way macOS/Linux does so we give fake\n// ones that look real and match the macOS/Linux versions for cross-platform apps.\nconst windowsBrowserProgIds = {\n\tMSEdgeHTM: {name: 'Edge', id: 'com.microsoft.edge'}, // The missing `L` is correct.\n\tMSEdgeBHTML: {name: 'Edge Beta', id: 'com.microsoft.edge.beta'},\n\tMSEdgeDHTML: {name: 'Edge Dev', id: 'com.microsoft.edge.dev'},\n\tAppXq0fevzme2pys62n3e0fbqa7peapykr8v: {name: 'Edge', id: 'com.microsoft.edge.old'},\n\tChromeHTML: {name: 'Chrome', id: 'com.google.chrome'},\n\tChromeBHTML: {name: 'Chrome Beta', id: 'com.google.chrome.beta'},\n\tChromeDHTML: {name: 'Chrome Dev', id: 'com.google.chrome.dev'},\n\tChromiumHTM: {name: 'Chromium', id: 'org.chromium.Chromium'},\n\tBraveHTML: {name: 'Brave', id: 'com.brave.Browser'},\n\tBraveBHTML: {name: 'Brave Beta', id: 'com.brave.Browser.beta'},\n\tBraveDHTML: {name: 'Brave Dev', id: 'com.brave.Browser.dev'},\n\tBraveSSHTM: {name: 'Brave Nightly', id: 'com.brave.Browser.nightly'},\n\tFirefoxURL: {name: 'Firefox', id: 'org.mozilla.firefox'},\n\tOperaStable: {name: 'Opera', id: 'com.operasoftware.Opera'},\n\tVivaldiHTM: {name: 'Vivaldi', id: 'com.vivaldi.Vivaldi'},\n\t'IE.HTTP': {name: 'Internet Explorer', id: 'com.microsoft.ie'},\n};\n\nexport const _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));\n\nexport class UnknownBrowserError extends Error {}\n\nexport default async function defaultBrowser(_execFileAsync = execFileAsync) {\n\tconst {stdout} = await _execFileAsync('reg', [\n\t\t'QUERY',\n\t\t' HKEY_CURRENT_USER\\\\Software\\\\Microsoft\\\\Windows\\\\Shell\\\\Associations\\\\UrlAssociations\\\\http\\\\UserChoice',\n\t\t'/v',\n\t\t'ProgId',\n\t]);\n\n\tconst match = /ProgId\\s*REG_SZ\\s*(?<id>\\S+)/.exec(stdout);\n\tif (!match) {\n\t\tthrow new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);\n\t}\n\n\tconst {id} = match.groups;\n\n\tconst browser = windowsBrowserProgIds[id];\n\tif (!browser) {\n\t\tthrow new UnknownBrowserError(`Unknown browser ID: ${id}`);\n\t}\n\n\treturn browser;\n}\n",
28
+ "import process from 'node:process';\nimport chalk from 'chalk';\nimport cliCursor from 'cli-cursor';\nimport cliSpinners from 'cli-spinners';\nimport logSymbols from 'log-symbols';\nimport stripAnsi from 'strip-ansi';\nimport stringWidth from 'string-width';\nimport isInteractive from 'is-interactive';\nimport isUnicodeSupported from 'is-unicode-supported';\nimport stdinDiscarder from 'stdin-discarder';\n\nclass Ora {\n\t#linesToClear = 0;\n\t#isDiscardingStdin = false;\n\t#lineCount = 0;\n\t#frameIndex = -1;\n\t#lastSpinnerFrameTime = 0;\n\t#options;\n\t#spinner;\n\t#stream;\n\t#id;\n\t#initialInterval;\n\t#isEnabled;\n\t#isSilent;\n\t#indent;\n\t#text;\n\t#prefixText;\n\t#suffixText;\n\tcolor;\n\n\tconstructor(options) {\n\t\tif (typeof options === 'string') {\n\t\t\toptions = {\n\t\t\t\ttext: options,\n\t\t\t};\n\t\t}\n\n\t\tthis.#options = {\n\t\t\tcolor: 'cyan',\n\t\t\tstream: process.stderr,\n\t\t\tdiscardStdin: true,\n\t\t\thideCursor: true,\n\t\t\t...options,\n\t\t};\n\n\t\t// Public\n\t\tthis.color = this.#options.color;\n\n\t\t// It's important that these use the public setters.\n\t\tthis.spinner = this.#options.spinner;\n\n\t\tthis.#initialInterval = this.#options.interval;\n\t\tthis.#stream = this.#options.stream;\n\t\tthis.#isEnabled = typeof this.#options.isEnabled === 'boolean' ? this.#options.isEnabled : isInteractive({stream: this.#stream});\n\t\tthis.#isSilent = typeof this.#options.isSilent === 'boolean' ? this.#options.isSilent : false;\n\n\t\t// Set *after* `this.#stream`.\n\t\t// It's important that these use the public setters.\n\t\tthis.text = this.#options.text;\n\t\tthis.prefixText = this.#options.prefixText;\n\t\tthis.suffixText = this.#options.suffixText;\n\t\tthis.indent = this.#options.indent;\n\n\t\tif (process.env.NODE_ENV === 'test') {\n\t\t\tthis._stream = this.#stream;\n\t\t\tthis._isEnabled = this.#isEnabled;\n\n\t\t\tObject.defineProperty(this, '_linesToClear', {\n\t\t\t\tget() {\n\t\t\t\t\treturn this.#linesToClear;\n\t\t\t\t},\n\t\t\t\tset(newValue) {\n\t\t\t\t\tthis.#linesToClear = newValue;\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tObject.defineProperty(this, '_frameIndex', {\n\t\t\t\tget() {\n\t\t\t\t\treturn this.#frameIndex;\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tObject.defineProperty(this, '_lineCount', {\n\t\t\t\tget() {\n\t\t\t\t\treturn this.#lineCount;\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\n\tget indent() {\n\t\treturn this.#indent;\n\t}\n\n\tset indent(indent = 0) {\n\t\tif (!(indent >= 0 && Number.isInteger(indent))) {\n\t\t\tthrow new Error('The `indent` option must be an integer from 0 and up');\n\t\t}\n\n\t\tthis.#indent = indent;\n\t\tthis.#updateLineCount();\n\t}\n\n\tget interval() {\n\t\treturn this.#initialInterval ?? this.#spinner.interval ?? 100;\n\t}\n\n\tget spinner() {\n\t\treturn this.#spinner;\n\t}\n\n\tset spinner(spinner) {\n\t\tthis.#frameIndex = -1;\n\t\tthis.#initialInterval = undefined;\n\n\t\tif (typeof spinner === 'object') {\n\t\t\tif (spinner.frames === undefined) {\n\t\t\t\tthrow new Error('The given spinner must have a `frames` property');\n\t\t\t}\n\n\t\t\tthis.#spinner = spinner;\n\t\t} else if (!isUnicodeSupported()) {\n\t\t\tthis.#spinner = cliSpinners.line;\n\t\t} else if (spinner === undefined) {\n\t\t\t// Set default spinner\n\t\t\tthis.#spinner = cliSpinners.dots;\n\t\t} else if (spinner !== 'default' && cliSpinners[spinner]) {\n\t\t\tthis.#spinner = cliSpinners[spinner];\n\t\t} else {\n\t\t\tthrow new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);\n\t\t}\n\t}\n\n\tget text() {\n\t\treturn this.#text;\n\t}\n\n\tset text(value = '') {\n\t\tthis.#text = value;\n\t\tthis.#updateLineCount();\n\t}\n\n\tget prefixText() {\n\t\treturn this.#prefixText;\n\t}\n\n\tset prefixText(value = '') {\n\t\tthis.#prefixText = value;\n\t\tthis.#updateLineCount();\n\t}\n\n\tget suffixText() {\n\t\treturn this.#suffixText;\n\t}\n\n\tset suffixText(value = '') {\n\t\tthis.#suffixText = value;\n\t\tthis.#updateLineCount();\n\t}\n\n\tget isSpinning() {\n\t\treturn this.#id !== undefined;\n\t}\n\n\t#getFullPrefixText(prefixText = this.#prefixText, postfix = ' ') {\n\t\tif (typeof prefixText === 'string' && prefixText !== '') {\n\t\t\treturn prefixText + postfix;\n\t\t}\n\n\t\tif (typeof prefixText === 'function') {\n\t\t\treturn prefixText() + postfix;\n\t\t}\n\n\t\treturn '';\n\t}\n\n\t#getFullSuffixText(suffixText = this.#suffixText, prefix = ' ') {\n\t\tif (typeof suffixText === 'string' && suffixText !== '') {\n\t\t\treturn prefix + suffixText;\n\t\t}\n\n\t\tif (typeof suffixText === 'function') {\n\t\t\treturn prefix + suffixText();\n\t\t}\n\n\t\treturn '';\n\t}\n\n\t#updateLineCount() {\n\t\tconst columns = this.#stream.columns ?? 80;\n\t\tconst fullPrefixText = this.#getFullPrefixText(this.#prefixText, '-');\n\t\tconst fullSuffixText = this.#getFullSuffixText(this.#suffixText, '-');\n\t\tconst fullText = ' '.repeat(this.#indent) + fullPrefixText + '--' + this.#text + '--' + fullSuffixText;\n\n\t\tthis.#lineCount = 0;\n\t\tfor (const line of stripAnsi(fullText).split('\\n')) {\n\t\t\tthis.#lineCount += Math.max(1, Math.ceil(stringWidth(line, {countAnsiEscapeCodes: true}) / columns));\n\t\t}\n\t}\n\n\tget isEnabled() {\n\t\treturn this.#isEnabled && !this.#isSilent;\n\t}\n\n\tset isEnabled(value) {\n\t\tif (typeof value !== 'boolean') {\n\t\t\tthrow new TypeError('The `isEnabled` option must be a boolean');\n\t\t}\n\n\t\tthis.#isEnabled = value;\n\t}\n\n\tget isSilent() {\n\t\treturn this.#isSilent;\n\t}\n\n\tset isSilent(value) {\n\t\tif (typeof value !== 'boolean') {\n\t\t\tthrow new TypeError('The `isSilent` option must be a boolean');\n\t\t}\n\n\t\tthis.#isSilent = value;\n\t}\n\n\tframe() {\n\t\t// Ensure we only update the spinner frame at the wanted interval,\n\t\t// even if the render method is called more often.\n\t\tconst now = Date.now();\n\t\tif (this.#frameIndex === -1 || now - this.#lastSpinnerFrameTime >= this.interval) {\n\t\t\tthis.#frameIndex = ++this.#frameIndex % this.#spinner.frames.length;\n\t\t\tthis.#lastSpinnerFrameTime = now;\n\t\t}\n\n\t\tconst {frames} = this.#spinner;\n\t\tlet frame = frames[this.#frameIndex];\n\n\t\tif (this.color) {\n\t\t\tframe = chalk[this.color](frame);\n\t\t}\n\n\t\tconst fullPrefixText = (typeof this.#prefixText === 'string' && this.#prefixText !== '') ? this.#prefixText + ' ' : '';\n\t\tconst fullText = typeof this.text === 'string' ? ' ' + this.text : '';\n\t\tconst fullSuffixText = (typeof this.#suffixText === 'string' && this.#suffixText !== '') ? ' ' + this.#suffixText : '';\n\n\t\treturn fullPrefixText + frame + fullText + fullSuffixText;\n\t}\n\n\tclear() {\n\t\tif (!this.#isEnabled || !this.#stream.isTTY) {\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.#stream.cursorTo(0);\n\n\t\tfor (let index = 0; index < this.#linesToClear; index++) {\n\t\t\tif (index > 0) {\n\t\t\t\tthis.#stream.moveCursor(0, -1);\n\t\t\t}\n\n\t\t\tthis.#stream.clearLine(1);\n\t\t}\n\n\t\tif (this.#indent || this.lastIndent !== this.#indent) {\n\t\t\tthis.#stream.cursorTo(this.#indent);\n\t\t}\n\n\t\tthis.lastIndent = this.#indent;\n\t\tthis.#linesToClear = 0;\n\n\t\treturn this;\n\t}\n\n\trender() {\n\t\tif (this.#isSilent) {\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.clear();\n\t\tthis.#stream.write(this.frame());\n\t\tthis.#linesToClear = this.#lineCount;\n\n\t\treturn this;\n\t}\n\n\tstart(text) {\n\t\tif (text) {\n\t\t\tthis.text = text;\n\t\t}\n\n\t\tif (this.#isSilent) {\n\t\t\treturn this;\n\t\t}\n\n\t\tif (!this.#isEnabled) {\n\t\t\tif (this.text) {\n\t\t\t\tthis.#stream.write(`- ${this.text}\\n`);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tif (this.isSpinning) {\n\t\t\treturn this;\n\t\t}\n\n\t\tif (this.#options.hideCursor) {\n\t\t\tcliCursor.hide(this.#stream);\n\t\t}\n\n\t\tif (this.#options.discardStdin && process.stdin.isTTY) {\n\t\t\tthis.#isDiscardingStdin = true;\n\t\t\tstdinDiscarder.start();\n\t\t}\n\n\t\tthis.render();\n\t\tthis.#id = setInterval(this.render.bind(this), this.interval);\n\n\t\treturn this;\n\t}\n\n\tstop() {\n\t\tif (!this.#isEnabled) {\n\t\t\treturn this;\n\t\t}\n\n\t\tclearInterval(this.#id);\n\t\tthis.#id = undefined;\n\t\tthis.#frameIndex = 0;\n\t\tthis.clear();\n\t\tif (this.#options.hideCursor) {\n\t\t\tcliCursor.show(this.#stream);\n\t\t}\n\n\t\tif (this.#options.discardStdin && process.stdin.isTTY && this.#isDiscardingStdin) {\n\t\t\tstdinDiscarder.stop();\n\t\t\tthis.#isDiscardingStdin = false;\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tsucceed(text) {\n\t\treturn this.stopAndPersist({symbol: logSymbols.success, text});\n\t}\n\n\tfail(text) {\n\t\treturn this.stopAndPersist({symbol: logSymbols.error, text});\n\t}\n\n\twarn(text) {\n\t\treturn this.stopAndPersist({symbol: logSymbols.warning, text});\n\t}\n\n\tinfo(text) {\n\t\treturn this.stopAndPersist({symbol: logSymbols.info, text});\n\t}\n\n\tstopAndPersist(options = {}) {\n\t\tif (this.#isSilent) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst prefixText = options.prefixText ?? this.#prefixText;\n\t\tconst fullPrefixText = this.#getFullPrefixText(prefixText, ' ');\n\n\t\tconst symbolText = options.symbol ?? ' ';\n\n\t\tconst text = options.text ?? this.text;\n\t\tconst separatorText = symbolText ? ' ' : '';\n\t\tconst fullText = (typeof text === 'string') ? separatorText + text : '';\n\n\t\tconst suffixText = options.suffixText ?? this.#suffixText;\n\t\tconst fullSuffixText = this.#getFullSuffixText(suffixText, ' ');\n\n\t\tconst textToWrite = fullPrefixText + symbolText + fullText + fullSuffixText + '\\n';\n\n\t\tthis.stop();\n\t\tthis.#stream.write(textToWrite);\n\n\t\treturn this;\n\t}\n}\n\nexport default function ora(options) {\n\treturn new Ora(options);\n}\n\nexport async function oraPromise(action, options) {\n\tconst actionIsFunction = typeof action === 'function';\n\tconst actionIsPromise = typeof action.then === 'function';\n\n\tif (!actionIsFunction && !actionIsPromise) {\n\t\tthrow new TypeError('Parameter `action` must be a Function or a Promise');\n\t}\n\n\tconst {successText, failText} = typeof options === 'object'\n\t\t? options\n\t\t: {successText: undefined, failText: undefined};\n\n\tconst spinner = ora(options).start();\n\n\ttry {\n\t\tconst promise = actionIsFunction ? action(spinner) : action;\n\t\tconst result = await promise;\n\n\t\tspinner.succeed(\n\t\t\tsuccessText === undefined\n\t\t\t\t? undefined\n\t\t\t\t: (typeof successText === 'string' ? successText : successText(result)),\n\t\t);\n\n\t\treturn result;\n\t} catch (error) {\n\t\tspinner.fail(\n\t\t\tfailText === undefined\n\t\t\t\t? undefined\n\t\t\t\t: (typeof failText === 'string' ? failText : failText(error)),\n\t\t);\n\n\t\tthrow error;\n\t}\n}\n\nexport {default as spinners} from 'cli-spinners';\n",
29
+ "const ANSI_BACKGROUND_OFFSET = 10;\n\nconst wrapAnsi16 = (offset = 0) => code => `\\u001B[${code + offset}m`;\n\nconst wrapAnsi256 = (offset = 0) => code => `\\u001B[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\u001B[${38 + offset};2;${red};${green};${blue}m`;\n\nconst styles = {\n\tmodifier: {\n\t\treset: [0, 0],\n\t\t// 21 isn't widely supported and 22 does the same thing\n\t\tbold: [1, 22],\n\t\tdim: [2, 22],\n\t\titalic: [3, 23],\n\t\tunderline: [4, 24],\n\t\toverline: [53, 55],\n\t\tinverse: [7, 27],\n\t\thidden: [8, 28],\n\t\tstrikethrough: [9, 29],\n\t},\n\tcolor: {\n\t\tblack: [30, 39],\n\t\tred: [31, 39],\n\t\tgreen: [32, 39],\n\t\tyellow: [33, 39],\n\t\tblue: [34, 39],\n\t\tmagenta: [35, 39],\n\t\tcyan: [36, 39],\n\t\twhite: [37, 39],\n\n\t\t// Bright color\n\t\tblackBright: [90, 39],\n\t\tgray: [90, 39], // Alias of `blackBright`\n\t\tgrey: [90, 39], // Alias of `blackBright`\n\t\tredBright: [91, 39],\n\t\tgreenBright: [92, 39],\n\t\tyellowBright: [93, 39],\n\t\tblueBright: [94, 39],\n\t\tmagentaBright: [95, 39],\n\t\tcyanBright: [96, 39],\n\t\twhiteBright: [97, 39],\n\t},\n\tbgColor: {\n\t\tbgBlack: [40, 49],\n\t\tbgRed: [41, 49],\n\t\tbgGreen: [42, 49],\n\t\tbgYellow: [43, 49],\n\t\tbgBlue: [44, 49],\n\t\tbgMagenta: [45, 49],\n\t\tbgCyan: [46, 49],\n\t\tbgWhite: [47, 49],\n\n\t\t// Bright color\n\t\tbgBlackBright: [100, 49],\n\t\tbgGray: [100, 49], // Alias of `bgBlackBright`\n\t\tbgGrey: [100, 49], // Alias of `bgBlackBright`\n\t\tbgRedBright: [101, 49],\n\t\tbgGreenBright: [102, 49],\n\t\tbgYellowBright: [103, 49],\n\t\tbgBlueBright: [104, 49],\n\t\tbgMagentaBright: [105, 49],\n\t\tbgCyanBright: [106, 49],\n\t\tbgWhiteBright: [107, 49],\n\t},\n};\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`,\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false,\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false,\n\t});\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = wrapAnsi16();\n\tstyles.color.ansi256 = wrapAnsi256();\n\tstyles.color.ansi16m = wrapAnsi16m();\n\tstyles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);\n\n\t// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js\n\tObject.defineProperties(styles, {\n\t\trgbToAnsi256: {\n\t\t\tvalue(red, green, blue) {\n\t\t\t\t// We use the extended greyscale palette here, with the exception of\n\t\t\t\t// black and white. normal palette only has 4 greyscale shades.\n\t\t\t\tif (red === green && green === blue) {\n\t\t\t\t\tif (red < 8) {\n\t\t\t\t\t\treturn 16;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (red > 248) {\n\t\t\t\t\t\treturn 231;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Math.round(((red - 8) / 247) * 24) + 232;\n\t\t\t\t}\n\n\t\t\t\treturn 16\n\t\t\t\t\t+ (36 * Math.round(red / 255 * 5))\n\t\t\t\t\t+ (6 * Math.round(green / 255 * 5))\n\t\t\t\t\t+ Math.round(blue / 255 * 5);\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToRgb: {\n\t\t\tvalue(hex) {\n\t\t\t\tconst matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n\t\t\t\tif (!matches) {\n\t\t\t\t\treturn [0, 0, 0];\n\t\t\t\t}\n\n\t\t\t\tlet [colorString] = matches;\n\n\t\t\t\tif (colorString.length === 3) {\n\t\t\t\t\tcolorString = [...colorString].map(character => character + character).join('');\n\t\t\t\t}\n\n\t\t\t\tconst integer = Number.parseInt(colorString, 16);\n\n\t\t\t\treturn [\n\t\t\t\t\t/* eslint-disable no-bitwise */\n\t\t\t\t\t(integer >> 16) & 0xFF,\n\t\t\t\t\t(integer >> 8) & 0xFF,\n\t\t\t\t\tinteger & 0xFF,\n\t\t\t\t\t/* eslint-enable no-bitwise */\n\t\t\t\t];\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi256: {\n\t\t\tvalue: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t\tansi256ToAnsi: {\n\t\t\tvalue(code) {\n\t\t\t\tif (code < 8) {\n\t\t\t\t\treturn 30 + code;\n\t\t\t\t}\n\n\t\t\t\tif (code < 16) {\n\t\t\t\t\treturn 90 + (code - 8);\n\t\t\t\t}\n\n\t\t\t\tlet red;\n\t\t\t\tlet green;\n\t\t\t\tlet blue;\n\n\t\t\t\tif (code >= 232) {\n\t\t\t\t\tred = (((code - 232) * 10) + 8) / 255;\n\t\t\t\t\tgreen = red;\n\t\t\t\t\tblue = red;\n\t\t\t\t} else {\n\t\t\t\t\tcode -= 16;\n\n\t\t\t\t\tconst remainder = code % 36;\n\n\t\t\t\t\tred = Math.floor(code / 36) / 5;\n\t\t\t\t\tgreen = Math.floor(remainder / 6) / 5;\n\t\t\t\t\tblue = (remainder % 6) / 5;\n\t\t\t\t}\n\n\t\t\t\tconst value = Math.max(red, green, blue) * 2;\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\treturn 30;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tlet result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n\t\t\t\tif (value === 2) {\n\t\t\t\t\tresult += 60;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\trgbToAnsi: {\n\t\t\tvalue: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi: {\n\t\t\tvalue: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t});\n\n\treturn styles;\n}\n\nconst ansiStyles = assembleStyles();\n\nexport default ansiStyles;\n",
30
+ "import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif ('FORCE_COLOR' in env) {\n\t\tif (env.FORCE_COLOR === 'true') {\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (env.FORCE_COLOR === 'false') {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-ghostty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'wezterm') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n",
31
+ "// TODO: When targeting Node.js 16, use `String.prototype.replaceAll`.\nexport function stringReplaceAll(string, substring, replacer) {\n\tlet index = string.indexOf(substring);\n\tif (index === -1) {\n\t\treturn string;\n\t}\n\n\tconst substringLength = substring.length;\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\treturnValue += string.slice(endIndex, index) + substring + replacer;\n\t\tendIndex = index + substringLength;\n\t\tindex = string.indexOf(substring, endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n\nexport function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\tconst gotCR = string[index - 1] === '\\r';\n\t\treturnValue += string.slice(endIndex, (gotCR ? index - 1 : index)) + prefix + (gotCR ? '\\r\\n' : '\\n') + postfix;\n\t\tendIndex = index + 1;\n\t\tindex = string.indexOf('\\n', endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n",
32
+ "import ansiStyles from '#ansi-styles';\nimport supportsColor from '#supports-color';\nimport { // eslint-disable-line import/order\n\tstringReplaceAll,\n\tstringEncaseCRLFWithFirstIndex,\n} from './utilities.js';\n\nconst {stdout: stdoutColor, stderr: stderrColor} = supportsColor;\n\nconst GENERATOR = Symbol('GENERATOR');\nconst STYLER = Symbol('STYLER');\nconst IS_EMPTY = Symbol('IS_EMPTY');\n\n// `supportsColor.level` → `ansiStyles.color[name]` mapping\nconst levelMapping = [\n\t'ansi',\n\t'ansi',\n\t'ansi256',\n\t'ansi16m',\n];\n\nconst styles = Object.create(null);\n\nconst applyOptions = (object, options = {}) => {\n\tif (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {\n\t\tthrow new Error('The `level` option should be an integer from 0 to 3');\n\t}\n\n\t// Detect level if not set manually\n\tconst colorLevel = stdoutColor ? stdoutColor.level : 0;\n\tobject.level = options.level === undefined ? colorLevel : options.level;\n};\n\nexport class Chalk {\n\tconstructor(options) {\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn chalkFactory(options);\n\t}\n}\n\nconst chalkFactory = options => {\n\tconst chalk = (...strings) => strings.join(' ');\n\tapplyOptions(chalk, options);\n\n\tObject.setPrototypeOf(chalk, createChalk.prototype);\n\n\treturn chalk;\n};\n\nfunction createChalk(options) {\n\treturn chalkFactory(options);\n}\n\nObject.setPrototypeOf(createChalk.prototype, Function.prototype);\n\nfor (const [styleName, style] of Object.entries(ansiStyles)) {\n\tstyles[styleName] = {\n\t\tget() {\n\t\t\tconst builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);\n\t\t\tObject.defineProperty(this, styleName, {value: builder});\n\t\t\treturn builder;\n\t\t},\n\t};\n}\n\nstyles.visible = {\n\tget() {\n\t\tconst builder = createBuilder(this, this[STYLER], true);\n\t\tObject.defineProperty(this, 'visible', {value: builder});\n\t\treturn builder;\n\t},\n};\n\nconst getModelAnsi = (model, level, type, ...arguments_) => {\n\tif (model === 'rgb') {\n\t\tif (level === 'ansi16m') {\n\t\t\treturn ansiStyles[type].ansi16m(...arguments_);\n\t\t}\n\n\t\tif (level === 'ansi256') {\n\t\t\treturn ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));\n\t\t}\n\n\t\treturn ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));\n\t}\n\n\tif (model === 'hex') {\n\t\treturn getModelAnsi('rgb', level, type, ...ansiStyles.hexToRgb(...arguments_));\n\t}\n\n\treturn ansiStyles[type][model](...arguments_);\n};\n\nconst usedModels = ['rgb', 'hex', 'ansi256'];\n\nfor (const model of usedModels) {\n\tstyles[model] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansiStyles.color.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n\n\tconst bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);\n\tstyles[bgModel] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansiStyles.bgColor.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n}\n\nconst proto = Object.defineProperties(() => {}, {\n\t...styles,\n\tlevel: {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn this[GENERATOR].level;\n\t\t},\n\t\tset(level) {\n\t\t\tthis[GENERATOR].level = level;\n\t\t},\n\t},\n});\n\nconst createStyler = (open, close, parent) => {\n\tlet openAll;\n\tlet closeAll;\n\tif (parent === undefined) {\n\t\topenAll = open;\n\t\tcloseAll = close;\n\t} else {\n\t\topenAll = parent.openAll + open;\n\t\tcloseAll = close + parent.closeAll;\n\t}\n\n\treturn {\n\t\topen,\n\t\tclose,\n\t\topenAll,\n\t\tcloseAll,\n\t\tparent,\n\t};\n};\n\nconst createBuilder = (self, _styler, _isEmpty) => {\n\t// Single argument is hot path, implicit coercion is faster than anything\n\t// eslint-disable-next-line no-implicit-coercion\n\tconst builder = (...arguments_) => applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));\n\n\t// We alter the prototype because we must return a function, but there is\n\t// no way to create a function with a different prototype\n\tObject.setPrototypeOf(builder, proto);\n\n\tbuilder[GENERATOR] = self;\n\tbuilder[STYLER] = _styler;\n\tbuilder[IS_EMPTY] = _isEmpty;\n\n\treturn builder;\n};\n\nconst applyStyle = (self, string) => {\n\tif (self.level <= 0 || !string) {\n\t\treturn self[IS_EMPTY] ? '' : string;\n\t}\n\n\tlet styler = self[STYLER];\n\n\tif (styler === undefined) {\n\t\treturn string;\n\t}\n\n\tconst {openAll, closeAll} = styler;\n\tif (string.includes('\\u001B')) {\n\t\twhile (styler !== undefined) {\n\t\t\t// Replace any instances already present with a re-opening code\n\t\t\t// otherwise only the part of the string until said closing code\n\t\t\t// will be colored, and the rest will simply be 'plain'.\n\t\t\tstring = stringReplaceAll(string, styler.close, styler.open);\n\n\t\t\tstyler = styler.parent;\n\t\t}\n\t}\n\n\t// We can move both next actions out of loop, because remaining actions in loop won't have\n\t// any/visible effect on parts we add here. Close the styling before a linebreak and reopen\n\t// after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92\n\tconst lfIndex = string.indexOf('\\n');\n\tif (lfIndex !== -1) {\n\t\tstring = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);\n\t}\n\n\treturn openAll + string + closeAll;\n};\n\nObject.defineProperties(createChalk.prototype, styles);\n\nconst chalk = createChalk();\nexport const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});\n\nexport {\n\tmodifierNames,\n\tforegroundColorNames,\n\tbackgroundColorNames,\n\tcolorNames,\n\n\t// TODO: Remove these aliases in the next major version\n\tmodifierNames as modifiers,\n\tforegroundColorNames as foregroundColors,\n\tbackgroundColorNames as backgroundColors,\n\tcolorNames as colors,\n} from './vendor/ansi-styles/index.js';\n\nexport {\n\tstdoutColor as supportsColor,\n\tstderrColor as supportsColorStderr,\n};\n\nexport default chalk;\n",
33
+ "import process from 'node:process';\nimport restoreCursor from 'restore-cursor';\n\nlet isHidden = false;\n\nconst cliCursor = {};\n\ncliCursor.show = (writableStream = process.stderr) => {\n\tif (!writableStream.isTTY) {\n\t\treturn;\n\t}\n\n\tisHidden = false;\n\twritableStream.write('\\u001B[?25h');\n};\n\ncliCursor.hide = (writableStream = process.stderr) => {\n\tif (!writableStream.isTTY) {\n\t\treturn;\n\t}\n\n\trestoreCursor();\n\tisHidden = true;\n\twritableStream.write('\\u001B[?25l');\n};\n\ncliCursor.toggle = (force, writableStream) => {\n\tif (force !== undefined) {\n\t\tisHidden = force;\n\t}\n\n\tif (isHidden) {\n\t\tcliCursor.show(writableStream);\n\t} else {\n\t\tcliCursor.hide(writableStream);\n\t}\n};\n\nexport default cliCursor;\n",
34
+ "import process from 'node:process';\nimport onetime from 'onetime';\nimport {onExit} from 'signal-exit';\n\nconst terminal = process.stderr.isTTY\n\t? process.stderr\n\t: (process.stdout.isTTY ? process.stdout : undefined);\n\nconst restoreCursor = terminal ? onetime(() => {\n\tonExit(() => {\n\t\tterminal.write('\\u001B[?25h');\n\t}, {alwaysLast: true});\n}) : () => {};\n\nexport default restoreCursor;\n",
35
+ "const copyProperty = (to, from, property, ignoreNonConfigurable) => {\n\t// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.\n\t// `Function#prototype` is non-writable and non-configurable so can never be modified.\n\tif (property === 'length' || property === 'prototype') {\n\t\treturn;\n\t}\n\n\t// `Function#arguments` and `Function#caller` should not be copied. They were reported to be present in `Reflect.ownKeys` for some devices in React Native (#41), so we explicitly ignore them here.\n\tif (property === 'arguments' || property === 'caller') {\n\t\treturn;\n\t}\n\n\tconst toDescriptor = Object.getOwnPropertyDescriptor(to, property);\n\tconst fromDescriptor = Object.getOwnPropertyDescriptor(from, property);\n\n\tif (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {\n\t\treturn;\n\t}\n\n\tObject.defineProperty(to, property, fromDescriptor);\n};\n\n// `Object.defineProperty()` throws if the property exists, is not configurable and either:\n// - one its descriptors is changed\n// - it is non-writable and its value is changed\nconst canCopyProperty = function (toDescriptor, fromDescriptor) {\n\treturn toDescriptor === undefined || toDescriptor.configurable || (\n\t\ttoDescriptor.writable === fromDescriptor.writable\n\t\t&& toDescriptor.enumerable === fromDescriptor.enumerable\n\t\t&& toDescriptor.configurable === fromDescriptor.configurable\n\t\t&& (toDescriptor.writable || toDescriptor.value === fromDescriptor.value)\n\t);\n};\n\nconst changePrototype = (to, from) => {\n\tconst fromPrototype = Object.getPrototypeOf(from);\n\tif (fromPrototype === Object.getPrototypeOf(to)) {\n\t\treturn;\n\t}\n\n\tObject.setPrototypeOf(to, fromPrototype);\n};\n\nconst wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\\n${fromBody}`;\n\nconst toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString');\nconst toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name');\n\n// We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected.\n// We use `bind()` instead of a closure for the same reason.\n// Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times.\nconst changeToString = (to, from, name) => {\n\tconst withName = name === '' ? '' : `with ${name.trim()}() `;\n\tconst newToString = wrappedToString.bind(null, withName, from.toString());\n\t// Ensure `to.toString.toString` is non-enumerable and has the same `same`\n\tObject.defineProperty(newToString, 'name', toStringName);\n\tconst {writable, enumerable, configurable} = toStringDescriptor; // We destructue to avoid a potential `get` descriptor.\n\tObject.defineProperty(to, 'toString', {value: newToString, writable, enumerable, configurable});\n};\n\nexport default function mimicFunction(to, from, {ignoreNonConfigurable = false} = {}) {\n\tconst {name} = to;\n\n\tfor (const property of Reflect.ownKeys(from)) {\n\t\tcopyProperty(to, from, property, ignoreNonConfigurable);\n\t}\n\n\tchangePrototype(to, from);\n\tchangeToString(to, from, name);\n\n\treturn to;\n}\n",
36
+ "import mimicFunction from 'mimic-function';\n\nconst calledFunctions = new WeakMap();\n\nconst onetime = (function_, options = {}) => {\n\tif (typeof function_ !== 'function') {\n\t\tthrow new TypeError('Expected a function');\n\t}\n\n\tlet returnValue;\n\tlet callCount = 0;\n\tconst functionName = function_.displayName || function_.name || '<anonymous>';\n\n\tconst onetime = function (...arguments_) {\n\t\tcalledFunctions.set(onetime, ++callCount);\n\n\t\tif (callCount === 1) {\n\t\t\treturnValue = function_.apply(this, arguments_);\n\t\t\tfunction_ = undefined;\n\t\t} else if (options.throw === true) {\n\t\t\tthrow new Error(`Function \\`${functionName}\\` can only be called once`);\n\t\t}\n\n\t\treturn returnValue;\n\t};\n\n\tmimicFunction(onetime, function_);\n\tcalledFunctions.set(onetime, callCount);\n\n\treturn onetime;\n};\n\nonetime.callCount = function_ => {\n\tif (!calledFunctions.has(function_)) {\n\t\tthrow new Error(`The given function \\`${function_.name}\\` is not wrapped by the \\`onetime\\` package`);\n\t}\n\n\treturn calledFunctions.get(function_);\n};\n\nexport default onetime;\n",
37
+ "/**\n * This is not the set of all possible signals.\n *\n * It IS, however, the set of all signals that trigger\n * an exit on either Linux or BSD systems. Linux is a\n * superset of the signal names supported on BSD, and\n * the unknown signals just fail to register, so we can\n * catch that easily enough.\n *\n * Windows signals are a different set, since there are\n * signals that terminate Windows processes, but don't\n * terminate (or don't even exist) on Posix systems.\n *\n * Don't bother with SIGKILL. It's uncatchable, which\n * means that we can't fire any callbacks anyway.\n *\n * If a user does happen to register a handler on a non-\n * fatal signal like SIGWINCH or something, and then\n * exit, it'll end up firing `process.emit('exit')`, so\n * the handler will be fired anyway.\n *\n * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n * artificially, inherently leave the process in a\n * state from which it is not safe to try and enter JS\n * listeners.\n */\nexport const signals = [];\nsignals.push('SIGHUP', 'SIGINT', 'SIGTERM');\nif (process.platform !== 'win32') {\n signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n );\n}\nif (process.platform === 'linux') {\n signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT');\n}\n//# sourceMappingURL=signals.js.map",
38
+ "// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\n// grab a reference to node's real process object right away\nimport { signals } from './signals.js';\nexport { signals };\nconst processOk = (process) => !!process &&\n typeof process === 'object' &&\n typeof process.removeListener === 'function' &&\n typeof process.emit === 'function' &&\n typeof process.reallyExit === 'function' &&\n typeof process.listeners === 'function' &&\n typeof process.kill === 'function' &&\n typeof process.pid === 'number' &&\n typeof process.on === 'function';\nconst kExitEmitter = Symbol.for('signal-exit emitter');\nconst global = globalThis;\nconst ObjectDefineProperty = Object.defineProperty.bind(Object);\n// teeny special purpose ee\nclass Emitter {\n emitted = {\n afterExit: false,\n exit: false,\n };\n listeners = {\n afterExit: [],\n exit: [],\n };\n count = 0;\n id = Math.random();\n constructor() {\n if (global[kExitEmitter]) {\n return global[kExitEmitter];\n }\n ObjectDefineProperty(global, kExitEmitter, {\n value: this,\n writable: false,\n enumerable: false,\n configurable: false,\n });\n }\n on(ev, fn) {\n this.listeners[ev].push(fn);\n }\n removeListener(ev, fn) {\n const list = this.listeners[ev];\n const i = list.indexOf(fn);\n /* c8 ignore start */\n if (i === -1) {\n return;\n }\n /* c8 ignore stop */\n if (i === 0 && list.length === 1) {\n list.length = 0;\n }\n else {\n list.splice(i, 1);\n }\n }\n emit(ev, code, signal) {\n if (this.emitted[ev]) {\n return false;\n }\n this.emitted[ev] = true;\n let ret = false;\n for (const fn of this.listeners[ev]) {\n ret = fn(code, signal) === true || ret;\n }\n if (ev === 'exit') {\n ret = this.emit('afterExit', code, signal) || ret;\n }\n return ret;\n }\n}\nclass SignalExitBase {\n}\nconst signalExitWrap = (handler) => {\n return {\n onExit(cb, opts) {\n return handler.onExit(cb, opts);\n },\n load() {\n return handler.load();\n },\n unload() {\n return handler.unload();\n },\n };\n};\nclass SignalExitFallback extends SignalExitBase {\n onExit() {\n return () => { };\n }\n load() { }\n unload() { }\n}\nclass SignalExit extends SignalExitBase {\n // \"SIGHUP\" throws an `ENOSYS` error on Windows,\n // so use a supported signal instead\n /* c8 ignore start */\n #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP';\n /* c8 ignore stop */\n #emitter = new Emitter();\n #process;\n #originalProcessEmit;\n #originalProcessReallyExit;\n #sigListeners = {};\n #loaded = false;\n constructor(process) {\n super();\n this.#process = process;\n // { <signal>: <listener fn>, ... }\n this.#sigListeners = {};\n for (const sig of signals) {\n this.#sigListeners[sig] = () => {\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n const listeners = this.#process.listeners(sig);\n let { count } = this.#emitter;\n // This is a workaround for the fact that signal-exit v3 and signal\n // exit v4 are not aware of each other, and each will attempt to let\n // the other handle it, so neither of them do. To correct this, we\n // detect if we're the only handler *except* for previous versions\n // of signal-exit, and increment by the count of listeners it has\n // created.\n /* c8 ignore start */\n const p = process;\n if (typeof p.__signal_exit_emitter__ === 'object' &&\n typeof p.__signal_exit_emitter__.count === 'number') {\n count += p.__signal_exit_emitter__.count;\n }\n /* c8 ignore stop */\n if (listeners.length === count) {\n this.unload();\n const ret = this.#emitter.emit('exit', null, sig);\n /* c8 ignore start */\n const s = sig === 'SIGHUP' ? this.#hupSig : sig;\n if (!ret)\n process.kill(process.pid, s);\n /* c8 ignore stop */\n }\n };\n }\n this.#originalProcessReallyExit = process.reallyExit;\n this.#originalProcessEmit = process.emit;\n }\n onExit(cb, opts) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return () => { };\n }\n /* c8 ignore stop */\n if (this.#loaded === false) {\n this.load();\n }\n const ev = opts?.alwaysLast ? 'afterExit' : 'exit';\n this.#emitter.on(ev, cb);\n return () => {\n this.#emitter.removeListener(ev, cb);\n if (this.#emitter.listeners['exit'].length === 0 &&\n this.#emitter.listeners['afterExit'].length === 0) {\n this.unload();\n }\n };\n }\n load() {\n if (this.#loaded) {\n return;\n }\n this.#loaded = true;\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n this.#emitter.count += 1;\n for (const sig of signals) {\n try {\n const fn = this.#sigListeners[sig];\n if (fn)\n this.#process.on(sig, fn);\n }\n catch (_) { }\n }\n this.#process.emit = (ev, ...a) => {\n return this.#processEmit(ev, ...a);\n };\n this.#process.reallyExit = (code) => {\n return this.#processReallyExit(code);\n };\n }\n unload() {\n if (!this.#loaded) {\n return;\n }\n this.#loaded = false;\n signals.forEach(sig => {\n const listener = this.#sigListeners[sig];\n /* c8 ignore start */\n if (!listener) {\n throw new Error('Listener not defined for signal: ' + sig);\n }\n /* c8 ignore stop */\n try {\n this.#process.removeListener(sig, listener);\n /* c8 ignore start */\n }\n catch (_) { }\n /* c8 ignore stop */\n });\n this.#process.emit = this.#originalProcessEmit;\n this.#process.reallyExit = this.#originalProcessReallyExit;\n this.#emitter.count -= 1;\n }\n #processReallyExit(code) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return 0;\n }\n this.#process.exitCode = code || 0;\n /* c8 ignore stop */\n this.#emitter.emit('exit', this.#process.exitCode, null);\n return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);\n }\n #processEmit(ev, ...args) {\n const og = this.#originalProcessEmit;\n if (ev === 'exit' && processOk(this.#process)) {\n if (typeof args[0] === 'number') {\n this.#process.exitCode = args[0];\n /* c8 ignore start */\n }\n /* c8 ignore start */\n const ret = og.call(this.#process, ev, ...args);\n /* c8 ignore start */\n this.#emitter.emit('exit', this.#process.exitCode, null);\n /* c8 ignore stop */\n return ret;\n }\n else {\n return og.call(this.#process, ev, ...args);\n }\n }\n}\nconst process = globalThis.process;\n// wrap so that we call the method on the actual handler, without\n// exporting it directly.\nexport const { \n/**\n * Called when the process is exiting, whether via signal, explicit\n * exit, or running out of stuff to do.\n *\n * If the global process object is not suitable for instrumentation,\n * then this will be a no-op.\n *\n * Returns a function that may be used to unload signal-exit.\n */\nonExit, \n/**\n * Load the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\nload, \n/**\n * Unload the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\nunload, } = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback());\n//# sourceMappingURL=index.js.map",
39
+ "import process from 'node:process';\n\nexport default function isUnicodeSupported() {\n\tif (process.platform !== 'win32') {\n\t\treturn process.env.TERM !== 'linux'; // Linux console (kernel)\n\t}\n\n\treturn Boolean(process.env.CI)\n\t\t|| Boolean(process.env.WT_SESSION) // Windows Terminal\n\t\t|| Boolean(process.env.TERMINUS_SUBLIME) // Terminus (<0.2.27)\n\t\t|| process.env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder\n\t\t|| process.env.TERM_PROGRAM === 'Terminus-Sublime'\n\t\t|| process.env.TERM_PROGRAM === 'vscode'\n\t\t|| process.env.TERM === 'xterm-256color'\n\t\t|| process.env.TERM === 'alacritty'\n\t\t|| process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';\n}\n",
40
+ "import chalk from 'chalk';\nimport isUnicodeSupported from 'is-unicode-supported';\n\nconst main = {\n\tinfo: chalk.blue('ℹ'),\n\tsuccess: chalk.green('✔'),\n\twarning: chalk.yellow('⚠'),\n\terror: chalk.red('✖'),\n};\n\nconst fallback = {\n\tinfo: chalk.blue('i'),\n\tsuccess: chalk.green('√'),\n\twarning: chalk.yellow('‼'),\n\terror: chalk.red('×'),\n};\n\nconst logSymbols = isUnicodeSupported() ? main : fallback;\n\nexport default logSymbols;\n",
41
+ "export default function ansiRegex({onlyFirst = false} = {}) {\n\t// Valid string terminator sequences are BEL, ESC\\, and 0x9c\n\tconst ST = '(?:\\\\u0007|\\\\u001B\\\\u005C|\\\\u009C)';\n\n\t// OSC sequences only: ESC ] ... ST (non-greedy until the first ST)\n\tconst osc = `(?:\\\\u001B\\\\][\\\\s\\\\S]*?${ST})`;\n\n\t// CSI and related: ESC/C1, optional intermediates, optional params (supports ; and :) then final byte\n\tconst csi = '[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:\\\\d{1,4}(?:[;:]\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]';\n\n\tconst pattern = `${osc}|${csi}`;\n\n\treturn new RegExp(pattern, onlyFirst ? undefined : 'g');\n}\n",
42
+ "import ansiRegex from 'ansi-regex';\n\nconst regex = ansiRegex();\n\nexport default function stripAnsi(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(`Expected a \\`string\\`, got \\`${typeof string}\\``);\n\t}\n\n\t// Even though the regex is global, we don't need to reset the `.lastIndex`\n\t// because unlike `.exec()` and `.test()`, `.replace()` does it automatically\n\t// and doing it manually has a performance penalty.\n\treturn string.replace(regex, '');\n}\n",
43
+ "// Generated code.\n\nfunction isAmbiguous(x) {\n\treturn x === 0xA1\n\t\t|| x === 0xA4\n\t\t|| x === 0xA7\n\t\t|| x === 0xA8\n\t\t|| x === 0xAA\n\t\t|| x === 0xAD\n\t\t|| x === 0xAE\n\t\t|| x >= 0xB0 && x <= 0xB4\n\t\t|| x >= 0xB6 && x <= 0xBA\n\t\t|| x >= 0xBC && x <= 0xBF\n\t\t|| x === 0xC6\n\t\t|| x === 0xD0\n\t\t|| x === 0xD7\n\t\t|| x === 0xD8\n\t\t|| x >= 0xDE && x <= 0xE1\n\t\t|| x === 0xE6\n\t\t|| x >= 0xE8 && x <= 0xEA\n\t\t|| x === 0xEC\n\t\t|| x === 0xED\n\t\t|| x === 0xF0\n\t\t|| x === 0xF2\n\t\t|| x === 0xF3\n\t\t|| x >= 0xF7 && x <= 0xFA\n\t\t|| x === 0xFC\n\t\t|| x === 0xFE\n\t\t|| x === 0x101\n\t\t|| x === 0x111\n\t\t|| x === 0x113\n\t\t|| x === 0x11B\n\t\t|| x === 0x126\n\t\t|| x === 0x127\n\t\t|| x === 0x12B\n\t\t|| x >= 0x131 && x <= 0x133\n\t\t|| x === 0x138\n\t\t|| x >= 0x13F && x <= 0x142\n\t\t|| x === 0x144\n\t\t|| x >= 0x148 && x <= 0x14B\n\t\t|| x === 0x14D\n\t\t|| x === 0x152\n\t\t|| x === 0x153\n\t\t|| x === 0x166\n\t\t|| x === 0x167\n\t\t|| x === 0x16B\n\t\t|| x === 0x1CE\n\t\t|| x === 0x1D0\n\t\t|| x === 0x1D2\n\t\t|| x === 0x1D4\n\t\t|| x === 0x1D6\n\t\t|| x === 0x1D8\n\t\t|| x === 0x1DA\n\t\t|| x === 0x1DC\n\t\t|| x === 0x251\n\t\t|| x === 0x261\n\t\t|| x === 0x2C4\n\t\t|| x === 0x2C7\n\t\t|| x >= 0x2C9 && x <= 0x2CB\n\t\t|| x === 0x2CD\n\t\t|| x === 0x2D0\n\t\t|| x >= 0x2D8 && x <= 0x2DB\n\t\t|| x === 0x2DD\n\t\t|| x === 0x2DF\n\t\t|| x >= 0x300 && x <= 0x36F\n\t\t|| x >= 0x391 && x <= 0x3A1\n\t\t|| x >= 0x3A3 && x <= 0x3A9\n\t\t|| x >= 0x3B1 && x <= 0x3C1\n\t\t|| x >= 0x3C3 && x <= 0x3C9\n\t\t|| x === 0x401\n\t\t|| x >= 0x410 && x <= 0x44F\n\t\t|| x === 0x451\n\t\t|| x === 0x2010\n\t\t|| x >= 0x2013 && x <= 0x2016\n\t\t|| x === 0x2018\n\t\t|| x === 0x2019\n\t\t|| x === 0x201C\n\t\t|| x === 0x201D\n\t\t|| x >= 0x2020 && x <= 0x2022\n\t\t|| x >= 0x2024 && x <= 0x2027\n\t\t|| x === 0x2030\n\t\t|| x === 0x2032\n\t\t|| x === 0x2033\n\t\t|| x === 0x2035\n\t\t|| x === 0x203B\n\t\t|| x === 0x203E\n\t\t|| x === 0x2074\n\t\t|| x === 0x207F\n\t\t|| x >= 0x2081 && x <= 0x2084\n\t\t|| x === 0x20AC\n\t\t|| x === 0x2103\n\t\t|| x === 0x2105\n\t\t|| x === 0x2109\n\t\t|| x === 0x2113\n\t\t|| x === 0x2116\n\t\t|| x === 0x2121\n\t\t|| x === 0x2122\n\t\t|| x === 0x2126\n\t\t|| x === 0x212B\n\t\t|| x === 0x2153\n\t\t|| x === 0x2154\n\t\t|| x >= 0x215B && x <= 0x215E\n\t\t|| x >= 0x2160 && x <= 0x216B\n\t\t|| x >= 0x2170 && x <= 0x2179\n\t\t|| x === 0x2189\n\t\t|| x >= 0x2190 && x <= 0x2199\n\t\t|| x === 0x21B8\n\t\t|| x === 0x21B9\n\t\t|| x === 0x21D2\n\t\t|| x === 0x21D4\n\t\t|| x === 0x21E7\n\t\t|| x === 0x2200\n\t\t|| x === 0x2202\n\t\t|| x === 0x2203\n\t\t|| x === 0x2207\n\t\t|| x === 0x2208\n\t\t|| x === 0x220B\n\t\t|| x === 0x220F\n\t\t|| x === 0x2211\n\t\t|| x === 0x2215\n\t\t|| x === 0x221A\n\t\t|| x >= 0x221D && x <= 0x2220\n\t\t|| x === 0x2223\n\t\t|| x === 0x2225\n\t\t|| x >= 0x2227 && x <= 0x222C\n\t\t|| x === 0x222E\n\t\t|| x >= 0x2234 && x <= 0x2237\n\t\t|| x === 0x223C\n\t\t|| x === 0x223D\n\t\t|| x === 0x2248\n\t\t|| x === 0x224C\n\t\t|| x === 0x2252\n\t\t|| x === 0x2260\n\t\t|| x === 0x2261\n\t\t|| x >= 0x2264 && x <= 0x2267\n\t\t|| x === 0x226A\n\t\t|| x === 0x226B\n\t\t|| x === 0x226E\n\t\t|| x === 0x226F\n\t\t|| x === 0x2282\n\t\t|| x === 0x2283\n\t\t|| x === 0x2286\n\t\t|| x === 0x2287\n\t\t|| x === 0x2295\n\t\t|| x === 0x2299\n\t\t|| x === 0x22A5\n\t\t|| x === 0x22BF\n\t\t|| x === 0x2312\n\t\t|| x >= 0x2460 && x <= 0x24E9\n\t\t|| x >= 0x24EB && x <= 0x254B\n\t\t|| x >= 0x2550 && x <= 0x2573\n\t\t|| x >= 0x2580 && x <= 0x258F\n\t\t|| x >= 0x2592 && x <= 0x2595\n\t\t|| x === 0x25A0\n\t\t|| x === 0x25A1\n\t\t|| x >= 0x25A3 && x <= 0x25A9\n\t\t|| x === 0x25B2\n\t\t|| x === 0x25B3\n\t\t|| x === 0x25B6\n\t\t|| x === 0x25B7\n\t\t|| x === 0x25BC\n\t\t|| x === 0x25BD\n\t\t|| x === 0x25C0\n\t\t|| x === 0x25C1\n\t\t|| x >= 0x25C6 && x <= 0x25C8\n\t\t|| x === 0x25CB\n\t\t|| x >= 0x25CE && x <= 0x25D1\n\t\t|| x >= 0x25E2 && x <= 0x25E5\n\t\t|| x === 0x25EF\n\t\t|| x === 0x2605\n\t\t|| x === 0x2606\n\t\t|| x === 0x2609\n\t\t|| x === 0x260E\n\t\t|| x === 0x260F\n\t\t|| x === 0x261C\n\t\t|| x === 0x261E\n\t\t|| x === 0x2640\n\t\t|| x === 0x2642\n\t\t|| x === 0x2660\n\t\t|| x === 0x2661\n\t\t|| x >= 0x2663 && x <= 0x2665\n\t\t|| x >= 0x2667 && x <= 0x266A\n\t\t|| x === 0x266C\n\t\t|| x === 0x266D\n\t\t|| x === 0x266F\n\t\t|| x === 0x269E\n\t\t|| x === 0x269F\n\t\t|| x === 0x26BF\n\t\t|| x >= 0x26C6 && x <= 0x26CD\n\t\t|| x >= 0x26CF && x <= 0x26D3\n\t\t|| x >= 0x26D5 && x <= 0x26E1\n\t\t|| x === 0x26E3\n\t\t|| x === 0x26E8\n\t\t|| x === 0x26E9\n\t\t|| x >= 0x26EB && x <= 0x26F1\n\t\t|| x === 0x26F4\n\t\t|| x >= 0x26F6 && x <= 0x26F9\n\t\t|| x === 0x26FB\n\t\t|| x === 0x26FC\n\t\t|| x === 0x26FE\n\t\t|| x === 0x26FF\n\t\t|| x === 0x273D\n\t\t|| x >= 0x2776 && x <= 0x277F\n\t\t|| x >= 0x2B56 && x <= 0x2B59\n\t\t|| x >= 0x3248 && x <= 0x324F\n\t\t|| x >= 0xE000 && x <= 0xF8FF\n\t\t|| x >= 0xFE00 && x <= 0xFE0F\n\t\t|| x === 0xFFFD\n\t\t|| x >= 0x1F100 && x <= 0x1F10A\n\t\t|| x >= 0x1F110 && x <= 0x1F12D\n\t\t|| x >= 0x1F130 && x <= 0x1F169\n\t\t|| x >= 0x1F170 && x <= 0x1F18D\n\t\t|| x === 0x1F18F\n\t\t|| x === 0x1F190\n\t\t|| x >= 0x1F19B && x <= 0x1F1AC\n\t\t|| x >= 0xE0100 && x <= 0xE01EF\n\t\t|| x >= 0xF0000 && x <= 0xFFFFD\n\t\t|| x >= 0x100000 && x <= 0x10FFFD;\n}\n\nfunction isFullWidth(x) {\n\treturn x === 0x3000\n\t\t|| x >= 0xFF01 && x <= 0xFF60\n\t\t|| x >= 0xFFE0 && x <= 0xFFE6;\n}\n\nfunction isWide(x) {\n\treturn x >= 0x1100 && x <= 0x115F\n\t\t|| x === 0x231A\n\t\t|| x === 0x231B\n\t\t|| x === 0x2329\n\t\t|| x === 0x232A\n\t\t|| x >= 0x23E9 && x <= 0x23EC\n\t\t|| x === 0x23F0\n\t\t|| x === 0x23F3\n\t\t|| x === 0x25FD\n\t\t|| x === 0x25FE\n\t\t|| x === 0x2614\n\t\t|| x === 0x2615\n\t\t|| x >= 0x2630 && x <= 0x2637\n\t\t|| x >= 0x2648 && x <= 0x2653\n\t\t|| x === 0x267F\n\t\t|| x >= 0x268A && x <= 0x268F\n\t\t|| x === 0x2693\n\t\t|| x === 0x26A1\n\t\t|| x === 0x26AA\n\t\t|| x === 0x26AB\n\t\t|| x === 0x26BD\n\t\t|| x === 0x26BE\n\t\t|| x === 0x26C4\n\t\t|| x === 0x26C5\n\t\t|| x === 0x26CE\n\t\t|| x === 0x26D4\n\t\t|| x === 0x26EA\n\t\t|| x === 0x26F2\n\t\t|| x === 0x26F3\n\t\t|| x === 0x26F5\n\t\t|| x === 0x26FA\n\t\t|| x === 0x26FD\n\t\t|| x === 0x2705\n\t\t|| x === 0x270A\n\t\t|| x === 0x270B\n\t\t|| x === 0x2728\n\t\t|| x === 0x274C\n\t\t|| x === 0x274E\n\t\t|| x >= 0x2753 && x <= 0x2755\n\t\t|| x === 0x2757\n\t\t|| x >= 0x2795 && x <= 0x2797\n\t\t|| x === 0x27B0\n\t\t|| x === 0x27BF\n\t\t|| x === 0x2B1B\n\t\t|| x === 0x2B1C\n\t\t|| x === 0x2B50\n\t\t|| x === 0x2B55\n\t\t|| x >= 0x2E80 && x <= 0x2E99\n\t\t|| x >= 0x2E9B && x <= 0x2EF3\n\t\t|| x >= 0x2F00 && x <= 0x2FD5\n\t\t|| x >= 0x2FF0 && x <= 0x2FFF\n\t\t|| x >= 0x3001 && x <= 0x303E\n\t\t|| x >= 0x3041 && x <= 0x3096\n\t\t|| x >= 0x3099 && x <= 0x30FF\n\t\t|| x >= 0x3105 && x <= 0x312F\n\t\t|| x >= 0x3131 && x <= 0x318E\n\t\t|| x >= 0x3190 && x <= 0x31E5\n\t\t|| x >= 0x31EF && x <= 0x321E\n\t\t|| x >= 0x3220 && x <= 0x3247\n\t\t|| x >= 0x3250 && x <= 0xA48C\n\t\t|| x >= 0xA490 && x <= 0xA4C6\n\t\t|| x >= 0xA960 && x <= 0xA97C\n\t\t|| x >= 0xAC00 && x <= 0xD7A3\n\t\t|| x >= 0xF900 && x <= 0xFAFF\n\t\t|| x >= 0xFE10 && x <= 0xFE19\n\t\t|| x >= 0xFE30 && x <= 0xFE52\n\t\t|| x >= 0xFE54 && x <= 0xFE66\n\t\t|| x >= 0xFE68 && x <= 0xFE6B\n\t\t|| x >= 0x16FE0 && x <= 0x16FE4\n\t\t|| x >= 0x16FF0 && x <= 0x16FF6\n\t\t|| x >= 0x17000 && x <= 0x18CD5\n\t\t|| x >= 0x18CFF && x <= 0x18D1E\n\t\t|| x >= 0x18D80 && x <= 0x18DF2\n\t\t|| x >= 0x1AFF0 && x <= 0x1AFF3\n\t\t|| x >= 0x1AFF5 && x <= 0x1AFFB\n\t\t|| x === 0x1AFFD\n\t\t|| x === 0x1AFFE\n\t\t|| x >= 0x1B000 && x <= 0x1B122\n\t\t|| x === 0x1B132\n\t\t|| x >= 0x1B150 && x <= 0x1B152\n\t\t|| x === 0x1B155\n\t\t|| x >= 0x1B164 && x <= 0x1B167\n\t\t|| x >= 0x1B170 && x <= 0x1B2FB\n\t\t|| x >= 0x1D300 && x <= 0x1D356\n\t\t|| x >= 0x1D360 && x <= 0x1D376\n\t\t|| x === 0x1F004\n\t\t|| x === 0x1F0CF\n\t\t|| x === 0x1F18E\n\t\t|| x >= 0x1F191 && x <= 0x1F19A\n\t\t|| x >= 0x1F200 && x <= 0x1F202\n\t\t|| x >= 0x1F210 && x <= 0x1F23B\n\t\t|| x >= 0x1F240 && x <= 0x1F248\n\t\t|| x === 0x1F250\n\t\t|| x === 0x1F251\n\t\t|| x >= 0x1F260 && x <= 0x1F265\n\t\t|| x >= 0x1F300 && x <= 0x1F320\n\t\t|| x >= 0x1F32D && x <= 0x1F335\n\t\t|| x >= 0x1F337 && x <= 0x1F37C\n\t\t|| x >= 0x1F37E && x <= 0x1F393\n\t\t|| x >= 0x1F3A0 && x <= 0x1F3CA\n\t\t|| x >= 0x1F3CF && x <= 0x1F3D3\n\t\t|| x >= 0x1F3E0 && x <= 0x1F3F0\n\t\t|| x === 0x1F3F4\n\t\t|| x >= 0x1F3F8 && x <= 0x1F43E\n\t\t|| x === 0x1F440\n\t\t|| x >= 0x1F442 && x <= 0x1F4FC\n\t\t|| x >= 0x1F4FF && x <= 0x1F53D\n\t\t|| x >= 0x1F54B && x <= 0x1F54E\n\t\t|| x >= 0x1F550 && x <= 0x1F567\n\t\t|| x === 0x1F57A\n\t\t|| x === 0x1F595\n\t\t|| x === 0x1F596\n\t\t|| x === 0x1F5A4\n\t\t|| x >= 0x1F5FB && x <= 0x1F64F\n\t\t|| x >= 0x1F680 && x <= 0x1F6C5\n\t\t|| x === 0x1F6CC\n\t\t|| x >= 0x1F6D0 && x <= 0x1F6D2\n\t\t|| x >= 0x1F6D5 && x <= 0x1F6D8\n\t\t|| x >= 0x1F6DC && x <= 0x1F6DF\n\t\t|| x === 0x1F6EB\n\t\t|| x === 0x1F6EC\n\t\t|| x >= 0x1F6F4 && x <= 0x1F6FC\n\t\t|| x >= 0x1F7E0 && x <= 0x1F7EB\n\t\t|| x === 0x1F7F0\n\t\t|| x >= 0x1F90C && x <= 0x1F93A\n\t\t|| x >= 0x1F93C && x <= 0x1F945\n\t\t|| x >= 0x1F947 && x <= 0x1F9FF\n\t\t|| x >= 0x1FA70 && x <= 0x1FA7C\n\t\t|| x >= 0x1FA80 && x <= 0x1FA8A\n\t\t|| x >= 0x1FA8E && x <= 0x1FAC6\n\t\t|| x === 0x1FAC8\n\t\t|| x >= 0x1FACD && x <= 0x1FADC\n\t\t|| x >= 0x1FADF && x <= 0x1FAEA\n\t\t|| x >= 0x1FAEF && x <= 0x1FAF8\n\t\t|| x >= 0x20000 && x <= 0x2FFFD\n\t\t|| x >= 0x30000 && x <= 0x3FFFD;\n}\n\nfunction getCategory(x) {\n\tif (isAmbiguous(x)) return 'ambiguous';\n\n\tif (isFullWidth(x)) return 'fullwidth';\n\n\tif (\n\t\tx === 0x20A9\n\t\t|| x >= 0xFF61 && x <= 0xFFBE\n\t\t|| x >= 0xFFC2 && x <= 0xFFC7\n\t\t|| x >= 0xFFCA && x <= 0xFFCF\n\t\t|| x >= 0xFFD2 && x <= 0xFFD7\n\t\t|| x >= 0xFFDA && x <= 0xFFDC\n\t\t|| x >= 0xFFE8 && x <= 0xFFEE\n\t) {\n\t\treturn 'halfwidth';\n\t}\n\n\tif (\n\t\tx >= 0x20 && x <= 0x7E\n\t\t|| x === 0xA2\n\t\t|| x === 0xA3\n\t\t|| x === 0xA5\n\t\t|| x === 0xA6\n\t\t|| x === 0xAC\n\t\t|| x === 0xAF\n\t\t|| x >= 0x27E6 && x <= 0x27ED\n\t\t|| x === 0x2985\n\t\t|| x === 0x2986\n\t) {\n\t\treturn 'narrow';\n\t}\n\n\tif (isWide(x)) return 'wide';\n\n\treturn 'neutral';\n}\n\nexport {isAmbiguous, isFullWidth, isWide, getCategory};\n",
44
+ "import {getCategory, isAmbiguous, isFullWidth, isWide} from './lookup.js';\n\nfunction validate(codePoint) {\n\tif (!Number.isSafeInteger(codePoint)) {\n\t\tthrow new TypeError(`Expected a code point, got \\`${typeof codePoint}\\`.`);\n\t}\n}\n\nexport function eastAsianWidthType(codePoint) {\n\tvalidate(codePoint);\n\n\treturn getCategory(codePoint);\n}\n\nexport function eastAsianWidth(codePoint, {ambiguousAsWide = false} = {}) {\n\tvalidate(codePoint);\n\n\tif (\n\t\tisFullWidth(codePoint)\n\t\t|| isWide(codePoint)\n\t\t|| (ambiguousAsWide && isAmbiguous(codePoint))\n\t) {\n\t\treturn 2;\n\t}\n\n\treturn 1;\n}\n\n// Private exports for https://github.com/sindresorhus/is-fullwidth-code-point\nexport {isFullWidth as _isFullWidth, isWide as _isWide} from './lookup.js';\n",
45
+ "import stripAnsi from 'strip-ansi';\nimport {eastAsianWidth} from 'get-east-asian-width';\nimport emojiRegex from 'emoji-regex';\n\nconst segmenter = new Intl.Segmenter();\n\nconst defaultIgnorableCodePointRegex = /^\\p{Default_Ignorable_Code_Point}$/u;\n\nexport default function stringWidth(string, options = {}) {\n\tif (typeof string !== 'string' || string.length === 0) {\n\t\treturn 0;\n\t}\n\n\tconst {\n\t\tambiguousIsNarrow = true,\n\t\tcountAnsiEscapeCodes = false,\n\t} = options;\n\n\tif (!countAnsiEscapeCodes) {\n\t\tstring = stripAnsi(string);\n\t}\n\n\tif (string.length === 0) {\n\t\treturn 0;\n\t}\n\n\tlet width = 0;\n\tconst eastAsianWidthOptions = {ambiguousAsWide: !ambiguousIsNarrow};\n\n\tfor (const {segment: character} of segmenter.segment(string)) {\n\t\tconst codePoint = character.codePointAt(0);\n\n\t\t// Ignore control characters\n\t\tif (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore zero-width characters\n\t\tif (\n\t\t\t(codePoint >= 0x20_0B && codePoint <= 0x20_0F) // Zero-width space, non-joiner, joiner, left-to-right mark, right-to-left mark\n\t\t\t|| codePoint === 0xFE_FF // Zero-width no-break space\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore combining characters\n\t\tif (\n\t\t\t(codePoint >= 0x3_00 && codePoint <= 0x3_6F) // Combining diacritical marks\n\t\t\t|| (codePoint >= 0x1A_B0 && codePoint <= 0x1A_FF) // Combining diacritical marks extended\n\t\t\t|| (codePoint >= 0x1D_C0 && codePoint <= 0x1D_FF) // Combining diacritical marks supplement\n\t\t\t|| (codePoint >= 0x20_D0 && codePoint <= 0x20_FF) // Combining diacritical marks for symbols\n\t\t\t|| (codePoint >= 0xFE_20 && codePoint <= 0xFE_2F) // Combining half marks\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore surrogate pairs\n\t\tif (codePoint >= 0xD8_00 && codePoint <= 0xDF_FF) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore variation selectors\n\t\tif (codePoint >= 0xFE_00 && codePoint <= 0xFE_0F) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// This covers some of the above cases, but we still keep them for performance reasons.\n\t\tif (defaultIgnorableCodePointRegex.test(character)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// TODO: Use `/\\p{RGI_Emoji}/v` when targeting Node.js 20.\n\t\tif (emojiRegex().test(character)) {\n\t\t\twidth += 2;\n\t\t\tcontinue;\n\t\t}\n\n\t\twidth += eastAsianWidth(codePoint, eastAsianWidthOptions);\n\t}\n\n\treturn width;\n}\n",
46
+ "export default function isInteractive({stream = process.stdout} = {}) {\n\treturn Boolean(\n\t\tstream && stream.isTTY &&\n\t\tprocess.env.TERM !== 'dumb' &&\n\t\t!('CI' in process.env)\n\t);\n}\n",
47
+ "import process from 'node:process';\n\nexport default function isUnicodeSupported() {\n\tconst {env} = process;\n\tconst {TERM, TERM_PROGRAM} = env;\n\n\tif (process.platform !== 'win32') {\n\t\treturn TERM !== 'linux'; // Linux console (kernel)\n\t}\n\n\treturn Boolean(env.WT_SESSION) // Windows Terminal\n\t\t|| Boolean(env.TERMINUS_SUBLIME) // Terminus (<0.2.27)\n\t\t|| env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder\n\t\t|| TERM_PROGRAM === 'Terminus-Sublime'\n\t\t|| TERM_PROGRAM === 'vscode'\n\t\t|| TERM === 'xterm-256color'\n\t\t|| TERM === 'alacritty'\n\t\t|| TERM === 'rxvt-unicode'\n\t\t|| TERM === 'rxvt-unicode-256color'\n\t\t|| env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';\n}\n",
48
+ "import process from 'node:process';\n\nconst ASCII_ETX_CODE = 0x03; // Ctrl+C emits this code\n\nclass StdinDiscarder {\n\t#activeCount = 0;\n\n\tstart() {\n\t\tthis.#activeCount++;\n\n\t\tif (this.#activeCount === 1) {\n\t\t\tthis.#realStart();\n\t\t}\n\t}\n\n\tstop() {\n\t\tif (this.#activeCount <= 0) {\n\t\t\tthrow new Error('`stop` called more times than `start`');\n\t\t}\n\n\t\tthis.#activeCount--;\n\n\t\tif (this.#activeCount === 0) {\n\t\t\tthis.#realStop();\n\t\t}\n\t}\n\n\t#realStart() {\n\t\t// No known way to make it work reliably on Windows.\n\t\tif (process.platform === 'win32' || !process.stdin.isTTY) {\n\t\t\treturn;\n\t\t}\n\n\t\tprocess.stdin.setRawMode(true);\n\t\tprocess.stdin.on('data', this.#handleInput);\n\t\tprocess.stdin.resume();\n\t}\n\n\t#realStop() {\n\t\tif (!process.stdin.isTTY) {\n\t\t\treturn;\n\t\t}\n\n\t\tprocess.stdin.off('data', this.#handleInput);\n\t\tprocess.stdin.pause();\n\t\tprocess.stdin.setRawMode(false);\n\t}\n\n\t#handleInput(chunk) {\n\t\t// Allow Ctrl+C to gracefully exit.\n\t\tif (chunk[0] === ASCII_ETX_CODE) {\n\t\t\tprocess.emit('SIGINT');\n\t\t}\n\t}\n}\n\nconst stdinDiscarder = new StdinDiscarder();\n\nexport default stdinDiscarder;\n",
49
+ "import { existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nexport const SHIPI_BASE_URL = process.env.SHIPI_BASE_URL;\n\nif (!SHIPI_BASE_URL) {\n throw new Error(\"SHIPI_BASE_URL environment variable is required\");\n}\n\nexport const SHIPI_API_URL =\n process.env.SHIPI_API_URL || `${SHIPI_BASE_URL}/api`;\n\nexport const CONFIG_FILE_NAME = \"shipi.json\";\n\nexport interface ShipiConfig {\n // Project ID (proj_xxxx) - links to shipi.app\n projectId?: string;\n // Paths to include in diff analysis (glob patterns)\n include?: string[];\n // Paths to exclude from diff analysis (glob patterns)\n exclude?: string[];\n // File extensions to include (e.g., [\".ts\", \".tsx\", \".js\"])\n extensions?: string[];\n // Max diff size per file in bytes\n maxDiffSize?: number;\n // Custom commit type labels\n commitTypes?: Record<string, string>;\n // Default language for generated release notes (e.g., \"en\", \"nl\", \"de\")\n language?: string;\n}\n\nexport const DEFAULT_CONFIG: ShipiConfig = {\n include: [\"src/**\", \"packages/**\", \"apps/**\", \"lib/**\"],\n exclude: [\n \"**/node_modules/**\",\n \"**/dist/**\",\n \"**/build/**\",\n \"**/.next/**\",\n \"**/coverage/**\",\n \"**/*.lock\",\n \"**/pnpm-lock.yaml\",\n \"**/package-lock.json\",\n \"**/yarn.lock\",\n \"**/bun.lock\",\n \"**/*.min.js\",\n \"**/*.min.css\",\n \"**/*.map\",\n \"**/*.d.ts\",\n \"**/generated/**\",\n \"**/.git/**\",\n ],\n extensions: [\n \".ts\",\n \".tsx\",\n \".js\",\n \".jsx\",\n \".mjs\",\n \".cjs\",\n \".vue\",\n \".svelte\",\n \".py\",\n \".go\",\n \".rs\",\n \".rb\",\n \".java\",\n \".kt\",\n \".swift\",\n \".c\",\n \".cpp\",\n \".h\",\n \".cs\",\n \".php\",\n \".md\",\n \".mdx\",\n ],\n maxDiffSize: 5000,\n commitTypes: {\n feat: \"Features\",\n fix: \"Bug Fixes\",\n perf: \"Performance\",\n refactor: \"Refactoring\",\n docs: \"Documentation\",\n test: \"Tests\",\n chore: \"Chores\",\n ci: \"CI/CD\",\n build: \"Build\",\n style: \"Styling\",\n },\n};\n\nexport function getConfigPath(cwd: string = process.cwd()): string {\n return join(cwd, CONFIG_FILE_NAME);\n}\n\nexport function configExists(cwd: string = process.cwd()): boolean {\n return existsSync(getConfigPath(cwd));\n}\n\nexport function loadConfig(cwd: string = process.cwd()): ShipiConfig {\n const configPath = getConfigPath(cwd);\n\n if (!existsSync(configPath)) {\n return DEFAULT_CONFIG;\n }\n\n try {\n const content = readFileSync(configPath, \"utf-8\");\n const userConfig = JSON.parse(content) as Partial<ShipiConfig>;\n\n // Merge with defaults\n return {\n ...DEFAULT_CONFIG,\n ...userConfig,\n // Deep merge arrays if user provides them\n include: userConfig.include ?? DEFAULT_CONFIG.include,\n exclude: userConfig.exclude ?? DEFAULT_CONFIG.exclude,\n extensions: userConfig.extensions ?? DEFAULT_CONFIG.extensions,\n commitTypes: {\n ...DEFAULT_CONFIG.commitTypes,\n ...userConfig.commitTypes,\n },\n };\n } catch {\n return DEFAULT_CONFIG;\n }\n}\n\nexport function saveConfig(\n config: ShipiConfig,\n cwd: string = process.cwd()\n): void {\n const configPath = getConfigPath(cwd);\n writeFileSync(configPath, JSON.stringify(config, null, 2) + \"\\n\");\n}\n\nexport function shouldIncludeFile(\n filePath: string,\n config: ShipiConfig\n): boolean {\n const { include = [], exclude = [], extensions = [] } = config;\n\n // Check extension first (if extensions are specified)\n if (extensions.length > 0) {\n const hasValidExtension = extensions.some((ext) => filePath.endsWith(ext));\n if (!hasValidExtension) {\n return false;\n }\n }\n\n // Check exclude patterns\n for (const pattern of exclude) {\n if (matchGlob(filePath, pattern)) {\n return false;\n }\n }\n\n // If no include patterns, include everything not excluded\n if (include.length === 0) {\n return true;\n }\n\n // Check include patterns\n for (const pattern of include) {\n if (matchGlob(filePath, pattern)) {\n return true;\n }\n }\n\n return false;\n}\n\n// Simple glob matching (supports * and **)\nfunction matchGlob(filePath: string, pattern: string): boolean {\n // Convert glob to regex\n const regexPattern = pattern\n .replace(/\\./g, \"\\\\.\") // Escape dots\n .replace(/\\*\\*/g, \"{{GLOBSTAR}}\") // Temp placeholder for **\n .replace(/\\*/g, \"[^/]*\") // * matches anything except /\n .replace(/\\{\\{GLOBSTAR\\}\\}/g, \".*\"); // ** matches anything\n\n const regex = new RegExp(`^${regexPattern}$`);\n return regex.test(filePath);\n}\n",
50
+ "import { existsSync, readFileSync, writeFileSync, unlinkSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\nconst SESSION_FILE = join(homedir(), \".shipi\");\n\nexport interface ShipiSession {\n id: string;\n name: string | null;\n email: string;\n apiKey: string;\n}\n\nexport function saveSession(sessionData: ShipiSession): void {\n writeFileSync(SESSION_FILE, JSON.stringify(sessionData, null, 2), {\n mode: 0o600,\n });\n}\n\nexport function loadSession(): ShipiSession | null {\n if (!existsSync(SESSION_FILE)) {\n return null;\n }\n\n try {\n const content = readFileSync(SESSION_FILE, \"utf-8\");\n return JSON.parse(content) as ShipiSession;\n } catch {\n return null;\n }\n}\n\nexport function clearSession(): boolean {\n if (!existsSync(SESSION_FILE)) {\n return false;\n }\n\n try {\n unlinkSync(SESSION_FILE);\n return true;\n } catch {\n return false;\n }\n}\n\nexport function getAPIKey(): string | null {\n // Environment variable takes precedence\n if (process.env.SHIPI_API_KEY) {\n return process.env.SHIPI_API_KEY;\n }\n\n const session = loadSession();\n return session?.apiKey ?? null;\n}\n",
51
+ "import pc from \"picocolors\";\nimport { clearSession, loadSession } from \"../utils/session.ts\";\n\nexport async function logoutCommand(): Promise<void> {\n console.log(pc.bold(\"\\n👋 Logout from Shipi\\n\"));\n\n const session = loadSession();\n\n if (!session) {\n console.log(pc.yellow(\"You are not logged in.\\n\"));\n return;\n }\n\n const wasCleared = clearSession();\n\n if (wasCleared) {\n console.log(pc.green(`✓ Logged out successfully`));\n console.log(pc.dim(` Removed credentials for ${session.email}\\n`));\n } else {\n console.log(pc.red(\"Failed to remove session file.\\n\"));\n process.exit(1);\n }\n}\n",
52
+ "import pc from \"picocolors\";\nimport { loadSession } from \"../utils/session.ts\";\n\nexport async function whoamiCommand(): Promise<void> {\n console.log(pc.bold(\"\\n👤 Current User\\n\"));\n\n const session = loadSession();\n\n if (!session) {\n console.log(pc.yellow(\"You are not logged in.\"));\n console.log(pc.dim(\"Run 'shipi login' to authenticate.\\n\"));\n return;\n }\n\n console.log(` ${pc.dim(\"Name:\")} ${session.name || pc.dim(\"(not set)\")}`);\n console.log(` ${pc.dim(\"Email:\")} ${session.email}`);\n console.log(` ${pc.dim(\"ID:\")} ${pc.dim(session.id)}`);\n console.log();\n}\n",
53
+ "import ora from \"ora\";\nimport pc from \"picocolors\";\nimport { loadSession } from \"../utils/session.ts\";\nimport { SHIPI_BASE_URL } from \"../utils/config.ts\";\n\nexport async function usageCommand() {\n const session = loadSession();\n\n if (!session) {\n console.log(pc.red(\"Not logged in. Run `shipi login` first.\"));\n process.exit(1);\n }\n\n const spinner = ora(\"Fetching usage...\").start();\n\n try {\n const response = await fetch(`${SHIPI_BASE_URL}/api/usage`, {\n headers: {\n \"x-api-key\": session.apiKey,\n },\n });\n\n if (!response.ok) {\n const error = await response.json().catch(() => ({}));\n spinner.fail(pc.red(error.error || \"Failed to fetch usage\"));\n process.exit(1);\n }\n\n const data = await response.json();\n spinner.stop();\n\n const { plan, current, limit, resetDate } = data;\n const percentage = limit === 999999 ? 0 : Math.round((current / limit) * 100);\n const barWidth = 30;\n const filledWidth = limit === 999999 ? 0 : Math.round((current / limit) * barWidth);\n const emptyWidth = barWidth - filledWidth;\n\n console.log();\n console.log(pc.bold(\"Usage\"));\n console.log();\n\n // Plan\n const planLabel = plan.charAt(0).toUpperCase() + plan.slice(1);\n const planDisplay = plan === \"pro\" ? pc.cyan(planLabel) : plan === \"team\" ? pc.magenta(planLabel) : pc.dim(planLabel);\n console.log(` Plan: ${planDisplay}`);\n console.log();\n\n // Progress bar\n const barColor = percentage >= 90 ? pc.red : percentage >= 70 ? pc.yellow : pc.green;\n const filled = barColor(\"█\".repeat(filledWidth));\n const empty = pc.dim(\"░\".repeat(emptyWidth));\n console.log(` Generations: ${current} / ${limit === 999999 ? \"∞\" : limit}`);\n if (limit !== 999999) {\n console.log(` [${filled}${empty}] ${percentage}%`);\n }\n console.log();\n\n // Reset date\n const resetDateObj = resetDate ? new Date(resetDate) : new Date(new Date().getFullYear(), new Date().getMonth() + 1, 1);\n console.log(pc.dim(` Resets on ${resetDateObj.toLocaleDateString()}`));\n\n // Warning if near limit\n if (percentage >= 90 && plan === \"free\") {\n console.log();\n console.log(pc.yellow(\" ⚠ You're approaching your limit. Consider upgrading to Pro.\"));\n }\n\n console.log();\n } catch (error) {\n spinner.fail(pc.red(\"Failed to fetch usage\"));\n console.error(error);\n process.exit(1);\n }\n}\n",
54
+ "import ora from \"ora\";\nimport pc from \"picocolors\";\nimport * as readline from \"node:readline\";\nimport {\n isGitRepo,\n getPreviousAncestorTag,\n getUnreleasedCommits,\n getCommitsBetween,\n getCommitsWithDiffs,\n getAllCommitsWithDiffs,\n getUncommittedChanges,\n parseRange,\n type Commit,\n type CommitWithDiff,\n type UncommittedChanges,\n} from \"../utils/git.ts\";\nimport { getAPIKey } from \"../utils/session.ts\";\nimport { SHIPI_BASE_URL, loadConfig, configExists, type ShipiConfig } from \"../utils/config.ts\";\nimport { getProjectContext, getRelatedFiles } from \"../utils/context.ts\";\n\ninterface PlanCheckResult {\n plan: string;\n canUsePremium: boolean;\n}\n\nasync function checkPlanAccess(apiKey: string): Promise<PlanCheckResult> {\n try {\n const response = await fetch(`${SHIPI_BASE_URL}/api/usage`, {\n headers: { \"x-api-key\": apiKey },\n });\n\n if (!response.ok) {\n return { plan: \"unknown\", canUsePremium: false };\n }\n\n const data = await response.json();\n const plan = data.plan || \"free\";\n const canUsePremium = plan === \"pro\" || plan === \"premium\" || plan === \"team\";\n\n return { plan, canUsePremium };\n } catch {\n return { plan: \"unknown\", canUsePremium: false };\n }\n}\n\ninterface ExistingRelease {\n id: string;\n tag: string;\n audience: string;\n content: string;\n createdAt: string;\n}\n\nasync function checkExistingRelease(\n apiKey: string,\n projectId: string,\n tag: string,\n audience: string\n): Promise<ExistingRelease | null> {\n try {\n const params = new URLSearchParams({ projectId, tag, audience });\n const response = await fetch(`${SHIPI_BASE_URL}/api/releases?${params}`, {\n headers: { \"x-api-key\": apiKey },\n });\n\n if (!response.ok) return null;\n\n const data = await response.json();\n if (data.success && data.exists) {\n return data.release;\n }\n return null;\n } catch {\n return null;\n }\n}\n\ninterface StoredRelease {\n id: string;\n tag: string;\n}\n\nasync function storeRelease(\n apiKey: string,\n projectId: string,\n tag: string,\n fromRef: string,\n toRef: string,\n audience: string,\n content: string,\n stats: { commitCount: number; filesChanged: number; additions: number; deletions: number }\n): Promise<StoredRelease | null> {\n try {\n const response = await fetch(`${SHIPI_BASE_URL}/api/releases`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-api-key\": apiKey,\n },\n body: JSON.stringify({\n projectId,\n tag,\n fromRef,\n toRef,\n audience,\n content,\n ...stats,\n }),\n });\n\n if (!response.ok) return null;\n\n const data = await response.json();\n if (data.success && data.release) {\n return data.release;\n }\n return null;\n } catch {\n return null;\n }\n}\n\nfunction confirm(question: string): Promise<boolean> {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n return new Promise((resolve) => {\n rl.question(question, (answer) => {\n rl.close();\n resolve(answer.toLowerCase() === \"y\" || answer.toLowerCase() === \"yes\");\n });\n });\n}\n\ninterface GenerateOptions {\n from?: string;\n output?: string;\n format?: \"md\" | \"json\";\n dryRun?: boolean;\n diffs?: boolean; // --no-diffs sets this to false\n header?: boolean; // --no-header sets this to false\n language?: string;\n uncommitted?: boolean;\n maxDiffSize?: string;\n verbose?: boolean;\n audience?: \"internal\" | \"customer\" | \"changelog\";\n premium?: boolean; // Use Claude instead of GPT-4o mini\n}\n\ninterface GenerateResponse {\n success: boolean;\n releaseNotes?: string;\n error?: string;\n}\n\nexport async function generateCommand(\n range?: string,\n options: GenerateOptions = {}\n): Promise<void> {\n console.log(pc.bold(\"\\n📝 Generate Release Notes\\n\"));\n\n // Check if we're in a git repo\n if (!isGitRepo()) {\n console.log(pc.red(\"Error: Not a git repository\"));\n process.exit(1);\n }\n\n // Check authentication (only if not dry-run)\n const apiKey = getAPIKey();\n if (!apiKey && !options.dryRun) {\n console.log(pc.red(\"Error: Not authenticated\"));\n console.log(pc.dim(\"Run 'shipi login' first.\\n\"));\n process.exit(1);\n }\n\n // Pre-flight check for premium access BEFORE expensive git operations\n if (options.premium && apiKey && !options.dryRun) {\n const planCheck = await checkPlanAccess(apiKey);\n if (!planCheck.canUsePremium) {\n console.log(pc.red(\"Error: Premium model (Claude) requires a Pro or Team plan.\"));\n console.log(pc.dim(`Your current plan: ${planCheck.plan}`));\n console.log(pc.dim(\"Upgrade at: https://shipi.dev/profile\\n\"));\n process.exit(1);\n }\n }\n\n const includeDiffs = options.diffs ?? true;\n\n // Load config\n const config = loadConfig();\n const maxDiffSize = parseInt(options.maxDiffSize || String(config.maxDiffSize || 5000), 10);\n\n if ((includeDiffs || options.uncommitted) && configExists()) {\n console.log(pc.dim(`Using config from shipi.json\\n`));\n } else if ((includeDiffs || options.uncommitted) && !configExists()) {\n console.log(pc.dim(`No shipi.json found, using defaults. Run 'shipi init' to customize.\\n`));\n }\n\n // Handle --uncommitted flag\n if (options.uncommitted) {\n return generateFromUncommitted(options, config, maxDiffSize, apiKey);\n }\n\n let commits: Commit[] | CommitWithDiff[];\n let fromRef: string;\n let toRef: string;\n\n // Determine the range\n if (range) {\n if (range.includes(\"..\")) {\n // Explicit range: v1.0.0..v1.1.0\n const parsed = parseRange(range);\n fromRef = parsed.from;\n toRef = parsed.to;\n commits = includeDiffs\n ? getCommitsWithDiffs(fromRef, toRef, maxDiffSize, config)\n : getCommitsBetween(fromRef, toRef);\n } else {\n // Single tag: v1.2.0 - auto-detect previous\n const parsed = parseRange(range);\n fromRef = parsed.from;\n toRef = parsed.to;\n commits = includeDiffs\n ? getCommitsWithDiffs(fromRef, toRef, maxDiffSize, config)\n : getCommitsBetween(fromRef, toRef);\n }\n } else if (options.from) {\n // --from flag\n fromRef = options.from;\n toRef = \"HEAD\";\n commits = includeDiffs\n ? getCommitsWithDiffs(fromRef, toRef, maxDiffSize, config)\n : getCommitsBetween(fromRef, toRef);\n } else {\n // Default: unreleased changes since last ancestor tag (branch-aware)\n const lastTag = getPreviousAncestorTag(\"HEAD\");\n if (lastTag) {\n fromRef = lastTag;\n toRef = \"HEAD\";\n commits = includeDiffs\n ? getCommitsWithDiffs(fromRef, toRef, maxDiffSize, config)\n : getCommitsBetween(fromRef, toRef);\n } else {\n console.log(pc.yellow(\"No tags found. Analyzing recent commits...\"));\n fromRef = \"initial\";\n toRef = \"HEAD\";\n commits = includeDiffs\n ? getAllCommitsWithDiffs(100, maxDiffSize, config)\n : getUnreleasedCommits();\n }\n }\n\n if (commits.length === 0) {\n console.log(pc.yellow(\"No commits found in the specified range.\"));\n console.log(pc.dim(`Range: ${fromRef}..${toRef}\\n`));\n return;\n }\n\n console.log(pc.dim(`Range: ${fromRef}..${toRef}`));\n console.log(pc.dim(`Found ${commits.length} commits`));\n if (includeDiffs) {\n const totalFiles = (commits as CommitWithDiff[]).reduce(\n (sum, c) => sum + c.stats.filesChanged,\n 0\n );\n const totalAdditions = (commits as CommitWithDiff[]).reduce(\n (sum, c) => sum + c.stats.additions,\n 0\n );\n const totalDeletions = (commits as CommitWithDiff[]).reduce(\n (sum, c) => sum + c.stats.deletions,\n 0\n );\n console.log(\n pc.dim(\n `Files changed: ${totalFiles} | +${totalAdditions} -${totalDeletions}`\n )\n );\n }\n console.log();\n\n // Group commits by type\n const grouped = groupCommitsByType(commits);\n\n if (options.dryRun) {\n console.log(pc.bold(\"Commits to analyze:\\n\"));\n printGroupedCommits(grouped, includeDiffs);\n console.log(pc.dim(\"\\n(Dry run - no API call made)\\n\"));\n return;\n }\n\n const audience = options.audience || \"internal\";\n\n // Check for existing release if project is linked\n if (config.projectId && apiKey) {\n const existing = await checkExistingRelease(\n apiKey,\n config.projectId,\n toRef,\n audience\n );\n\n if (existing) {\n console.log(pc.yellow(`⚠️ Release notes already exist for ${toRef} (${audience})\\n`));\n console.log(pc.dim(`Created: ${new Date(existing.createdAt).toLocaleString()}`));\n console.log(pc.dim(`View: ${SHIPI_BASE_URL}/projects/${config.projectId}/releases/${existing.id}\\n`));\n\n const regenerate = await confirm(\n `Do you want to regenerate? ${pc.dim(\"(y/N)\")} `\n );\n\n if (!regenerate) {\n console.log();\n console.log(pc.bold(\"Existing release notes:\\n\"));\n console.log(\"─\".repeat(50));\n console.log(existing.content);\n console.log(\"─\".repeat(50));\n console.log();\n return;\n }\n console.log();\n }\n }\n\n // Only gather file relationships for internal audience (not used for customer/changelog)\n const needsRelatedFiles = audience === \"internal\" && includeDiffs;\n\n // Show spinner during expensive operations\n const prepSpinner = ora(\"Gathering project context...\").start();\n\n // Gather project context\n const projectContext = getProjectContext();\n\n // Get all changed files for relation analysis (only for internal audience)\n let relatedFiles: ReturnType<typeof getRelatedFiles> = [];\n if (needsRelatedFiles) {\n const allChangedFiles = (commits as CommitWithDiff[]).flatMap((c) => c.files.map((f) => f.file));\n prepSpinner.text = `Analyzing ${allChangedFiles.length} changed files...`;\n relatedFiles = getRelatedFiles(allChangedFiles);\n }\n\n prepSpinner.succeed(\"Context gathered\");\n\n const payload = {\n // Project context for better understanding\n project: {\n name: projectContext.name,\n description: projectContext.description,\n techStack: projectContext.techStack,\n structure: projectContext.structure,\n readme: projectContext.readme,\n },\n // File relationships\n relatedFiles:\n relatedFiles.length > 0\n ? relatedFiles.map((r) => ({\n file: r.file,\n importedBy: r.importedBy.slice(0, 5), // Limit to 5\n imports: r.imports.slice(0, 10), // Limit to 10\n }))\n : undefined,\n // Commits with changes\n commits: commits.map((c) => {\n const base = {\n hash: c.shortHash,\n subject: c.subject,\n body: c.body,\n author: c.author,\n type: c.type,\n scope: c.scope,\n breaking: c.breaking,\n };\n\n if (includeDiffs && \"files\" in c) {\n return {\n ...base,\n files: c.files.map((f) => ({\n file: f.file,\n additions: f.additions,\n deletions: f.deletions,\n diff: f.diff,\n })),\n stats: c.stats,\n };\n }\n\n return base;\n }),\n fromRef,\n toRef,\n format: options.format || \"md\",\n includeDiffs,\n audience: options.audience || \"internal\",\n noHeader: options.header === false,\n language: options.language || config.language,\n model: options.premium ? \"claude\" : \"gpt\",\n };\n\n // Verbose logging\n if (options.verbose) {\n console.log(pc.bold(\"\\n📦 Payload to send:\\n\"));\n console.log(pc.dim(\"─\".repeat(50)));\n console.log(JSON.stringify(payload, null, 2));\n console.log(pc.dim(\"─\".repeat(50)));\n console.log();\n console.log(pc.dim(`Payload size: ${JSON.stringify(payload).length} bytes`));\n console.log();\n }\n\n const modelLabel = options.premium ? \"Claude Sonnet 4 (premium)\" : \"GPT-4o mini\";\n const spinner = ora(`Connecting...`).start();\n\n try {\n const response = await fetch(`${SHIPI_BASE_URL}/api/generate-stream`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-api-key\": apiKey!,\n },\n body: JSON.stringify(payload),\n });\n\n if (!response.ok) {\n const error = await response.text();\n throw new Error(error || `HTTP ${response.status}`);\n }\n\n if (!response.body) {\n throw new Error(\"No response body\");\n }\n\n // Read SSE stream\n const reader = response.body.getReader();\n const decoder = new TextDecoder();\n let buffer = \"\";\n let releaseNotes = \"\";\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n\n buffer += decoder.decode(value, { stream: true });\n const lines = buffer.split(\"\\n\\n\");\n buffer = lines.pop() || \"\";\n\n for (const line of lines) {\n if (!line.startsWith(\"data: \")) continue;\n const jsonStr = line.slice(6);\n\n try {\n const event = JSON.parse(jsonStr);\n\n if (event.event === \"progress\") {\n spinner.text = event.message || \"Processing...\";\n } else if (event.event === \"complete\") {\n releaseNotes = event.releaseNotes || \"\";\n } else if (event.event === \"error\") {\n throw new Error(event.error || \"Generation failed\");\n }\n } catch (parseErr) {\n // Ignore parse errors for incomplete chunks\n }\n }\n }\n\n if (!releaseNotes) {\n throw new Error(\"No release notes received\");\n }\n\n spinner.succeed(pc.green(\"Release notes generated!\"));\n\n console.log(\"\\n\" + pc.bold(\"─\".repeat(50)) + \"\\n\");\n console.log(releaseNotes);\n console.log(\"\\n\" + pc.bold(\"─\".repeat(50)) + \"\\n\");\n\n // Write to file if output specified\n if (options.output) {\n const fs = await import(\"node:fs\");\n fs.writeFileSync(options.output, releaseNotes);\n console.log(pc.green(`✓ Written to ${options.output}`));\n }\n\n // Store release if project is linked\n if (config.projectId && apiKey) {\n const totalFiles = includeDiffs\n ? (commits as CommitWithDiff[]).reduce((sum, c) => sum + c.stats.filesChanged, 0)\n : 0;\n const totalAdditions = includeDiffs\n ? (commits as CommitWithDiff[]).reduce((sum, c) => sum + c.stats.additions, 0)\n : 0;\n const totalDeletions = includeDiffs\n ? (commits as CommitWithDiff[]).reduce((sum, c) => sum + c.stats.deletions, 0)\n : 0;\n\n const stored = await storeRelease(\n apiKey,\n config.projectId,\n toRef,\n fromRef,\n toRef,\n audience,\n releaseNotes,\n {\n commitCount: commits.length,\n filesChanged: totalFiles,\n additions: totalAdditions,\n deletions: totalDeletions,\n }\n );\n\n if (stored) {\n console.log(pc.green(`✓ View at ${SHIPI_BASE_URL}/projects/${config.projectId}/releases/${stored.id}`));\n }\n }\n\n console.log();\n } catch (err) {\n spinner.fail(pc.red(\"Failed to generate release notes\"));\n console.log(pc.dim(err instanceof Error ? err.message : \"Unknown error\"));\n console.log();\n process.exit(1);\n }\n}\n\nfunction groupCommitsByType(\n commits: Commit[] | CommitWithDiff[]\n): Record<string, (Commit | CommitWithDiff)[]> {\n const groups: Record<string, (Commit | CommitWithDiff)[]> = {\n breaking: [],\n feat: [],\n fix: [],\n perf: [],\n refactor: [],\n docs: [],\n test: [],\n chore: [],\n other: [],\n };\n\n for (const commit of commits) {\n if (commit.breaking) {\n groups.breaking!.push(commit);\n } else if (commit.type && groups[commit.type]) {\n groups[commit.type]!.push(commit);\n } else {\n groups.other!.push(commit);\n }\n }\n\n return groups;\n}\n\nfunction printGroupedCommits(\n grouped: Record<string, (Commit | CommitWithDiff)[]>,\n showDiffs: boolean\n): void {\n const labels: Record<string, string> = {\n breaking: \"🚨 Breaking Changes\",\n feat: \"✨ Features\",\n fix: \"🐛 Bug Fixes\",\n perf: \"⚡ Performance\",\n refactor: \"♻️ Refactoring\",\n docs: \"📚 Documentation\",\n test: \"🧪 Tests\",\n chore: \"🔧 Chores\",\n other: \"📦 Other\",\n };\n\n for (const [type, commits] of Object.entries(grouped)) {\n if (commits.length === 0) continue;\n\n console.log(pc.bold(labels[type] || type));\n for (const commit of commits) {\n const scope = commit.scope ? pc.dim(`(${commit.scope})`) : \"\";\n console.log(` ${pc.dim(commit.shortHash)} ${commit.subject} ${scope}`);\n\n if (showDiffs && \"files\" in commit) {\n const c = commit as CommitWithDiff;\n console.log(\n pc.dim(\n ` ${c.stats.filesChanged} files | +${c.stats.additions} -${c.stats.deletions}`\n )\n );\n for (const file of c.files.slice(0, 5)) {\n // Show first 5 files\n console.log(\n pc.dim(` ${file.file} (+${file.additions} -${file.deletions})`)\n );\n }\n if (c.files.length > 5) {\n console.log(pc.dim(` ... and ${c.files.length - 5} more files`));\n }\n }\n }\n console.log();\n }\n}\n\nasync function generateFromUncommitted(\n options: GenerateOptions,\n config: ShipiConfig,\n maxDiffSize: number,\n apiKey: string | null\n): Promise<void> {\n console.log(pc.bold(\"\\n📝 Generate from Uncommitted Changes\\n\"));\n\n const changes = getUncommittedChanges(maxDiffSize, config);\n\n if (changes.stats.filesChanged === 0) {\n console.log(pc.yellow(\"No uncommitted changes found.\"));\n console.log(pc.dim(\"Stage or modify some files first.\\n\"));\n return;\n }\n\n console.log(pc.dim(`Staged files: ${changes.staged.length}`));\n console.log(pc.dim(`Unstaged files: ${changes.unstaged.length}`));\n console.log(\n pc.dim(\n `Total: ${changes.stats.filesChanged} files | +${changes.stats.additions} -${changes.stats.deletions}`\n )\n );\n console.log();\n\n if (options.dryRun) {\n console.log(pc.bold(\"Changes to analyze:\\n\"));\n printUncommittedChanges(changes);\n console.log(pc.dim(\"\\n(Dry run - no API call made)\\n\"));\n return;\n }\n\n // Gather project context\n const projectContext = getProjectContext();\n\n // Get all changed files for relation analysis\n const allChangedFiles = [...changes.staged, ...changes.unstaged].map((f) => f.file);\n const relatedFiles = getRelatedFiles(allChangedFiles);\n\n // Create a virtual \"commit\" representing uncommitted changes\n const payload = {\n project: {\n name: projectContext.name,\n description: projectContext.description,\n techStack: projectContext.techStack,\n structure: projectContext.structure,\n readme: projectContext.readme,\n },\n relatedFiles:\n relatedFiles.length > 0\n ? relatedFiles.map((r) => ({\n file: r.file,\n importedBy: r.importedBy.slice(0, 5),\n imports: r.imports.slice(0, 10),\n }))\n : undefined,\n commits: [\n {\n hash: \"uncommitted\",\n subject: \"Uncommitted changes\",\n body: \"\",\n author: \"local\",\n type: \"changes\",\n files: [...changes.staged, ...changes.unstaged].map((f) => ({\n file: f.file,\n additions: f.additions,\n deletions: f.deletions,\n diff: f.diff,\n })),\n stats: changes.stats,\n },\n ],\n fromRef: \"HEAD\",\n toRef: \"working-tree\",\n format: options.format || \"md\",\n includeDiffs: true,\n audience: options.audience || \"internal\",\n noHeader: options.header === false,\n language: options.language || config.language,\n model: options.premium ? \"claude\" : \"gpt\",\n };\n\n // Verbose logging\n if (options.verbose) {\n console.log(pc.bold(\"\\n📦 Payload to send:\\n\"));\n console.log(pc.dim(\"─\".repeat(50)));\n console.log(JSON.stringify(payload, null, 2));\n console.log(pc.dim(\"─\".repeat(50)));\n console.log();\n console.log(pc.dim(`Payload size: ${JSON.stringify(payload).length} bytes`));\n console.log();\n }\n\n const modelLabel = options.premium ? \"Claude Sonnet 4 (premium)\" : \"GPT-4o mini\";\n const spinner = ora(`Connecting...`).start();\n\n try {\n const response = await fetch(`${SHIPI_BASE_URL}/api/generate-stream`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-api-key\": apiKey!,\n },\n body: JSON.stringify(payload),\n });\n\n if (!response.ok) {\n const error = await response.text();\n throw new Error(error || `HTTP ${response.status}`);\n }\n\n if (!response.body) {\n throw new Error(\"No response body\");\n }\n\n // Read SSE stream\n const reader = response.body.getReader();\n const decoder = new TextDecoder();\n let buffer = \"\";\n let releaseNotes = \"\";\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n\n buffer += decoder.decode(value, { stream: true });\n const lines = buffer.split(\"\\n\\n\");\n buffer = lines.pop() || \"\";\n\n for (const line of lines) {\n if (!line.startsWith(\"data: \")) continue;\n const jsonStr = line.slice(6);\n\n try {\n const event = JSON.parse(jsonStr);\n\n if (event.event === \"progress\") {\n spinner.text = event.message || \"Processing...\";\n } else if (event.event === \"complete\") {\n releaseNotes = event.releaseNotes || \"\";\n } else if (event.event === \"error\") {\n throw new Error(event.error || \"Generation failed\");\n }\n } catch (parseErr) {\n // Ignore parse errors for incomplete chunks\n }\n }\n }\n\n if (!releaseNotes) {\n throw new Error(\"No release notes received\");\n }\n\n spinner.succeed(pc.green(\"Release notes generated!\"));\n\n console.log(\"\\n\" + pc.bold(\"─\".repeat(50)) + \"\\n\");\n console.log(releaseNotes);\n console.log(\"\\n\" + pc.bold(\"─\".repeat(50)) + \"\\n\");\n\n // Write to file if output specified\n if (options.output) {\n const fs = await import(\"node:fs\");\n fs.writeFileSync(options.output, releaseNotes);\n console.log(pc.green(`✓ Written to ${options.output}\\n`));\n }\n } catch (err) {\n spinner.fail(pc.red(\"Failed to generate release notes\"));\n console.log(pc.dim(err instanceof Error ? err.message : \"Unknown error\"));\n console.log();\n process.exit(1);\n }\n}\n\nfunction printUncommittedChanges(changes: UncommittedChanges): void {\n if (changes.staged.length > 0) {\n console.log(pc.bold(\"📦 Staged Changes\"));\n for (const file of changes.staged) {\n console.log(\n pc.dim(` ${file.file} (+${file.additions} -${file.deletions})`)\n );\n }\n console.log();\n }\n\n if (changes.unstaged.length > 0) {\n console.log(pc.bold(\"📝 Unstaged Changes\"));\n for (const file of changes.unstaged) {\n const status = file.status === \"added\" ? pc.green(\"(new)\") : \"\";\n console.log(\n pc.dim(` ${file.file} (+${file.additions} -${file.deletions}) ${status}`)\n );\n }\n console.log();\n }\n}\n",
55
+ "import { execSync } from \"node:child_process\";\nimport { shouldIncludeFile, type ShipiConfig } from \"./config.ts\";\n\nexport interface Commit {\n hash: string;\n shortHash: string;\n subject: string;\n body: string;\n author: string;\n date: string;\n type?: string;\n scope?: string;\n breaking?: boolean;\n}\n\nexport interface Tag {\n name: string;\n hash: string;\n date: string;\n}\n\nfunction exec(command: string): string {\n try {\n return execSync(command, { encoding: \"utf-8\" }).trim();\n } catch {\n return \"\";\n }\n}\n\n// Escape special characters for shell commands\nfunction escapeShellArg(arg: string): string {\n // Replace single quotes with '\\'' (end quote, escaped quote, start quote)\n return `'${arg.replace(/'/g, \"'\\\\''\")}'`;\n}\n\nexport function isGitRepo(): boolean {\n return exec(\"git rev-parse --is-inside-work-tree\") === \"true\";\n}\n\nexport function getTags(): Tag[] {\n // Use null byte as delimiter to avoid issues with | in tag names\n const output = exec(\n 'git tag --sort=-creatordate --format=\"%(refname:short)%x00%(objectname:short)%x00%(creatordate:iso)\"'\n );\n\n if (!output) return [];\n\n return output\n .split(\"\\n\")\n .filter(Boolean)\n .map((line) => {\n const [name, hash, date] = line.split(\"\\x00\");\n return { name: name!, hash: hash!, date: date! };\n });\n}\n\nexport function getLatestTag(): Tag | null {\n const tags = getTags();\n return tags[0] || null;\n}\n\nexport function getPreviousTag(currentTag: string): Tag | null {\n const tags = getTags();\n const currentIndex = tags.findIndex((t) => t.name === currentTag);\n\n if (currentIndex === -1 || currentIndex >= tags.length - 1) {\n return null;\n }\n\n return tags[currentIndex + 1] || null;\n}\n\n// Get the last tag that's an ancestor of the given ref (branch-aware)\n// Uses git describe which follows commit history, not just chronological order\nexport function getPreviousAncestorTag(ref: string = \"HEAD\"): string | null {\n // First, get the tag at current ref if it exists\n const currentTag = exec(`git describe --tags --exact-match ${ref} 2>/dev/null`);\n\n if (currentTag) {\n // We're on a tag, find the previous ancestor tag\n // Go back one commit and find the last tag from there\n const previousTag = exec(`git describe --tags --abbrev=0 ${ref}^ 2>/dev/null`);\n return previousTag || null;\n }\n\n // Not on a tag, just find the last ancestor tag\n const lastTag = exec(`git describe --tags --abbrev=0 ${ref} 2>/dev/null`);\n return lastTag || null;\n}\n\nexport function getCommitsBetween(from: string, to: string = \"HEAD\"): Commit[] {\n // Use null byte as field delimiter and record separator to avoid issues with | in commit messages\n const format = \"%H%x00%h%x00%s%x00%b%x00%an%x00%aI%x00\";\n const recordSep = \"%x01\"; // Use SOH as record separator\n\n const output = exec(\n `git log ${from}..${to} --pretty=format:\"${format}${recordSep}\"`\n );\n\n if (!output) return [];\n\n return output\n .split(\"\\x01\")\n .filter(Boolean)\n .map((entry) => {\n const [hash, shortHash, subject, body, author, date] = entry\n .trim()\n .split(\"\\x00\");\n const parsed = parseConventionalCommit(subject || \"\");\n\n return {\n hash: hash || \"\",\n shortHash: shortHash || \"\",\n subject: subject || \"\",\n body: body || \"\",\n author: author || \"\",\n date: date || \"\",\n ...parsed,\n };\n });\n}\n\nexport function getCommitsSinceTag(tag: string): Commit[] {\n return getCommitsBetween(tag, \"HEAD\");\n}\n\nexport function getUnreleasedCommits(): Commit[] {\n const latestTag = getLatestTag();\n if (!latestTag) {\n // No tags, get all commits\n return getAllCommits();\n }\n return getCommitsSinceTag(latestTag.name);\n}\n\nexport function getAllCommits(limit: number = 100): Commit[] {\n // Use null byte as field delimiter and SOH as record separator\n const format = \"%H%x00%h%x00%s%x00%b%x00%an%x00%aI%x00\";\n const recordSep = \"%x01\";\n\n const output = exec(\n `git log -n ${limit} --pretty=format:\"${format}${recordSep}\"`\n );\n\n if (!output) return [];\n\n return output\n .split(\"\\x01\")\n .filter(Boolean)\n .map((entry) => {\n const [hash, shortHash, subject, body, author, date] = entry\n .trim()\n .split(\"\\x00\");\n const parsed = parseConventionalCommit(subject || \"\");\n\n return {\n hash: hash || \"\",\n shortHash: shortHash || \"\",\n subject: subject || \"\",\n body: body || \"\",\n author: author || \"\",\n date: date || \"\",\n ...parsed,\n };\n });\n}\n\nfunction parseConventionalCommit(subject: string): {\n type?: string;\n scope?: string;\n breaking?: boolean;\n} {\n // Match: type(scope)!: description or type!: description or type: description\n const match = subject.match(\n /^(\\w+)(?:\\(([^)]+)\\))?(!)?\\s*:\\s*/\n );\n\n if (!match) {\n return {};\n }\n\n return {\n type: match[1],\n scope: match[2] || undefined,\n breaking: match[3] === \"!\" || subject.includes(\"BREAKING CHANGE\"),\n };\n}\n\nexport function parseRange(range: string): { from: string; to: string } {\n // Handle git-style range: v1.0.0..v1.1.0\n if (range.includes(\"..\")) {\n const [from, to] = range.split(\"..\");\n return { from: from!, to: to || \"HEAD\" };\n }\n\n // Single tag/commit - find previous ancestor tag (branch-aware)\n const previousTag = getPreviousAncestorTag(range);\n\n if (previousTag) {\n return { from: previousTag, to: range };\n }\n\n // No previous tag found, this might be the first tag\n // Return range that gets all commits up to this point\n return { from: range, to: \"HEAD\" };\n}\n\nexport function resolveRef(ref: string): string | null {\n const result = exec(`git rev-parse --verify ${ref} 2>/dev/null`);\n return result || null;\n}\n\nexport function getCurrentBranch(): string {\n return exec(\"git branch --show-current\") || \"main\";\n}\n\nexport function getRepoInfo(): { owner: string; repo: string } | null {\n const remoteUrl = exec(\"git config --get remote.origin.url\");\n\n if (!remoteUrl) return null;\n\n // Handle SSH: git@github.com:owner/repo.git\n // Handle HTTPS: https://github.com/owner/repo.git\n const match = remoteUrl.match(/[/:]([\\w-]+)\\/([\\w.-]+?)(\\.git)?$/);\n\n if (!match) return null;\n\n return { owner: match[1]!, repo: match[2]! };\n}\n\nexport interface FileDiff {\n file: string;\n status: \"added\" | \"modified\" | \"deleted\" | \"renamed\";\n additions: number;\n deletions: number;\n diff: string;\n}\n\nexport interface CommitWithDiff extends Commit {\n files: FileDiff[];\n stats: {\n filesChanged: number;\n additions: number;\n deletions: number;\n };\n}\n\nexport function getCommitDiff(\n hash: string,\n maxDiffSize: number = 5000,\n config?: ShipiConfig\n): FileDiff[] {\n // Get list of files changed with stats\n const statsOutput = exec(\n `git show ${hash} --numstat --format=\"\" 2>/dev/null`\n );\n\n if (!statsOutput) return [];\n\n const files: FileDiff[] = [];\n\n const lines = statsOutput.split(\"\\n\").filter(Boolean);\n\n for (const line of lines) {\n const [additions, deletions, file] = line.split(\"\\t\");\n if (!file) continue;\n\n // Filter based on config\n if (config && !shouldIncludeFile(file, config)) {\n continue;\n }\n\n // Determine status\n let status: FileDiff[\"status\"] = \"modified\";\n if (additions === \"-\" && deletions === \"-\") {\n status = \"modified\"; // binary file\n }\n\n // Get the actual diff for this file\n // Use -p for patch output, --no-color for clean output\n // Use -U10 for 10 lines of context (instead of default 3)\n const escapedFile = escapeShellArg(file);\n let diff = exec(\n `git show ${hash} --format=\"\" -p --no-color -U10 -- ${escapedFile} 2>/dev/null`\n );\n\n // If empty, try getting the file content for new files\n if (!diff) {\n diff = exec(`git show ${hash}:${escapedFile} 2>/dev/null`);\n if (diff) {\n diff = `+++ ${file} (new file)\\n` + diff.split(\"\\n\").map(l => `+ ${l}`).join(\"\\n\");\n }\n }\n\n // Truncate if too large\n if (diff && diff.length > maxDiffSize) {\n diff = diff.substring(0, maxDiffSize) + \"\\n... [truncated]\";\n }\n\n files.push({\n file,\n status,\n additions: additions === \"-\" ? 0 : parseInt(additions || \"0\", 10),\n deletions: deletions === \"-\" ? 0 : parseInt(deletions || \"0\", 10),\n diff: diff || \"\",\n });\n }\n\n return files;\n}\n\nexport function getCommitWithDiff(\n hash: string,\n maxDiffSize: number = 5000,\n config?: ShipiConfig\n): CommitWithDiff | null {\n // Use null byte as delimiter to avoid issues with | in commit messages\n const format = \"%H%x00%h%x00%s%x00%b%x00%an%x00%aI\";\n const output = exec(`git show ${hash} --pretty=format:\"${format}\" --no-patch`);\n\n if (!output) return null;\n\n const [fullHash, shortHash, subject, body, author, date] = output.split(\"\\x00\");\n const parsed = parseConventionalCommit(subject || \"\");\n const files = getCommitDiff(hash, maxDiffSize, config);\n\n const stats = {\n filesChanged: files.length,\n additions: files.reduce((sum, f) => sum + f.additions, 0),\n deletions: files.reduce((sum, f) => sum + f.deletions, 0),\n };\n\n return {\n hash: fullHash || \"\",\n shortHash: shortHash || \"\",\n subject: subject || \"\",\n body: body || \"\",\n author: author || \"\",\n date: date || \"\",\n ...parsed,\n files,\n stats,\n };\n}\n\nexport function getCommitsWithDiffs(\n from: string,\n to: string = \"HEAD\",\n maxDiffSize: number = 5000,\n config?: ShipiConfig\n): CommitWithDiff[] {\n // Get commit hashes in range\n const hashesOutput = exec(`git log ${from}..${to} --pretty=format:\"%H\"`);\n\n if (!hashesOutput) return [];\n\n const hashes = hashesOutput.split(\"\\n\").filter(Boolean);\n\n return hashes\n .map((hash) => getCommitWithDiff(hash, maxDiffSize, config))\n .filter((c): c is CommitWithDiff => c !== null);\n}\n\nexport function getAllCommitsWithDiffs(\n limit: number = 100,\n maxDiffSize: number = 5000,\n config?: ShipiConfig\n): CommitWithDiff[] {\n const hashesOutput = exec(`git log -n ${limit} --pretty=format:\"%H\"`);\n\n if (!hashesOutput) return [];\n\n const hashes = hashesOutput.split(\"\\n\").filter(Boolean);\n\n return hashes\n .map((hash) => getCommitWithDiff(hash, maxDiffSize, config))\n .filter((c): c is CommitWithDiff => c !== null);\n}\n\nexport interface UncommittedChanges {\n staged: FileDiff[];\n unstaged: FileDiff[];\n stats: {\n filesChanged: number;\n additions: number;\n deletions: number;\n };\n}\n\nexport function getUncommittedChanges(\n maxDiffSize: number = 5000,\n config?: ShipiConfig\n): UncommittedChanges {\n const staged: FileDiff[] = [];\n const unstaged: FileDiff[] = [];\n\n // Get staged changes (--cached)\n const stagedFiles = exec(\"git diff --cached --numstat 2>/dev/null\");\n if (stagedFiles) {\n for (const line of stagedFiles.split(\"\\n\").filter(Boolean)) {\n const [additions, deletions, file] = line.split(\"\\t\");\n if (!file) continue;\n\n if (config && !shouldIncludeFile(file, config)) continue;\n\n const escapedFile = escapeShellArg(file);\n let diff = exec(`git diff --cached --no-color -U10 -- ${escapedFile} 2>/dev/null`);\n\n if (diff && diff.length > maxDiffSize) {\n diff = diff.substring(0, maxDiffSize) + \"\\n... [truncated]\";\n }\n\n staged.push({\n file,\n status: \"modified\",\n additions: additions === \"-\" ? 0 : parseInt(additions || \"0\", 10),\n deletions: deletions === \"-\" ? 0 : parseInt(deletions || \"0\", 10),\n diff: diff || \"\",\n });\n }\n }\n\n // Get unstaged changes (working directory)\n const unstagedFiles = exec(\"git diff --numstat 2>/dev/null\");\n if (unstagedFiles) {\n for (const line of unstagedFiles.split(\"\\n\").filter(Boolean)) {\n const [additions, deletions, file] = line.split(\"\\t\");\n if (!file) continue;\n\n if (config && !shouldIncludeFile(file, config)) continue;\n\n const escapedFile = escapeShellArg(file);\n let diff = exec(`git diff --no-color -U10 -- ${escapedFile} 2>/dev/null`);\n\n if (diff && diff.length > maxDiffSize) {\n diff = diff.substring(0, maxDiffSize) + \"\\n... [truncated]\";\n }\n\n unstaged.push({\n file,\n status: \"modified\",\n additions: additions === \"-\" ? 0 : parseInt(additions || \"0\", 10),\n deletions: deletions === \"-\" ? 0 : parseInt(deletions || \"0\", 10),\n diff: diff || \"\",\n });\n }\n }\n\n // Get untracked files\n const untrackedFiles = exec(\"git ls-files --others --exclude-standard 2>/dev/null\");\n if (untrackedFiles) {\n for (const file of untrackedFiles.split(\"\\n\").filter(Boolean)) {\n if (config && !shouldIncludeFile(file, config)) continue;\n\n const escapedFile = escapeShellArg(file);\n let content = exec(`cat ${escapedFile} 2>/dev/null`);\n\n if (content) {\n let diff = `+++ ${file} (new file)\\n` + content.split(\"\\n\").map(l => `+ ${l}`).join(\"\\n\");\n if (diff.length > maxDiffSize) {\n diff = diff.substring(0, maxDiffSize) + \"\\n... [truncated]\";\n }\n\n const lines = content.split(\"\\n\").length;\n unstaged.push({\n file,\n status: \"added\",\n additions: lines,\n deletions: 0,\n diff,\n });\n }\n }\n }\n\n const allFiles = [...staged, ...unstaged];\n const stats = {\n filesChanged: allFiles.length,\n additions: allFiles.reduce((sum, f) => sum + f.additions, 0),\n deletions: allFiles.reduce((sum, f) => sum + f.deletions, 0),\n };\n\n return { staged, unstaged, stats };\n}\n",
56
+ "import { existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { execSync } from \"node:child_process\";\n\nexport interface ProjectContext {\n name?: string;\n description?: string;\n readme?: string;\n techStack?: string[];\n structure?: string;\n}\n\nexport interface FileRelation {\n file: string;\n importedBy: string[];\n imports: string[];\n}\n\nexport function getProjectContext(cwd: string = process.cwd()): ProjectContext {\n const context: ProjectContext = {};\n\n // Get package.json info\n const packageJsonPath = join(cwd, \"package.json\");\n if (existsSync(packageJsonPath)) {\n try {\n const pkg = JSON.parse(readFileSync(packageJsonPath, \"utf-8\"));\n context.name = pkg.name;\n context.description = pkg.description;\n\n // Detect tech stack from dependencies\n const deps = {\n ...pkg.dependencies,\n ...pkg.devDependencies,\n };\n const techStack: string[] = [];\n\n if (deps[\"react\"] || deps[\"react-dom\"]) techStack.push(\"React\");\n if (deps[\"vue\"]) techStack.push(\"Vue\");\n if (deps[\"svelte\"]) techStack.push(\"Svelte\");\n if (deps[\"next\"]) techStack.push(\"Next.js\");\n if (deps[\"@tanstack/react-start\"]) techStack.push(\"TanStack Start\");\n if (deps[\"express\"]) techStack.push(\"Express\");\n if (deps[\"fastify\"]) techStack.push(\"Fastify\");\n if (deps[\"typescript\"]) techStack.push(\"TypeScript\");\n if (deps[\"tailwindcss\"]) techStack.push(\"Tailwind CSS\");\n if (deps[\"prisma\"] || deps[\"@prisma/client\"]) techStack.push(\"Prisma\");\n if (deps[\"drizzle-orm\"]) techStack.push(\"Drizzle\");\n if (deps[\"@supabase/supabase-js\"]) techStack.push(\"Supabase\");\n\n context.techStack = techStack;\n } catch {\n // Ignore parse errors\n }\n }\n\n // Get README (truncated)\n const readmePaths = [\"README.md\", \"readme.md\", \"Readme.md\"];\n for (const readmePath of readmePaths) {\n const fullPath = join(cwd, readmePath);\n if (existsSync(fullPath)) {\n try {\n let readme = readFileSync(fullPath, \"utf-8\");\n // Truncate to first 2000 chars (intro section usually)\n if (readme.length > 2000) {\n readme = readme.substring(0, 2000) + \"\\n... [truncated]\";\n }\n context.readme = readme;\n break;\n } catch {\n // Ignore read errors\n }\n }\n }\n\n // Get basic project structure (top-level dirs)\n try {\n const lsOutput = execSync(\"ls -d */ 2>/dev/null || true\", {\n cwd,\n encoding: \"utf-8\",\n }).trim();\n if (lsOutput) {\n context.structure = lsOutput.replace(/\\//g, \"\").split(\"\\n\").join(\", \");\n }\n } catch {\n // Ignore\n }\n\n return context;\n}\n\nexport function getRelatedFiles(\n changedFiles: string[],\n cwd: string = process.cwd()\n): FileRelation[] {\n const relations: FileRelation[] = [];\n\n for (const file of changedFiles) {\n const relation: FileRelation = {\n file,\n importedBy: [],\n imports: [],\n };\n\n // Find files that import this file\n const fileName = file.replace(/\\.(ts|tsx|js|jsx|mjs)$/, \"\");\n const baseName = fileName.split(\"/\").pop() || \"\";\n\n try {\n // Search for imports of this file (simplified grep)\n // Escape special regex characters in baseName\n const escapedBaseName = baseName.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n // Use simpler pattern to avoid shell quoting issues\n const grepResult = execSync(\n `grep -rl -E \"from .${escapedBaseName}\" --include=\"*.ts\" --include=\"*.tsx\" --include=\"*.js\" --include=\"*.jsx\" . 2>/dev/null | head -10 || true`,\n { cwd, encoding: \"utf-8\" }\n ).trim();\n\n if (grepResult) {\n relation.importedBy = grepResult\n .split(\"\\n\")\n .filter(Boolean)\n .map((f) => f.replace(\"./\", \"\"))\n .filter((f) => f !== file); // Exclude self\n }\n } catch {\n // Ignore grep errors\n }\n\n // Get imports from the changed file itself\n const fullPath = join(cwd, file);\n if (existsSync(fullPath)) {\n try {\n const content = readFileSync(fullPath, \"utf-8\");\n const importRegex = /(?:import|from)\\s+['\"]([^'\"]+)['\"]/g;\n let match;\n while ((match = importRegex.exec(content)) !== null) {\n const importPath = match[1];\n if (importPath && !importPath.startsWith(\".\")) {\n // External package\n relation.imports.push(importPath.split(\"/\")[0]!);\n }\n }\n // Dedupe\n relation.imports = [...new Set(relation.imports)];\n } catch {\n // Ignore read errors\n }\n }\n\n if (relation.importedBy.length > 0 || relation.imports.length > 0) {\n relations.push(relation);\n }\n }\n\n return relations;\n}\n",
57
+ "import pc from \"picocolors\";\nimport ora from \"ora\";\nimport * as readline from \"node:readline\";\nimport {\n configExists,\n loadConfig,\n saveConfig,\n DEFAULT_CONFIG,\n CONFIG_FILE_NAME,\n SHIPI_BASE_URL,\n} from \"../utils/config.ts\";\nimport { isGitRepo, getRepoInfo } from \"../utils/git.ts\";\nimport { getAPIKey } from \"../utils/session.ts\";\n\ninterface InitOptions {\n force?: boolean;\n}\n\nfunction prompt(question: string): Promise<string> {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n return new Promise((resolve) => {\n rl.question(question, (answer) => {\n rl.close();\n resolve(answer.trim());\n });\n });\n}\n\nexport async function initCommand(options: InitOptions = {}): Promise<void> {\n console.log(pc.bold(\"\\n⚙️ Initialize Shipi\\n\"));\n\n // Check if we're in a git repo\n if (!isGitRepo()) {\n console.log(pc.red(\"Error: Not a git repository\"));\n console.log(pc.dim(\"Run this command in a git repository.\\n\"));\n process.exit(1);\n }\n\n // Check if config already exists\n const existingConfig = configExists() ? loadConfig() : null;\n\n if (existingConfig && !options.force) {\n // Config exists - check if it has a project ID\n if (existingConfig.projectId) {\n console.log(pc.green(`✓ Already initialized: ${existingConfig.projectId}\\n`));\n console.log(pc.dim(\"Use --force to reinitialize.\\n\"));\n return;\n }\n }\n\n // Check authentication\n const apiKey = getAPIKey();\n if (!apiKey) {\n console.log(pc.yellow(\"Not authenticated. Creating local config only.\"));\n console.log(pc.dim(\"Run 'shipi login' to link this project to your account.\\n\"));\n\n // Just create local config without project ID\n saveConfig({ ...DEFAULT_CONFIG });\n console.log(pc.green(`✓ Created ${CONFIG_FILE_NAME}\\n`));\n printNextSteps();\n return;\n }\n\n // Get repo info for default name\n const repoInfo = getRepoInfo();\n const defaultName = repoInfo?.repo || \"my-project\";\n\n // Ask for project name\n const projectName = await prompt(\n `Project name ${pc.dim(`(${defaultName})`)}: `\n ) || defaultName;\n\n const spinner = ora(\"Creating project...\").start();\n\n try {\n // Create project via API\n const response = await fetch(`${SHIPI_BASE_URL}/api/projects`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-api-key\": apiKey,\n },\n body: JSON.stringify({\n name: projectName,\n repoUrl: repoInfo ? `https://github.com/${repoInfo.owner}/${repoInfo.repo}` : undefined,\n }),\n });\n\n if (!response.ok) {\n const error = await response.text();\n throw new Error(error || `HTTP ${response.status}`);\n }\n\n const data = await response.json();\n\n if (!data.success || !data.project) {\n throw new Error(data.error || \"Failed to create project\");\n }\n\n spinner.succeed(pc.green(`Project created: ${data.project.name} (${data.project.id})`));\n\n // Save config with project ID\n const config = {\n ...DEFAULT_CONFIG,\n ...existingConfig,\n projectId: data.project.id,\n };\n saveConfig(config);\n\n console.log(pc.green(`\\n✓ Created ${CONFIG_FILE_NAME}\\n`));\n\n printNextSteps();\n } catch (err) {\n spinner.fail(pc.red(\"Failed to create project\"));\n console.log(pc.dim(err instanceof Error ? err.message : \"Unknown error\"));\n console.log();\n\n // Still create local config\n console.log(pc.dim(\"Creating local config without project link...\"));\n saveConfig({ ...DEFAULT_CONFIG, ...existingConfig });\n console.log(pc.green(`✓ Created ${CONFIG_FILE_NAME}\\n`));\n printNextSteps();\n }\n}\n\nfunction printNextSteps(): void {\n console.log(pc.bold(\"Next steps:\"));\n console.log(` 1. Edit ${pc.cyan(CONFIG_FILE_NAME)} to customize paths`);\n console.log(` 2. Run ${pc.cyan(\"shipi generate --dry-run\")} to preview`);\n console.log(` 3. Run ${pc.cyan(\"shipi generate --include-diffs\")} to generate`);\n console.log();\n}\n",
58
+ "#!/usr/bin/env node\nimport { program } from \"commander\";\nimport { loginCommand } from \"./commands/login.ts\";\nimport { logoutCommand } from \"./commands/logout.ts\";\nimport { whoamiCommand } from \"./commands/whoami.ts\";\nimport { usageCommand } from \"./commands/usage.ts\";\nimport { generateCommand } from \"./commands/generate.ts\";\nimport { initCommand } from \"./commands/init.ts\";\n\nprogram\n .name(\"shipi\")\n .description(\"Shipi CLI - AI-powered release notes generator\")\n .version(\"0.0.1\");\n\nprogram\n .command(\"init\")\n .description(\"Initialize shipi.json configuration\")\n .option(\"--force\", \"Overwrite existing config\")\n .action(initCommand);\n\nprogram\n .command(\"login\")\n .description(\"Authenticate with Shipi\")\n .action(loginCommand);\n\nprogram\n .command(\"logout\")\n .description(\"Log out from Shipi\")\n .action(logoutCommand);\n\nprogram\n .command(\"whoami\")\n .description(\"Show current authenticated user\")\n .action(whoamiCommand);\n\nprogram\n .command(\"usage\")\n .description(\"Show current usage and plan limits\")\n .action(usageCommand);\n\nprogram\n .command(\"generate [range]\")\n .description(\"Generate release notes from git history\")\n .option(\"--from <ref>\", \"Start from specific commit or tag\")\n .option(\"-o, --output <file>\", \"Write output to file\")\n .option(\"-f, --format <format>\", \"Output format (md or json)\", \"md\")\n .option(\"-a, --audience <type>\", \"Target audience: internal (technical), customer (user-friendly), changelog (brief)\", \"internal\")\n .option(\"--dry-run\", \"Preview commits without generating\")\n .option(\"--no-diffs\", \"Disable code diffs (diffs included by default)\")\n .option(\"--no-header\", \"Omit the changelog header from output\")\n .option(\"-l, --language <lang>\", \"Language for release notes (e.g., en, nl, de)\")\n .option(\"-u, --uncommitted\", \"Generate from uncommitted changes (staged + unstaged)\")\n .option(\"--max-diff-size <bytes>\", \"Max diff size per file in bytes\", \"5000\")\n .option(\"-v, --verbose\", \"Log the full payload before sending to AI\")\n .option(\"--premium\", \"Use Claude for higher quality output (costs more)\")\n .action(generateCommand);\n\nprogram.parse();\n"
59
+ ],
60
+ "mappings": ";udAGA,MAAM,WAAuB,KAAM,CAOjC,WAAW,CAAC,EAAU,EAAM,EAAS,CACnC,MAAM,CAAO,EAEb,MAAM,kBAAkB,KAAM,KAAK,WAAW,EAC9C,KAAK,KAAO,KAAK,YAAY,KAC7B,KAAK,KAAO,EACZ,KAAK,SAAW,EAChB,KAAK,YAAc,OAEvB,CAK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