@docyrus/docyrus 0.0.16 → 0.0.18

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.
Files changed (43) hide show
  1. package/README.md +33 -2
  2. package/agent-loader.js +2640 -0
  3. package/agent-loader.js.map +7 -0
  4. package/main.js +833 -505
  5. package/main.js.map +4 -4
  6. package/package.json +5 -1
  7. package/resources/pi-agent/prompts/agent-system.md +25 -0
  8. package/resources/pi-agent/prompts/coder-append-system.md +19 -0
  9. package/resources/pi-agent/skills/docyrus-ai/SKILL.md +28 -0
  10. package/resources/pi-agent/skills/docyrus-api-dev/SKILL.md +161 -0
  11. package/resources/pi-agent/skills/docyrus-api-dev/references/api-client.md +349 -0
  12. package/resources/pi-agent/skills/docyrus-api-dev/references/authentication.md +238 -0
  13. package/resources/pi-agent/skills/docyrus-api-dev/references/data-source-query-guide.md +2059 -0
  14. package/resources/pi-agent/skills/docyrus-api-dev/references/formula-design-guide-llm.md +320 -0
  15. package/resources/pi-agent/skills/docyrus-api-dev/references/query-and-formulas.md +592 -0
  16. package/resources/pi-agent/skills/docyrus-api-doctor/SKILL.md +70 -0
  17. package/resources/pi-agent/skills/docyrus-api-doctor/references/checklist-details.md +588 -0
  18. package/resources/pi-agent/skills/docyrus-app-dev/SKILL.md +159 -0
  19. package/resources/pi-agent/skills/docyrus-app-dev/references/api-client-and-auth.md +275 -0
  20. package/resources/pi-agent/skills/docyrus-app-dev/references/collections-and-patterns.md +352 -0
  21. package/resources/pi-agent/skills/docyrus-app-dev/references/data-source-query-guide.md +2059 -0
  22. package/resources/pi-agent/skills/docyrus-app-dev/references/formula-design-guide-llm.md +320 -0
  23. package/resources/pi-agent/skills/docyrus-app-dev/references/query-guide.md +525 -0
  24. package/resources/pi-agent/skills/docyrus-app-ui-design/SKILL.md +466 -0
  25. package/resources/pi-agent/skills/docyrus-app-ui-design/references/component-selection-guide.md +602 -0
  26. package/resources/pi-agent/skills/docyrus-app-ui-design/references/icon-usage-guide.md +463 -0
  27. package/resources/pi-agent/skills/docyrus-app-ui-design/references/preferred-components-catalog.md +242 -0
  28. package/resources/pi-agent/skills/docyrus-apps/SKILL.md +54 -0
  29. package/resources/pi-agent/skills/docyrus-architect/SKILL.md +174 -0
  30. package/resources/pi-agent/skills/docyrus-architect/references/custom-query-guide.md +410 -0
  31. package/resources/pi-agent/skills/docyrus-architect/references/data-source-query-guide.md +2059 -0
  32. package/resources/pi-agent/skills/docyrus-architect/references/formula-design-guide-llm.md +320 -0
  33. package/resources/pi-agent/skills/docyrus-architect/references/formula-reference.md +145 -0
  34. package/resources/pi-agent/skills/docyrus-auth/SKILL.md +100 -0
  35. package/resources/pi-agent/skills/docyrus-cli-app/SKILL.md +279 -0
  36. package/resources/pi-agent/skills/docyrus-cli-app/references/cli-manifest.md +532 -0
  37. package/resources/pi-agent/skills/docyrus-cli-app/references/list-query-examples.md +248 -0
  38. package/resources/pi-agent/skills/docyrus-curl/SKILL.md +32 -0
  39. package/resources/pi-agent/skills/docyrus-discover/SKILL.md +63 -0
  40. package/resources/pi-agent/skills/docyrus-ds/SKILL.md +95 -0
  41. package/resources/pi-agent/skills/docyrus-env/SKILL.md +21 -0
  42. package/resources/pi-agent/skills/docyrus-studio/SKILL.md +369 -0
  43. package/resources/pi-agent/skills/docyrus-tui/SKILL.md +15 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js", "../../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/node_modules/.pnpm/ansi-regex@6.1.0/node_modules/ansi-regex/index.js", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/node_modules/.pnpm/eastasianwidth@0.2.0/node_modules/eastasianwidth/eastasianwidth.js", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/node_modules/.pnpm/emoji-regex@9.2.2/node_modules/emoji-regex/index.js", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/node_modules/.pnpm/string-width@5.1.2/node_modules/string-width/index.js", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/node_modules/.pnpm/ansi-styles@6.2.1/node_modules/ansi-styles/index.js", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/node_modules/.pnpm/wrap-ansi@8.1.0/node_modules/wrap-ansi/index.js", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/src/utils/settings.ts", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/src/utils/string.ts", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/src/utils/index.ts", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/src/prompts/prompt.ts", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/src/prompts/confirm.ts", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/src/prompts/group-multiselect.ts", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/src/prompts/multi-select.ts", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/src/prompts/password.ts", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/src/prompts/select.ts", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/src/prompts/select-key.ts", "../../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/src/prompts/text.ts", "../../../node_modules/.pnpm/@clack+prompts@0.11.0/node_modules/node_modules/.pnpm/is-unicode-supported@1.3.0/node_modules/is-unicode-supported/index.js", "../../../node_modules/.pnpm/@clack+prompts@0.11.0/node_modules/@clack/prompts/src/index.ts", "../../../apps/api-cli/src/agent/loader.ts", "../../../apps/api-cli/src/agent/envStore.ts", "../../../apps/api-cli/src/agent/modelsConfig.ts", "../../../apps/api-cli/src/agent/authFlows.ts", "../../../apps/api-cli/src/agent/logo.ts", "../../../apps/api-cli/src/agent/providerCatalog.ts", "../../../apps/api-cli/src/agent/interactiveAuth.ts", "../../../apps/api-cli/src/agent/onboarding.ts"],
4
+ "sourcesContent": ["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", "'use strict';\n\nconst ESC = '\\x1B';\nconst CSI = `${ESC}[`;\nconst beep = '\\u0007';\n\nconst cursor = {\n to(x, y) {\n if (!y) return `${CSI}${x + 1}G`;\n return `${CSI}${y + 1};${x + 1}H`;\n },\n move(x, y) {\n let ret = '';\n\n if (x < 0) ret += `${CSI}${-x}D`;\n else if (x > 0) ret += `${CSI}${x}C`;\n\n if (y < 0) ret += `${CSI}${-y}A`;\n else if (y > 0) ret += `${CSI}${y}B`;\n\n return ret;\n },\n up: (count = 1) => `${CSI}${count}A`,\n down: (count = 1) => `${CSI}${count}B`,\n forward: (count = 1) => `${CSI}${count}C`,\n backward: (count = 1) => `${CSI}${count}D`,\n nextLine: (count = 1) => `${CSI}E`.repeat(count),\n prevLine: (count = 1) => `${CSI}F`.repeat(count),\n left: `${CSI}G`,\n hide: `${CSI}?25l`,\n show: `${CSI}?25h`,\n save: `${ESC}7`,\n restore: `${ESC}8`\n}\n\nconst scroll = {\n up: (count = 1) => `${CSI}S`.repeat(count),\n down: (count = 1) => `${CSI}T`.repeat(count)\n}\n\nconst erase = {\n screen: `${CSI}2J`,\n up: (count = 1) => `${CSI}1J`.repeat(count),\n down: (count = 1) => `${CSI}J`.repeat(count),\n line: `${CSI}2K`,\n lineEnd: `${CSI}K`,\n lineStart: `${CSI}1K`,\n lines(count) {\n let clear = '';\n for (let i = 0; i < count; i++)\n clear += this.line + (i < count - 1 ? cursor.up() : '');\n if (count)\n clear += cursor.left;\n return clear;\n }\n}\n\nmodule.exports = { cursor, scroll, erase, beep };\n", "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\tconst pattern = [\n\t\t`[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?${ST})`,\n\t\t'(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]))',\n\t].join('|');\n\n\treturn new RegExp(pattern, onlyFirst ? undefined : 'g');\n}\n", "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", "var eaw = {};\n\nif ('undefined' == typeof module) {\n window.eastasianwidth = eaw;\n} else {\n module.exports = eaw;\n}\n\neaw.eastAsianWidth = function(character) {\n var x = character.charCodeAt(0);\n var y = (character.length == 2) ? character.charCodeAt(1) : 0;\n var codePoint = x;\n if ((0xD800 <= x && x <= 0xDBFF) && (0xDC00 <= y && y <= 0xDFFF)) {\n x &= 0x3FF;\n y &= 0x3FF;\n codePoint = (x << 10) | y;\n codePoint += 0x10000;\n }\n\n if ((0x3000 == codePoint) ||\n (0xFF01 <= codePoint && codePoint <= 0xFF60) ||\n (0xFFE0 <= codePoint && codePoint <= 0xFFE6)) {\n return 'F';\n }\n if ((0x20A9 == codePoint) ||\n (0xFF61 <= codePoint && codePoint <= 0xFFBE) ||\n (0xFFC2 <= codePoint && codePoint <= 0xFFC7) ||\n (0xFFCA <= codePoint && codePoint <= 0xFFCF) ||\n (0xFFD2 <= codePoint && codePoint <= 0xFFD7) ||\n (0xFFDA <= codePoint && codePoint <= 0xFFDC) ||\n (0xFFE8 <= codePoint && codePoint <= 0xFFEE)) {\n return 'H';\n }\n if ((0x1100 <= codePoint && codePoint <= 0x115F) ||\n (0x11A3 <= codePoint && codePoint <= 0x11A7) ||\n (0x11FA <= codePoint && codePoint <= 0x11FF) ||\n (0x2329 <= codePoint && codePoint <= 0x232A) ||\n (0x2E80 <= codePoint && codePoint <= 0x2E99) ||\n (0x2E9B <= codePoint && codePoint <= 0x2EF3) ||\n (0x2F00 <= codePoint && codePoint <= 0x2FD5) ||\n (0x2FF0 <= codePoint && codePoint <= 0x2FFB) ||\n (0x3001 <= codePoint && codePoint <= 0x303E) ||\n (0x3041 <= codePoint && codePoint <= 0x3096) ||\n (0x3099 <= codePoint && codePoint <= 0x30FF) ||\n (0x3105 <= codePoint && codePoint <= 0x312D) ||\n (0x3131 <= codePoint && codePoint <= 0x318E) ||\n (0x3190 <= codePoint && codePoint <= 0x31BA) ||\n (0x31C0 <= codePoint && codePoint <= 0x31E3) ||\n (0x31F0 <= codePoint && codePoint <= 0x321E) ||\n (0x3220 <= codePoint && codePoint <= 0x3247) ||\n (0x3250 <= codePoint && codePoint <= 0x32FE) ||\n (0x3300 <= codePoint && codePoint <= 0x4DBF) ||\n (0x4E00 <= codePoint && codePoint <= 0xA48C) ||\n (0xA490 <= codePoint && codePoint <= 0xA4C6) ||\n (0xA960 <= codePoint && codePoint <= 0xA97C) ||\n (0xAC00 <= codePoint && codePoint <= 0xD7A3) ||\n (0xD7B0 <= codePoint && codePoint <= 0xD7C6) ||\n (0xD7CB <= codePoint && codePoint <= 0xD7FB) ||\n (0xF900 <= codePoint && codePoint <= 0xFAFF) ||\n (0xFE10 <= codePoint && codePoint <= 0xFE19) ||\n (0xFE30 <= codePoint && codePoint <= 0xFE52) ||\n (0xFE54 <= codePoint && codePoint <= 0xFE66) ||\n (0xFE68 <= codePoint && codePoint <= 0xFE6B) ||\n (0x1B000 <= codePoint && codePoint <= 0x1B001) ||\n (0x1F200 <= codePoint && codePoint <= 0x1F202) ||\n (0x1F210 <= codePoint && codePoint <= 0x1F23A) ||\n (0x1F240 <= codePoint && codePoint <= 0x1F248) ||\n (0x1F250 <= codePoint && codePoint <= 0x1F251) ||\n (0x20000 <= codePoint && codePoint <= 0x2F73F) ||\n (0x2B740 <= codePoint && codePoint <= 0x2FFFD) ||\n (0x30000 <= codePoint && codePoint <= 0x3FFFD)) {\n return 'W';\n }\n if ((0x0020 <= codePoint && codePoint <= 0x007E) ||\n (0x00A2 <= codePoint && codePoint <= 0x00A3) ||\n (0x00A5 <= codePoint && codePoint <= 0x00A6) ||\n (0x00AC == codePoint) ||\n (0x00AF == codePoint) ||\n (0x27E6 <= codePoint && codePoint <= 0x27ED) ||\n (0x2985 <= codePoint && codePoint <= 0x2986)) {\n return 'Na';\n }\n if ((0x00A1 == codePoint) ||\n (0x00A4 == codePoint) ||\n (0x00A7 <= codePoint && codePoint <= 0x00A8) ||\n (0x00AA == codePoint) ||\n (0x00AD <= codePoint && codePoint <= 0x00AE) ||\n (0x00B0 <= codePoint && codePoint <= 0x00B4) ||\n (0x00B6 <= codePoint && codePoint <= 0x00BA) ||\n (0x00BC <= codePoint && codePoint <= 0x00BF) ||\n (0x00C6 == codePoint) ||\n (0x00D0 == codePoint) ||\n (0x00D7 <= codePoint && codePoint <= 0x00D8) ||\n (0x00DE <= codePoint && codePoint <= 0x00E1) ||\n (0x00E6 == codePoint) ||\n (0x00E8 <= codePoint && codePoint <= 0x00EA) ||\n (0x00EC <= codePoint && codePoint <= 0x00ED) ||\n (0x00F0 == codePoint) ||\n (0x00F2 <= codePoint && codePoint <= 0x00F3) ||\n (0x00F7 <= codePoint && codePoint <= 0x00FA) ||\n (0x00FC == codePoint) ||\n (0x00FE == codePoint) ||\n (0x0101 == codePoint) ||\n (0x0111 == codePoint) ||\n (0x0113 == codePoint) ||\n (0x011B == codePoint) ||\n (0x0126 <= codePoint && codePoint <= 0x0127) ||\n (0x012B == codePoint) ||\n (0x0131 <= codePoint && codePoint <= 0x0133) ||\n (0x0138 == codePoint) ||\n (0x013F <= codePoint && codePoint <= 0x0142) ||\n (0x0144 == codePoint) ||\n (0x0148 <= codePoint && codePoint <= 0x014B) ||\n (0x014D == codePoint) ||\n (0x0152 <= codePoint && codePoint <= 0x0153) ||\n (0x0166 <= codePoint && codePoint <= 0x0167) ||\n (0x016B == codePoint) ||\n (0x01CE == codePoint) ||\n (0x01D0 == codePoint) ||\n (0x01D2 == codePoint) ||\n (0x01D4 == codePoint) ||\n (0x01D6 == codePoint) ||\n (0x01D8 == codePoint) ||\n (0x01DA == codePoint) ||\n (0x01DC == codePoint) ||\n (0x0251 == codePoint) ||\n (0x0261 == codePoint) ||\n (0x02C4 == codePoint) ||\n (0x02C7 == codePoint) ||\n (0x02C9 <= codePoint && codePoint <= 0x02CB) ||\n (0x02CD == codePoint) ||\n (0x02D0 == codePoint) ||\n (0x02D8 <= codePoint && codePoint <= 0x02DB) ||\n (0x02DD == codePoint) ||\n (0x02DF == codePoint) ||\n (0x0300 <= codePoint && codePoint <= 0x036F) ||\n (0x0391 <= codePoint && codePoint <= 0x03A1) ||\n (0x03A3 <= codePoint && codePoint <= 0x03A9) ||\n (0x03B1 <= codePoint && codePoint <= 0x03C1) ||\n (0x03C3 <= codePoint && codePoint <= 0x03C9) ||\n (0x0401 == codePoint) ||\n (0x0410 <= codePoint && codePoint <= 0x044F) ||\n (0x0451 == codePoint) ||\n (0x2010 == codePoint) ||\n (0x2013 <= codePoint && codePoint <= 0x2016) ||\n (0x2018 <= codePoint && codePoint <= 0x2019) ||\n (0x201C <= codePoint && codePoint <= 0x201D) ||\n (0x2020 <= codePoint && codePoint <= 0x2022) ||\n (0x2024 <= codePoint && codePoint <= 0x2027) ||\n (0x2030 == codePoint) ||\n (0x2032 <= codePoint && codePoint <= 0x2033) ||\n (0x2035 == codePoint) ||\n (0x203B == codePoint) ||\n (0x203E == codePoint) ||\n (0x2074 == codePoint) ||\n (0x207F == codePoint) ||\n (0x2081 <= codePoint && codePoint <= 0x2084) ||\n (0x20AC == codePoint) ||\n (0x2103 == codePoint) ||\n (0x2105 == codePoint) ||\n (0x2109 == codePoint) ||\n (0x2113 == codePoint) ||\n (0x2116 == codePoint) ||\n (0x2121 <= codePoint && codePoint <= 0x2122) ||\n (0x2126 == codePoint) ||\n (0x212B == codePoint) ||\n (0x2153 <= codePoint && codePoint <= 0x2154) ||\n (0x215B <= codePoint && codePoint <= 0x215E) ||\n (0x2160 <= codePoint && codePoint <= 0x216B) ||\n (0x2170 <= codePoint && codePoint <= 0x2179) ||\n (0x2189 == codePoint) ||\n (0x2190 <= codePoint && codePoint <= 0x2199) ||\n (0x21B8 <= codePoint && codePoint <= 0x21B9) ||\n (0x21D2 == codePoint) ||\n (0x21D4 == codePoint) ||\n (0x21E7 == codePoint) ||\n (0x2200 == codePoint) ||\n (0x2202 <= codePoint && codePoint <= 0x2203) ||\n (0x2207 <= codePoint && codePoint <= 0x2208) ||\n (0x220B == codePoint) ||\n (0x220F == codePoint) ||\n (0x2211 == codePoint) ||\n (0x2215 == codePoint) ||\n (0x221A == codePoint) ||\n (0x221D <= codePoint && codePoint <= 0x2220) ||\n (0x2223 == codePoint) ||\n (0x2225 == codePoint) ||\n (0x2227 <= codePoint && codePoint <= 0x222C) ||\n (0x222E == codePoint) ||\n (0x2234 <= codePoint && codePoint <= 0x2237) ||\n (0x223C <= codePoint && codePoint <= 0x223D) ||\n (0x2248 == codePoint) ||\n (0x224C == codePoint) ||\n (0x2252 == codePoint) ||\n (0x2260 <= codePoint && codePoint <= 0x2261) ||\n (0x2264 <= codePoint && codePoint <= 0x2267) ||\n (0x226A <= codePoint && codePoint <= 0x226B) ||\n (0x226E <= codePoint && codePoint <= 0x226F) ||\n (0x2282 <= codePoint && codePoint <= 0x2283) ||\n (0x2286 <= codePoint && codePoint <= 0x2287) ||\n (0x2295 == codePoint) ||\n (0x2299 == codePoint) ||\n (0x22A5 == codePoint) ||\n (0x22BF == codePoint) ||\n (0x2312 == codePoint) ||\n (0x2460 <= codePoint && codePoint <= 0x24E9) ||\n (0x24EB <= codePoint && codePoint <= 0x254B) ||\n (0x2550 <= codePoint && codePoint <= 0x2573) ||\n (0x2580 <= codePoint && codePoint <= 0x258F) ||\n (0x2592 <= codePoint && codePoint <= 0x2595) ||\n (0x25A0 <= codePoint && codePoint <= 0x25A1) ||\n (0x25A3 <= codePoint && codePoint <= 0x25A9) ||\n (0x25B2 <= codePoint && codePoint <= 0x25B3) ||\n (0x25B6 <= codePoint && codePoint <= 0x25B7) ||\n (0x25BC <= codePoint && codePoint <= 0x25BD) ||\n (0x25C0 <= codePoint && codePoint <= 0x25C1) ||\n (0x25C6 <= codePoint && codePoint <= 0x25C8) ||\n (0x25CB == codePoint) ||\n (0x25CE <= codePoint && codePoint <= 0x25D1) ||\n (0x25E2 <= codePoint && codePoint <= 0x25E5) ||\n (0x25EF == codePoint) ||\n (0x2605 <= codePoint && codePoint <= 0x2606) ||\n (0x2609 == codePoint) ||\n (0x260E <= codePoint && codePoint <= 0x260F) ||\n (0x2614 <= codePoint && codePoint <= 0x2615) ||\n (0x261C == codePoint) ||\n (0x261E == codePoint) ||\n (0x2640 == codePoint) ||\n (0x2642 == codePoint) ||\n (0x2660 <= codePoint && codePoint <= 0x2661) ||\n (0x2663 <= codePoint && codePoint <= 0x2665) ||\n (0x2667 <= codePoint && codePoint <= 0x266A) ||\n (0x266C <= codePoint && codePoint <= 0x266D) ||\n (0x266F == codePoint) ||\n (0x269E <= codePoint && codePoint <= 0x269F) ||\n (0x26BE <= codePoint && codePoint <= 0x26BF) ||\n (0x26C4 <= codePoint && codePoint <= 0x26CD) ||\n (0x26CF <= codePoint && codePoint <= 0x26E1) ||\n (0x26E3 == codePoint) ||\n (0x26E8 <= codePoint && codePoint <= 0x26FF) ||\n (0x273D == codePoint) ||\n (0x2757 == codePoint) ||\n (0x2776 <= codePoint && codePoint <= 0x277F) ||\n (0x2B55 <= codePoint && codePoint <= 0x2B59) ||\n (0x3248 <= codePoint && codePoint <= 0x324F) ||\n (0xE000 <= codePoint && codePoint <= 0xF8FF) ||\n (0xFE00 <= codePoint && codePoint <= 0xFE0F) ||\n (0xFFFD == codePoint) ||\n (0x1F100 <= codePoint && codePoint <= 0x1F10A) ||\n (0x1F110 <= codePoint && codePoint <= 0x1F12D) ||\n (0x1F130 <= codePoint && codePoint <= 0x1F169) ||\n (0x1F170 <= codePoint && codePoint <= 0x1F19A) ||\n (0xE0100 <= codePoint && codePoint <= 0xE01EF) ||\n (0xF0000 <= codePoint && codePoint <= 0xFFFFD) ||\n (0x100000 <= codePoint && codePoint <= 0x10FFFD)) {\n return 'A';\n }\n\n return 'N';\n};\n\neaw.characterLength = function(character) {\n var code = this.eastAsianWidth(character);\n if (code == 'F' || code == 'W' || code == 'A') {\n return 2;\n } else {\n return 1;\n }\n};\n\n// Split a string considering surrogate-pairs.\nfunction stringToArray(string) {\n return string.match(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[^\\uD800-\\uDFFF]/g) || [];\n}\n\neaw.length = function(string) {\n var characters = stringToArray(string);\n var len = 0;\n for (var i = 0; i < characters.length; i++) {\n len = len + this.characterLength(characters[i]);\n }\n return len;\n};\n\neaw.slice = function(text, start, end) {\n textLen = eaw.length(text)\n start = start ? start : 0;\n end = end ? end : 1;\n if (start < 0) {\n start = textLen + start;\n }\n if (end < 0) {\n end = textLen + end;\n }\n var result = '';\n var eawLen = 0;\n var chars = stringToArray(text);\n for (var i = 0; i < chars.length; i++) {\n var char = chars[i];\n var charLen = eaw.length(char);\n if (eawLen >= start - (charLen == 2 ? 1 : 0)) {\n if (eawLen + charLen <= end) {\n result += char;\n } else {\n break;\n }\n }\n eawLen += charLen;\n }\n return result;\n};\n", "\"use strict\";\n\nmodule.exports = function () {\n // https://mths.be/emoji\n return /\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62(?:\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73|\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74|\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67)\\uDB40\\uDC7F|(?:\\uD83E\\uDDD1\\uD83C\\uDFFF\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFE])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFE\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB-\\uDFFD\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFD\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFC\\uDFFE\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFC\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFB\\uDFFD-\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFB\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69]))(?:\\uD83C[\\uDFFC-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C\\uDFFB(?:\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFC-\\uDFFF])|[\\u2695\\u2696\\u2708]\\uFE0F|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))?|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFF]))|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83D\\uDC68|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\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\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])\\uFE0F|\\u200D(?:(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D[\\uDC66\\uDC67])|\\uD83C\\uDFFF|\\uD83C\\uDFFE|\\uD83C\\uDFFD|\\uD83C\\uDFFC)?|(?:\\uD83D\\uDC69(?:\\uD83C\\uDFFB\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|(?:\\uD83C[\\uDFFC-\\uDFFF])\\u200D\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69]))|\\uD83E\\uDDD1(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1)(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC69(?:\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uD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uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFC\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFB\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF7C\\uDF84\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D\\uDC41\\uFE0F\\u200D\\uD83D\\uDDE8|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDC69(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|\\uD83D\\uDE36\\u200D\\uD83C\\uDF2B|\\uD83C\\uDFF3\\uFE0F\\u200D\\u26A7|\\uD83D\\uDC3B\\u200D\\u2744|(?:(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])(?:\\uD83C[\\uDFFB-\\uDFFF])|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF])\\u200D[\\u2640\\u2642]|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|\\uD83C\\uDFF4\\u200D\\u2620|(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD])\\u200D[\\u2640\\u2642]|[\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u2328\\u23CF\\u23ED-\\u23EF\\u23F1\\u23F2\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB\\u25FC\\u2600-\\u2604\\u260E\\u2611\\u2618\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u2692\\u2694-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A7\\u26B0\\u26B1\\u26C8\\u26CF\\u26D1\\u26D3\\u26E9\\u26F0\\u26F1\\u26F4\\u26F7\\u26F8\\u2702\\u2708\\u2709\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2733\\u2734\\u2744\\u2747\\u2763\\u27A1\\u2934\\u2935\\u2B05-\\u2B07\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDE02\\uDE37\\uDF21\\uDF24-\\uDF2C\\uDF36\\uDF7D\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E\\uDF9F\\uDFCD\\uDFCE\\uDFD4-\\uDFDF\\uDFF5\\uDFF7]|\\uD83D[\\uDC3F\\uDCFD\\uDD49\\uDD4A\\uDD6F\\uDD70\\uDD73\\uDD76-\\uDD79\\uDD87\\uDD8A-\\uDD8D\\uDDA5\\uDDA8\\uDDB1\\uDDB2\\uDDBC\\uDDC2-\\uDDC4\\uDDD1-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DEC0\\uDECC]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1C\\uDD1E\\uDD1F\\uDD30-\\uDD34\\uDD36\\uDD77\\uDDB5\\uDDB6\\uDDBB\\uDDD2\\uDDD3\\uDDD5])(?:\\uD83C[\\uDFFB-\\uDFFF])|(?:[\\u261D\\u270C\\u270D]|\\uD83D[\\uDD74\\uDD90])(?:\\uFE0F|\\uD83C[\\uDFFB-\\uDFFF])|[\\u270A\\u270B]|\\uD83C[\\uDF85\\uDFC2\\uDFC7]|\\uD83D[\\uDC08\\uDC15\\uDC3B\\uDC42\\uDC43\\uDC46-\\uDC50\\uDC66\\uDC67\\uDC6B-\\uDC6D\\uDC72\\uDC74-\\uDC76\\uDC78\\uDC7C\\uDC83\\uDC85\\uDC8F\\uDC91\\uDCAA\\uDD7A\\uDD95\\uDD96\\uDE2E\\uDE35\\uDE36\\uDE4C\\uDE4F\\uDEC0\\uDECC]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1C\\uDD1E\\uDD1F\\uDD30-\\uDD34\\uDD36\\uDD77\\uDDB5\\uDDB6\\uDDBB\\uDDD2\\uDDD3\\uDDD5]|\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC70\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD35\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD4\\uDDD6-\\uDDDD]|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF]|[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u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-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6]|(?:[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u270A\\u270B\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF93\\uDFA0-\\uDFCA\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF4\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC3E\\uDC40\\uDC42-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDD7A\\uDD95\\uDD96\\uDDA4\\uDDFB-\\uDE4F\\uDE80-\\uDEC5\\uDECC\\uDED0-\\uDED2\\uDED5-\\uDED7\\uDEEB\\uDEEC\\uDEF4-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0C-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])|(?:[#\\*0-9\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23E9-\\u23F3\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB-\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u261D\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A1\\u26A7\\u26AA\\u26AB\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C5\\u26C8\\u26CE\\u26CF\\u26D1\\u26D3\\u26D4\\u26E9\\u26EA\\u26F0-\\u26F5\\u26F7-\\u26FA\\u26FD\\u2702\\u2705\\u2708-\\u270D\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2728\\u2733\\u2734\\u2744\\u2747\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2763\\u2764\\u2795-\\u2797\\u27A1\\u27B0\\u27BF\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B50\\u2B55\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDC04\\uDCCF\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE02\\uDE1A\\uDE2F\\uDE32-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF21\\uDF24-\\uDF93\\uDF96\\uDF97\\uDF99-\\uDF9B\\uDF9E-\\uDFF0\\uDFF3-\\uDFF5\\uDFF7-\\uDFFF]|\\uD83D[\\uDC00-\\uDCFD\\uDCFF-\\uDD3D\\uDD49-\\uDD4E\\uDD50-\\uDD67\\uDD6F\\uDD70\\uDD73-\\uDD7A\\uDD87\\uDD8A-\\uDD8D\\uDD90\\uDD95\\uDD96\\uDDA4\\uDDA5\\uDDA8\\uDDB1\\uDDB2\\uDDBC\\uDDC2-\\uDDC4\\uDDD1-\\uDDD3\\uDDDC-\\uDDDE\\uDDE1\\uDDE3\\uDDE8\\uDDEF\\uDDF3\\uDDFA-\\uDE4F\\uDE80-\\uDEC5\\uDECB-\\uDED2\\uDED5-\\uDED7\\uDEE0-\\uDEE5\\uDEE9\\uDEEB\\uDEEC\\uDEF0\\uDEF3-\\uDEFC\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0C-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD78\\uDD7A-\\uDDCB\\uDDCD-\\uDDFF\\uDE70-\\uDE74\\uDE78-\\uDE7A\\uDE80-\\uDE86\\uDE90-\\uDEA8\\uDEB0-\\uDEB6\\uDEC0-\\uDEC2\\uDED0-\\uDED6])\\uFE0F|(?:[\\u261D\\u26F9\\u270A-\\u270D]|\\uD83C[\\uDF85\\uDFC2-\\uDFC4\\uDFC7\\uDFCA-\\uDFCC]|\\uD83D[\\uDC42\\uDC43\\uDC46-\\uDC50\\uDC66-\\uDC78\\uDC7C\\uDC81-\\uDC83\\uDC85-\\uDC87\\uDC8F\\uDC91\\uDCAA\\uDD74\\uDD75\\uDD7A\\uDD90\\uDD95\\uDD96\\uDE45-\\uDE47\\uDE4B-\\uDE4F\\uDEA3\\uDEB4-\\uDEB6\\uDEC0\\uDECC]|\\uD83E[\\uDD0C\\uDD0F\\uDD18-\\uDD1F\\uDD26\\uDD30-\\uDD39\\uDD3C-\\uDD3E\\uDD77\\uDDB5\\uDDB6\\uDDB8\\uDDB9\\uDDBB\\uDDCD-\\uDDCF\\uDDD1-\\uDDDD])/g;\n};\n", "import stripAnsi from 'strip-ansi';\nimport eastAsianWidth from 'eastasianwidth';\nimport emojiRegex from 'emoji-regex';\n\nexport default function stringWidth(string, options = {}) {\n\tif (typeof string !== 'string' || string.length === 0) {\n\t\treturn 0;\n\t}\n\n\toptions = {\n\t\tambiguousIsNarrow: true,\n\t\t...options\n\t};\n\n\tstring = stripAnsi(string);\n\n\tif (string.length === 0) {\n\t\treturn 0;\n\t}\n\n\tstring = string.replace(emojiRegex(), ' ');\n\n\tconst ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;\n\tlet width = 0;\n\n\tfor (const character of 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 combining characters\n\t\tif (codePoint >= 0x300 && codePoint <= 0x36F) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst code = eastAsianWidth.eastAsianWidth(character);\n\t\tswitch (code) {\n\t\t\tcase 'F':\n\t\t\tcase 'W':\n\t\t\t\twidth += 2;\n\t\t\t\tbreak;\n\t\t\tcase 'A':\n\t\t\t\twidth += ambiguousCharacterWidth;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\twidth += 1;\n\t\t}\n\t}\n\n\treturn width;\n}\n", "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", "import stringWidth from 'string-width';\nimport stripAnsi from 'strip-ansi';\nimport ansiStyles from 'ansi-styles';\n\nconst ESCAPES = new Set([\n\t'\\u001B',\n\t'\\u009B',\n]);\n\nconst END_CODE = 39;\nconst ANSI_ESCAPE_BELL = '\\u0007';\nconst ANSI_CSI = '[';\nconst ANSI_OSC = ']';\nconst ANSI_SGR_TERMINATOR = 'm';\nconst ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;\n\nconst wrapAnsiCode = code => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = uri => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;\n\n// Calculate the length of words split on ' ', ignoring\n// the extra characters added by ansi escape codes\nconst wordLengths = string => string.split(' ').map(character => stringWidth(character));\n\n// Wrap a long word across multiple rows\n// Ansi escape codes do not count towards length\nconst wrapWord = (rows, word, columns) => {\n\tconst characters = [...word];\n\n\tlet isInsideEscape = false;\n\tlet isInsideLinkEscape = false;\n\tlet visible = stringWidth(stripAnsi(rows[rows.length - 1]));\n\n\tfor (const [index, character] of characters.entries()) {\n\t\tconst characterLength = stringWidth(character);\n\n\t\tif (visible + characterLength <= columns) {\n\t\t\trows[rows.length - 1] += character;\n\t\t} else {\n\t\t\trows.push(character);\n\t\t\tvisible = 0;\n\t\t}\n\n\t\tif (ESCAPES.has(character)) {\n\t\t\tisInsideEscape = true;\n\t\t\tisInsideLinkEscape = characters.slice(index + 1).join('').startsWith(ANSI_ESCAPE_LINK);\n\t\t}\n\n\t\tif (isInsideEscape) {\n\t\t\tif (isInsideLinkEscape) {\n\t\t\t\tif (character === ANSI_ESCAPE_BELL) {\n\t\t\t\t\tisInsideEscape = false;\n\t\t\t\t\tisInsideLinkEscape = false;\n\t\t\t\t}\n\t\t\t} else if (character === ANSI_SGR_TERMINATOR) {\n\t\t\t\tisInsideEscape = false;\n\t\t\t}\n\n\t\t\tcontinue;\n\t\t}\n\n\t\tvisible += characterLength;\n\n\t\tif (visible === columns && index < characters.length - 1) {\n\t\t\trows.push('');\n\t\t\tvisible = 0;\n\t\t}\n\t}\n\n\t// It's possible that the last row we copy over is only\n\t// ansi escape characters, handle this edge-case\n\tif (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {\n\t\trows[rows.length - 2] += rows.pop();\n\t}\n};\n\n// Trims spaces from a string ignoring invisible sequences\nconst stringVisibleTrimSpacesRight = string => {\n\tconst words = string.split(' ');\n\tlet last = words.length;\n\n\twhile (last > 0) {\n\t\tif (stringWidth(words[last - 1]) > 0) {\n\t\t\tbreak;\n\t\t}\n\n\t\tlast--;\n\t}\n\n\tif (last === words.length) {\n\t\treturn string;\n\t}\n\n\treturn words.slice(0, last).join(' ') + words.slice(last).join('');\n};\n\n// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode\n//\n// 'hard' will never allow a string to take up more than columns characters\n//\n// 'soft' allows long words to expand past the column length\nconst exec = (string, columns, options = {}) => {\n\tif (options.trim !== false && string.trim() === '') {\n\t\treturn '';\n\t}\n\n\tlet returnValue = '';\n\tlet escapeCode;\n\tlet escapeUrl;\n\n\tconst lengths = wordLengths(string);\n\tlet rows = [''];\n\n\tfor (const [index, word] of string.split(' ').entries()) {\n\t\tif (options.trim !== false) {\n\t\t\trows[rows.length - 1] = rows[rows.length - 1].trimStart();\n\t\t}\n\n\t\tlet rowLength = stringWidth(rows[rows.length - 1]);\n\n\t\tif (index !== 0) {\n\t\t\tif (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {\n\t\t\t\t// If we start with a new word but the current row length equals the length of the columns, add a new row\n\t\t\t\trows.push('');\n\t\t\t\trowLength = 0;\n\t\t\t}\n\n\t\t\tif (rowLength > 0 || options.trim === false) {\n\t\t\t\trows[rows.length - 1] += ' ';\n\t\t\t\trowLength++;\n\t\t\t}\n\t\t}\n\n\t\t// In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns'\n\t\tif (options.hard && lengths[index] > columns) {\n\t\t\tconst remainingColumns = (columns - rowLength);\n\t\t\tconst breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);\n\t\t\tconst breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);\n\t\t\tif (breaksStartingNextLine < breaksStartingThisLine) {\n\t\t\t\trows.push('');\n\t\t\t}\n\n\t\t\twrapWord(rows, word, columns);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {\n\t\t\tif (options.wordWrap === false && rowLength < columns) {\n\t\t\t\twrapWord(rows, word, columns);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\trows.push('');\n\t\t}\n\n\t\tif (rowLength + lengths[index] > columns && options.wordWrap === false) {\n\t\t\twrapWord(rows, word, columns);\n\t\t\tcontinue;\n\t\t}\n\n\t\trows[rows.length - 1] += word;\n\t}\n\n\tif (options.trim !== false) {\n\t\trows = rows.map(row => stringVisibleTrimSpacesRight(row));\n\t}\n\n\tconst pre = [...rows.join('\\n')];\n\n\tfor (const [index, character] of pre.entries()) {\n\t\treturnValue += character;\n\n\t\tif (ESCAPES.has(character)) {\n\t\t\tconst {groups} = new RegExp(`(?:\\\\${ANSI_CSI}(?<code>\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join('')) || {groups: {}};\n\t\t\tif (groups.code !== undefined) {\n\t\t\t\tconst code = Number.parseFloat(groups.code);\n\t\t\t\tescapeCode = code === END_CODE ? undefined : code;\n\t\t\t} else if (groups.uri !== undefined) {\n\t\t\t\tescapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n\t\t\t}\n\t\t}\n\n\t\tconst code = ansiStyles.codes.get(Number(escapeCode));\n\n\t\tif (pre[index + 1] === '\\n') {\n\t\t\tif (escapeUrl) {\n\t\t\t\treturnValue += wrapAnsiHyperlink('');\n\t\t\t}\n\n\t\t\tif (escapeCode && code) {\n\t\t\t\treturnValue += wrapAnsiCode(code);\n\t\t\t}\n\t\t} else if (character === '\\n') {\n\t\t\tif (escapeCode && code) {\n\t\t\t\treturnValue += wrapAnsiCode(escapeCode);\n\t\t\t}\n\n\t\t\tif (escapeUrl) {\n\t\t\t\treturnValue += wrapAnsiHyperlink(escapeUrl);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn returnValue;\n};\n\n// For each newline, invoke the method separately\nexport default function wrapAnsi(string, columns, options) {\n\treturn String(string)\n\t\t.normalize()\n\t\t.replace(/\\r\\n/g, '\\n')\n\t\t.split('\\n')\n\t\t.map(line => exec(line, columns, options))\n\t\t.join('\\n');\n}\n", "const actions = ['up', 'down', 'left', 'right', 'space', 'enter', 'cancel'] as const;\nexport type Action = (typeof actions)[number];\n\n/** Global settings for Clack programs, stored in memory */\ninterface InternalClackSettings {\n\tactions: Set<Action>;\n\taliases: Map<string, Action>;\n}\n\nexport const settings: InternalClackSettings = {\n\tactions: new Set(actions),\n\taliases: new Map<string, Action>([\n\t\t// vim support\n\t\t['k', 'up'],\n\t\t['j', 'down'],\n\t\t['h', 'left'],\n\t\t['l', 'right'],\n\t\t['\\x03', 'cancel'],\n\t\t// opinionated defaults!\n\t\t['escape', 'cancel'],\n\t]),\n};\n\nexport interface ClackSettings {\n\t/**\n\t * Set custom global aliases for the default actions.\n\t * This will not overwrite existing aliases, it will only add new ones!\n\t *\n\t * @param aliases - An object that maps aliases to actions\n\t * @default { k: 'up', j: 'down', h: 'left', l: 'right', '\\x03': 'cancel', 'escape': 'cancel' }\n\t */\n\taliases: Record<string, Action>;\n}\n\nexport function updateSettings(updates: ClackSettings) {\n\tfor (const _key in updates) {\n\t\tconst key = _key as keyof ClackSettings;\n\t\tif (!Object.hasOwn(updates, key)) continue;\n\t\tconst value = updates[key];\n\n\t\tswitch (key) {\n\t\t\tcase 'aliases': {\n\t\t\t\tfor (const alias in value) {\n\t\t\t\t\tif (!Object.hasOwn(value, alias)) continue;\n\t\t\t\t\tif (!settings.aliases.has(alias)) {\n\t\t\t\t\t\tsettings.aliases.set(alias, value[alias]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Check if a key is an alias for a default action\n * @param key - The raw key which might match to an action\n * @param action - The action to match\n * @returns boolean\n */\nexport function isActionKey(key: string | Array<string | undefined>, action: Action) {\n\tif (typeof key === 'string') {\n\t\treturn settings.aliases.get(key) === action;\n\t}\n\n\tfor (const value of key) {\n\t\tif (value === undefined) continue;\n\t\tif (isActionKey(value, action)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n", "export function diffLines(a: string, b: string) {\n\tif (a === b) return;\n\n\tconst aLines = a.split('\\n');\n\tconst bLines = b.split('\\n');\n\tconst diff: number[] = [];\n\n\tfor (let i = 0; i < Math.max(aLines.length, bLines.length); i++) {\n\t\tif (aLines[i] !== bLines[i]) diff.push(i);\n\t}\n\n\treturn diff;\n}\n", "import { stdin, stdout } from 'node:process';\nimport type { Key } from 'node:readline';\nimport * as readline from 'node:readline';\nimport type { Readable } from 'node:stream';\nimport { cursor } from 'sisteransi';\nimport { isActionKey } from './settings';\n\nexport * from './string';\nexport * from './settings';\n\nconst isWindows = globalThis.process.platform.startsWith('win');\n\nexport const CANCEL_SYMBOL = Symbol('clack:cancel');\n\nexport function isCancel(value: unknown): value is symbol {\n\treturn value === CANCEL_SYMBOL;\n}\n\nexport function setRawMode(input: Readable, value: boolean) {\n\tconst i = input as typeof stdin;\n\n\tif (i.isTTY) i.setRawMode(value);\n}\n\nexport function block({\n\tinput = stdin,\n\toutput = stdout,\n\toverwrite = true,\n\thideCursor = true,\n} = {}) {\n\tconst rl = readline.createInterface({\n\t\tinput,\n\t\toutput,\n\t\tprompt: '',\n\t\ttabSize: 1,\n\t});\n\treadline.emitKeypressEvents(input, rl);\n\tif (input.isTTY) input.setRawMode(true);\n\n\tconst clear = (data: Buffer, { name, sequence }: Key) => {\n\t\tconst str = String(data);\n\t\tif (isActionKey([str, name, sequence], 'cancel')) {\n\t\t\tif (hideCursor) output.write(cursor.show);\n\t\t\tprocess.exit(0);\n\t\t\treturn;\n\t\t}\n\t\tif (!overwrite) return;\n\t\tconst dx = name === 'return' ? 0 : -1;\n\t\tconst dy = name === 'return' ? -1 : 0;\n\n\t\treadline.moveCursor(output, dx, dy, () => {\n\t\t\treadline.clearLine(output, 1, () => {\n\t\t\t\tinput.once('keypress', clear);\n\t\t\t});\n\t\t});\n\t};\n\tif (hideCursor) output.write(cursor.hide);\n\tinput.once('keypress', clear);\n\n\treturn () => {\n\t\tinput.off('keypress', clear);\n\t\tif (hideCursor) output.write(cursor.show);\n\n\t\t// Prevent Windows specific issues: https://github.com/bombshell-dev/clack/issues/176\n\t\tif (input.isTTY && !isWindows) input.setRawMode(false);\n\n\t\t// @ts-expect-error fix for https://github.com/nodejs/node/issues/31762#issuecomment-1441223907\n\t\trl.terminal = false;\n\t\trl.close();\n\t};\n}\n", "import { stdin, stdout } from 'node:process';\nimport readline, { type Key, type ReadLine } from 'node:readline';\nimport type { Readable } from 'node:stream';\nimport { Writable } from 'node:stream';\nimport { cursor, erase } from 'sisteransi';\nimport wrap from 'wrap-ansi';\n\nimport { CANCEL_SYMBOL, diffLines, isActionKey, setRawMode, settings } from '../utils';\n\nimport type { ClackEvents, ClackState } from '../types';\nimport type { Action } from '../utils';\n\nexport interface PromptOptions<Self extends Prompt> {\n\trender(this: Omit<Self, 'prompt'>): string | undefined;\n\tplaceholder?: string;\n\tinitialValue?: any;\n\tvalidate?: ((value: any) => string | Error | undefined) | undefined;\n\tinput?: Readable;\n\toutput?: Writable;\n\tdebug?: boolean;\n\tsignal?: AbortSignal;\n}\n\nexport default class Prompt {\n\tprotected input: Readable;\n\tprotected output: Writable;\n\tprivate _abortSignal?: AbortSignal;\n\n\tprivate rl: ReadLine | undefined;\n\tprivate opts: Omit<PromptOptions<Prompt>, 'render' | 'input' | 'output'>;\n\tprivate _render: (context: Omit<Prompt, 'prompt'>) => string | undefined;\n\tprivate _track = false;\n\tprivate _prevFrame = '';\n\tprivate _subscribers = new Map<string, { cb: (...args: any) => any; once?: boolean }[]>();\n\tprotected _cursor = 0;\n\n\tpublic state: ClackState = 'initial';\n\tpublic error = '';\n\tpublic value: any;\n\n\tconstructor(options: PromptOptions<Prompt>, trackValue = true) {\n\t\tconst { input = stdin, output = stdout, render, signal, ...opts } = options;\n\n\t\tthis.opts = opts;\n\t\tthis.onKeypress = this.onKeypress.bind(this);\n\t\tthis.close = this.close.bind(this);\n\t\tthis.render = this.render.bind(this);\n\t\tthis._render = render.bind(this);\n\t\tthis._track = trackValue;\n\t\tthis._abortSignal = signal;\n\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t}\n\n\t/**\n\t * Unsubscribe all listeners\n\t */\n\tprotected unsubscribe() {\n\t\tthis._subscribers.clear();\n\t}\n\n\t/**\n\t * Set a subscriber with opts\n\t * @param event - The event name\n\t */\n\tprivate setSubscriber<T extends keyof ClackEvents>(\n\t\tevent: T,\n\t\topts: { cb: ClackEvents[T]; once?: boolean }\n\t) {\n\t\tconst params = this._subscribers.get(event) ?? [];\n\t\tparams.push(opts);\n\t\tthis._subscribers.set(event, params);\n\t}\n\n\t/**\n\t * Subscribe to an event\n\t * @param event - The event name\n\t * @param cb - The callback\n\t */\n\tpublic on<T extends keyof ClackEvents>(event: T, cb: ClackEvents[T]) {\n\t\tthis.setSubscriber(event, { cb });\n\t}\n\n\t/**\n\t * Subscribe to an event once\n\t * @param event - The event name\n\t * @param cb - The callback\n\t */\n\tpublic once<T extends keyof ClackEvents>(event: T, cb: ClackEvents[T]) {\n\t\tthis.setSubscriber(event, { cb, once: true });\n\t}\n\n\t/**\n\t * Emit an event with data\n\t * @param event - The event name\n\t * @param data - The data to pass to the callback\n\t */\n\tpublic emit<T extends keyof ClackEvents>(event: T, ...data: Parameters<ClackEvents[T]>) {\n\t\tconst cbs = this._subscribers.get(event) ?? [];\n\t\tconst cleanup: (() => void)[] = [];\n\n\t\tfor (const subscriber of cbs) {\n\t\t\tsubscriber.cb(...data);\n\n\t\t\tif (subscriber.once) {\n\t\t\t\tcleanup.push(() => cbs.splice(cbs.indexOf(subscriber), 1));\n\t\t\t}\n\t\t}\n\n\t\tfor (const cb of cleanup) {\n\t\t\tcb();\n\t\t}\n\t}\n\n\tpublic prompt() {\n\t\treturn new Promise<string | symbol>((resolve, reject) => {\n\t\t\tif (this._abortSignal) {\n\t\t\t\tif (this._abortSignal.aborted) {\n\t\t\t\t\tthis.state = 'cancel';\n\n\t\t\t\t\tthis.close();\n\t\t\t\t\treturn resolve(CANCEL_SYMBOL);\n\t\t\t\t}\n\n\t\t\t\tthis._abortSignal.addEventListener(\n\t\t\t\t\t'abort',\n\t\t\t\t\t() => {\n\t\t\t\t\t\tthis.state = 'cancel';\n\t\t\t\t\t\tthis.close();\n\t\t\t\t\t},\n\t\t\t\t\t{ once: true }\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst sink = new Writable();\n\t\t\tsink._write = (chunk, encoding, done) => {\n\t\t\t\tif (this._track) {\n\t\t\t\t\tthis.value = this.rl?.line.replace(/\\t/g, '');\n\t\t\t\t\tthis._cursor = this.rl?.cursor ?? 0;\n\t\t\t\t\tthis.emit('value', this.value);\n\t\t\t\t}\n\t\t\t\tdone();\n\t\t\t};\n\t\t\tthis.input.pipe(sink);\n\n\t\t\tthis.rl = readline.createInterface({\n\t\t\t\tinput: this.input,\n\t\t\t\toutput: sink,\n\t\t\t\ttabSize: 2,\n\t\t\t\tprompt: '',\n\t\t\t\tescapeCodeTimeout: 50,\n\t\t\t\tterminal: true,\n\t\t\t});\n\t\t\treadline.emitKeypressEvents(this.input, this.rl);\n\t\t\tthis.rl.prompt();\n\t\t\tif (this.opts.initialValue !== undefined && this._track) {\n\t\t\t\tthis.rl.write(this.opts.initialValue);\n\t\t\t}\n\n\t\t\tthis.input.on('keypress', this.onKeypress);\n\t\t\tsetRawMode(this.input, true);\n\t\t\tthis.output.on('resize', this.render);\n\n\t\t\tthis.render();\n\n\t\t\tthis.once('submit', () => {\n\t\t\t\tthis.output.write(cursor.show);\n\t\t\t\tthis.output.off('resize', this.render);\n\t\t\t\tsetRawMode(this.input, false);\n\t\t\t\tresolve(this.value);\n\t\t\t});\n\t\t\tthis.once('cancel', () => {\n\t\t\t\tthis.output.write(cursor.show);\n\t\t\t\tthis.output.off('resize', this.render);\n\t\t\t\tsetRawMode(this.input, false);\n\t\t\t\tresolve(CANCEL_SYMBOL);\n\t\t\t});\n\t\t});\n\t}\n\n\tprivate onKeypress(char: string, key?: Key) {\n\t\tif (this.state === 'error') {\n\t\t\tthis.state = 'active';\n\t\t}\n\t\tif (key?.name) {\n\t\t\tif (!this._track && settings.aliases.has(key.name)) {\n\t\t\t\tthis.emit('cursor', settings.aliases.get(key.name));\n\t\t\t}\n\t\t\tif (settings.actions.has(key.name as Action)) {\n\t\t\t\tthis.emit('cursor', key.name as Action);\n\t\t\t}\n\t\t}\n\t\tif (char && (char.toLowerCase() === 'y' || char.toLowerCase() === 'n')) {\n\t\t\tthis.emit('confirm', char.toLowerCase() === 'y');\n\t\t}\n\t\tif (char === '\\t' && this.opts.placeholder) {\n\t\t\tif (!this.value) {\n\t\t\t\tthis.rl?.write(this.opts.placeholder);\n\t\t\t\tthis.emit('value', this.opts.placeholder);\n\t\t\t}\n\t\t}\n\t\tif (char) {\n\t\t\tthis.emit('key', char.toLowerCase());\n\t\t}\n\n\t\tif (key?.name === 'return') {\n\t\t\tif (this.opts.validate) {\n\t\t\t\tconst problem = this.opts.validate(this.value);\n\t\t\t\tif (problem) {\n\t\t\t\t\tthis.error = problem instanceof Error ? problem.message : problem;\n\t\t\t\t\tthis.state = 'error';\n\t\t\t\t\tthis.rl?.write(this.value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.state !== 'error') {\n\t\t\t\tthis.state = 'submit';\n\t\t\t}\n\t\t}\n\n\t\tif (isActionKey([char, key?.name, key?.sequence], 'cancel')) {\n\t\t\tthis.state = 'cancel';\n\t\t}\n\t\tif (this.state === 'submit' || this.state === 'cancel') {\n\t\t\tthis.emit('finalize');\n\t\t}\n\t\tthis.render();\n\t\tif (this.state === 'submit' || this.state === 'cancel') {\n\t\t\tthis.close();\n\t\t}\n\t}\n\n\tprotected close() {\n\t\tthis.input.unpipe();\n\t\tthis.input.removeListener('keypress', this.onKeypress);\n\t\tthis.output.write('\\n');\n\t\tsetRawMode(this.input, false);\n\t\tthis.rl?.close();\n\t\tthis.rl = undefined;\n\t\tthis.emit(`${this.state}`, this.value);\n\t\tthis.unsubscribe();\n\t}\n\n\tprivate restoreCursor() {\n\t\tconst lines =\n\t\t\twrap(this._prevFrame, process.stdout.columns, { hard: true }).split('\\n').length - 1;\n\t\tthis.output.write(cursor.move(-999, lines * -1));\n\t}\n\n\tprivate render() {\n\t\tconst frame = wrap(this._render(this) ?? '', process.stdout.columns, { hard: true });\n\t\tif (frame === this._prevFrame) return;\n\n\t\tif (this.state === 'initial') {\n\t\t\tthis.output.write(cursor.hide);\n\t\t} else {\n\t\t\tconst diff = diffLines(this._prevFrame, frame);\n\t\t\tthis.restoreCursor();\n\t\t\t// If a single line has changed, only update that line\n\t\t\tif (diff && diff?.length === 1) {\n\t\t\t\tconst diffLine = diff[0];\n\t\t\t\tthis.output.write(cursor.move(0, diffLine));\n\t\t\t\tthis.output.write(erase.lines(1));\n\t\t\t\tconst lines = frame.split('\\n');\n\t\t\t\tthis.output.write(lines[diffLine]);\n\t\t\t\tthis._prevFrame = frame;\n\t\t\t\tthis.output.write(cursor.move(0, lines.length - diffLine - 1));\n\t\t\t\treturn;\n\t\t\t\t// If many lines have changed, rerender everything past the first line\n\t\t\t}\n\t\t\tif (diff && diff?.length > 1) {\n\t\t\t\tconst diffLine = diff[0];\n\t\t\t\tthis.output.write(cursor.move(0, diffLine));\n\t\t\t\tthis.output.write(erase.down());\n\t\t\t\tconst lines = frame.split('\\n');\n\t\t\t\tconst newLines = lines.slice(diffLine);\n\t\t\t\tthis.output.write(newLines.join('\\n'));\n\t\t\t\tthis._prevFrame = frame;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.output.write(erase.down());\n\t\t}\n\n\t\tthis.output.write(frame);\n\t\tif (this.state === 'initial') {\n\t\t\tthis.state = 'active';\n\t\t}\n\t\tthis._prevFrame = frame;\n\t}\n}\n", "import { cursor } from 'sisteransi';\nimport Prompt, { type PromptOptions } from './prompt';\n\ninterface ConfirmOptions extends PromptOptions<ConfirmPrompt> {\n\tactive: string;\n\tinactive: string;\n\tinitialValue?: boolean;\n}\nexport default class ConfirmPrompt extends Prompt {\n\tget cursor() {\n\t\treturn this.value ? 0 : 1;\n\t}\n\n\tprivate get _value() {\n\t\treturn this.cursor === 0;\n\t}\n\n\tconstructor(opts: ConfirmOptions) {\n\t\tsuper(opts, false);\n\t\tthis.value = !!opts.initialValue;\n\n\t\tthis.on('value', () => {\n\t\t\tthis.value = this._value;\n\t\t});\n\n\t\tthis.on('confirm', (confirm) => {\n\t\t\tthis.output.write(cursor.move(0, -1));\n\t\t\tthis.value = confirm;\n\t\t\tthis.state = 'submit';\n\t\t\tthis.close();\n\t\t});\n\n\t\tthis.on('cursor', () => {\n\t\t\tthis.value = !this.value;\n\t\t});\n\t}\n}\n", "import Prompt, { type PromptOptions } from './prompt';\n\ninterface GroupMultiSelectOptions<T extends { value: any }>\n\textends PromptOptions<GroupMultiSelectPrompt<T>> {\n\toptions: Record<string, T[]>;\n\tinitialValues?: T['value'][];\n\trequired?: boolean;\n\tcursorAt?: T['value'];\n\tselectableGroups?: boolean;\n}\nexport default class GroupMultiSelectPrompt<T extends { value: any }> extends Prompt {\n\toptions: (T & { group: string | boolean })[];\n\tcursor = 0;\n\t#selectableGroups: boolean;\n\n\tgetGroupItems(group: string): T[] {\n\t\treturn this.options.filter((o) => o.group === group);\n\t}\n\n\tisGroupSelected(group: string) {\n\t\tconst items = this.getGroupItems(group);\n\t\treturn items.every((i) => this.value.includes(i.value));\n\t}\n\n\tprivate toggleValue() {\n\t\tconst item = this.options[this.cursor];\n\t\tif (item.group === true) {\n\t\t\tconst group = item.value;\n\t\t\tconst groupedItems = this.getGroupItems(group);\n\t\t\tif (this.isGroupSelected(group)) {\n\t\t\t\tthis.value = this.value.filter(\n\t\t\t\t\t(v: string) => groupedItems.findIndex((i) => i.value === v) === -1\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.value = [...this.value, ...groupedItems.map((i) => i.value)];\n\t\t\t}\n\t\t\tthis.value = Array.from(new Set(this.value));\n\t\t} else {\n\t\t\tconst selected = this.value.includes(item.value);\n\t\t\tthis.value = selected\n\t\t\t\t? this.value.filter((v: T['value']) => v !== item.value)\n\t\t\t\t: [...this.value, item.value];\n\t\t}\n\t}\n\n\tconstructor(opts: GroupMultiSelectOptions<T>) {\n\t\tsuper(opts, false);\n\t\tconst { options } = opts;\n\t\tthis.#selectableGroups = opts.selectableGroups !== false;\n\t\tthis.options = Object.entries(options).flatMap(([key, option]) => [\n\t\t\t{ value: key, group: true, label: key },\n\t\t\t...option.map((opt) => ({ ...opt, group: key })),\n\t\t]) as any;\n\t\tthis.value = [...(opts.initialValues ?? [])];\n\t\tthis.cursor = Math.max(\n\t\t\tthis.options.findIndex(({ value }) => value === opts.cursorAt),\n\t\t\tthis.#selectableGroups ? 0 : 1\n\t\t);\n\n\t\tthis.on('cursor', (key) => {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'left':\n\t\t\t\tcase 'up': {\n\t\t\t\t\tthis.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;\n\t\t\t\t\tconst currentIsGroup = this.options[this.cursor]?.group === true;\n\t\t\t\t\tif (!this.#selectableGroups && currentIsGroup) {\n\t\t\t\t\t\tthis.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'down':\n\t\t\t\tcase 'right': {\n\t\t\t\t\tthis.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;\n\t\t\t\t\tconst currentIsGroup = this.options[this.cursor]?.group === true;\n\t\t\t\t\tif (!this.#selectableGroups && currentIsGroup) {\n\t\t\t\t\t\tthis.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'space':\n\t\t\t\t\tthis.toggleValue();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t}\n}\n", "import Prompt, { type PromptOptions } from './prompt';\n\ninterface MultiSelectOptions<T extends { value: any }> extends PromptOptions<MultiSelectPrompt<T>> {\n\toptions: T[];\n\tinitialValues?: T['value'][];\n\trequired?: boolean;\n\tcursorAt?: T['value'];\n}\nexport default class MultiSelectPrompt<T extends { value: any }> extends Prompt {\n\toptions: T[];\n\tcursor = 0;\n\n\tprivate get _value() {\n\t\treturn this.options[this.cursor].value;\n\t}\n\n\tprivate toggleAll() {\n\t\tconst allSelected = this.value.length === this.options.length;\n\t\tthis.value = allSelected ? [] : this.options.map((v) => v.value);\n\t}\n\n\tprivate toggleValue() {\n\t\tconst selected = this.value.includes(this._value);\n\t\tthis.value = selected\n\t\t\t? this.value.filter((value: T['value']) => value !== this._value)\n\t\t\t: [...this.value, this._value];\n\t}\n\n\tconstructor(opts: MultiSelectOptions<T>) {\n\t\tsuper(opts, false);\n\n\t\tthis.options = opts.options;\n\t\tthis.value = [...(opts.initialValues ?? [])];\n\t\tthis.cursor = Math.max(\n\t\t\tthis.options.findIndex(({ value }) => value === opts.cursorAt),\n\t\t\t0\n\t\t);\n\t\tthis.on('key', (char) => {\n\t\t\tif (char === 'a') {\n\t\t\t\tthis.toggleAll();\n\t\t\t}\n\t\t});\n\n\t\tthis.on('cursor', (key) => {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'left':\n\t\t\t\tcase 'up':\n\t\t\t\t\tthis.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'down':\n\t\t\t\tcase 'right':\n\t\t\t\t\tthis.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'space':\n\t\t\t\t\tthis.toggleValue();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t}\n}\n", "import color from 'picocolors';\nimport Prompt, { type PromptOptions } from './prompt';\n\ninterface PasswordOptions extends PromptOptions<PasswordPrompt> {\n\tmask?: string;\n}\nexport default class PasswordPrompt extends Prompt {\n\tvalueWithCursor = '';\n\tprivate _mask = '•';\n\tget cursor() {\n\t\treturn this._cursor;\n\t}\n\tget masked() {\n\t\treturn this.value.replaceAll(/./g, this._mask);\n\t}\n\tconstructor({ mask, ...opts }: PasswordOptions) {\n\t\tsuper(opts);\n\t\tthis._mask = mask ?? '•';\n\n\t\tthis.on('finalize', () => {\n\t\t\tthis.valueWithCursor = this.masked;\n\t\t});\n\t\tthis.on('value', () => {\n\t\t\tif (this.cursor >= this.value.length) {\n\t\t\t\tthis.valueWithCursor = `${this.masked}${color.inverse(color.hidden('_'))}`;\n\t\t\t} else {\n\t\t\t\tconst s1 = this.masked.slice(0, this.cursor);\n\t\t\t\tconst s2 = this.masked.slice(this.cursor);\n\t\t\t\tthis.valueWithCursor = `${s1}${color.inverse(s2[0])}${s2.slice(1)}`;\n\t\t\t}\n\t\t});\n\t}\n}\n", "import Prompt, { type PromptOptions } from './prompt';\n\ninterface SelectOptions<T extends { value: any }> extends PromptOptions<SelectPrompt<T>> {\n\toptions: T[];\n\tinitialValue?: T['value'];\n}\nexport default class SelectPrompt<T extends { value: any }> extends Prompt {\n\toptions: T[];\n\tcursor = 0;\n\n\tprivate get _value() {\n\t\treturn this.options[this.cursor];\n\t}\n\n\tprivate changeValue() {\n\t\tthis.value = this._value.value;\n\t}\n\n\tconstructor(opts: SelectOptions<T>) {\n\t\tsuper(opts, false);\n\n\t\tthis.options = opts.options;\n\t\tthis.cursor = this.options.findIndex(({ value }) => value === opts.initialValue);\n\t\tif (this.cursor === -1) this.cursor = 0;\n\t\tthis.changeValue();\n\n\t\tthis.on('cursor', (key) => {\n\t\t\tswitch (key) {\n\t\t\t\tcase 'left':\n\t\t\t\tcase 'up':\n\t\t\t\t\tthis.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'down':\n\t\t\t\tcase 'right':\n\t\t\t\t\tthis.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.changeValue();\n\t\t});\n\t}\n}\n", "import Prompt, { type PromptOptions } from './prompt';\n\ninterface SelectKeyOptions<T extends { value: any }> extends PromptOptions<SelectKeyPrompt<T>> {\n\toptions: T[];\n}\nexport default class SelectKeyPrompt<T extends { value: any }> extends Prompt {\n\toptions: T[];\n\tcursor = 0;\n\n\tconstructor(opts: SelectKeyOptions<T>) {\n\t\tsuper(opts, false);\n\n\t\tthis.options = opts.options;\n\t\tconst keys = this.options.map(({ value: [initial] }) => initial?.toLowerCase());\n\t\tthis.cursor = Math.max(keys.indexOf(opts.initialValue), 0);\n\n\t\tthis.on('key', (key) => {\n\t\t\tif (!keys.includes(key)) return;\n\t\t\tconst value = this.options.find(({ value: [initial] }) => initial?.toLowerCase() === key);\n\t\t\tif (value) {\n\t\t\t\tthis.value = value.value;\n\t\t\t\tthis.state = 'submit';\n\t\t\t\tthis.emit('submit');\n\t\t\t}\n\t\t});\n\t}\n}\n", "import color from 'picocolors';\nimport Prompt, { type PromptOptions } from './prompt';\n\nexport interface TextOptions extends PromptOptions<TextPrompt> {\n\tplaceholder?: string;\n\tdefaultValue?: string;\n}\n\nexport default class TextPrompt extends Prompt {\n\tget valueWithCursor() {\n\t\tif (this.state === 'submit') {\n\t\t\treturn this.value;\n\t\t}\n\t\tif (this.cursor >= this.value.length) {\n\t\t\treturn `${this.value}█`;\n\t\t}\n\t\tconst s1 = this.value.slice(0, this.cursor);\n\t\tconst [s2, ...s3] = this.value.slice(this.cursor);\n\t\treturn `${s1}${color.inverse(s2)}${s3.join('')}`;\n\t}\n\tget cursor() {\n\t\treturn this._cursor;\n\t}\n\tconstructor(opts: TextOptions) {\n\t\tsuper(opts);\n\n\t\tthis.on('finalize', () => {\n\t\t\tif (!this.value) {\n\t\t\t\tthis.value = opts.defaultValue;\n\t\t\t}\n\t\t});\n\t}\n}\n", "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", "import { stripVTControlCharacters as strip } from 'node:util';\nimport {\n\tConfirmPrompt,\n\tGroupMultiSelectPrompt,\n\tMultiSelectPrompt,\n\tPasswordPrompt,\n\tSelectKeyPrompt,\n\tSelectPrompt,\n\ttype State,\n\tTextPrompt,\n\tblock,\n\tisCancel,\n} from '@clack/core';\nimport isUnicodeSupported from 'is-unicode-supported';\nimport color from 'picocolors';\nimport { cursor, erase } from 'sisteransi';\n\nexport { isCancel } from '@clack/core';\nexport { updateSettings, type ClackSettings } from '@clack/core';\n\nconst unicode = isUnicodeSupported();\nconst s = (c: string, fallback: string) => (unicode ? c : fallback);\nconst S_STEP_ACTIVE = s('◆', '*');\nconst S_STEP_CANCEL = s('■', 'x');\nconst S_STEP_ERROR = s('▲', 'x');\nconst S_STEP_SUBMIT = s('◇', 'o');\n\nconst S_BAR_START = s('┌', 'T');\nconst S_BAR = s('│', '|');\nconst S_BAR_END = s('└', '—');\n\nconst S_RADIO_ACTIVE = s('●', '>');\nconst S_RADIO_INACTIVE = s('○', ' ');\nconst S_CHECKBOX_ACTIVE = s('◻', '[•]');\nconst S_CHECKBOX_SELECTED = s('◼', '[+]');\nconst S_CHECKBOX_INACTIVE = s('◻', '[ ]');\nconst S_PASSWORD_MASK = s('▪', '•');\n\nconst S_BAR_H = s('─', '-');\nconst S_CORNER_TOP_RIGHT = s('╮', '+');\nconst S_CONNECT_LEFT = s('├', '+');\nconst S_CORNER_BOTTOM_RIGHT = s('╯', '+');\n\nconst S_INFO = s('●', '•');\nconst S_SUCCESS = s('◆', '*');\nconst S_WARN = s('▲', '!');\nconst S_ERROR = s('■', 'x');\n\nconst symbol = (state: State) => {\n\tswitch (state) {\n\t\tcase 'initial':\n\t\tcase 'active':\n\t\t\treturn color.cyan(S_STEP_ACTIVE);\n\t\tcase 'cancel':\n\t\t\treturn color.red(S_STEP_CANCEL);\n\t\tcase 'error':\n\t\t\treturn color.yellow(S_STEP_ERROR);\n\t\tcase 'submit':\n\t\t\treturn color.green(S_STEP_SUBMIT);\n\t}\n};\n\ninterface LimitOptionsParams<TOption> {\n\toptions: TOption[];\n\tmaxItems: number | undefined;\n\tcursor: number;\n\tstyle: (option: TOption, active: boolean) => string;\n}\n\nconst limitOptions = <TOption>(params: LimitOptionsParams<TOption>): string[] => {\n\tconst { cursor, options, style } = params;\n\n\tconst paramMaxItems = params.maxItems ?? Number.POSITIVE_INFINITY;\n\tconst outputMaxItems = Math.max(process.stdout.rows - 4, 0);\n\t// We clamp to minimum 5 because anything less doesn't make sense UX wise\n\tconst maxItems = Math.min(outputMaxItems, Math.max(paramMaxItems, 5));\n\tlet slidingWindowLocation = 0;\n\n\tif (cursor >= slidingWindowLocation + maxItems - 3) {\n\t\tslidingWindowLocation = Math.max(Math.min(cursor - maxItems + 3, options.length - maxItems), 0);\n\t} else if (cursor < slidingWindowLocation + 2) {\n\t\tslidingWindowLocation = Math.max(cursor - 2, 0);\n\t}\n\n\tconst shouldRenderTopEllipsis = maxItems < options.length && slidingWindowLocation > 0;\n\tconst shouldRenderBottomEllipsis =\n\t\tmaxItems < options.length && slidingWindowLocation + maxItems < options.length;\n\n\treturn options\n\t\t.slice(slidingWindowLocation, slidingWindowLocation + maxItems)\n\t\t.map((option, i, arr) => {\n\t\t\tconst isTopLimit = i === 0 && shouldRenderTopEllipsis;\n\t\t\tconst isBottomLimit = i === arr.length - 1 && shouldRenderBottomEllipsis;\n\t\t\treturn isTopLimit || isBottomLimit\n\t\t\t\t? color.dim('...')\n\t\t\t\t: style(option, i + slidingWindowLocation === cursor);\n\t\t});\n};\n\nexport interface TextOptions {\n\tmessage: string;\n\tplaceholder?: string;\n\tdefaultValue?: string;\n\tinitialValue?: string;\n\tvalidate?: (value: string) => string | Error | undefined;\n}\nexport const text = (opts: TextOptions) => {\n\treturn new TextPrompt({\n\t\tvalidate: opts.validate,\n\t\tplaceholder: opts.placeholder,\n\t\tdefaultValue: opts.defaultValue,\n\t\tinitialValue: opts.initialValue,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\t\t\tconst placeholder = opts.placeholder\n\t\t\t\t? color.inverse(opts.placeholder[0]) + color.dim(opts.placeholder.slice(1))\n\t\t\t\t: color.inverse(color.hidden('_'));\n\t\t\tconst value = !this.value ? placeholder : this.valueWithCursor;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'error':\n\t\t\t\t\treturn `${title.trim()}\\n${color.yellow(S_BAR)} ${value}\\n${color.yellow(\n\t\t\t\t\t\tS_BAR_END\n\t\t\t\t\t)} ${color.yellow(this.error)}\\n`;\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.dim(this.value || opts.placeholder)}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.strikethrough(\n\t\t\t\t\t\tcolor.dim(this.value ?? '')\n\t\t\t\t\t)}${this.value?.trim() ? `\\n${color.gray(S_BAR)}` : ''}`;\n\t\t\t\tdefault:\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${value}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<string | symbol>;\n};\n\nexport interface PasswordOptions {\n\tmessage: string;\n\tmask?: string;\n\tvalidate?: (value: string) => string | Error | undefined;\n}\nexport const password = (opts: PasswordOptions) => {\n\treturn new PasswordPrompt({\n\t\tvalidate: opts.validate,\n\t\tmask: opts.mask ?? S_PASSWORD_MASK,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\t\t\tconst value = this.valueWithCursor;\n\t\t\tconst masked = this.masked;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'error':\n\t\t\t\t\treturn `${title.trim()}\\n${color.yellow(S_BAR)} ${masked}\\n${color.yellow(\n\t\t\t\t\t\tS_BAR_END\n\t\t\t\t\t)} ${color.yellow(this.error)}\\n`;\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.dim(masked)}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.strikethrough(color.dim(masked ?? ''))}${\n\t\t\t\t\t\tmasked ? `\\n${color.gray(S_BAR)}` : ''\n\t\t\t\t\t}`;\n\t\t\t\tdefault:\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${value}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<string | symbol>;\n};\n\nexport interface ConfirmOptions {\n\tmessage: string;\n\tactive?: string;\n\tinactive?: string;\n\tinitialValue?: boolean;\n}\nexport const confirm = (opts: ConfirmOptions) => {\n\tconst active = opts.active ?? 'Yes';\n\tconst inactive = opts.inactive ?? 'No';\n\treturn new ConfirmPrompt({\n\t\tactive,\n\t\tinactive,\n\t\tinitialValue: opts.initialValue ?? true,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\t\t\tconst value = this.value ? active : inactive;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.dim(value)}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.strikethrough(\n\t\t\t\t\t\tcolor.dim(value)\n\t\t\t\t\t)}\\n${color.gray(S_BAR)}`;\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${\n\t\t\t\t\t\tthis.value\n\t\t\t\t\t\t\t? `${color.green(S_RADIO_ACTIVE)} ${active}`\n\t\t\t\t\t\t\t: `${color.dim(S_RADIO_INACTIVE)} ${color.dim(active)}`\n\t\t\t\t\t} ${color.dim('/')} ${\n\t\t\t\t\t\t!this.value\n\t\t\t\t\t\t\t? `${color.green(S_RADIO_ACTIVE)} ${inactive}`\n\t\t\t\t\t\t\t: `${color.dim(S_RADIO_INACTIVE)} ${color.dim(inactive)}`\n\t\t\t\t\t}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<boolean | symbol>;\n};\n\ntype Primitive = Readonly<string | boolean | number>;\n\nexport type Option<Value> = Value extends Primitive\n\t? {\n\t\t\t/**\n\t\t\t * Internal data for this option.\n\t\t\t */\n\t\t\tvalue: Value;\n\t\t\t/**\n\t\t\t * The optional, user-facing text for this option.\n\t\t\t *\n\t\t\t * By default, the `value` is converted to a string.\n\t\t\t */\n\t\t\tlabel?: string;\n\t\t\t/**\n\t\t\t * An optional hint to display to the user when\n\t\t\t * this option might be selected.\n\t\t\t *\n\t\t\t * By default, no `hint` is displayed.\n\t\t\t */\n\t\t\thint?: string;\n\t\t}\n\t: {\n\t\t\t/**\n\t\t\t * Internal data for this option.\n\t\t\t */\n\t\t\tvalue: Value;\n\t\t\t/**\n\t\t\t * Required. The user-facing text for this option.\n\t\t\t */\n\t\t\tlabel: string;\n\t\t\t/**\n\t\t\t * An optional hint to display to the user when\n\t\t\t * this option might be selected.\n\t\t\t *\n\t\t\t * By default, no `hint` is displayed.\n\t\t\t */\n\t\t\thint?: string;\n\t\t};\n\nexport interface SelectOptions<Value> {\n\tmessage: string;\n\toptions: Option<Value>[];\n\tinitialValue?: Value;\n\tmaxItems?: number;\n}\n\nexport const select = <Value>(opts: SelectOptions<Value>) => {\n\tconst opt = (option: Option<Value>, state: 'inactive' | 'active' | 'selected' | 'cancelled') => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tswitch (state) {\n\t\t\tcase 'selected':\n\t\t\t\treturn `${color.dim(label)}`;\n\t\t\tcase 'active':\n\t\t\t\treturn `${color.green(S_RADIO_ACTIVE)} ${label} ${\n\t\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t\t}`;\n\t\t\tcase 'cancelled':\n\t\t\t\treturn `${color.strikethrough(color.dim(label))}`;\n\t\t\tdefault:\n\t\t\t\treturn `${color.dim(S_RADIO_INACTIVE)} ${color.dim(label)}`;\n\t\t}\n\t};\n\n\treturn new SelectPrompt({\n\t\toptions: opts.options,\n\t\tinitialValue: opts.initialValue,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${opt(this.options[this.cursor], 'selected')}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${opt(\n\t\t\t\t\t\tthis.options[this.cursor],\n\t\t\t\t\t\t'cancelled'\n\t\t\t\t\t)}\\n${color.gray(S_BAR)}`;\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${limitOptions({\n\t\t\t\t\t\tcursor: this.cursor,\n\t\t\t\t\t\toptions: this.options,\n\t\t\t\t\t\tmaxItems: opts.maxItems,\n\t\t\t\t\t\tstyle: (item, active) => opt(item, active ? 'active' : 'inactive'),\n\t\t\t\t\t}).join(`\\n${color.cyan(S_BAR)} `)}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value | symbol>;\n};\n\nexport const selectKey = <Value extends string>(opts: SelectOptions<Value>) => {\n\tconst opt = (\n\t\toption: Option<Value>,\n\t\tstate: 'inactive' | 'active' | 'selected' | 'cancelled' = 'inactive'\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tif (state === 'selected') {\n\t\t\treturn `${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'cancelled') {\n\t\t\treturn `${color.strikethrough(color.dim(label))}`;\n\t\t}\n\t\tif (state === 'active') {\n\t\t\treturn `${color.bgCyan(color.gray(` ${option.value} `))} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\treturn `${color.gray(color.bgWhite(color.inverse(` ${option.value} `)))} ${label} ${\n\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t}`;\n\t};\n\n\treturn new SelectKeyPrompt({\n\t\toptions: opts.options,\n\t\tinitialValue: opts.initialValue,\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${opt(\n\t\t\t\t\t\tthis.options.find((opt) => opt.value === this.value) ?? opts.options[0],\n\t\t\t\t\t\t'selected'\n\t\t\t\t\t)}`;\n\t\t\t\tcase 'cancel':\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${opt(this.options[0], 'cancelled')}\\n${color.gray(\n\t\t\t\t\t\tS_BAR\n\t\t\t\t\t)}`;\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${this.options\n\t\t\t\t\t\t.map((option, i) => opt(option, i === this.cursor ? 'active' : 'inactive'))\n\t\t\t\t\t\t.join(`\\n${color.cyan(S_BAR)} `)}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value | symbol>;\n};\n\nexport interface MultiSelectOptions<Value> {\n\tmessage: string;\n\toptions: Option<Value>[];\n\tinitialValues?: Value[];\n\tmaxItems?: number;\n\trequired?: boolean;\n\tcursorAt?: Value;\n}\nexport const multiselect = <Value>(opts: MultiSelectOptions<Value>) => {\n\tconst opt = (\n\t\toption: Option<Value>,\n\t\tstate: 'inactive' | 'active' | 'selected' | 'active-selected' | 'submitted' | 'cancelled'\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tif (state === 'active') {\n\t\t\treturn `${color.cyan(S_CHECKBOX_ACTIVE)} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'selected') {\n\t\t\treturn `${color.green(S_CHECKBOX_SELECTED)} ${color.dim(label)} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'cancelled') {\n\t\t\treturn `${color.strikethrough(color.dim(label))}`;\n\t\t}\n\t\tif (state === 'active-selected') {\n\t\t\treturn `${color.green(S_CHECKBOX_SELECTED)} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'submitted') {\n\t\t\treturn `${color.dim(label)}`;\n\t\t}\n\t\treturn `${color.dim(S_CHECKBOX_INACTIVE)} ${color.dim(label)}`;\n\t};\n\n\treturn new MultiSelectPrompt({\n\t\toptions: opts.options,\n\t\tinitialValues: opts.initialValues,\n\t\trequired: opts.required ?? true,\n\t\tcursorAt: opts.cursorAt,\n\t\tvalidate(selected: Value[]) {\n\t\t\tif (this.required && selected.length === 0)\n\t\t\t\treturn `Please select at least one option.\\n${color.reset(\n\t\t\t\t\tcolor.dim(\n\t\t\t\t\t\t`Press ${color.gray(color.bgWhite(color.inverse(' space ')))} to select, ${color.gray(\n\t\t\t\t\t\t\tcolor.bgWhite(color.inverse(' enter '))\n\t\t\t\t\t\t)} to submit`\n\t\t\t\t\t)\n\t\t\t\t)}`;\n\t\t},\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\tconst styleOption = (option: Option<Value>, active: boolean) => {\n\t\t\t\tconst selected = this.value.includes(option.value);\n\t\t\t\tif (active && selected) {\n\t\t\t\t\treturn opt(option, 'active-selected');\n\t\t\t\t}\n\t\t\t\tif (selected) {\n\t\t\t\t\treturn opt(option, 'selected');\n\t\t\t\t}\n\t\t\t\treturn opt(option, active ? 'active' : 'inactive');\n\t\t\t};\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${\n\t\t\t\t\t\tthis.options\n\t\t\t\t\t\t\t.filter(({ value }) => this.value.includes(value))\n\t\t\t\t\t\t\t.map((option) => opt(option, 'submitted'))\n\t\t\t\t\t\t\t.join(color.dim(', ')) || color.dim('none')\n\t\t\t\t\t}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst label = this.options\n\t\t\t\t\t\t.filter(({ value }) => this.value.includes(value))\n\t\t\t\t\t\t.map((option) => opt(option, 'cancelled'))\n\t\t\t\t\t\t.join(color.dim(', '));\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${\n\t\t\t\t\t\tlabel.trim() ? `${label}\\n${color.gray(S_BAR)}` : ''\n\t\t\t\t\t}`;\n\t\t\t\t}\n\t\t\t\tcase 'error': {\n\t\t\t\t\tconst footer = this.error\n\t\t\t\t\t\t.split('\\n')\n\t\t\t\t\t\t.map((ln, i) =>\n\t\t\t\t\t\t\ti === 0 ? `${color.yellow(S_BAR_END)} ${color.yellow(ln)}` : ` ${ln}`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join('\\n');\n\t\t\t\t\treturn `${title + color.yellow(S_BAR)} ${limitOptions({\n\t\t\t\t\t\toptions: this.options,\n\t\t\t\t\t\tcursor: this.cursor,\n\t\t\t\t\t\tmaxItems: opts.maxItems,\n\t\t\t\t\t\tstyle: styleOption,\n\t\t\t\t\t}).join(`\\n${color.yellow(S_BAR)} `)}\\n${footer}\\n`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${limitOptions({\n\t\t\t\t\t\toptions: this.options,\n\t\t\t\t\t\tcursor: this.cursor,\n\t\t\t\t\t\tmaxItems: opts.maxItems,\n\t\t\t\t\t\tstyle: styleOption,\n\t\t\t\t\t}).join(`\\n${color.cyan(S_BAR)} `)}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value[] | symbol>;\n};\n\nexport interface GroupMultiSelectOptions<Value> {\n\tmessage: string;\n\toptions: Record<string, Option<Value>[]>;\n\tinitialValues?: Value[];\n\trequired?: boolean;\n\tcursorAt?: Value;\n\tselectableGroups?: boolean;\n}\nexport const groupMultiselect = <Value>(opts: GroupMultiSelectOptions<Value>) => {\n\tconst { selectableGroups = true } = opts;\n\tconst opt = (\n\t\toption: Option<Value>,\n\t\tstate:\n\t\t\t| 'inactive'\n\t\t\t| 'active'\n\t\t\t| 'selected'\n\t\t\t| 'active-selected'\n\t\t\t| 'group-active'\n\t\t\t| 'group-active-selected'\n\t\t\t| 'submitted'\n\t\t\t| 'cancelled',\n\t\toptions: Option<Value>[] = []\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tconst isItem = typeof (option as any).group === 'string';\n\t\tconst next = isItem && (options[options.indexOf(option) + 1] ?? { group: true });\n\t\tconst isLast = isItem && (next as any).group === true;\n\t\tconst prefix = isItem ? (selectableGroups ? `${isLast ? S_BAR_END : S_BAR} ` : ' ') : '';\n\n\t\tif (state === 'active') {\n\t\t\treturn `${color.dim(prefix)}${color.cyan(S_CHECKBOX_ACTIVE)} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'group-active') {\n\t\t\treturn `${prefix}${color.cyan(S_CHECKBOX_ACTIVE)} ${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'group-active-selected') {\n\t\t\treturn `${prefix}${color.green(S_CHECKBOX_SELECTED)} ${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'selected') {\n\t\t\tconst selectedCheckbox = isItem || selectableGroups ? color.green(S_CHECKBOX_SELECTED) : '';\n\t\t\treturn `${color.dim(prefix)}${selectedCheckbox} ${color.dim(label)} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'cancelled') {\n\t\t\treturn `${color.strikethrough(color.dim(label))}`;\n\t\t}\n\t\tif (state === 'active-selected') {\n\t\t\treturn `${color.dim(prefix)}${color.green(S_CHECKBOX_SELECTED)} ${label} ${\n\t\t\t\toption.hint ? color.dim(`(${option.hint})`) : ''\n\t\t\t}`;\n\t\t}\n\t\tif (state === 'submitted') {\n\t\t\treturn `${color.dim(label)}`;\n\t\t}\n\t\tconst unselectedCheckbox = isItem || selectableGroups ? color.dim(S_CHECKBOX_INACTIVE) : '';\n\t\treturn `${color.dim(prefix)}${unselectedCheckbox} ${color.dim(label)}`;\n\t};\n\n\treturn new GroupMultiSelectPrompt({\n\t\toptions: opts.options,\n\t\tinitialValues: opts.initialValues,\n\t\trequired: opts.required ?? true,\n\t\tcursorAt: opts.cursorAt,\n\t\tselectableGroups,\n\t\tvalidate(selected: Value[]) {\n\t\t\tif (this.required && selected.length === 0)\n\t\t\t\treturn `Please select at least one option.\\n${color.reset(\n\t\t\t\t\tcolor.dim(\n\t\t\t\t\t\t`Press ${color.gray(color.bgWhite(color.inverse(' space ')))} to select, ${color.gray(\n\t\t\t\t\t\t\tcolor.bgWhite(color.inverse(' enter '))\n\t\t\t\t\t\t)} to submit`\n\t\t\t\t\t)\n\t\t\t\t)}`;\n\t\t},\n\t\trender() {\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${this.options\n\t\t\t\t\t\t.filter(({ value }) => this.value.includes(value))\n\t\t\t\t\t\t.map((option) => opt(option, 'submitted'))\n\t\t\t\t\t\t.join(color.dim(', '))}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst label = this.options\n\t\t\t\t\t\t.filter(({ value }) => this.value.includes(value))\n\t\t\t\t\t\t.map((option) => opt(option, 'cancelled'))\n\t\t\t\t\t\t.join(color.dim(', '));\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${\n\t\t\t\t\t\tlabel.trim() ? `${label}\\n${color.gray(S_BAR)}` : ''\n\t\t\t\t\t}`;\n\t\t\t\t}\n\t\t\t\tcase 'error': {\n\t\t\t\t\tconst footer = this.error\n\t\t\t\t\t\t.split('\\n')\n\t\t\t\t\t\t.map((ln, i) =>\n\t\t\t\t\t\t\ti === 0 ? `${color.yellow(S_BAR_END)} ${color.yellow(ln)}` : ` ${ln}`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join('\\n');\n\t\t\t\t\treturn `${title}${color.yellow(S_BAR)} ${this.options\n\t\t\t\t\t\t.map((option, i, options) => {\n\t\t\t\t\t\t\tconst selected =\n\t\t\t\t\t\t\t\tthis.value.includes(option.value) ||\n\t\t\t\t\t\t\t\t(option.group === true && this.isGroupSelected(`${option.value}`));\n\t\t\t\t\t\t\tconst active = i === this.cursor;\n\t\t\t\t\t\t\tconst groupActive =\n\t\t\t\t\t\t\t\t!active &&\n\t\t\t\t\t\t\t\ttypeof option.group === 'string' &&\n\t\t\t\t\t\t\t\tthis.options[this.cursor].value === option.group;\n\t\t\t\t\t\t\tif (groupActive) {\n\t\t\t\t\t\t\t\treturn opt(option, selected ? 'group-active-selected' : 'group-active', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (active && selected) {\n\t\t\t\t\t\t\t\treturn opt(option, 'active-selected', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (selected) {\n\t\t\t\t\t\t\t\treturn opt(option, 'selected', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn opt(option, active ? 'active' : 'inactive', options);\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(`\\n${color.yellow(S_BAR)} `)}\\n${footer}\\n`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)} ${this.options\n\t\t\t\t\t\t.map((option, i, options) => {\n\t\t\t\t\t\t\tconst selected =\n\t\t\t\t\t\t\t\tthis.value.includes(option.value) ||\n\t\t\t\t\t\t\t\t(option.group === true && this.isGroupSelected(`${option.value}`));\n\t\t\t\t\t\t\tconst active = i === this.cursor;\n\t\t\t\t\t\t\tconst groupActive =\n\t\t\t\t\t\t\t\t!active &&\n\t\t\t\t\t\t\t\ttypeof option.group === 'string' &&\n\t\t\t\t\t\t\t\tthis.options[this.cursor].value === option.group;\n\t\t\t\t\t\t\tif (groupActive) {\n\t\t\t\t\t\t\t\treturn opt(option, selected ? 'group-active-selected' : 'group-active', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (active && selected) {\n\t\t\t\t\t\t\t\treturn opt(option, 'active-selected', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (selected) {\n\t\t\t\t\t\t\t\treturn opt(option, 'selected', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn opt(option, active ? 'active' : 'inactive', options);\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(`\\n${color.cyan(S_BAR)} `)}\\n${color.cyan(S_BAR_END)}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value[] | symbol>;\n};\n\nexport const note = (message = '', title = '') => {\n\tconst lines = `\\n${message}\\n`.split('\\n');\n\tconst titleLen = strip(title).length;\n\tconst len =\n\t\tMath.max(\n\t\t\tlines.reduce((sum, ln) => {\n\t\t\t\tconst line = strip(ln);\n\t\t\t\treturn line.length > sum ? line.length : sum;\n\t\t\t}, 0),\n\t\t\ttitleLen\n\t\t) + 2;\n\tconst msg = lines\n\t\t.map(\n\t\t\t(ln) =>\n\t\t\t\t`${color.gray(S_BAR)} ${color.dim(ln)}${' '.repeat(len - strip(ln).length)}${color.gray(\n\t\t\t\t\tS_BAR\n\t\t\t\t)}`\n\t\t)\n\t\t.join('\\n');\n\tprocess.stdout.write(\n\t\t`${color.gray(S_BAR)}\\n${color.green(S_STEP_SUBMIT)} ${color.reset(title)} ${color.gray(\n\t\t\tS_BAR_H.repeat(Math.max(len - titleLen - 1, 1)) + S_CORNER_TOP_RIGHT\n\t\t)}\\n${msg}\\n${color.gray(S_CONNECT_LEFT + S_BAR_H.repeat(len + 2) + S_CORNER_BOTTOM_RIGHT)}\\n`\n\t);\n};\n\nexport const cancel = (message = '') => {\n\tprocess.stdout.write(`${color.gray(S_BAR_END)} ${color.red(message)}\\n\\n`);\n};\n\nexport const intro = (title = '') => {\n\tprocess.stdout.write(`${color.gray(S_BAR_START)} ${title}\\n`);\n};\n\nexport const outro = (message = '') => {\n\tprocess.stdout.write(`${color.gray(S_BAR)}\\n${color.gray(S_BAR_END)} ${message}\\n\\n`);\n};\n\nexport type LogMessageOptions = {\n\tsymbol?: string;\n};\nexport const log = {\n\tmessage: (message = '', { symbol = color.gray(S_BAR) }: LogMessageOptions = {}) => {\n\t\tconst parts = [`${color.gray(S_BAR)}`];\n\t\tif (message) {\n\t\t\tconst [firstLine, ...lines] = message.split('\\n');\n\t\t\tparts.push(`${symbol} ${firstLine}`, ...lines.map((ln) => `${color.gray(S_BAR)} ${ln}`));\n\t\t}\n\t\tprocess.stdout.write(`${parts.join('\\n')}\\n`);\n\t},\n\tinfo: (message: string) => {\n\t\tlog.message(message, { symbol: color.blue(S_INFO) });\n\t},\n\tsuccess: (message: string) => {\n\t\tlog.message(message, { symbol: color.green(S_SUCCESS) });\n\t},\n\tstep: (message: string) => {\n\t\tlog.message(message, { symbol: color.green(S_STEP_SUBMIT) });\n\t},\n\twarn: (message: string) => {\n\t\tlog.message(message, { symbol: color.yellow(S_WARN) });\n\t},\n\t/** alias for `log.warn()`. */\n\twarning: (message: string) => {\n\t\tlog.warn(message);\n\t},\n\terror: (message: string) => {\n\t\tlog.message(message, { symbol: color.red(S_ERROR) });\n\t},\n};\n\nconst prefix = `${color.gray(S_BAR)} `;\nexport const stream = {\n\tmessage: async (\n\t\titerable: Iterable<string> | AsyncIterable<string>,\n\t\t{ symbol = color.gray(S_BAR) }: LogMessageOptions = {}\n\t) => {\n\t\tprocess.stdout.write(`${color.gray(S_BAR)}\\n${symbol} `);\n\t\tlet lineWidth = 3;\n\t\tfor await (let chunk of iterable) {\n\t\t\tchunk = chunk.replace(/\\n/g, `\\n${prefix}`);\n\t\t\tif (chunk.includes('\\n')) {\n\t\t\t\tlineWidth = 3 + strip(chunk.slice(chunk.lastIndexOf('\\n'))).length;\n\t\t\t}\n\t\t\tconst chunkLen = strip(chunk).length;\n\t\t\tif (lineWidth + chunkLen < process.stdout.columns) {\n\t\t\t\tlineWidth += chunkLen;\n\t\t\t\tprocess.stdout.write(chunk);\n\t\t\t} else {\n\t\t\t\tprocess.stdout.write(`\\n${prefix}${chunk.trimStart()}`);\n\t\t\t\tlineWidth = 3 + strip(chunk.trimStart()).length;\n\t\t\t}\n\t\t}\n\t\tprocess.stdout.write('\\n');\n\t},\n\tinfo: (iterable: Iterable<string> | AsyncIterable<string>) => {\n\t\treturn stream.message(iterable, { symbol: color.blue(S_INFO) });\n\t},\n\tsuccess: (iterable: Iterable<string> | AsyncIterable<string>) => {\n\t\treturn stream.message(iterable, { symbol: color.green(S_SUCCESS) });\n\t},\n\tstep: (iterable: Iterable<string> | AsyncIterable<string>) => {\n\t\treturn stream.message(iterable, { symbol: color.green(S_STEP_SUBMIT) });\n\t},\n\twarn: (iterable: Iterable<string> | AsyncIterable<string>) => {\n\t\treturn stream.message(iterable, { symbol: color.yellow(S_WARN) });\n\t},\n\t/** alias for `log.warn()`. */\n\twarning: (iterable: Iterable<string> | AsyncIterable<string>) => {\n\t\treturn stream.warn(iterable);\n\t},\n\terror: (iterable: Iterable<string> | AsyncIterable<string>) => {\n\t\treturn stream.message(iterable, { symbol: color.red(S_ERROR) });\n\t},\n};\n\nexport interface SpinnerOptions {\n\tindicator?: 'dots' | 'timer';\n}\n\nexport const spinner = ({ indicator = 'dots' }: SpinnerOptions = {}) => {\n\tconst frames = unicode ? ['◒', '◐', '◓', '◑'] : ['•', 'o', 'O', '0'];\n\tconst delay = unicode ? 80 : 120;\n\tconst isCI = process.env.CI === 'true';\n\n\tlet unblock: () => void;\n\tlet loop: NodeJS.Timeout;\n\tlet isSpinnerActive = false;\n\tlet _message = '';\n\tlet _prevMessage: string | undefined = undefined;\n\tlet _origin: number = performance.now();\n\n\tconst handleExit = (code: number) => {\n\t\tconst msg = code > 1 ? 'Something went wrong' : 'Canceled';\n\t\tif (isSpinnerActive) stop(msg, code);\n\t};\n\n\tconst errorEventHandler = () => handleExit(2);\n\tconst signalEventHandler = () => handleExit(1);\n\n\tconst registerHooks = () => {\n\t\t// Reference: https://nodejs.org/api/process.html#event-uncaughtexception\n\t\tprocess.on('uncaughtExceptionMonitor', errorEventHandler);\n\t\t// Reference: https://nodejs.org/api/process.html#event-unhandledrejection\n\t\tprocess.on('unhandledRejection', errorEventHandler);\n\t\t// Reference Signal Events: https://nodejs.org/api/process.html#signal-events\n\t\tprocess.on('SIGINT', signalEventHandler);\n\t\tprocess.on('SIGTERM', signalEventHandler);\n\t\tprocess.on('exit', handleExit);\n\t};\n\n\tconst clearHooks = () => {\n\t\tprocess.removeListener('uncaughtExceptionMonitor', errorEventHandler);\n\t\tprocess.removeListener('unhandledRejection', errorEventHandler);\n\t\tprocess.removeListener('SIGINT', signalEventHandler);\n\t\tprocess.removeListener('SIGTERM', signalEventHandler);\n\t\tprocess.removeListener('exit', handleExit);\n\t};\n\n\tconst clearPrevMessage = () => {\n\t\tif (_prevMessage === undefined) return;\n\t\tif (isCI) process.stdout.write('\\n');\n\t\tconst prevLines = _prevMessage.split('\\n');\n\t\tprocess.stdout.write(cursor.move(-999, prevLines.length - 1));\n\t\tprocess.stdout.write(erase.down(prevLines.length));\n\t};\n\n\tconst parseMessage = (msg: string): string => {\n\t\treturn msg.replace(/\\.+$/, '');\n\t};\n\n\tconst formatTimer = (origin: number): string => {\n\t\tconst duration = (performance.now() - origin) / 1000;\n\t\tconst min = Math.floor(duration / 60);\n\t\tconst secs = Math.floor(duration % 60);\n\t\treturn min > 0 ? `[${min}m ${secs}s]` : `[${secs}s]`;\n\t};\n\n\tconst start = (msg = ''): void => {\n\t\tisSpinnerActive = true;\n\t\tunblock = block();\n\t\t_message = parseMessage(msg);\n\t\t_origin = performance.now();\n\t\tprocess.stdout.write(`${color.gray(S_BAR)}\\n`);\n\t\tlet frameIndex = 0;\n\t\tlet indicatorTimer = 0;\n\t\tregisterHooks();\n\t\tloop = setInterval(() => {\n\t\t\tif (isCI && _message === _prevMessage) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tclearPrevMessage();\n\t\t\t_prevMessage = _message;\n\t\t\tconst frame = color.magenta(frames[frameIndex]);\n\n\t\t\tif (isCI) {\n\t\t\t\tprocess.stdout.write(`${frame} ${_message}...`);\n\t\t\t} else if (indicator === 'timer') {\n\t\t\t\tprocess.stdout.write(`${frame} ${_message} ${formatTimer(_origin)}`);\n\t\t\t} else {\n\t\t\t\tconst loadingDots = '.'.repeat(Math.floor(indicatorTimer)).slice(0, 3);\n\t\t\t\tprocess.stdout.write(`${frame} ${_message}${loadingDots}`);\n\t\t\t}\n\n\t\t\tframeIndex = frameIndex + 1 < frames.length ? frameIndex + 1 : 0;\n\t\t\tindicatorTimer = indicatorTimer < frames.length ? indicatorTimer + 0.125 : 0;\n\t\t}, delay);\n\t};\n\n\tconst stop = (msg = '', code = 0): void => {\n\t\tisSpinnerActive = false;\n\t\tclearInterval(loop);\n\t\tclearPrevMessage();\n\t\tconst step =\n\t\t\tcode === 0\n\t\t\t\t? color.green(S_STEP_SUBMIT)\n\t\t\t\t: code === 1\n\t\t\t\t\t? color.red(S_STEP_CANCEL)\n\t\t\t\t\t: color.red(S_STEP_ERROR);\n\t\t_message = parseMessage(msg ?? _message);\n\t\tif (indicator === 'timer') {\n\t\t\tprocess.stdout.write(`${step} ${_message} ${formatTimer(_origin)}\\n`);\n\t\t} else {\n\t\t\tprocess.stdout.write(`${step} ${_message}\\n`);\n\t\t}\n\t\tclearHooks();\n\t\tunblock();\n\t};\n\n\tconst message = (msg = ''): void => {\n\t\t_message = parseMessage(msg ?? _message);\n\t};\n\n\treturn {\n\t\tstart,\n\t\tstop,\n\t\tmessage,\n\t};\n};\n\nexport type PromptGroupAwaitedReturn<T> = {\n\t[P in keyof T]: Exclude<Awaited<T[P]>, symbol>;\n};\n\nexport interface PromptGroupOptions<T> {\n\t/**\n\t * Control how the group can be canceled\n\t * if one of the prompts is canceled.\n\t */\n\tonCancel?: (opts: { results: Prettify<Partial<PromptGroupAwaitedReturn<T>>> }) => void;\n}\n\ntype Prettify<T> = {\n\t[P in keyof T]: T[P];\n} & {};\n\nexport type PromptGroup<T> = {\n\t[P in keyof T]: (opts: {\n\t\tresults: Prettify<Partial<PromptGroupAwaitedReturn<Omit<T, P>>>>;\n\t}) => undefined | Promise<T[P] | undefined>;\n};\n\n/**\n * Define a group of prompts to be displayed\n * and return a results of objects within the group\n */\nexport const group = async <T>(\n\tprompts: PromptGroup<T>,\n\topts?: PromptGroupOptions<T>\n): Promise<Prettify<PromptGroupAwaitedReturn<T>>> => {\n\tconst results = {} as any;\n\tconst promptNames = Object.keys(prompts);\n\n\tfor (const name of promptNames) {\n\t\tconst prompt = prompts[name as keyof T];\n\t\tconst result = await prompt({ results })?.catch((e) => {\n\t\t\tthrow e;\n\t\t});\n\n\t\t// Pass the results to the onCancel function\n\t\t// so the user can decide what to do with the results\n\t\t// TODO: Switch to callback within core to avoid isCancel Fn\n\t\tif (typeof opts?.onCancel === 'function' && isCancel(result)) {\n\t\t\tresults[name] = 'canceled';\n\t\t\topts.onCancel({ results });\n\t\t\tcontinue;\n\t\t}\n\n\t\tresults[name] = result;\n\t}\n\n\treturn results;\n};\n\nexport type Task = {\n\t/**\n\t * Task title\n\t */\n\ttitle: string;\n\t/**\n\t * Task function\n\t */\n\ttask: (message: (string: string) => void) => string | Promise<string> | void | Promise<void>;\n\n\t/**\n\t * If enabled === false the task will be skipped\n\t */\n\tenabled?: boolean;\n};\n\n/**\n * Define a group of tasks to be executed\n */\nexport const tasks = async (tasks: Task[]) => {\n\tfor (const task of tasks) {\n\t\tif (task.enabled === false) continue;\n\n\t\tconst s = spinner();\n\t\ts.start(task.title);\n\t\tconst result = await task.task(s.message);\n\t\ts.stop(result || task.title);\n\t}\n};\n", "import { existsSync } from \"node:fs\";\nimport { pathToFileURL } from \"node:url\";\nimport { join, resolve as resolvePath } from \"node:path\";\nimport picocolors from \"picocolors\";\nimport { AgentEnvStore } from \"./envStore\";\nimport { installInteractiveAuthInterceptors } from \"./interactiveAuth\";\nimport { renderDocyrusLogoPrimary } from \"./logo\";\nimport { cleanupOnboardingStdinState, runOnboarding, shouldRunOnboarding } from \"./onboarding\";\n\ntype IDocyrusPiProfileId = \"agent\" | \"coder\";\ntype IDocyrusPiMode = \"text\" | \"json\";\ntype IDocyrusPiThinkingLevel = \"off\" | \"minimal\" | \"low\" | \"medium\" | \"high\" | \"xhigh\";\n\ninterface IDocyrusPiLoaderRequest {\n profile: IDocyrusPiProfileId;\n prompt?: string;\n print?: boolean;\n mode?: IDocyrusPiMode;\n continue?: boolean;\n resume?: boolean;\n provider?: string;\n model?: string;\n thinking?: IDocyrusPiThinkingLevel;\n session?: string;\n sessionDir?: string;\n apiKey?: string;\n verbose?: boolean;\n}\n\ninterface IPiExports {\n AuthStorage: {\n create(path?: string): any;\n };\n DefaultResourceLoader: new(config: Record<string, unknown>) => { reload(): Promise<void> };\n ModelRegistry: new(authStorage: any, modelsJsonPath?: string) => any;\n SettingsManager: {\n create(cwd?: string, agentDir?: string): any;\n };\n SessionManager: {\n create(cwd: string, sessionDir?: string): any;\n open(path: string, sessionDir?: string): any;\n continueRecent(cwd: string, sessionDir?: string): any;\n list(cwd: string, sessionDir?: string): Promise<Array<{\n path: string;\n name?: string;\n firstMessage: string;\n modified: Date;\n }>>;\n };\n createAgentSession(options: Record<string, unknown>): Promise<{ session: any; modelFallbackMessage?: string }>;\n InteractiveMode: new(session: any, options?: Record<string, unknown>) => any;\n runPrintMode(session: any, options: Record<string, unknown>): Promise<void>;\n createBashTool(cwd: string): unknown;\n createEditTool(cwd: string): unknown;\n createFindTool(cwd: string): unknown;\n createGrepTool(cwd: string): unknown;\n createLsTool(cwd: string): unknown;\n createReadTool(cwd: string): unknown;\n createWriteTool(cwd: string): unknown;\n ExtensionInputComponent: new(...args: any[]) => any;\n ExtensionSelectorComponent: new(...args: any[]) => any;\n}\n\nfunction readRequiredEnv(name: string): string {\n const value = process.env[name];\n if (!value || value.trim().length === 0) {\n throw new Error(`Missing required environment variable: ${name}`);\n }\n\n return value;\n}\n\nfunction readLoaderRequest(): IDocyrusPiLoaderRequest {\n return JSON.parse(readRequiredEnv(\"DOCYRUS_PI_REQUEST\")) as IDocyrusPiLoaderRequest;\n}\n\nasync function loadPiExports(): Promise<IPiExports> {\n const piPackageDir = readRequiredEnv(\"PI_PACKAGE_DIR\");\n const moduleUrl = pathToFileURL(join(piPackageDir, \"dist\", \"index.js\")).href;\n return await import(moduleUrl) as IPiExports;\n}\n\nfunction resolvePackagedPiResourceRoot(): string {\n const candidates = [\n resolvePath(process.cwd(), \"apps/api-cli/resources/pi-agent\"),\n resolvePath(__dirname, \"../resources/pi-agent\"),\n resolvePath(__dirname, \"resources/pi-agent\"),\n resolvePath(process.cwd(), \"dist/apps/api-cli/resources/pi-agent\"),\n ];\n\n const resolved = candidates.find((candidate) => existsSync(candidate));\n if (!resolved) {\n throw new Error(`Unable to locate pi agent resources. Checked: ${candidates.join(\", \")}`);\n }\n\n return resolved;\n}\n\nasync function readPipedStdin(): Promise<string | undefined> {\n if (process.stdin.isTTY) {\n return undefined;\n }\n\n return await new Promise((resolve) => {\n let data = \"\";\n process.stdin.setEncoding(\"utf8\");\n process.stdin.on(\"data\", (chunk) => {\n data += chunk;\n });\n process.stdin.on(\"end\", () => {\n resolve(data.trim() || undefined);\n });\n process.stdin.resume();\n });\n}\n\nfunction buildTools(profile: IDocyrusPiProfileId, cwd: string, pi: IPiExports) {\n if (profile === \"agent\") {\n return [\n pi.createReadTool(cwd),\n pi.createBashTool(cwd),\n pi.createGrepTool(cwd),\n pi.createFindTool(cwd),\n pi.createLsTool(cwd),\n ];\n }\n\n return [\n pi.createReadTool(cwd),\n pi.createBashTool(cwd),\n pi.createEditTool(cwd),\n pi.createWriteTool(cwd),\n pi.createGrepTool(cwd),\n pi.createFindTool(cwd),\n pi.createLsTool(cwd),\n ];\n}\n\nfunction resolveRequestedModel(params: {\n request: IDocyrusPiLoaderRequest;\n modelRegistry: { getAvailable(): Array<{ provider: string; id: string }>; find(provider: string, modelId: string): unknown | undefined };\n}): unknown | undefined {\n const { request, modelRegistry } = params;\n const requestedProvider = request.provider?.trim();\n const requestedModel = request.model?.trim();\n\n if (!requestedProvider && !requestedModel) {\n return undefined;\n }\n\n if (requestedProvider && requestedModel) {\n const normalizedModelId = requestedModel.startsWith(`${requestedProvider}/`)\n ? requestedModel.slice(requestedProvider.length + 1)\n : requestedModel;\n return modelRegistry.find(requestedProvider, normalizedModelId);\n }\n\n if (requestedModel && requestedModel.includes(\"/\")) {\n const slashIndex = requestedModel.indexOf(\"/\");\n return modelRegistry.find(requestedModel.slice(0, slashIndex).trim(), requestedModel.slice(slashIndex + 1).trim());\n }\n\n if (requestedModel) {\n const availableModels = modelRegistry.getAvailable();\n const exactMatches = availableModels.filter((model) => model.id === requestedModel);\n if (exactMatches.length === 1) {\n return exactMatches[0];\n }\n\n return availableModels.find((model) => model.id.includes(requestedModel));\n }\n\n return undefined;\n}\n\nfunction buildModelIdsByProvider(modelRegistry: { getAll(): Array<{ provider: string; id: string }> }): Record<string, string[]> {\n const values: Record<string, string[]> = {};\n for (const model of modelRegistry.getAll()) {\n if (!values[model.provider]) {\n values[model.provider] = [];\n }\n values[model.provider].push(model.id);\n }\n\n return values;\n}\n\nasync function chooseResumeSession(params: {\n pi: IPiExports;\n request: IDocyrusPiLoaderRequest;\n cwd: string;\n}): Promise<string | undefined> {\n const sessions = await params.pi.SessionManager.list(params.cwd, params.request.sessionDir);\n if (sessions.length === 0) {\n return undefined;\n }\n\n const prompts = await import(\"@clack/prompts\");\n const selected = await prompts.select({\n message: \"Select a session to resume\",\n options: sessions.slice(0, 20).map((session) => ({\n value: session.path,\n label: session.name || session.modified.toLocaleString(),\n hint: session.firstMessage.replace(/\\n/g, \" \").slice(0, 80) || \"Empty session\",\n })),\n });\n\n if (prompts.isCancel(selected) || !selected) {\n process.exit(0);\n }\n\n return String(selected);\n}\n\nasync function createSessionManager(params: {\n pi: IPiExports;\n request: IDocyrusPiLoaderRequest;\n cwd: string;\n isInteractive: boolean;\n}): Promise<any> {\n if (params.request.session) {\n return params.pi.SessionManager.open(params.request.session, params.request.sessionDir);\n }\n\n if (params.request.resume) {\n if (!params.isInteractive) {\n return params.pi.SessionManager.continueRecent(params.cwd, params.request.sessionDir);\n }\n\n const selectedSessionPath = await chooseResumeSession(params);\n if (selectedSessionPath) {\n return params.pi.SessionManager.open(selectedSessionPath, params.request.sessionDir);\n }\n }\n\n if (params.request.continue) {\n return params.pi.SessionManager.continueRecent(params.cwd, params.request.sessionDir);\n }\n\n return params.pi.SessionManager.create(params.cwd, params.request.sessionDir);\n}\n\nfunction renderStartupSplash(version: string): void {\n process.stderr.write(\n renderDocyrusLogoPrimary() +\n \"\\n\" +\n ` ${picocolors.bold(\"DOCYRUS\")} ${picocolors.dim(`v${version}`)}\\n` +\n ` ${picocolors.green(\"Welcome.\")} Preparing your agent workspace...\\n\\n`,\n );\n}\n\nasync function main(): Promise<void> {\n const request = readLoaderRequest();\n const pi = await loadPiExports();\n const cwd = process.cwd();\n const agentDir = readRequiredEnv(\"PI_CODING_AGENT_DIR\");\n const version = process.env.DOCYRUS_PI_VERSION || \"dev\";\n const resourceRoot = resolvePackagedPiResourceRoot();\n const envStore = new AgentEnvStore(join(agentDir, \"env.json\"));\n await envStore.hydrateProcessEnv(process.env);\n\n const authStorage = pi.AuthStorage.create(join(agentDir, \"auth.json\"));\n const settingsManager = pi.SettingsManager.create(cwd, agentDir);\n const modelsJsonPath = join(agentDir, \"models.json\");\n const initialModelRegistry = new pi.ModelRegistry(authStorage, modelsJsonPath);\n const isPrintMode = Boolean(request.print) || !process.stdin.isTTY;\n const isInteractive = process.stdin.isTTY && !isPrintMode;\n const quietStartup = !request.verbose;\n\n if (quietStartup) {\n process.env.PI_SKIP_VERSION_CHECK = \"1\";\n settingsManager.setQuietStartup(true);\n settingsManager.setCollapseChangelog(true);\n settingsManager.setLastChangelogVersion(version);\n }\n\n const browserProviders = authStorage.getOAuthProviders();\n const apiKeyProviderIds = Array.from(new Set(initialModelRegistry.getAll().map((model: { provider: string }) => model.provider)));\n const modelIdsByProvider = buildModelIdsByProvider(initialModelRegistry);\n\n let usedClack = false;\n renderStartupSplash(version);\n\n if (await shouldRunOnboarding({\n authStorage,\n envStore,\n settingsManager,\n isInteractive,\n isPrintMode,\n browserProviders,\n apiKeyProviderIds,\n modelIdsByProvider,\n } as any)) {\n usedClack = true;\n await runOnboarding({\n authStorage,\n envStore,\n settingsManager,\n modelsJsonPath,\n browserProviders,\n apiKeyProviderIds,\n modelIdsByProvider,\n } as any);\n await envStore.hydrateProcessEnv(process.env);\n }\n\n const modelRegistry = new pi.ModelRegistry(authStorage, modelsJsonPath);\n const requestedModel = resolveRequestedModel({\n request,\n modelRegistry,\n });\n\n if (request.apiKey) {\n const apiKeyProvider = request.provider?.trim() || (requestedModel as { provider?: string } | undefined)?.provider;\n if (!apiKeyProvider) {\n throw new Error(\"--api-key requires a provider or a resolvable model.\");\n }\n\n authStorage.setRuntimeApiKey(apiKeyProvider, request.apiKey);\n }\n\n const sessionManager = await createSessionManager({\n pi,\n request,\n cwd,\n isInteractive,\n });\n\n const resourceLoader = new pi.DefaultResourceLoader({\n cwd,\n agentDir,\n settingsManager,\n systemPrompt: request.profile === \"agent\" ? join(resourceRoot, \"prompts\", \"agent-system.md\") : undefined,\n appendSystemPrompt: request.profile === \"coder\" ? join(resourceRoot, \"prompts\", \"coder-append-system.md\") : undefined,\n });\n await resourceLoader.reload();\n\n const { session, modelFallbackMessage } = await pi.createAgentSession({\n cwd,\n agentDir,\n authStorage,\n modelRegistry,\n resourceLoader,\n settingsManager,\n sessionManager,\n tools: buildTools(request.profile, cwd, pi),\n model: requestedModel,\n thinkingLevel: request.thinking,\n });\n\n if (usedClack) {\n cleanupOnboardingStdinState();\n }\n\n const pipedStdin = await readPipedStdin();\n if (pipedStdin !== undefined && !request.print) {\n request.print = true;\n }\n\n if (request.print || pipedStdin !== undefined) {\n if (!session.model) {\n throw new Error(`No models available.\\n\\nSet an API key environment variable:\\n ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY, etc.\\n\\nOr create ${modelsJsonPath}`);\n }\n\n const initialMessage = pipedStdin || request.prompt;\n const initialMessages = pipedStdin && request.prompt ? [request.prompt] : undefined;\n await pi.runPrintMode(session, {\n mode: request.mode || \"text\",\n initialMessage,\n messages: initialMessages,\n });\n return;\n }\n\n const interactiveMode = new pi.InteractiveMode(session, {\n initialMessage: request.prompt,\n modelFallbackMessage,\n verbose: request.verbose,\n });\n const originalInit = interactiveMode.init.bind(interactiveMode);\n interactiveMode.init = async() => {\n await originalInit();\n installInteractiveAuthInterceptors(interactiveMode, {\n authStorage,\n envStore,\n settingsManager,\n modelsJsonPath,\n browserProviders,\n apiKeyProviderIds: Array.from(new Set(modelRegistry.getAll().map((model: { provider: string }) => model.provider))),\n modelIdsByProvider: buildModelIdsByProvider(modelRegistry),\n uiComponents: {\n ExtensionInputComponent: pi.ExtensionInputComponent,\n ExtensionSelectorComponent: pi.ExtensionSelectorComponent,\n },\n });\n };\n\n await interactiveMode.run();\n}\n\nvoid main().catch((error: unknown) => {\n const message = error instanceof Error ? error.message : String(error);\n process.stderr.write(`${message}\\n`);\n process.exitCode = 1;\n});\n", "import { chmod, mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\n\nexport interface IAgentEnvStoreState {\n version: 1;\n values: Record<string, string>;\n}\n\nfunction createDefaultState(): IAgentEnvStoreState {\n return {\n version: 1,\n values: {},\n };\n}\n\nfunction normalizeState(state: IAgentEnvStoreState): IAgentEnvStoreState {\n const values: Record<string, string> = {};\n for (const [key, value] of Object.entries(state.values || {})) {\n const normalizedKey = key.trim();\n const normalizedValue = value.trim();\n if (!normalizedKey || !normalizedValue) {\n continue;\n }\n values[normalizedKey] = normalizedValue;\n }\n\n return {\n version: 1,\n values,\n };\n}\n\nexport class AgentEnvStore {\n constructor(private readonly filePath: string) {}\n\n getFilePath(): string {\n return this.filePath;\n }\n\n async readState(): Promise<IAgentEnvStoreState> {\n try {\n const raw = await readFile(this.filePath, \"utf8\");\n const parsed = JSON.parse(raw) as IAgentEnvStoreState;\n if (!parsed || parsed.version !== 1 || typeof parsed.values !== \"object\" || parsed.values === null) {\n return createDefaultState();\n }\n\n return normalizeState(parsed);\n }\n catch (error: unknown) {\n if (\n typeof error === \"object\"\n && error !== null\n && \"code\" in error\n && (error as { code?: string }).code === \"ENOENT\"\n ) {\n return createDefaultState();\n }\n\n return createDefaultState();\n }\n }\n\n async writeState(state: IAgentEnvStoreState): Promise<void> {\n const normalized = normalizeState(state);\n const directory = dirname(this.filePath);\n\n await mkdir(directory, {\n recursive: true,\n mode: 0o700,\n });\n\n await writeFile(this.filePath, `${JSON.stringify(normalized, null, 2)}\\n`, {\n encoding: \"utf8\",\n mode: 0o600,\n });\n\n await chmod(this.filePath, 0o600);\n }\n\n async setMany(values: Record<string, string>): Promise<void> {\n const state = await this.readState();\n await this.writeState({\n version: 1,\n values: {\n ...state.values,\n ...Object.fromEntries(\n Object.entries(values)\n .map(([key, value]) => [key.trim(), value.trim()] as const)\n .filter(([key, value]) => key.length > 0 && value.length > 0),\n ),\n },\n });\n }\n\n async removeMany(keys: string[]): Promise<void> {\n const state = await this.readState();\n const nextValues = { ...state.values };\n\n for (const key of keys) {\n delete nextValues[key];\n }\n\n await this.writeState({\n version: 1,\n values: nextValues,\n });\n }\n\n async hydrateProcessEnv(env: NodeJS.ProcessEnv = process.env): Promise<Record<string, string>> {\n const state = await this.readState();\n for (const [key, value] of Object.entries(state.values)) {\n if (!env[key]) {\n env[key] = value;\n }\n }\n\n return state.values;\n }\n\n async hasAny(keys: string[]): Promise<boolean> {\n const state = await this.readState();\n return keys.some((key) => Boolean(state.values[key] || process.env[key]));\n }\n}\n", "import { chmod, mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\n\ntype IJsonValue = string | number | boolean | null | IJsonArray | IJsonObject;\ninterface IJsonObject {\n [key: string]: IJsonValue;\n}\ntype IJsonArray = IJsonValue[];\n\nexport interface IModelsConfigState {\n providers: Record<string, IJsonObject>;\n}\n\nfunction createDefaultState(): IModelsConfigState {\n return {\n providers: {},\n };\n}\n\nexport async function readModelsConfig(filePath: string): Promise<IModelsConfigState> {\n try {\n const raw = await readFile(filePath, \"utf8\");\n const parsed = JSON.parse(raw) as IModelsConfigState;\n if (!parsed || typeof parsed !== \"object\" || typeof parsed.providers !== \"object\" || parsed.providers === null) {\n return createDefaultState();\n }\n\n return {\n providers: { ...parsed.providers },\n };\n }\n catch (error: unknown) {\n if (\n typeof error === \"object\"\n && error !== null\n && \"code\" in error\n && (error as { code?: string }).code === \"ENOENT\"\n ) {\n return createDefaultState();\n }\n\n return createDefaultState();\n }\n}\n\nexport async function writeModelsConfig(filePath: string, state: IModelsConfigState): Promise<void> {\n const directory = dirname(filePath);\n await mkdir(directory, {\n recursive: true,\n mode: 0o700,\n });\n\n await writeFile(filePath, `${JSON.stringify(state, null, 2)}\\n`, {\n encoding: \"utf8\",\n mode: 0o600,\n });\n\n await chmod(filePath, 0o600);\n}\n\nexport async function upsertModelsProvider(filePath: string, providerId: string, providerConfig: IJsonObject): Promise<void> {\n const state = await readModelsConfig(filePath);\n await writeModelsConfig(filePath, {\n providers: {\n ...state.providers,\n [providerId]: providerConfig,\n },\n });\n}\n\nexport async function removeModelsProvider(filePath: string, providerId: string): Promise<void> {\n const state = await readModelsConfig(filePath);\n const nextProviders = { ...state.providers };\n delete nextProviders[providerId];\n\n await writeModelsConfig(filePath, {\n providers: nextProviders,\n });\n}\n\nexport function createCustomOpenAiProviderConfig(params: {\n baseUrl: string;\n modelId: string;\n}): IJsonObject {\n return {\n baseUrl: params.baseUrl,\n apiKey: \"env:CUSTOM_OPENAI_API_KEY\",\n api: \"openai-completions\",\n models: [\n {\n id: params.modelId,\n name: params.modelId,\n reasoning: false,\n input: [\"text\"],\n contextWindow: 128000,\n maxTokens: 16384,\n cost: {\n input: 0,\n output: 0,\n cacheRead: 0,\n cacheWrite: 0,\n },\n },\n ],\n };\n}\n\nexport function createAzureProviderConfig(params: {\n baseUrl: string;\n modelId: string;\n useCustomModel: boolean;\n}): IJsonObject {\n const providerConfig: IJsonObject = {\n baseUrl: params.baseUrl,\n apiKey: \"env:AZURE_OPENAI_API_KEY\",\n };\n\n if (params.useCustomModel) {\n providerConfig.api = \"azure-openai-responses\";\n providerConfig.models = [\n {\n id: params.modelId,\n name: params.modelId,\n reasoning: false,\n input: [\"text\"],\n contextWindow: 128000,\n maxTokens: 16384,\n cost: {\n input: 0,\n output: 0,\n cacheRead: 0,\n cacheWrite: 0,\n },\n },\n ];\n }\n\n return providerConfig;\n}\n", "import type { AuthStorage, SettingsManager } from \"@mariozechner/pi-coding-agent\";\nimport { AgentEnvStore } from \"./envStore\";\nimport {\n createAzureProviderConfig,\n createCustomOpenAiProviderConfig,\n removeModelsProvider,\n upsertModelsProvider,\n} from \"./modelsConfig\";\n\nexport interface IAzureConfigInput {\n apiKey: string;\n baseUrl: string;\n modelId: string;\n deploymentName?: string;\n apiVersion?: string;\n useCustomModel?: boolean;\n}\n\nexport interface ICustomOpenAiConfigInput {\n apiKey: string;\n baseUrl: string;\n modelId: string;\n}\n\nexport interface IBedrockConfigInput {\n region: string;\n modelId: string;\n profile?: string;\n accessKeyId?: string;\n secretAccessKey?: string;\n sessionToken?: string;\n}\n\nexport interface IDocyrusAuthFlowDependencies {\n authStorage: AuthStorage;\n envStore: AgentEnvStore;\n settingsManager: SettingsManager;\n modelsJsonPath: string;\n}\n\nfunction trimOrUndefined(value?: string): string | undefined {\n const trimmed = value?.trim();\n return trimmed && trimmed.length > 0 ? trimmed : undefined;\n}\n\nexport async function saveGenericApiKey(params: IDocyrusAuthFlowDependencies & {\n providerId: string;\n apiKey: string;\n}): Promise<void> {\n params.authStorage.set(params.providerId, {\n type: \"api_key\",\n key: params.apiKey.trim(),\n });\n}\n\nexport async function saveCustomOpenAiConfig(params: IDocyrusAuthFlowDependencies & ICustomOpenAiConfigInput): Promise<void> {\n params.authStorage.set(\"custom-openai\", {\n type: \"api_key\",\n key: params.apiKey.trim(),\n });\n\n await params.envStore.removeMany([\n \"CUSTOM_OPENAI_API_KEY\",\n ]);\n await params.envStore.setMany({\n CUSTOM_OPENAI_API_KEY: params.apiKey.trim(),\n });\n\n await upsertModelsProvider(params.modelsJsonPath, \"custom-openai\", createCustomOpenAiProviderConfig({\n baseUrl: params.baseUrl.trim(),\n modelId: params.modelId.trim(),\n }));\n\n params.settingsManager.setDefaultModelAndProvider(\"custom-openai\", params.modelId.trim());\n}\n\nexport async function saveAzureConfig(params: IDocyrusAuthFlowDependencies & IAzureConfigInput): Promise<void> {\n const modelId = params.modelId.trim();\n const useCustomModel = params.useCustomModel ?? false;\n\n params.authStorage.set(\"azure-openai-responses\", {\n type: \"api_key\",\n key: params.apiKey.trim(),\n });\n\n await params.envStore.removeMany([\n \"AZURE_OPENAI_API_KEY\",\n \"AZURE_OPENAI_API_VERSION\",\n \"AZURE_OPENAI_DEPLOYMENT_NAME_MAP\",\n ]);\n const envValues: Record<string, string> = {\n AZURE_OPENAI_API_KEY: params.apiKey.trim(),\n };\n const trimmedApiVersion = trimOrUndefined(params.apiVersion);\n if (trimmedApiVersion) {\n envValues.AZURE_OPENAI_API_VERSION = trimmedApiVersion;\n }\n\n const trimmedDeploymentName = trimOrUndefined(params.deploymentName);\n if (trimmedDeploymentName && trimmedDeploymentName !== modelId) {\n envValues.AZURE_OPENAI_DEPLOYMENT_NAME_MAP = JSON.stringify({\n [modelId]: trimmedDeploymentName,\n });\n }\n\n await params.envStore.setMany(envValues);\n\n await upsertModelsProvider(params.modelsJsonPath, \"azure-openai-responses\", createAzureProviderConfig({\n baseUrl: params.baseUrl.trim(),\n modelId,\n useCustomModel,\n }));\n\n params.settingsManager.setDefaultModelAndProvider(\"azure-openai-responses\", modelId);\n}\n\nexport async function saveBedrockConfig(params: IDocyrusAuthFlowDependencies & IBedrockConfigInput): Promise<void> {\n params.authStorage.set(\"amazon-bedrock\", {\n type: \"api_key\",\n key: \"aws-configured\",\n });\n\n await params.envStore.removeMany([\n \"AWS_PROFILE\",\n \"AWS_ACCESS_KEY_ID\",\n \"AWS_SECRET_ACCESS_KEY\",\n \"AWS_SESSION_TOKEN\",\n \"AWS_REGION\",\n \"AWS_DEFAULT_REGION\",\n \"AWS_BEARER_TOKEN_BEDROCK\",\n ]);\n const envValues: Record<string, string> = {\n AWS_REGION: params.region.trim(),\n AWS_DEFAULT_REGION: params.region.trim(),\n };\n\n const profile = trimOrUndefined(params.profile);\n if (profile) {\n envValues.AWS_PROFILE = profile;\n }\n\n const accessKeyId = trimOrUndefined(params.accessKeyId);\n const secretAccessKey = trimOrUndefined(params.secretAccessKey);\n if (accessKeyId && secretAccessKey) {\n envValues.AWS_ACCESS_KEY_ID = accessKeyId;\n envValues.AWS_SECRET_ACCESS_KEY = secretAccessKey;\n }\n\n const sessionToken = trimOrUndefined(params.sessionToken);\n if (sessionToken) {\n envValues.AWS_SESSION_TOKEN = sessionToken;\n }\n\n await params.envStore.setMany(envValues);\n params.settingsManager.setDefaultModelAndProvider(\"amazon-bedrock\", params.modelId.trim());\n}\n\nexport async function clearProviderConfig(params: IDocyrusAuthFlowDependencies & {\n providerId: string;\n}): Promise<void> {\n params.authStorage.remove(params.providerId);\n\n if (params.providerId === \"custom-openai\") {\n await params.envStore.removeMany([\n \"CUSTOM_OPENAI_API_KEY\",\n ]);\n await removeModelsProvider(params.modelsJsonPath, \"custom-openai\");\n }\n\n if (params.providerId === \"azure-openai-responses\") {\n await params.envStore.removeMany([\n \"AZURE_OPENAI_API_KEY\",\n \"AZURE_OPENAI_API_VERSION\",\n \"AZURE_OPENAI_DEPLOYMENT_NAME_MAP\",\n ]);\n await removeModelsProvider(params.modelsJsonPath, \"azure-openai-responses\");\n }\n\n if (params.providerId === \"amazon-bedrock\") {\n await params.envStore.removeMany([\n \"AWS_PROFILE\",\n \"AWS_ACCESS_KEY_ID\",\n \"AWS_SECRET_ACCESS_KEY\",\n \"AWS_SESSION_TOKEN\",\n \"AWS_REGION\",\n \"AWS_DEFAULT_REGION\",\n \"AWS_BEARER_TOKEN_BEDROCK\",\n ]);\n }\n}\n", "export const DOCYRUS_LOGO: readonly string[] = [\n \"\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\",\n \"\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u255A\u2588\u2588\u2557 \u2588\u2588\u2554\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\",\n \"\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\",\n \"\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u255A\u2588\u2588\u2554\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\",\n \"\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\",\n \"\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\",\n];\n\nexport const DOCYRUS_LOGO_PRIMARY_HEX = \"#ef4444\";\nexport const DOCYRUS_LOGO_SHADOW_HEX = \"#3f4bff\";\n\nfunction colorizeHex(text: string, hex: string): string {\n const normalizedHex = hex.replace(\"#\", \"\");\n const red = parseInt(normalizedHex.slice(0, 2), 16);\n const green = parseInt(normalizedHex.slice(2, 4), 16);\n const blue = parseInt(normalizedHex.slice(4, 6), 16);\n\n return `\\x1b[38;2;${red};${green};${blue}m${text}\\x1b[0m`;\n}\n\nexport function renderDocyrusLogo(color: (text: string) => string = (text) => colorizeHex(text, DOCYRUS_LOGO_PRIMARY_HEX)): string {\n return `\\n${DOCYRUS_LOGO.map(color).join(\"\\n\")}\\n`;\n}\n\nexport function renderDocyrusLogoPrimary(): string {\n return renderDocyrusLogo();\n}\n", "import type { AgentEnvStore } from \"./envStore\";\n\nexport type IDocyrusAuthFlowId = \"oauth\" | \"generic-api-key\" | \"custom-openai\" | \"azure-openai-responses\" | \"amazon-bedrock\";\n\nexport interface IDocyrusProviderOption {\n id: string;\n label: string;\n hint?: string;\n flow: IDocyrusAuthFlowId;\n}\n\nconst OAUTH_ONLY_PROVIDER_IDS = new Set([\n \"github-copilot\",\n \"openai-codex\",\n \"google-gemini-cli\",\n \"google-antigravity\",\n]);\n\nconst PROVIDER_LABELS: Record<string, string> = {\n anthropic: \"Anthropic (Claude)\",\n openai: \"OpenAI\",\n google: \"Google (Gemini)\",\n \"google-vertex\": \"Google Vertex AI\",\n \"azure-openai-responses\": \"Azure OpenAI\",\n \"amazon-bedrock\": \"Amazon Bedrock\",\n xai: \"xAI (Grok)\",\n groq: \"Groq\",\n cerebras: \"Cerebras\",\n openrouter: \"OpenRouter\",\n \"vercel-ai-gateway\": \"Vercel AI Gateway\",\n zai: \"ZAI\",\n mistral: \"Mistral\",\n minimax: \"MiniMax\",\n \"minimax-cn\": \"MiniMax CN\",\n huggingface: \"Hugging Face\",\n opencode: \"OpenCode\",\n \"opencode-go\": \"OpenCode Go\",\n \"kimi-coding\": \"Kimi Coding\",\n \"custom-openai\": \"Custom OpenAI-Compatible\",\n \"google-gemini-cli\": \"Google Gemini CLI\",\n \"google-antigravity\": \"Google Antigravity\",\n \"openai-codex\": \"OpenAI Codex\",\n \"github-copilot\": \"GitHub Copilot\",\n};\n\nconst PROVIDER_HINTS: Record<string, string> = {\n anthropic: \"recommended\",\n \"custom-openai\": \"custom base URL + API key\",\n \"azure-openai-responses\": \"API key + base URL/resource + deployment\",\n \"amazon-bedrock\": \"AWS profile or access key pair\",\n \"openai-codex\": \"browser auth\",\n \"github-copilot\": \"browser auth\",\n \"google-gemini-cli\": \"browser auth\",\n \"google-antigravity\": \"browser auth\",\n};\n\nfunction humanizeProviderId(providerId: string): string {\n return providerId\n .split(\"-\")\n .map((part) => {\n if (!part) {return part;}\n if (part.length <= 3) {return part.toUpperCase();}\n return part[0].toUpperCase() + part.slice(1);\n })\n .join(\" \");\n}\n\nfunction toLabel(providerId: string): string {\n return PROVIDER_LABELS[providerId] || humanizeProviderId(providerId);\n}\n\nfunction toHint(providerId: string): string | undefined {\n return PROVIDER_HINTS[providerId];\n}\n\nfunction compareProviderOptions(a: IDocyrusProviderOption, b: IDocyrusProviderOption): number {\n return a.label.localeCompare(b.label);\n}\n\nexport function getBrowserAuthProviderOptions(oauthProviders: Array<{ id: string; name?: string }>): IDocyrusProviderOption[] {\n return oauthProviders\n .map((provider: { id: string; name?: string }) => ({\n id: provider.id,\n label: provider.name || toLabel(provider.id),\n hint: toHint(provider.id),\n flow: \"oauth\" as const,\n }))\n .sort(compareProviderOptions);\n}\n\nexport function getApiKeyProviderOptions(providerIds: string[]): IDocyrusProviderOption[] {\n const baseProviders: IDocyrusProviderOption[] = providerIds\n .filter((providerId: string) => !OAUTH_ONLY_PROVIDER_IDS.has(providerId))\n .map((providerId: string) => {\n let flow: IDocyrusAuthFlowId = \"generic-api-key\";\n if (providerId === \"azure-openai-responses\") {\n flow = \"azure-openai-responses\";\n }\n else if (providerId === \"amazon-bedrock\") {\n flow = \"amazon-bedrock\";\n }\n\n return {\n id: providerId,\n label: toLabel(providerId),\n hint: toHint(providerId),\n flow,\n } satisfies IDocyrusProviderOption;\n });\n\n baseProviders.push({\n id: \"custom-openai\",\n label: toLabel(\"custom-openai\"),\n hint: toHint(\"custom-openai\"),\n flow: \"custom-openai\",\n });\n\n const deduped = new Map<string, IDocyrusProviderOption>();\n for (const provider of baseProviders) {\n deduped.set(provider.id, provider);\n }\n\n return Array.from(deduped.values()).sort(compareProviderOptions);\n}\n\nexport async function findExistingConfiguredProvider(params: {\n authStorage: {\n hasAuth(providerId: string): boolean;\n };\n envStore: AgentEnvStore;\n knownProviderIds: string[];\n}): Promise<string | null> {\n for (const providerId of params.knownProviderIds) {\n if (params.authStorage.hasAuth(providerId)) {\n return providerId;\n }\n }\n\n const hasBedrock = await params.envStore.hasAny([\"AWS_PROFILE\", \"AWS_ACCESS_KEY_ID\", \"AWS_BEARER_TOKEN_BEDROCK\"]);\n if (hasBedrock) {\n return \"amazon-bedrock\";\n }\n\n return null;\n}\n\nexport function getProviderLabel(providerId: string): string {\n return toLabel(providerId);\n}\n\nexport function getProviderHint(providerId: string): string | undefined {\n return toHint(providerId);\n}\n", "import type { AuthStorage, InteractiveMode, SettingsManager } from \"@mariozechner/pi-coding-agent\";\nimport { clearProviderConfig, saveAzureConfig, saveBedrockConfig, saveCustomOpenAiConfig, saveGenericApiKey, type IDocyrusAuthFlowDependencies } from \"./authFlows\";\nimport { AgentEnvStore } from \"./envStore\";\nimport { renderDocyrusLogoPrimary } from \"./logo\";\nimport { getApiKeyProviderOptions, getProviderLabel, type IDocyrusProviderOption } from \"./providerCatalog\";\n\nexport interface IInteractiveAuthUiComponents {\n ExtensionInputComponent: new(\n title: string,\n placeholder: string | undefined,\n onSubmit: (value: string) => void,\n onCancel: () => void,\n options?: { tui?: unknown },\n ) => any;\n ExtensionSelectorComponent: new(\n title: string,\n options: string[],\n onSelect: (value: string) => void,\n onCancel: () => void,\n settings?: { tui?: unknown },\n ) => any;\n}\n\nexport interface IInteractiveAuthDependencies extends IDocyrusAuthFlowDependencies {\n authStorage: AuthStorage;\n envStore: AgentEnvStore;\n settingsManager: SettingsManager;\n modelsJsonPath: string;\n browserProviders: Array<{ id: string; name?: string }>;\n apiKeyProviderIds: string[];\n modelIdsByProvider: Record<string, string[]>;\n uiComponents: IInteractiveAuthUiComponents;\n}\n\nfunction modeAsAny(mode: InteractiveMode): any {\n return mode as any;\n}\n\nfunction getConfiguredProviderIds(dependencies: IInteractiveAuthDependencies): string[] {\n const ids = new Set<string>(dependencies.authStorage.list());\n return Array.from(ids.values()).sort((left, right) => getProviderLabel(left).localeCompare(getProviderLabel(right)));\n}\n\nfunction buildBrandedTitle(title: string): string {\n return `${renderDocyrusLogoPrimary().trim()}\\n\\n${title}`;\n}\n\nasync function showSelection(mode: InteractiveMode, title: string, options: Array<{ value: string; label: string; hint?: string }>): Promise<string | undefined> {\n const modeAny = modeAsAny(mode);\n const displayToValue = new Map<string, string>();\n const displayOptions = options.map((option) => {\n const display = option.hint\n ? `${option.label} \u2014 ${option.hint}`\n : option.label;\n displayToValue.set(display, option.value);\n return display;\n });\n\n return await new Promise((resolve) => {\n modeAny.showSelector((done: () => void) => {\n const selector = new modeAny.__docyrusUiComponents.ExtensionSelectorComponent(\n buildBrandedTitle(title),\n displayOptions,\n (selected: string) => {\n done();\n resolve(displayToValue.get(selected));\n },\n () => {\n done();\n resolve(undefined);\n },\n { tui: modeAny.ui },\n );\n\n return {\n component: selector,\n focus: selector,\n };\n });\n });\n}\n\nasync function showInput(mode: InteractiveMode, title: string, placeholder?: string): Promise<string | undefined> {\n const modeAny = modeAsAny(mode);\n return await new Promise((resolve) => {\n modeAny.showSelector((done: () => void) => {\n const input = new modeAny.__docyrusUiComponents.ExtensionInputComponent(\n buildBrandedTitle(title),\n placeholder,\n (value: string) => {\n done();\n resolve(value.trim() || undefined);\n },\n () => {\n done();\n resolve(undefined);\n },\n { tui: modeAny.ui },\n );\n\n return {\n component: input,\n focus: input,\n };\n });\n });\n}\n\nasync function refreshAfterCredentialChange(mode: InteractiveMode, preferredProviderId?: string, preferredModelId?: string): Promise<void> {\n const modeAny = modeAsAny(mode);\n modeAny.session.modelRegistry.refresh();\n await modeAny.updateAvailableProviderCount?.();\n\n const availableModels = modeAny.session.modelRegistry.getAvailable();\n const preferredModel = preferredProviderId && preferredModelId\n ? availableModels.find((model: { provider: string; id: string }) => (\n model.provider === preferredProviderId && model.id === preferredModelId\n ))\n : preferredProviderId\n ? availableModels.find((model: { provider: string }) => model.provider === preferredProviderId)\n : undefined;\n\n const currentModel = modeAny.session.model;\n const currentModelStillAvailable = currentModel\n ? availableModels.some((model: { provider: string; id: string }) => (\n model.provider === currentModel.provider && model.id === currentModel.id\n ))\n : false;\n\n if (currentModel && !currentModelStillAvailable) {\n if (preferredModel) {\n await modeAny.session.setModel(preferredModel);\n return;\n }\n\n if (availableModels[0]) {\n await modeAny.session.setModel(availableModels[0]);\n }\n return;\n }\n\n if (!currentModel && preferredModel) {\n await modeAny.session.setModel(preferredModel);\n return;\n }\n\n if (!currentModel && availableModels[0]) {\n await modeAny.session.setModel(availableModels[0]);\n }\n}\n\nasync function runApiKeyProviderFlow(mode: InteractiveMode, dependencies: IInteractiveAuthDependencies, provider: IDocyrusProviderOption): Promise<void> {\n const modeAny = modeAsAny(mode);\n\n switch (provider.flow) {\n case \"custom-openai\": {\n const baseUrl = await showInput(mode, \"Custom OpenAI base URL\", \"https://my-proxy.example.com/v1\");\n if (!baseUrl) {return;}\n const apiKey = await showInput(mode, \"Custom OpenAI API key\");\n if (!apiKey) {return;}\n const modelId = await showInput(mode, \"Model ID\", \"gpt-4o\");\n if (!modelId) {return;}\n\n await saveCustomOpenAiConfig({\n ...dependencies,\n baseUrl,\n apiKey,\n modelId,\n });\n await refreshAfterCredentialChange(mode, \"custom-openai\", modelId);\n modeAny.showStatus(`Configured ${provider.label}`);\n return;\n }\n\n case \"azure-openai-responses\": {\n const apiKey = await showInput(mode, \"Azure OpenAI API key\");\n if (!apiKey) {return;}\n\n const configMode = await showSelection(mode, \"Azure OpenAI configuration\", [\n { value: \"base-url\", label: \"Use a base URL\" },\n { value: \"resource-name\", label: \"Use an Azure resource name\" },\n ]);\n if (!configMode) {return;}\n\n let baseUrl: string | undefined;\n if (configMode === \"base-url\") {\n baseUrl = await showInput(mode, \"Azure OpenAI base URL\", \"https://my-resource.openai.azure.com/openai/v1\");\n }\n else {\n const resourceName = await showInput(mode, \"Azure resource name\", \"my-resource\");\n if (resourceName) {\n baseUrl = `https://${resourceName}.openai.azure.com/openai/v1`;\n }\n }\n if (!baseUrl) {return;}\n\n const modelId = await showInput(mode, \"Model ID\", dependencies.modelIdsByProvider[\"azure-openai-responses\"]?.[0] || \"gpt-4.1\");\n if (!modelId) {return;}\n\n const deploymentName = await showInput(mode, \"Deployment name (optional)\", modelId);\n const apiVersion = await showInput(mode, \"API version (optional)\", \"2025-03-01-preview\");\n const builtInModelIds = new Set(dependencies.modelIdsByProvider[\"azure-openai-responses\"] || []);\n\n await saveAzureConfig({\n ...dependencies,\n apiKey,\n baseUrl,\n modelId,\n deploymentName,\n apiVersion,\n useCustomModel: !builtInModelIds.has(modelId),\n });\n await refreshAfterCredentialChange(mode, \"azure-openai-responses\", modelId);\n modeAny.showStatus(`Configured ${provider.label}`);\n return;\n }\n\n case \"amazon-bedrock\": {\n const authMode = await showSelection(mode, \"Amazon Bedrock authentication\", [\n { value: \"profile\", label: \"Use an AWS profile\" },\n { value: \"access-keys\", label: \"Paste AWS access keys\" },\n ]);\n if (!authMode) {return;}\n\n let profile: string | undefined;\n let accessKeyId: string | undefined;\n let secretAccessKey: string | undefined;\n let sessionToken: string | undefined;\n\n if (authMode === \"profile\") {\n profile = await showInput(mode, \"AWS profile name\", \"default\");\n if (!profile) {return;}\n }\n else {\n accessKeyId = await showInput(mode, \"AWS access key ID\");\n if (!accessKeyId) {return;}\n secretAccessKey = await showInput(mode, \"AWS secret access key\");\n if (!secretAccessKey) {return;}\n sessionToken = await showInput(mode, \"AWS session token (optional)\");\n }\n\n const region = await showInput(mode, \"AWS region\", \"us-east-1\");\n if (!region) {return;}\n\n const modelId = await showInput(mode, \"Bedrock model ID\", dependencies.modelIdsByProvider[\"amazon-bedrock\"]?.[0] || \"anthropic.claude-3-7-sonnet-20250219-v1:0\");\n if (!modelId) {return;}\n\n await saveBedrockConfig({\n ...dependencies,\n region,\n modelId,\n profile,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n });\n await refreshAfterCredentialChange(mode, \"amazon-bedrock\", modelId);\n modeAny.showStatus(`Configured ${provider.label}`);\n return;\n }\n\n case \"generic-api-key\":\n default: {\n const apiKey = await showInput(mode, `${provider.label} API key`);\n if (!apiKey) {return;}\n\n await saveGenericApiKey({\n ...dependencies,\n providerId: provider.id,\n apiKey,\n });\n await refreshAfterCredentialChange(mode, provider.id);\n modeAny.showStatus(`Configured ${provider.label}`);\n }\n }\n}\n\nasync function handleInteractiveLogin(mode: InteractiveMode, dependencies: IInteractiveAuthDependencies): Promise<void> {\n const modeAny = modeAsAny(mode);\n const method = await showSelection(mode, \"How do you want to sign in?\", [\n { value: \"browser\", label: \"Sign in with your browser\", hint: \"OAuth-backed providers\" },\n { value: \"api-key\", label: \"Paste an API key\", hint: \"provider dashboard\" },\n ]);\n\n if (!method) {\n modeAny.showStatus(\"Login cancelled\");\n return;\n }\n\n if (method === \"browser\") {\n await modeAny.showOAuthSelector(\"login\");\n return;\n }\n\n const providerId = await showSelection(mode, \"Choose provider\", getApiKeyProviderOptions(dependencies.apiKeyProviderIds).map((provider) => ({\n value: provider.id,\n label: provider.label,\n hint: provider.hint,\n })));\n\n if (!providerId) {\n modeAny.showStatus(\"Login cancelled\");\n return;\n }\n\n const provider = getApiKeyProviderOptions(dependencies.apiKeyProviderIds).find((item) => item.id === providerId);\n if (!provider) {\n modeAny.showError(`Unknown provider: ${providerId}`);\n return;\n }\n\n try {\n await runApiKeyProviderFlow(mode, dependencies, provider);\n }\n catch (error: unknown) {\n modeAny.showError(`Failed to login to ${provider.label}: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n\nasync function handleInteractiveLogout(mode: InteractiveMode, dependencies: IInteractiveAuthDependencies): Promise<void> {\n const modeAny = modeAsAny(mode);\n const configuredProviderIds = getConfiguredProviderIds(dependencies);\n if (configuredProviderIds.length === 0) {\n modeAny.showStatus(\"No saved providers to remove.\");\n return;\n }\n\n const providerId = await showSelection(mode, \"Remove which saved provider?\", configuredProviderIds.map((id) => ({\n value: id,\n label: getProviderLabel(id),\n })));\n\n if (!providerId) {\n modeAny.showStatus(\"Logout cancelled\");\n return;\n }\n\n try {\n await clearProviderConfig({\n ...dependencies,\n providerId,\n });\n await refreshAfterCredentialChange(mode);\n modeAny.showStatus(`Removed ${getProviderLabel(providerId)}`);\n }\n catch (error: unknown) {\n modeAny.showError(`Failed to remove ${getProviderLabel(providerId)}: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n\nexport function installInteractiveAuthInterceptors(mode: InteractiveMode, dependencies: IInteractiveAuthDependencies): void {\n const modeAny = modeAsAny(mode);\n modeAny.__docyrusUiComponents = dependencies.uiComponents;\n const defaultEditor = modeAny.defaultEditor;\n if (!defaultEditor || typeof defaultEditor.onSubmit !== \"function\") {\n return;\n }\n\n const originalOnSubmit = defaultEditor.onSubmit.bind(defaultEditor);\n\n defaultEditor.onSubmit = async(text: string) => {\n const trimmed = text.trim();\n if (trimmed === \"/login\") {\n modeAny.editor.setText(\"\");\n await handleInteractiveLogin(mode, dependencies);\n return;\n }\n\n if (trimmed === \"/logout\") {\n modeAny.editor.setText(\"\");\n await handleInteractiveLogout(mode, dependencies);\n return;\n }\n\n await originalOnSubmit(text);\n };\n\n if (modeAny.editor === defaultEditor) {\n modeAny.editor.onSubmit = defaultEditor.onSubmit;\n }\n}\n", "import { exec } from \"node:child_process\";\nimport type { AuthStorage, SettingsManager } from \"@mariozechner/pi-coding-agent\";\nimport { clearProviderConfig, saveAzureConfig, saveBedrockConfig, saveCustomOpenAiConfig, saveGenericApiKey, type IDocyrusAuthFlowDependencies } from \"./authFlows\";\nimport { AgentEnvStore } from \"./envStore\";\nimport { renderDocyrusLogoPrimary } from \"./logo\";\nimport { findExistingConfiguredProvider, getApiKeyProviderOptions, getBrowserAuthProviderOptions, getProviderLabel, type IDocyrusProviderOption } from \"./providerCatalog\";\n\ntype IClackModule = typeof import(\"@clack/prompts\");\ntype IPicoModule = typeof import(\"picocolors\");\n\nconst API_KEY_PREFIXES: Record<string, string[]> = {\n anthropic: [\"sk-ant-\"],\n openai: [\"sk-\"],\n};\n\nexport interface IDocyrusOnboardingDependencies extends IDocyrusAuthFlowDependencies {\n authStorage: AuthStorage;\n envStore: AgentEnvStore;\n settingsManager: SettingsManager;\n modelsJsonPath: string;\n browserProviders: Array<{ id: string; name?: string }>;\n apiKeyProviderIds: string[];\n modelIdsByProvider: Record<string, string[]>;\n}\n\nasync function loadClack(): Promise<IClackModule> {\n return await import(\"@clack/prompts\");\n}\n\nasync function loadPico(): Promise<IPicoModule> {\n return await import(\"picocolors\");\n}\n\nfunction isCancelError(clack: IClackModule, value: unknown): boolean {\n return clack.isCancel(value);\n}\n\nfunction openBrowser(url: string): void {\n const command = process.platform === \"darwin\"\n ? \"open\"\n : process.platform === \"win32\"\n ? \"start\"\n : \"xdg-open\";\n exec(`${command} \"${url}\"`, () => {\n // best effort\n });\n}\n\nexport async function shouldRunOnboarding(params: {\n authStorage: AuthStorage;\n envStore: AgentEnvStore;\n settingsManager: SettingsManager;\n isInteractive: boolean;\n isPrintMode: boolean;\n browserProviders: Array<{ id: string; name?: string }>;\n apiKeyProviderIds: string[];\n modelIdsByProvider: Record<string, string[]>;\n}): Promise<boolean> {\n if (!params.isInteractive || params.isPrintMode) {\n return false;\n }\n\n if (params.settingsManager.getDefaultProvider()) {\n return false;\n }\n\n const existingProvider = await findExistingConfiguredProvider({\n authStorage: params.authStorage,\n envStore: params.envStore,\n knownProviderIds: [\n ...params.browserProviders.map((provider) => provider.id),\n ...params.apiKeyProviderIds,\n \"custom-openai\",\n ],\n });\n\n return !existingProvider;\n}\n\nexport function cleanupOnboardingStdinState(): void {\n process.stdin.removeAllListeners(\"data\");\n process.stdin.removeAllListeners(\"keypress\");\n if (process.stdin.setRawMode) {\n process.stdin.setRawMode(false);\n }\n process.stdin.pause();\n}\n\nasync function runOAuthFlow(clack: IClackModule, pico: IPicoModule, dependencies: IDocyrusOnboardingDependencies, providerId: string): Promise<boolean> {\n const providerInfo = getBrowserAuthProviderOptions(dependencies.browserProviders).find((provider) => provider.id === providerId);\n const providerName = providerInfo?.label || getProviderLabel(providerId);\n const spinner = clack.spinner();\n spinner.start(`Authenticating with ${providerName}...`);\n\n try {\n await dependencies.authStorage.login(providerId, {\n onAuth: (info: { url: string; instructions?: string }) => {\n spinner.stop(`Opening browser for ${providerName}`);\n openBrowser(info.url);\n clack.log.info(`${pico.dim(\"URL:\")} ${pico.cyan(info.url)}`);\n if (info.instructions) {\n clack.log.info(pico.yellow(info.instructions));\n }\n },\n onPrompt: async(prompt: { message: string; placeholder?: string }) => {\n const result = await clack.text({\n message: prompt.message,\n placeholder: prompt.placeholder,\n });\n\n if (clack.isCancel(result)) {\n return \"\";\n }\n\n return String(result);\n },\n onProgress: (message: string) => {\n clack.log.step(pico.dim(message));\n },\n onManualCodeInput: async() => {\n const result = await clack.text({\n message: \"Paste the redirect URL from your browser:\",\n placeholder: \"http://localhost:...\",\n });\n\n if (clack.isCancel(result)) {\n return \"\";\n }\n\n return String(result);\n },\n });\n\n clack.log.success(`Authenticated with ${pico.green(providerName)}`);\n return true;\n }\n catch (error: unknown) {\n spinner.stop(`${providerName} authentication failed`);\n clack.log.warn(`OAuth error: ${error instanceof Error ? error.message : String(error)}`);\n return false;\n }\n}\n\nasync function runGenericApiKeyFlow(clack: IClackModule, pico: IPicoModule, dependencies: IDocyrusOnboardingDependencies, provider: IDocyrusProviderOption): Promise<boolean> {\n const apiKey = await clack.password({\n message: `Paste your ${provider.label} API key:`,\n mask: \"\u25CF\",\n });\n\n if (clack.isCancel(apiKey) || !apiKey) {\n return false;\n }\n\n const trimmed = String(apiKey).trim();\n if (!trimmed) {\n return false;\n }\n\n const expectedPrefixes = API_KEY_PREFIXES[provider.id];\n if (expectedPrefixes && !expectedPrefixes.some((prefix) => trimmed.startsWith(prefix))) {\n clack.log.warn(`Key doesn't start with expected prefix (${expectedPrefixes.join(\" or \")}). Saving anyway.`);\n }\n\n await saveGenericApiKey({\n ...dependencies,\n providerId: provider.id,\n apiKey: trimmed,\n });\n\n clack.log.success(`API key saved for ${pico.green(provider.label)}`);\n return true;\n}\n\nasync function runCustomOpenAiFlow(clack: IClackModule, pico: IPicoModule, dependencies: IDocyrusOnboardingDependencies): Promise<boolean> {\n const baseUrl = await clack.text({\n message: \"Base URL of your OpenAI-compatible endpoint:\",\n placeholder: \"https://my-proxy.example.com/v1\",\n validate: (value: string | undefined) => {\n const trimmed = value?.trim();\n if (!trimmed) {\n return \"Base URL is required\";\n }\n\n try {\n new URL(trimmed);\n }\n catch {\n return \"Must be a valid URL\";\n }\n },\n });\n\n if (clack.isCancel(baseUrl) || !baseUrl) {\n return false;\n }\n\n const apiKey = await clack.password({\n message: \"API key for this endpoint:\",\n mask: \"\u25CF\",\n });\n\n if (clack.isCancel(apiKey) || !apiKey) {\n return false;\n }\n\n const modelId = await clack.text({\n message: \"Model ID to use:\",\n placeholder: \"gpt-4o\",\n validate: (value: string | undefined) => value?.trim() ? undefined : \"Model ID is required\",\n });\n\n if (clack.isCancel(modelId) || !modelId) {\n return false;\n }\n\n await saveCustomOpenAiConfig({\n ...dependencies,\n apiKey: String(apiKey).trim(),\n baseUrl: String(baseUrl).trim(),\n modelId: String(modelId).trim(),\n });\n\n clack.log.success(`Custom endpoint saved: ${pico.green(String(baseUrl).trim())}`);\n clack.log.info(`Model: ${pico.cyan(String(modelId).trim())}`);\n return true;\n}\n\nasync function runAzureFlow(clack: IClackModule, pico: IPicoModule, dependencies: IDocyrusOnboardingDependencies): Promise<boolean> {\n const apiKey = await clack.password({\n message: \"Paste your Azure OpenAI API key:\",\n mask: \"\u25CF\",\n });\n\n if (clack.isCancel(apiKey) || !apiKey) {\n return false;\n }\n\n const configMode = await clack.select({\n message: \"How do you want to configure Azure OpenAI?\",\n options: [\n { value: \"base-url\", label: \"Use a base URL\" },\n { value: \"resource-name\", label: \"Use an Azure resource name\" },\n ],\n });\n\n if (clack.isCancel(configMode) || !configMode) {\n return false;\n }\n\n let baseUrl = \"\";\n if (configMode === \"base-url\") {\n const baseUrlInput = await clack.text({\n message: \"Azure OpenAI base URL:\",\n placeholder: \"https://my-resource.openai.azure.com/openai/v1\",\n validate: (value: string | undefined) => value?.trim() ? undefined : \"Base URL is required\",\n });\n\n if (clack.isCancel(baseUrlInput) || !baseUrlInput) {\n return false;\n }\n\n baseUrl = String(baseUrlInput).trim();\n }\n else {\n const resourceName = await clack.text({\n message: \"Azure resource name:\",\n placeholder: \"my-resource\",\n validate: (value: string | undefined) => value?.trim() ? undefined : \"Resource name is required\",\n });\n\n if (clack.isCancel(resourceName) || !resourceName) {\n return false;\n }\n\n baseUrl = `https://${String(resourceName).trim()}.openai.azure.com/openai/v1`;\n }\n\n const modelId = await clack.text({\n message: \"Model ID to use:\",\n placeholder: dependencies.modelIdsByProvider[\"azure-openai-responses\"]?.[0] || \"gpt-4.1\",\n validate: (value: string | undefined) => value?.trim() ? undefined : \"Model ID is required\",\n });\n\n if (clack.isCancel(modelId) || !modelId) {\n return false;\n }\n\n const deploymentName = await clack.text({\n message: `Deployment name ${pico.dim(\"(leave blank to reuse the model id)\")}:`,\n placeholder: String(modelId).trim(),\n });\n\n if (clack.isCancel(deploymentName)) {\n return false;\n }\n\n const apiVersion = await clack.text({\n message: `API version ${pico.dim(\"(leave blank to use pi's default)\")}:`,\n placeholder: \"2025-03-01-preview\",\n });\n\n if (clack.isCancel(apiVersion)) {\n return false;\n }\n\n const builtInModelIds = new Set(dependencies.modelIdsByProvider[\"azure-openai-responses\"] || []);\n await saveAzureConfig({\n ...dependencies,\n apiKey: String(apiKey).trim(),\n baseUrl,\n modelId: String(modelId).trim(),\n deploymentName: String(deploymentName || \"\").trim() || undefined,\n apiVersion: String(apiVersion || \"\").trim() || undefined,\n useCustomModel: !builtInModelIds.has(String(modelId).trim()),\n });\n\n clack.log.success(`Azure OpenAI configured for ${pico.green(String(modelId).trim())}`);\n return true;\n}\n\nasync function runBedrockFlow(clack: IClackModule, pico: IPicoModule, dependencies: IDocyrusOnboardingDependencies): Promise<boolean> {\n const authMode = await clack.select({\n message: \"How do you want to authenticate with Amazon Bedrock?\",\n options: [\n { value: \"profile\", label: \"Use an AWS profile\" },\n { value: \"access-keys\", label: \"Paste AWS access keys\" },\n ],\n });\n\n if (clack.isCancel(authMode) || !authMode) {\n return false;\n }\n\n let profile: string | undefined;\n let accessKeyId: string | undefined;\n let secretAccessKey: string | undefined;\n let sessionToken: string | undefined;\n\n if (authMode === \"profile\") {\n const profileInput = await clack.text({\n message: \"AWS profile name:\",\n placeholder: \"default\",\n validate: (value: string | undefined) => value?.trim() ? undefined : \"Profile name is required\",\n });\n\n if (clack.isCancel(profileInput) || !profileInput) {\n return false;\n }\n\n profile = String(profileInput).trim();\n }\n else {\n const accessKeyInput = await clack.password({\n message: \"AWS access key ID:\",\n mask: \"\u25CF\",\n });\n if (clack.isCancel(accessKeyInput) || !accessKeyInput) {\n return false;\n }\n\n const secretKeyInput = await clack.password({\n message: \"AWS secret access key:\",\n mask: \"\u25CF\",\n });\n if (clack.isCancel(secretKeyInput) || !secretKeyInput) {\n return false;\n }\n\n const sessionTokenInput = await clack.password({\n message: `AWS session token ${pico.dim(\"(optional)\")}:`,\n mask: \"\u25CF\",\n });\n if (clack.isCancel(sessionTokenInput)) {\n return false;\n }\n\n accessKeyId = String(accessKeyInput).trim();\n secretAccessKey = String(secretKeyInput).trim();\n sessionToken = String(sessionTokenInput || \"\").trim() || undefined;\n }\n\n const region = await clack.text({\n message: \"AWS region:\",\n placeholder: \"us-east-1\",\n validate: (value: string | undefined) => value?.trim() ? undefined : \"Region is required\",\n });\n\n if (clack.isCancel(region) || !region) {\n return false;\n }\n\n const modelId = await clack.text({\n message: \"Bedrock model ID:\",\n placeholder: dependencies.modelIdsByProvider[\"amazon-bedrock\"]?.[0] || \"anthropic.claude-3-7-sonnet-20250219-v1:0\",\n validate: (value: string | undefined) => value?.trim() ? undefined : \"Model ID is required\",\n });\n\n if (clack.isCancel(modelId) || !modelId) {\n return false;\n }\n\n await saveBedrockConfig({\n ...dependencies,\n region: String(region).trim(),\n modelId: String(modelId).trim(),\n profile,\n accessKeyId,\n secretAccessKey,\n sessionToken,\n });\n\n clack.log.success(`Amazon Bedrock configured for ${pico.green(String(modelId).trim())}`);\n return true;\n}\n\nasync function runProviderFlow(clack: IClackModule, pico: IPicoModule, dependencies: IDocyrusOnboardingDependencies, provider: IDocyrusProviderOption): Promise<boolean> {\n switch (provider.flow) {\n case \"oauth\":\n return await runOAuthFlow(clack, pico, dependencies, provider.id);\n case \"custom-openai\":\n return await runCustomOpenAiFlow(clack, pico, dependencies);\n case \"azure-openai-responses\":\n return await runAzureFlow(clack, pico, dependencies);\n case \"amazon-bedrock\":\n return await runBedrockFlow(clack, pico, dependencies);\n case \"generic-api-key\":\n default:\n return await runGenericApiKeyFlow(clack, pico, dependencies, provider);\n }\n}\n\nasync function runLogoutFlow(clack: IClackModule, pico: IPicoModule, dependencies: IDocyrusOnboardingDependencies, providerId: string): Promise<void> {\n await clearProviderConfig({\n ...dependencies,\n providerId,\n });\n clack.log.success(`Removed saved configuration for ${pico.green(getProviderLabel(providerId))}`);\n}\n\nexport async function runOnboarding(dependencies: IDocyrusOnboardingDependencies): Promise<void> {\n const [clack, pico] = await Promise.all([loadClack(), loadPico()]);\n process.stderr.write(renderDocyrusLogoPrimary());\n clack.intro(pico.bold(\"Welcome to DOCYRUS \u2014 let's get you set up\"));\n\n const existingProvider = await findExistingConfiguredProvider({\n authStorage: dependencies.authStorage,\n envStore: dependencies.envStore,\n knownProviderIds: [\n ...dependencies.browserProviders.map((provider) => provider.id),\n ...dependencies.apiKeyProviderIds,\n \"custom-openai\",\n ],\n });\n\n type IAuthOption = { value: string; label: string; hint?: string; providerId?: string };\n const authOptions: IAuthOption[] = [];\n if (existingProvider) {\n authOptions.push({\n value: \"keep\",\n label: `Keep current (${getProviderLabel(existingProvider)})`,\n hint: \"already configured\",\n providerId: existingProvider,\n });\n authOptions.push({\n value: \"logout-current\",\n label: `Remove current (${getProviderLabel(existingProvider)})`,\n hint: \"clear saved auth and config\",\n providerId: existingProvider,\n });\n }\n\n authOptions.push(\n { value: \"browser\", label: \"Sign in with your browser\", hint: \"recommended for OAuth-backed providers\" },\n { value: \"api-key\", label: \"Paste an API key\", hint: \"from your provider dashboard\" },\n { value: \"skip\", label: \"Skip for now\", hint: \"you can use /login inside DOCYRUS later\" },\n );\n\n const authMethod = await clack.select({\n message: existingProvider ? `LLM provider: ${getProviderLabel(existingProvider)} \u2014 change it?` : \"How do you want to sign in?\",\n options: authOptions.map((option) => ({\n value: option.value,\n label: option.label,\n hint: option.hint,\n })),\n });\n\n if (isCancelError(clack, authMethod) || authMethod === \"skip\") {\n clack.cancel(\"Setup skipped \u2014 you can run /login later inside DOCYRUS.\");\n return;\n }\n\n if (authMethod === \"keep\") {\n clack.log.success(`Keeping ${pico.green(getProviderLabel(existingProvider || \"\"))}`);\n clack.outro(\"DOCYRUS setup complete.\");\n return;\n }\n\n if (authMethod === \"logout-current\" && existingProvider) {\n await runLogoutFlow(clack, pico, dependencies, existingProvider);\n }\n\n let configuredProviderLabel: string | null = null;\n\n if (authMethod === \"browser\") {\n const provider = await clack.select({\n message: \"Choose provider\",\n options: getBrowserAuthProviderOptions(dependencies.browserProviders).map((providerOption) => ({\n value: providerOption.id,\n label: providerOption.label,\n hint: providerOption.hint,\n })),\n });\n\n if (!isCancelError(clack, provider) && provider) {\n const selected = getBrowserAuthProviderOptions(dependencies.browserProviders).find((item) => item.id === provider);\n if (selected && await runProviderFlow(clack, pico, dependencies, selected)) {\n configuredProviderLabel = selected.label;\n }\n }\n }\n else if (authMethod === \"api-key\") {\n const provider = await clack.select({\n message: \"Choose provider\",\n options: getApiKeyProviderOptions(dependencies.apiKeyProviderIds).map((providerOption) => ({\n value: providerOption.id,\n label: providerOption.label,\n hint: providerOption.hint,\n })),\n });\n\n if (!isCancelError(clack, provider) && provider) {\n const selected = getApiKeyProviderOptions(dependencies.apiKeyProviderIds).find((item) => item.id === provider);\n if (selected && await runProviderFlow(clack, pico, dependencies, selected)) {\n configuredProviderLabel = selected.label;\n }\n }\n }\n\n if (configuredProviderLabel) {\n clack.outro(`DOCYRUS is ready. Provider configured: ${pico.green(configuredProviderLabel)}`);\n }\n else {\n clack.outro(\"DOCYRUS setup ended without saving a provider.\");\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,oFAAAA,UAAAC,SAAA;AAAA;AAAA,QAAIC,KAAI,WAAW,CAAC;AAApB,QAAuB,OAAOA,GAAE,QAAQ,CAAC;AAAzC,QAA4C,MAAMA,GAAE,OAAO,CAAC;AAC5D,QAAI,mBACH,EAAE,CAAC,CAAC,IAAI,YAAY,KAAK,SAAS,YAAY,OAC7C,CAAC,CAAC,IAAI,eAAe,KAAK,SAAS,SAA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,GAAG;AAAA,QAC5B,4BAA4B,GAAG;AAAA,MACjC;AAAA,IACF,CAAC;AAAA,EACH;AAEA,QAAM,gBAAgB,IAAI;AAC5B;AAEA,KAAK,KAAK,EAAE,MAAM,CAAC,UAAmB;AACpC,QAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AACrE,UAAQ,OAAO,MAAM,GAAG,OAAO;AAAA,CAAI;AACnC,UAAQ,WAAW;AACrB,CAAC;",
6
+ "names": ["exports", "module", "p", "exports", "module", "x", "y", "ansiRegex", "onlyFirst", "pattern", "stripAnsi", "string", "regex", "e", "stringWidth", "options", "emojiRegex", "ambiguousCharacterWidth", "width", "character", "codePoint", "eastAsianWidth", "assembleStyles", "codes", "groupName", "group", "styles", "styleName", "style", "wrapAnsi16", "wrapAnsi256", "wrapAnsi16m", "ANSI_BACKGROUND_OFFSET", "red", "green", "blue", "hex", "matches", "colorString", "integer", "code", "remainder", "value", "result", "wrapAnsi", "columns", "line", "exec", "updateSettings", "updates", "_key", "key", "alias", "settings", "isActionKey", "action", "diffLines", "a", "b", "aLines", "bLines", "diff", "i", "isCancel", "CANCEL_SYMBOL", "setRawMode", "input", "block", "stdin", "output", "stdout", "overwrite", "hideCursor", "rl", "readline", "clear", "data", "name", "sequence", "str", "cursor", "dx", "dy", "isWindows", "foregroundColorNames", "backgroundColorNames", "ansiStyles", "ESCAPES", "END_CODE", "ANSI_ESCAPE_BELL", "ANSI_CSI", "ANSI_OSC", "ANSI_SGR_TERMINATOR", "ANSI_ESCAPE_LINK", "wrapAnsiCode", "wrapAnsiHyperlink", "wordLengths", "wrapWord", "stringVisibleTrimSpacesRight", "actions", "v", "s", "Prompt", "ConfirmPrompt", "g", "n", "c", "l", "h", "p", "_selectableGroups", "o", "PasswordPrompt", "SelectPrompt", "SelectKeyPrompt", "TextPrompt", "eaw", "module", "x", "y", "stringToArray", "characters", "len", "text", "start", "end", "eawLen", "chars", "char", "charLen", "offset", "uri", "rows", "word", "isInsideEscape", "isInsideLinkEscape", "visible", "index", "characterLength", "words", "last", "returnValue", "escapeCode", "escapeUrl", "lengths", "rowLength", "remainingColumns", "breaksStartingThisLine", "row", "pre", "groups", "t", "trackValue", "__publicField", "render", "signal", "opts", "event", "params", "cb", "cbs", "cleanup", "subscriber", "resolve", "reject", "sink", "Writable", "chunk", "encoding", "done", "problem", "lines", "wrap", "frame", "diffLine", "erase", "newLines", "confirm", "__privateAdd", "__privateSet", "option", "opt", "__privateGet", "currentIsGroup", "item", "groupedItems", "selected", "allSelected", "u", "mask", "color", "s1", "s2", "keys", "initial", "s3", "isUnicodeSupported", "process", "unicode", "s", "S_STEP_ACTIVE", "S_STEP_CANCEL", "S_STEP_ERROR", "S_STEP_SUBMIT", "S_BAR_START", "S_BAR", "S_BAR_END", "S_RADIO_ACTIVE", "S_RADIO_INACTIVE", "S_CHECKBOX_ACTIVE", "S_CHECKBOX_SELECTED", "S_CHECKBOX_INACTIVE", "S_PASSWORD_MASK", "S_BAR_H", "S_CORNER_TOP_RIGHT", "S_CONNECT_LEFT", "S_CORNER_BOTTOM_RIGHT", "S_INFO", "S_SUCCESS", "S_WARN", "S_ERROR", "symbol", "limitOptions", "text", "password", "confirm", "select", "selectKey", "multiselect", "groupMultiselect", "note", "cancel", "intro", "outro", "log", "prefix", "stream", "spinner", "group", "tasks", "c", "fallback", "state", "color", "params", "cursor", "options", "style", "paramMaxItems", "outputMaxItems", "maxItems", "slidingWindowLocation", "shouldRenderTopEllipsis", "shouldRenderBottomEllipsis", "option", "i", "arr", "isTopLimit", "isBottomLimit", "opts", "TextPrompt", "title", "placeholder", "value", "PasswordPrompt", "masked", "active", "inactive", "ConfirmPrompt", "opt", "label", "SelectPrompt", "item", "SelectKeyPrompt", "MultiSelectPrompt", "selected", "styleOption", "footer", "ln", "selectableGroups", "isItem", "next", "isLast", "selectedCheckbox", "unselectedCheckbox", "GroupMultiSelectPrompt", "message", "lines", "titleLen", "strip", "len", "sum", "line", "msg", "parts", "firstLine", "iterable", "lineWidth", "chunk", "chunkLen", "indicator", "frames", "delay", "isCI", "unblock", "loop", "isSpinnerActive", "_message", "_prevMessage", "_origin", "handleExit", "code", "stop", "errorEventHandler", "signalEventHandler", "registerHooks", "clearHooks", "clearPrevMessage", "prevLines", "erase", "parseMessage", "formatTimer", "origin", "duration", "min", "secs", "start", "block", "frameIndex", "indicatorTimer", "frame", "loadingDots", "step", "prompts", "results", "promptNames", "name", "prompt", "result", "e", "isCancel", "task", "import_node_path", "import_picocolors", "import_promises", "import_node_path", "createDefaultState", "b", "provider", "resolvePath", "picocolors"]
7
+ }