agentprofiles-cli 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +91 -55
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../node_modules/tsup/assets/esm_shims.js","../node_modules/citty/dist/_chunks/libs/scule.mjs","../node_modules/citty/dist/index.mjs","../node_modules/picocolors/picocolors.js","../node_modules/sisteransi/src/index.js","../node_modules/@clack/core/src/utils/cursor.ts","../node_modules/node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js","../node_modules/node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js","../node_modules/node_modules/.pnpm/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js","../node_modules/node_modules/.pnpm/fast-wrap-ansi@0.1.3/node_modules/fast-wrap-ansi/lib/main.js","../node_modules/@clack/core/src/utils/settings.ts","../node_modules/@clack/core/src/utils/string.ts","../node_modules/@clack/core/src/utils/index.ts","../node_modules/@clack/core/src/prompts/prompt.ts","../node_modules/@clack/core/src/prompts/autocomplete.ts","../node_modules/@clack/core/src/prompts/confirm.ts","../node_modules/@clack/core/src/prompts/group-multiselect.ts","../node_modules/@clack/core/src/prompts/multi-select.ts","../node_modules/@clack/core/src/prompts/password.ts","../node_modules/@clack/core/src/prompts/select.ts","../node_modules/@clack/core/src/prompts/select-key.ts","../node_modules/@clack/core/src/prompts/text.ts","../node_modules/node_modules/.pnpm/is-unicode-supported@1.3.0/node_modules/is-unicode-supported/index.js","../node_modules/@clack/prompts/src/common.ts","../node_modules/node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js","../node_modules/node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js","../node_modules/node_modules/.pnpm/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js","../node_modules/node_modules/.pnpm/fast-wrap-ansi@0.1.3/node_modules/fast-wrap-ansi/lib/main.js","../node_modules/@clack/prompts/src/limit-options.ts","../node_modules/@clack/prompts/src/autocomplete.ts","../node_modules/@clack/prompts/src/box.ts","../node_modules/@clack/prompts/src/confirm.ts","../node_modules/@clack/prompts/src/group.ts","../node_modules/@clack/prompts/src/group-multi-select.ts","../node_modules/@clack/prompts/src/log.ts","../node_modules/@clack/prompts/src/messages.ts","../node_modules/@clack/prompts/src/multi-select.ts","../node_modules/@clack/prompts/src/note.ts","../node_modules/@clack/prompts/src/password.ts","../node_modules/@clack/prompts/src/path.ts","../node_modules/@clack/prompts/src/spinner.ts","../node_modules/@clack/prompts/src/progress-bar.ts","../node_modules/@clack/prompts/src/select.ts","../node_modules/@clack/prompts/src/select-key.ts","../node_modules/@clack/prompts/src/stream.ts","../node_modules/@clack/prompts/src/task.ts","../node_modules/@clack/prompts/src/task-log.ts","../node_modules/@clack/prompts/src/text.ts","../src/types/index.ts","../src/lib/validation.ts","../src/lib/profileinclude.ts","../src/lib/gitignore.ts","../src/lib/symlink.ts","../src/lib/config.ts","../src/lib/onboarding.ts","../src/commands/status.ts","../src/commands/list.ts","../node_modules/joyful/dist/index.mjs","../src/lib/prompts.ts","../src/commands/add.ts","../src/commands/set.ts","../src/commands/unset.ts","../src/commands/edit.ts","../src/commands/remove.ts","../src/commands/release.ts","../src/commands/doctor.ts","../src/lib/main-menu.ts","../src/commands/setup.ts","../src/commands/init.ts","../src/commands/create.ts","../src/commands/rm.ts","../src/index.ts","../src/lib/banner.ts","../src/lib/update.ts"],"sourcesContent":["// Shim globals in esm bundle\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","const NUMBER_CHAR_RE = /\\d/;\nconst STR_SPLITTERS = [\n\t\"-\",\n\t\"_\",\n\t\"/\",\n\t\".\"\n];\nfunction isUppercase(char = \"\") {\n\tif (NUMBER_CHAR_RE.test(char)) return;\n\treturn char !== char.toLowerCase();\n}\nfunction splitByCase(str, separators) {\n\tconst splitters = separators ?? STR_SPLITTERS;\n\tconst parts = [];\n\tif (!str || typeof str !== \"string\") return parts;\n\tlet buff = \"\";\n\tlet previousUpper;\n\tlet previousSplitter;\n\tfor (const char of str) {\n\t\tconst isSplitter = splitters.includes(char);\n\t\tif (isSplitter === true) {\n\t\t\tparts.push(buff);\n\t\t\tbuff = \"\";\n\t\t\tpreviousUpper = void 0;\n\t\t\tcontinue;\n\t\t}\n\t\tconst isUpper = isUppercase(char);\n\t\tif (previousSplitter === false) {\n\t\t\tif (previousUpper === false && isUpper === true) {\n\t\t\t\tparts.push(buff);\n\t\t\t\tbuff = char;\n\t\t\t\tpreviousUpper = isUpper;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (previousUpper === true && isUpper === false && buff.length > 1) {\n\t\t\t\tconst lastChar = buff.at(-1);\n\t\t\t\tparts.push(buff.slice(0, Math.max(0, buff.length - 1)));\n\t\t\t\tbuff = lastChar + char;\n\t\t\t\tpreviousUpper = isUpper;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tbuff += char;\n\t\tpreviousUpper = isUpper;\n\t\tpreviousSplitter = isSplitter;\n\t}\n\tparts.push(buff);\n\treturn parts;\n}\nfunction upperFirst(str) {\n\treturn str ? str[0].toUpperCase() + str.slice(1) : \"\";\n}\nfunction lowerFirst(str) {\n\treturn str ? str[0].toLowerCase() + str.slice(1) : \"\";\n}\nfunction pascalCase(str, opts) {\n\treturn str ? (Array.isArray(str) ? str : splitByCase(str)).map((p) => upperFirst(opts?.normalize ? p.toLowerCase() : p)).join(\"\") : \"\";\n}\nfunction camelCase(str, opts) {\n\treturn lowerFirst(pascalCase(str || \"\", opts));\n}\nfunction kebabCase(str, joiner) {\n\treturn str ? (Array.isArray(str) ? str : splitByCase(str)).map((p) => p.toLowerCase()).join(joiner ?? \"-\") : \"\";\n}\nexport { kebabCase as n, camelCase as t };\n","import { n as kebabCase, t as camelCase } from \"./_chunks/libs/scule.mjs\";\nimport { parseArgs as parseArgs$1 } from \"node:util\";\nfunction toArray(val) {\n\tif (Array.isArray(val)) return val;\n\treturn val === void 0 ? [] : [val];\n}\nfunction formatLineColumns(lines, linePrefix = \"\") {\n\tconst maxLength = [];\n\tfor (const line of lines) for (const [i, element] of line.entries()) maxLength[i] = Math.max(maxLength[i] || 0, element.length);\n\treturn lines.map((l) => l.map((c, i) => linePrefix + c[i === 0 ? \"padStart\" : \"padEnd\"](maxLength[i])).join(\" \")).join(\"\\n\");\n}\nfunction resolveValue(input) {\n\treturn typeof input === \"function\" ? input() : input;\n}\nvar CLIError = class extends Error {\n\tcode;\n\tconstructor(message, code) {\n\t\tsuper(message);\n\t\tthis.name = \"CLIError\";\n\t\tthis.code = code;\n\t}\n};\nfunction parseRawArgs(args = [], opts = {}) {\n\tconst booleans = new Set(opts.boolean || []);\n\tconst strings = new Set(opts.string || []);\n\tconst aliasMap = opts.alias || {};\n\tconst defaults = opts.default || {};\n\tconst aliasToMain = /* @__PURE__ */ new Map();\n\tconst mainToAliases = /* @__PURE__ */ new Map();\n\tfor (const [key, value] of Object.entries(aliasMap)) {\n\t\tconst targets = value;\n\t\tfor (const target of targets) {\n\t\t\taliasToMain.set(key, target);\n\t\t\tif (!mainToAliases.has(target)) mainToAliases.set(target, []);\n\t\t\tmainToAliases.get(target).push(key);\n\t\t\taliasToMain.set(target, key);\n\t\t\tif (!mainToAliases.has(key)) mainToAliases.set(key, []);\n\t\t\tmainToAliases.get(key).push(target);\n\t\t}\n\t}\n\tconst options = {};\n\tfunction getType(name) {\n\t\tif (booleans.has(name)) return \"boolean\";\n\t\tconst aliases = mainToAliases.get(name) || [];\n\t\tfor (const alias of aliases) if (booleans.has(alias)) return \"boolean\";\n\t\treturn \"string\";\n\t}\n\tconst allOptions = new Set([\n\t\t...booleans,\n\t\t...strings,\n\t\t...Object.keys(aliasMap),\n\t\t...Object.values(aliasMap).flat(),\n\t\t...Object.keys(defaults)\n\t]);\n\tfor (const name of allOptions) if (!options[name]) options[name] = {\n\t\ttype: getType(name),\n\t\tdefault: defaults[name]\n\t};\n\tfor (const [alias, main] of aliasToMain.entries()) if (alias.length === 1 && options[main] && !options[main].short) options[main].short = alias;\n\tconst processedArgs = [];\n\tconst negatedFlags = {};\n\tfor (let i = 0; i < args.length; i++) {\n\t\tconst arg = args[i];\n\t\tif (arg === \"--\") {\n\t\t\tprocessedArgs.push(...args.slice(i));\n\t\t\tbreak;\n\t\t}\n\t\tif (arg.startsWith(\"--no-\")) {\n\t\t\tconst flagName = arg.slice(5);\n\t\t\tnegatedFlags[flagName] = true;\n\t\t\tcontinue;\n\t\t}\n\t\tprocessedArgs.push(arg);\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = parseArgs$1({\n\t\t\targs: processedArgs,\n\t\t\toptions: Object.keys(options).length > 0 ? options : void 0,\n\t\t\tallowPositionals: true,\n\t\t\tstrict: false\n\t\t});\n\t} catch {\n\t\tparsed = {\n\t\t\tvalues: {},\n\t\t\tpositionals: processedArgs\n\t\t};\n\t}\n\tconst out = { _: [] };\n\tout._ = parsed.positionals;\n\tfor (const [key, value] of Object.entries(parsed.values)) out[key] = value;\n\tfor (const [name] of Object.entries(negatedFlags)) {\n\t\tout[name] = false;\n\t\tconst mainName = aliasToMain.get(name);\n\t\tif (mainName) out[mainName] = false;\n\t\tconst aliases = mainToAliases.get(name);\n\t\tif (aliases) for (const alias of aliases) out[alias] = false;\n\t}\n\tfor (const [alias, main] of aliasToMain.entries()) {\n\t\tif (out[alias] !== void 0 && out[main] === void 0) out[main] = out[alias];\n\t\tif (out[main] !== void 0 && out[alias] === void 0) out[alias] = out[main];\n\t}\n\treturn out;\n}\nconst noColor = /* @__PURE__ */ (() => {\n\tconst env = globalThis.process?.env ?? {};\n\treturn env.NO_COLOR === \"1\" || env.TERM === \"dumb\" || env.TEST || env.CI;\n})();\nconst _c = (c, r = 39) => (t) => noColor ? t : `\\u001B[${c}m${t}\\u001B[${r}m`;\nconst bold = /* @__PURE__ */ _c(1, 22);\nconst cyan = /* @__PURE__ */ _c(36);\nconst gray = /* @__PURE__ */ _c(90);\nconst underline = /* @__PURE__ */ _c(4, 24);\nfunction parseArgs(rawArgs, argsDef) {\n\tconst parseOptions = {\n\t\tboolean: [],\n\t\tstring: [],\n\t\talias: {},\n\t\tdefault: {}\n\t};\n\tconst args = resolveArgs(argsDef);\n\tfor (const arg of args) {\n\t\tif (arg.type === \"positional\") continue;\n\t\tif (arg.type === \"string\" || arg.type === \"enum\") parseOptions.string.push(arg.name);\n\t\telse if (arg.type === \"boolean\") parseOptions.boolean.push(arg.name);\n\t\tif (arg.default !== void 0) parseOptions.default[arg.name] = arg.default;\n\t\tif (arg.alias) parseOptions.alias[arg.name] = arg.alias;\n\t\tconst camelName = camelCase(arg.name);\n\t\tconst kebabName = kebabCase(arg.name);\n\t\tif (camelName !== arg.name || kebabName !== arg.name) {\n\t\t\tconst existingAliases = toArray(parseOptions.alias[arg.name] || []);\n\t\t\tif (camelName !== arg.name && !existingAliases.includes(camelName)) existingAliases.push(camelName);\n\t\t\tif (kebabName !== arg.name && !existingAliases.includes(kebabName)) existingAliases.push(kebabName);\n\t\t\tif (existingAliases.length > 0) parseOptions.alias[arg.name] = existingAliases;\n\t\t}\n\t}\n\tconst parsed = parseRawArgs(rawArgs, parseOptions);\n\tconst [ ...positionalArguments] = parsed._;\n\tconst parsedArgsProxy = new Proxy(parsed, { get(target, prop) {\n\t\treturn target[prop] ?? target[camelCase(prop)] ?? target[kebabCase(prop)];\n\t} });\n\tfor (const [, arg] of args.entries()) if (arg.type === \"positional\") {\n\t\tconst nextPositionalArgument = positionalArguments.shift();\n\t\tif (nextPositionalArgument !== void 0) parsedArgsProxy[arg.name] = nextPositionalArgument;\n\t\telse if (arg.default === void 0 && arg.required !== false) throw new CLIError(`Missing required positional argument: ${arg.name.toUpperCase()}`, \"EARG\");\n\t\telse parsedArgsProxy[arg.name] = arg.default;\n\t} else if (arg.type === \"enum\") {\n\t\tconst argument = parsedArgsProxy[arg.name];\n\t\tconst options = arg.options || [];\n\t\tif (argument !== void 0 && options.length > 0 && !options.includes(argument)) throw new CLIError(`Invalid value for argument: ${cyan(`--${arg.name}`)} (${cyan(argument)}). Expected one of: ${options.map((o) => cyan(o)).join(\", \")}.`, \"EARG\");\n\t} else if (arg.required && parsedArgsProxy[arg.name] === void 0) throw new CLIError(`Missing required argument: --${arg.name}`, \"EARG\");\n\treturn parsedArgsProxy;\n}\nfunction resolveArgs(argsDef) {\n\tconst args = [];\n\tfor (const [name, argDef] of Object.entries(argsDef || {})) args.push({\n\t\t...argDef,\n\t\tname,\n\t\talias: toArray(argDef.alias)\n\t});\n\treturn args;\n}\nfunction defineCommand(def) {\n\treturn def;\n}\nasync function runCommand(cmd, opts) {\n\tconst cmdArgs = await resolveValue(cmd.args || {});\n\tconst parsedArgs = parseArgs(opts.rawArgs, cmdArgs);\n\tconst context = {\n\t\trawArgs: opts.rawArgs,\n\t\targs: parsedArgs,\n\t\tdata: opts.data,\n\t\tcmd\n\t};\n\tif (typeof cmd.setup === \"function\") await cmd.setup(context);\n\tlet result;\n\ttry {\n\t\tconst subCommands = await resolveValue(cmd.subCommands);\n\t\tif (subCommands && Object.keys(subCommands).length > 0) {\n\t\t\tconst subCommandArgIndex = opts.rawArgs.findIndex((arg) => !arg.startsWith(\"-\"));\n\t\t\tconst subCommandName = opts.rawArgs[subCommandArgIndex];\n\t\t\tif (subCommandName) {\n\t\t\t\tif (!subCommands[subCommandName]) throw new CLIError(`Unknown command ${cyan(subCommandName)}`, \"E_UNKNOWN_COMMAND\");\n\t\t\t\tconst subCommand = await resolveValue(subCommands[subCommandName]);\n\t\t\t\tif (subCommand) await runCommand(subCommand, { rawArgs: opts.rawArgs.slice(subCommandArgIndex + 1) });\n\t\t\t} else if (!cmd.run) throw new CLIError(`No command specified.`, \"E_NO_COMMAND\");\n\t\t}\n\t\tif (typeof cmd.run === \"function\") result = await cmd.run(context);\n\t} finally {\n\t\tif (typeof cmd.cleanup === \"function\") await cmd.cleanup(context);\n\t}\n\treturn { result };\n}\nasync function resolveSubCommand(cmd, rawArgs, parent) {\n\tconst subCommands = await resolveValue(cmd.subCommands);\n\tif (subCommands && Object.keys(subCommands).length > 0) {\n\t\tconst subCommandArgIndex = rawArgs.findIndex((arg) => !arg.startsWith(\"-\"));\n\t\tconst subCommandName = rawArgs[subCommandArgIndex];\n\t\tconst subCommand = await resolveValue(subCommands[subCommandName]);\n\t\tif (subCommand) return resolveSubCommand(subCommand, rawArgs.slice(subCommandArgIndex + 1), cmd);\n\t}\n\treturn [cmd, parent];\n}\nasync function showUsage(cmd, parent) {\n\ttry {\n\t\tconsole.log(await renderUsage(cmd, parent) + \"\\n\");\n\t} catch (error) {\n\t\tconsole.error(error);\n\t}\n}\nconst negativePrefixRe = /^no[-A-Z]/;\nasync function renderUsage(cmd, parent) {\n\tconst cmdMeta = await resolveValue(cmd.meta || {});\n\tconst cmdArgs = resolveArgs(await resolveValue(cmd.args || {}));\n\tconst parentMeta = await resolveValue(parent?.meta || {});\n\tconst commandName = `${parentMeta.name ? `${parentMeta.name} ` : \"\"}` + (cmdMeta.name || process.argv[1]);\n\tconst argLines = [];\n\tconst posLines = [];\n\tconst commandsLines = [];\n\tconst usageLine = [];\n\tfor (const arg of cmdArgs) if (arg.type === \"positional\") {\n\t\tconst name = arg.name.toUpperCase();\n\t\tconst isRequired = arg.required !== false && arg.default === void 0;\n\t\tconst defaultHint = arg.default ? `=\"${arg.default}\"` : \"\";\n\t\tposLines.push([\n\t\t\tcyan(name + defaultHint),\n\t\t\targ.description || \"\",\n\t\t\targ.valueHint ? `<${arg.valueHint}>` : \"\"\n\t\t]);\n\t\tusageLine.push(isRequired ? `<${name}>` : `[${name}]`);\n\t} else {\n\t\tconst isRequired = arg.required === true && arg.default === void 0;\n\t\tconst argStr = [...(arg.alias || []).map((a) => `-${a}`), `--${arg.name}`].join(\", \") + (arg.type === \"string\" && (arg.valueHint || arg.default) ? `=${arg.valueHint ? `<${arg.valueHint}>` : `\"${arg.default || \"\"}\"`}` : \"\") + (arg.type === \"enum\" && arg.options ? `=<${arg.options.join(\"|\")}>` : \"\");\n\t\targLines.push([cyan(argStr + (isRequired ? \" (required)\" : \"\")), arg.description || \"\"]);\n\t\tif (arg.type === \"boolean\" && (arg.default === true || arg.negativeDescription) && !negativePrefixRe.test(arg.name)) {\n\t\t\tconst negativeArgStr = [...(arg.alias || []).map((a) => `--no-${a}`), `--no-${arg.name}`].join(\", \");\n\t\t\targLines.push([cyan(negativeArgStr + (isRequired ? \" (required)\" : \"\")), arg.negativeDescription || \"\"]);\n\t\t}\n\t\tif (isRequired) usageLine.push(argStr);\n\t}\n\tif (cmd.subCommands) {\n\t\tconst commandNames = [];\n\t\tconst subCommands = await resolveValue(cmd.subCommands);\n\t\tfor (const [name, sub] of Object.entries(subCommands)) {\n\t\t\tconst meta = await resolveValue((await resolveValue(sub))?.meta);\n\t\t\tif (meta?.hidden) continue;\n\t\t\tcommandsLines.push([cyan(name), meta?.description || \"\"]);\n\t\t\tcommandNames.push(name);\n\t\t}\n\t\tusageLine.push(commandNames.join(\"|\"));\n\t}\n\tconst usageLines = [];\n\tconst version = cmdMeta.version || parentMeta.version;\n\tusageLines.push(gray(`${cmdMeta.description} (${commandName + (version ? ` v${version}` : \"\")})`), \"\");\n\tconst hasOptions = argLines.length > 0 || posLines.length > 0;\n\tusageLines.push(`${underline(bold(\"USAGE\"))} ${cyan(`${commandName}${hasOptions ? \" [OPTIONS]\" : \"\"} ${usageLine.join(\" \")}`)}`, \"\");\n\tif (posLines.length > 0) {\n\t\tusageLines.push(underline(bold(\"ARGUMENTS\")), \"\");\n\t\tusageLines.push(formatLineColumns(posLines, \" \"));\n\t\tusageLines.push(\"\");\n\t}\n\tif (argLines.length > 0) {\n\t\tusageLines.push(underline(bold(\"OPTIONS\")), \"\");\n\t\tusageLines.push(formatLineColumns(argLines, \" \"));\n\t\tusageLines.push(\"\");\n\t}\n\tif (commandsLines.length > 0) {\n\t\tusageLines.push(underline(bold(\"COMMANDS\")), \"\");\n\t\tusageLines.push(formatLineColumns(commandsLines, \" \"));\n\t\tusageLines.push(\"\", `Use ${cyan(`${commandName} <command> --help`)} for more information about a command.`);\n\t}\n\treturn usageLines.filter((l) => typeof l === \"string\").join(\"\\n\");\n}\nasync function runMain(cmd, opts = {}) {\n\tconst rawArgs = opts.rawArgs || process.argv.slice(2);\n\tconst showUsage$1 = opts.showUsage || showUsage;\n\ttry {\n\t\tif (rawArgs.includes(\"--help\") || rawArgs.includes(\"-h\")) {\n\t\t\tawait showUsage$1(...await resolveSubCommand(cmd, rawArgs));\n\t\t\tprocess.exit(0);\n\t\t} else if (rawArgs.length === 1 && rawArgs[0] === \"--version\") {\n\t\t\tconst meta = typeof cmd.meta === \"function\" ? await cmd.meta() : await cmd.meta;\n\t\t\tif (!meta?.version) throw new CLIError(\"No version specified\", \"E_NO_VERSION\");\n\t\t\tconsole.log(meta.version);\n\t\t} else await runCommand(cmd, { rawArgs });\n\t} catch (error) {\n\t\tif (error instanceof CLIError) {\n\t\t\tawait showUsage$1(...await resolveSubCommand(cmd, rawArgs));\n\t\t\tconsole.error(error.message);\n\t\t} else console.error(error, \"\\n\");\n\t\tprocess.exit(1);\n\t}\n}\nfunction createMain(cmd) {\n\treturn (opts = {}) => runMain(cmd, opts);\n}\nexport { createMain, defineCommand, parseArgs, renderUsage, runCommand, runMain, showUsage };\n","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 function findCursor<T extends { disabled?: boolean }>(\n\tcursor: number,\n\tdelta: number,\n\toptions: T[]\n) {\n\tconst hasEnabledOptions = options.some((opt) => !opt.disabled);\n\tif (!hasEnabledOptions) {\n\t\treturn cursor;\n\t}\n\tconst newCursor = cursor + delta;\n\tconst maxCursor = Math.max(options.length - 1, 0);\n\tconst clampedCursor = newCursor < 0 ? maxCursor : newCursor > maxCursor ? 0 : newCursor;\n\tconst newOption = options[clampedCursor];\n\tif (newOption.disabled) {\n\t\treturn findCursor(clampedCursor, delta < 0 ? -1 : 1, options);\n\t}\n\treturn clampedCursor;\n}\n","/* MAIN */\n//URL: https://github.com/sindresorhus/get-east-asian-width/blob/main/lookup.js\n//LICENSE: https://github.com/sindresorhus/get-east-asian-width/blob/main/license\n//TODO: Replace these with some unicode property classes, if the ones we need exist\nconst isAmbiguous = (x) => {\n return x === 0xA1 || x === 0xA4 || x === 0xA7 || x === 0xA8 || x === 0xAA || x === 0xAD || x === 0xAE || x >= 0xB0 && x <= 0xB4 || x >= 0xB6 && x <= 0xBA || x >= 0xBC && x <= 0xBF || x === 0xC6 || x === 0xD0 || x === 0xD7 || x === 0xD8 || x >= 0xDE && x <= 0xE1 || x === 0xE6 || x >= 0xE8 && x <= 0xEA || x === 0xEC || x === 0xED || x === 0xF0 || x === 0xF2 || x === 0xF3 || x >= 0xF7 && x <= 0xFA || x === 0xFC || x === 0xFE || x === 0x101 || x === 0x111 || x === 0x113 || x === 0x11B || x === 0x126 || x === 0x127 || x === 0x12B || x >= 0x131 && x <= 0x133 || x === 0x138 || x >= 0x13F && x <= 0x142 || x === 0x144 || x >= 0x148 && x <= 0x14B || x === 0x14D || x === 0x152 || x === 0x153 || x === 0x166 || x === 0x167 || x === 0x16B || x === 0x1CE || x === 0x1D0 || x === 0x1D2 || x === 0x1D4 || x === 0x1D6 || x === 0x1D8 || x === 0x1DA || x === 0x1DC || x === 0x251 || x === 0x261 || x === 0x2C4 || x === 0x2C7 || x >= 0x2C9 && x <= 0x2CB || x === 0x2CD || x === 0x2D0 || x >= 0x2D8 && x <= 0x2DB || x === 0x2DD || x === 0x2DF || x >= 0x300 && x <= 0x36F || x >= 0x391 && x <= 0x3A1 || x >= 0x3A3 && x <= 0x3A9 || x >= 0x3B1 && x <= 0x3C1 || x >= 0x3C3 && x <= 0x3C9 || x === 0x401 || x >= 0x410 && x <= 0x44F || x === 0x451 || x === 0x2010 || x >= 0x2013 && x <= 0x2016 || x === 0x2018 || x === 0x2019 || x === 0x201C || x === 0x201D || x >= 0x2020 && x <= 0x2022 || x >= 0x2024 && x <= 0x2027 || x === 0x2030 || x === 0x2032 || x === 0x2033 || x === 0x2035 || x === 0x203B || x === 0x203E || x === 0x2074 || x === 0x207F || x >= 0x2081 && x <= 0x2084 || x === 0x20AC || x === 0x2103 || x === 0x2105 || x === 0x2109 || x === 0x2113 || x === 0x2116 || x === 0x2121 || x === 0x2122 || x === 0x2126 || x === 0x212B || x === 0x2153 || x === 0x2154 || x >= 0x215B && x <= 0x215E || x >= 0x2160 && x <= 0x216B || x >= 0x2170 && x <= 0x2179 || x === 0x2189 || x >= 0x2190 && x <= 0x2199 || x === 0x21B8 || x === 0x21B9 || x === 0x21D2 || x === 0x21D4 || x === 0x21E7 || x === 0x2200 || x === 0x2202 || x === 0x2203 || x === 0x2207 || x === 0x2208 || x === 0x220B || x === 0x220F || x === 0x2211 || x === 0x2215 || x === 0x221A || x >= 0x221D && x <= 0x2220 || x === 0x2223 || x === 0x2225 || x >= 0x2227 && x <= 0x222C || x === 0x222E || x >= 0x2234 && x <= 0x2237 || x === 0x223C || x === 0x223D || x === 0x2248 || x === 0x224C || x === 0x2252 || x === 0x2260 || x === 0x2261 || x >= 0x2264 && x <= 0x2267 || x === 0x226A || x === 0x226B || x === 0x226E || x === 0x226F || x === 0x2282 || x === 0x2283 || x === 0x2286 || x === 0x2287 || x === 0x2295 || x === 0x2299 || x === 0x22A5 || x === 0x22BF || x === 0x2312 || x >= 0x2460 && x <= 0x24E9 || x >= 0x24EB && x <= 0x254B || x >= 0x2550 && x <= 0x2573 || x >= 0x2580 && x <= 0x258F || x >= 0x2592 && x <= 0x2595 || x === 0x25A0 || x === 0x25A1 || x >= 0x25A3 && x <= 0x25A9 || x === 0x25B2 || x === 0x25B3 || x === 0x25B6 || x === 0x25B7 || x === 0x25BC || x === 0x25BD || x === 0x25C0 || x === 0x25C1 || x >= 0x25C6 && x <= 0x25C8 || x === 0x25CB || x >= 0x25CE && x <= 0x25D1 || x >= 0x25E2 && x <= 0x25E5 || x === 0x25EF || x === 0x2605 || x === 0x2606 || x === 0x2609 || x === 0x260E || x === 0x260F || x === 0x261C || x === 0x261E || x === 0x2640 || x === 0x2642 || x === 0x2660 || x === 0x2661 || x >= 0x2663 && x <= 0x2665 || x >= 0x2667 && x <= 0x266A || x === 0x266C || x === 0x266D || x === 0x266F || x === 0x269E || x === 0x269F || x === 0x26BF || x >= 0x26C6 && x <= 0x26CD || x >= 0x26CF && x <= 0x26D3 || x >= 0x26D5 && x <= 0x26E1 || x === 0x26E3 || x === 0x26E8 || x === 0x26E9 || x >= 0x26EB && x <= 0x26F1 || x === 0x26F4 || x >= 0x26F6 && x <= 0x26F9 || x === 0x26FB || x === 0x26FC || x === 0x26FE || x === 0x26FF || x === 0x273D || x >= 0x2776 && x <= 0x277F || x >= 0x2B56 && x <= 0x2B59 || x >= 0x3248 && x <= 0x324F || x >= 0xE000 && x <= 0xF8FF || x >= 0xFE00 && x <= 0xFE0F || x === 0xFFFD || x >= 0x1F100 && x <= 0x1F10A || x >= 0x1F110 && x <= 0x1F12D || x >= 0x1F130 && x <= 0x1F169 || x >= 0x1F170 && x <= 0x1F18D || x === 0x1F18F || x === 0x1F190 || x >= 0x1F19B && x <= 0x1F1AC || x >= 0xE0100 && x <= 0xE01EF || x >= 0xF0000 && x <= 0xFFFFD || x >= 0x100000 && x <= 0x10FFFD;\n};\nconst isFullWidth = (x) => {\n return x === 0x3000 || x >= 0xFF01 && x <= 0xFF60 || x >= 0xFFE0 && x <= 0xFFE6;\n};\nconst isWide = (x) => {\n return x >= 0x1100 && x <= 0x115F || x === 0x231A || x === 0x231B || x === 0x2329 || x === 0x232A || x >= 0x23E9 && x <= 0x23EC || x === 0x23F0 || x === 0x23F3 || x === 0x25FD || x === 0x25FE || x === 0x2614 || x === 0x2615 || x >= 0x2648 && x <= 0x2653 || x === 0x267F || x === 0x2693 || x === 0x26A1 || x === 0x26AA || x === 0x26AB || x === 0x26BD || x === 0x26BE || x === 0x26C4 || x === 0x26C5 || x === 0x26CE || x === 0x26D4 || x === 0x26EA || x === 0x26F2 || x === 0x26F3 || x === 0x26F5 || x === 0x26FA || x === 0x26FD || x === 0x2705 || x === 0x270A || x === 0x270B || x === 0x2728 || x === 0x274C || x === 0x274E || x >= 0x2753 && x <= 0x2755 || x === 0x2757 || x >= 0x2795 && x <= 0x2797 || x === 0x27B0 || x === 0x27BF || x === 0x2B1B || x === 0x2B1C || x === 0x2B50 || x === 0x2B55 || x >= 0x2E80 && x <= 0x2E99 || x >= 0x2E9B && x <= 0x2EF3 || x >= 0x2F00 && x <= 0x2FD5 || x >= 0x2FF0 && x <= 0x2FFF || x >= 0x3001 && x <= 0x303E || x >= 0x3041 && x <= 0x3096 || x >= 0x3099 && x <= 0x30FF || x >= 0x3105 && x <= 0x312F || x >= 0x3131 && x <= 0x318E || x >= 0x3190 && x <= 0x31E3 || x >= 0x31EF && x <= 0x321E || x >= 0x3220 && x <= 0x3247 || x >= 0x3250 && x <= 0x4DBF || x >= 0x4E00 && x <= 0xA48C || x >= 0xA490 && x <= 0xA4C6 || x >= 0xA960 && x <= 0xA97C || x >= 0xAC00 && x <= 0xD7A3 || x >= 0xF900 && x <= 0xFAFF || x >= 0xFE10 && x <= 0xFE19 || x >= 0xFE30 && x <= 0xFE52 || x >= 0xFE54 && x <= 0xFE66 || x >= 0xFE68 && x <= 0xFE6B || x >= 0x16FE0 && x <= 0x16FE4 || x === 0x16FF0 || x === 0x16FF1 || x >= 0x17000 && x <= 0x187F7 || x >= 0x18800 && x <= 0x18CD5 || x >= 0x18D00 && x <= 0x18D08 || x >= 0x1AFF0 && x <= 0x1AFF3 || x >= 0x1AFF5 && x <= 0x1AFFB || x === 0x1AFFD || x === 0x1AFFE || x >= 0x1B000 && x <= 0x1B122 || x === 0x1B132 || x >= 0x1B150 && x <= 0x1B152 || x === 0x1B155 || x >= 0x1B164 && x <= 0x1B167 || x >= 0x1B170 && x <= 0x1B2FB || x === 0x1F004 || x === 0x1F0CF || x === 0x1F18E || x >= 0x1F191 && x <= 0x1F19A || x >= 0x1F200 && x <= 0x1F202 || x >= 0x1F210 && x <= 0x1F23B || x >= 0x1F240 && x <= 0x1F248 || x === 0x1F250 || x === 0x1F251 || x >= 0x1F260 && x <= 0x1F265 || x >= 0x1F300 && x <= 0x1F320 || x >= 0x1F32D && x <= 0x1F335 || x >= 0x1F337 && x <= 0x1F37C || x >= 0x1F37E && x <= 0x1F393 || x >= 0x1F3A0 && x <= 0x1F3CA || x >= 0x1F3CF && x <= 0x1F3D3 || x >= 0x1F3E0 && x <= 0x1F3F0 || x === 0x1F3F4 || x >= 0x1F3F8 && x <= 0x1F43E || x === 0x1F440 || x >= 0x1F442 && x <= 0x1F4FC || x >= 0x1F4FF && x <= 0x1F53D || x >= 0x1F54B && x <= 0x1F54E || x >= 0x1F550 && x <= 0x1F567 || x === 0x1F57A || x === 0x1F595 || x === 0x1F596 || x === 0x1F5A4 || x >= 0x1F5FB && x <= 0x1F64F || x >= 0x1F680 && x <= 0x1F6C5 || x === 0x1F6CC || x >= 0x1F6D0 && x <= 0x1F6D2 || x >= 0x1F6D5 && x <= 0x1F6D7 || x >= 0x1F6DC && x <= 0x1F6DF || x === 0x1F6EB || x === 0x1F6EC || x >= 0x1F6F4 && x <= 0x1F6FC || x >= 0x1F7E0 && x <= 0x1F7EB || x === 0x1F7F0 || x >= 0x1F90C && x <= 0x1F93A || x >= 0x1F93C && x <= 0x1F945 || x >= 0x1F947 && x <= 0x1F9FF || x >= 0x1FA70 && x <= 0x1FA7C || x >= 0x1FA80 && x <= 0x1FA88 || x >= 0x1FA90 && x <= 0x1FABD || x >= 0x1FABF && x <= 0x1FAC5 || x >= 0x1FACE && x <= 0x1FADB || x >= 0x1FAE0 && x <= 0x1FAE8 || x >= 0x1FAF0 && x <= 0x1FAF8 || x >= 0x20000 && x <= 0x2FFFD || x >= 0x30000 && x <= 0x3FFFD;\n};\n/* EXPORT */\nexport { isAmbiguous, isFullWidth, isWide };\n","/* IMPORT */\nimport { isAmbiguous, isFullWidth, isWide } from './utils.js';\n/* HELPERS */\nconst ANSI_RE = /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;\nconst CONTROL_RE = /[\\x00-\\x08\\x0A-\\x1F\\x7F-\\x9F]{1,1000}/y;\nconst TAB_RE = /\\t{1,1000}/y;\nconst EMOJI_RE = /[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*/yu;\nconst LATIN_RE = /(?:[\\x20-\\x7E\\xA0-\\xFF](?!\\uFE0F)){1,1000}/y;\nconst MODIFIER_RE = /\\p{M}+/gu;\nconst NO_TRUNCATION = { limit: Infinity, ellipsis: '' };\n/* MAIN */\n//TODO: Optimize matching non-latin letters\nconst getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {\n /* CONSTANTS */\n const LIMIT = truncationOptions.limit ?? Infinity;\n const ELLIPSIS = truncationOptions.ellipsis ?? '';\n const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);\n const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;\n const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;\n const TAB_WIDTH = widthOptions.tabWidth ?? 8;\n const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;\n const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;\n const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;\n const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;\n const WIDE_WIDTH = widthOptions.wideWidth ?? 2;\n /* STATE */\n let indexPrev = 0;\n let index = 0;\n let length = input.length;\n let lengthExtra = 0;\n let truncationEnabled = false;\n let truncationIndex = length;\n let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);\n let unmatchedStart = 0;\n let unmatchedEnd = 0;\n let width = 0;\n let widthExtra = 0;\n /* PARSE LOOP */\n outer: while (true) {\n /* UNMATCHED */\n if ((unmatchedEnd > unmatchedStart) || (index >= length && index > indexPrev)) {\n const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);\n lengthExtra = 0;\n for (const char of unmatched.replaceAll(MODIFIER_RE, '')) {\n const codePoint = char.codePointAt(0) || 0;\n if (isFullWidth(codePoint)) {\n widthExtra = FULL_WIDTH_WIDTH;\n }\n else if (isWide(codePoint)) {\n widthExtra = WIDE_WIDTH;\n }\n else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {\n widthExtra = AMBIGUOUS_WIDTH;\n }\n else {\n widthExtra = REGULAR_WIDTH;\n }\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break outer;\n }\n lengthExtra += char.length;\n width += widthExtra;\n }\n unmatchedStart = unmatchedEnd = 0;\n }\n /* EXITING */\n if (index >= length)\n break;\n /* LATIN */\n LATIN_RE.lastIndex = index;\n if (LATIN_RE.test(input)) {\n lengthExtra = LATIN_RE.lastIndex - index;\n widthExtra = lengthExtra * REGULAR_WIDTH;\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += widthExtra;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = LATIN_RE.lastIndex;\n continue;\n }\n /* ANSI */\n ANSI_RE.lastIndex = index;\n if (ANSI_RE.test(input)) {\n if ((width + ANSI_WIDTH) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index);\n }\n if ((width + ANSI_WIDTH) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += ANSI_WIDTH;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = ANSI_RE.lastIndex;\n continue;\n }\n /* CONTROL */\n CONTROL_RE.lastIndex = index;\n if (CONTROL_RE.test(input)) {\n lengthExtra = CONTROL_RE.lastIndex - index;\n widthExtra = lengthExtra * CONTROL_WIDTH;\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += widthExtra;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = CONTROL_RE.lastIndex;\n continue;\n }\n /* TAB */\n TAB_RE.lastIndex = index;\n if (TAB_RE.test(input)) {\n lengthExtra = TAB_RE.lastIndex - index;\n widthExtra = lengthExtra * TAB_WIDTH;\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += widthExtra;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = TAB_RE.lastIndex;\n continue;\n }\n /* EMOJI */\n EMOJI_RE.lastIndex = index;\n if (EMOJI_RE.test(input)) {\n if ((width + EMOJI_WIDTH) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index);\n }\n if ((width + EMOJI_WIDTH) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += EMOJI_WIDTH;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = EMOJI_RE.lastIndex;\n continue;\n }\n /* UNMATCHED INDEX */\n index += 1;\n }\n /* RETURN */\n return {\n width: truncationEnabled ? truncationLimit : width,\n index: truncationEnabled ? truncationIndex : length,\n truncated: truncationEnabled,\n ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH\n };\n};\n/* EXPORT */\nexport default getStringTruncatedWidth;\n","/* IMPORT */\nimport fastStringTruncatedWidth from 'fast-string-truncated-width';\n/* HELPERS */\nconst NO_TRUNCATION = {\n limit: Infinity,\n ellipsis: '',\n ellipsisWidth: 0,\n};\n/* MAIN */\nconst fastStringWidth = (input, options = {}) => {\n return fastStringTruncatedWidth(input, NO_TRUNCATION, options).width;\n};\n/* EXPORT */\nexport default fastStringWidth;\n","import stringWidth from 'fast-string-width';\nconst ESC = '\\x1B';\nconst CSI = '\\x9B';\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;;`;\nconst GROUP_REGEX = new RegExp(`(?:\\\\${ANSI_CSI}(?<code>\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, 'y');\nconst getClosingCode = (openingCode) => {\n if (openingCode >= 30 && openingCode <= 37)\n return 39;\n if (openingCode >= 90 && openingCode <= 97)\n return 39;\n if (openingCode >= 40 && openingCode <= 47)\n return 49;\n if (openingCode >= 100 && openingCode <= 107)\n return 49;\n if (openingCode === 1 || openingCode === 2)\n return 22;\n if (openingCode === 3)\n return 23;\n if (openingCode === 4)\n return 24;\n if (openingCode === 7)\n return 27;\n if (openingCode === 8)\n return 28;\n if (openingCode === 9)\n return 29;\n if (openingCode === 0)\n return 0;\n return undefined;\n};\nconst wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;\nconst wordLengths = (words) => words.map((character) => stringWidth(character));\nconst wrapWord = (rows, word, columns) => {\n const characters = word[Symbol.iterator]();\n let isInsideEscape = false;\n let isInsideLinkEscape = false;\n let lastRow = rows.at(-1);\n let visible = lastRow === undefined ? 0 : stringWidth(lastRow);\n let currentCharacter = characters.next();\n let nextCharacter = characters.next();\n let rawCharacterIndex = 0;\n while (!currentCharacter.done) {\n const character = currentCharacter.value;\n const characterLength = stringWidth(character);\n if (visible + characterLength <= columns) {\n rows[rows.length - 1] += character;\n }\n else {\n rows.push(character);\n visible = 0;\n }\n if (character === ESC || character === CSI) {\n isInsideEscape = true;\n isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);\n }\n if (isInsideEscape) {\n if (isInsideLinkEscape) {\n if (character === ANSI_ESCAPE_BELL) {\n isInsideEscape = false;\n isInsideLinkEscape = false;\n }\n }\n else if (character === ANSI_SGR_TERMINATOR) {\n isInsideEscape = false;\n }\n }\n else {\n visible += characterLength;\n if (visible === columns && !nextCharacter.done) {\n rows.push('');\n visible = 0;\n }\n }\n currentCharacter = nextCharacter;\n nextCharacter = characters.next();\n rawCharacterIndex += character.length;\n }\n lastRow = rows.at(-1);\n if (!visible &&\n lastRow !== undefined &&\n lastRow.length > 0 &&\n rows.length > 1) {\n rows[rows.length - 2] += rows.pop();\n }\n};\nconst stringVisibleTrimSpacesRight = (string) => {\n const words = string.split(' ');\n let last = words.length;\n while (last > 0) {\n if (stringWidth(words[last - 1]) > 0) {\n break;\n }\n last--;\n }\n if (last === words.length) {\n return string;\n }\n return words.slice(0, last).join(' ') + words.slice(last).join('');\n};\nconst exec = (string, columns, options = {}) => {\n if (options.trim !== false && string.trim() === '') {\n return '';\n }\n let returnValue = '';\n let escapeCode;\n let escapeUrl;\n const words = string.split(' ');\n const lengths = wordLengths(words);\n let rows = [''];\n for (const [index, word] of words.entries()) {\n if (options.trim !== false) {\n rows[rows.length - 1] = (rows.at(-1) ?? '').trimStart();\n }\n let rowLength = stringWidth(rows.at(-1) ?? '');\n if (index !== 0) {\n if (rowLength >= columns &&\n (options.wordWrap === false || options.trim === false)) {\n rows.push('');\n rowLength = 0;\n }\n if (rowLength > 0 || options.trim === false) {\n rows[rows.length - 1] += ' ';\n rowLength++;\n }\n }\n if (options.hard && lengths[index] > columns) {\n const remainingColumns = columns - rowLength;\n const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);\n const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);\n if (breaksStartingNextLine < breaksStartingThisLine) {\n rows.push('');\n }\n wrapWord(rows, word, columns);\n continue;\n }\n if (rowLength + lengths[index] > columns &&\n rowLength > 0 &&\n lengths[index] > 0) {\n if (options.wordWrap === false && rowLength < columns) {\n wrapWord(rows, word, columns);\n continue;\n }\n rows.push('');\n }\n if (rowLength + lengths[index] > columns && options.wordWrap === false) {\n wrapWord(rows, word, columns);\n continue;\n }\n rows[rows.length - 1] += word;\n }\n if (options.trim !== false) {\n rows = rows.map((row) => stringVisibleTrimSpacesRight(row));\n }\n const preString = rows.join('\\n');\n const pre = preString[Symbol.iterator]();\n let currentPre = pre.next();\n let nextPre = pre.next();\n // We need to keep a separate index as `String#slice()` works on Unicode code units, while `pre` is an array of codepoints.\n let preStringIndex = 0;\n while (!currentPre.done) {\n const character = currentPre.value;\n const nextCharacter = nextPre.value;\n returnValue += character;\n if (character === ESC || character === CSI) {\n GROUP_REGEX.lastIndex = preStringIndex + 1;\n const groupsResult = GROUP_REGEX.exec(preString);\n const groups = groupsResult?.groups;\n if (groups?.code !== undefined) {\n const code = Number.parseFloat(groups.code);\n escapeCode = code === END_CODE ? undefined : code;\n }\n else if (groups?.uri !== undefined) {\n escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n }\n }\n const closingCode = escapeCode ? getClosingCode(escapeCode) : undefined;\n if (nextCharacter === '\\n') {\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink('');\n }\n if (escapeCode && closingCode) {\n returnValue += wrapAnsiCode(closingCode);\n }\n }\n else if (character === '\\n') {\n if (escapeCode && closingCode) {\n returnValue += wrapAnsiCode(escapeCode);\n }\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(escapeUrl);\n }\n }\n preStringIndex += character.length;\n currentPre = nextPre;\n nextPre = pre.next();\n }\n return returnValue;\n};\nexport function wrapAnsi(string, columns, options) {\n return String(string)\n .normalize()\n .replaceAll('\\r\\n', '\\n')\n .split('\\n')\n .map((line) => exec(line, columns, options))\n .join('\\n');\n}\n//# sourceMappingURL=main.js.map","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\tmessages: {\n\t\tcancel: string;\n\t\terror: string;\n\t};\n\twithGuide: boolean;\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\tmessages: {\n\t\tcancel: 'Canceled',\n\t\terror: 'Something went wrong',\n\t},\n\twithGuide: true,\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\t/**\n\t * Custom messages for prompts\n\t */\n\tmessages?: {\n\t\t/**\n\t\t * Custom message to display when a spinner is cancelled\n\t\t * @default \"Canceled\"\n\t\t */\n\t\tcancel?: string;\n\t\t/**\n\t\t * Custom message to display when a spinner encounters an error\n\t\t * @default \"Something went wrong\"\n\t\t */\n\t\terror?: string;\n\t};\n\n\twithGuide?: boolean;\n}\n\nexport function updateSettings(updates: ClackSettings) {\n\t// Handle each property in the updates\n\tif (updates.aliases !== undefined) {\n\t\tconst aliases = updates.aliases;\n\t\tfor (const alias in aliases) {\n\t\t\tif (!Object.hasOwn(aliases, alias)) continue;\n\n\t\t\tconst action = aliases[alias];\n\t\t\tif (!settings.actions.has(action)) continue;\n\n\t\t\tif (!settings.aliases.has(alias)) {\n\t\t\t\tsettings.aliases.set(alias, action);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (updates.messages !== undefined) {\n\t\tconst messages = updates.messages;\n\t\tif (messages.cancel !== undefined) {\n\t\t\tsettings.messages.cancel = messages.cancel;\n\t\t}\n\t\tif (messages.error !== undefined) {\n\t\t\tsettings.messages.error = messages.error;\n\t\t}\n\t}\n\n\tif (updates.withGuide !== undefined) {\n\t\tsettings.withGuide = updates.withGuide !== false;\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 numLines = Math.max(aLines.length, bLines.length);\n\tconst diff: number[] = [];\n\n\tfor (let i = 0; i < numLines; i++) {\n\t\tif (aLines[i] !== bLines[i]) diff.push(i);\n\t}\n\n\treturn {\n\t\tlines: diff,\n\t\tnumLinesBefore: aLines.length,\n\t\tnumLinesAfter: bLines.length,\n\t\tnumLines,\n\t};\n}\n","import { stdin, stdout } from 'node:process';\nimport type { Key } from 'node:readline';\nimport * as readline from 'node:readline';\nimport type { Readable, Writable } from 'node:stream';\nimport { ReadStream } from 'node:tty';\nimport { wrapAnsi } from 'fast-wrap-ansi';\nimport { cursor } from 'sisteransi';\nimport { isActionKey } from './settings.js';\n\nexport * from './settings.js';\nexport * from './string.js';\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\ninterface BlockOptions {\n\tinput?: Readable;\n\toutput?: Writable;\n\toverwrite?: boolean;\n\thideCursor?: boolean;\n}\n\nexport function block({\n\tinput = stdin,\n\toutput = stdout,\n\toverwrite = true,\n\thideCursor = true,\n}: BlockOptions = {}) {\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\n\tif (input instanceof ReadStream && input.isTTY) {\n\t\tinput.setRawMode(true);\n\t}\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 instanceof ReadStream && input.isTTY && !isWindows) {\n\t\t\tinput.setRawMode(false);\n\t\t}\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\nexport const getColumns = (output: Writable): number => {\n\tif ('columns' in output && typeof output.columns === 'number') {\n\t\treturn output.columns;\n\t}\n\treturn 80;\n};\n\nexport const getRows = (output: Writable): number => {\n\tif ('rows' in output && typeof output.rows === 'number') {\n\t\treturn output.rows;\n\t}\n\treturn 20;\n};\n\nexport function wrapTextWithPrefix(\n\toutput: Writable | undefined,\n\ttext: string,\n\tprefix: string,\n\tstartPrefix: string = prefix\n): string {\n\tconst columns = getColumns(output ?? stdout);\n\tconst wrapped = wrapAnsi(text, columns - prefix.length, {\n\t\thard: true,\n\t\ttrim: false,\n\t});\n\tconst lines = wrapped\n\t\t.split('\\n')\n\t\t.map((line, index) => {\n\t\t\treturn `${index === 0 ? startPrefix : prefix}${line}`;\n\t\t})\n\t\t.join('\\n');\n\treturn lines;\n}\n","import { stdin, stdout } from 'node:process';\nimport readline, { type Key, type ReadLine } from 'node:readline';\nimport type { Readable, Writable } from 'node:stream';\nimport { wrapAnsi } from 'fast-wrap-ansi';\nimport { cursor, erase } from 'sisteransi';\nimport type { ClackEvents, ClackState } from '../types.js';\nimport type { Action } from '../utils/index.js';\nimport {\n\tCANCEL_SYMBOL,\n\tdiffLines,\n\tgetRows,\n\tisActionKey,\n\tsetRawMode,\n\tsettings,\n} from '../utils/index.js';\n\nexport interface PromptOptions<TValue, Self extends Prompt<TValue>> {\n\trender(this: Omit<Self, 'prompt'>): string | undefined;\n\tinitialValue?: any;\n\tinitialUserInput?: string;\n\tvalidate?: ((value: TValue | undefined) => string | Error | undefined) | undefined;\n\tinput?: Readable;\n\toutput?: Writable;\n\tdebug?: boolean;\n\tsignal?: AbortSignal;\n}\n\nexport default class Prompt<TValue> {\n\tprotected input: Readable;\n\tprotected output: Writable;\n\tprivate _abortSignal?: AbortSignal;\n\n\tprivate rl: ReadLine | undefined;\n\tprivate opts: Omit<PromptOptions<TValue, Prompt<TValue>>, 'render' | 'input' | 'output'>;\n\tprivate _render: (context: Omit<Prompt<TValue>, '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: TValue | undefined;\n\tpublic userInput = '';\n\n\tconstructor(options: PromptOptions<TValue, Prompt<TValue>>, 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<TValue>>(\n\t\tevent: T,\n\t\topts: { cb: ClackEvents<TValue>[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<TValue>>(event: T, cb: ClackEvents<TValue>[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<TValue>>(event: T, cb: ClackEvents<TValue>[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<TValue>>(\n\t\tevent: T,\n\t\t...data: Parameters<ClackEvents<TValue>[T]>\n\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<TValue | symbol | undefined>((resolve) => {\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\tthis.rl = readline.createInterface({\n\t\t\t\tinput: this.input,\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\tthis.rl.prompt();\n\n\t\t\tif (this.opts.initialUserInput !== undefined) {\n\t\t\t\tthis._setUserInput(this.opts.initialUserInput, true);\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\tprotected _isActionKey(char: string | undefined, _key: Key): boolean {\n\t\treturn char === '\\t';\n\t}\n\n\tprotected _setValue(value: TValue | undefined): void {\n\t\tthis.value = value;\n\t\tthis.emit('value', this.value);\n\t}\n\n\tprotected _setUserInput(value: string | undefined, write?: boolean): void {\n\t\tthis.userInput = value ?? '';\n\t\tthis.emit('userInput', this.userInput);\n\t\tif (write && this._track && this.rl) {\n\t\t\tthis.rl.write(this.userInput);\n\t\t\tthis._cursor = this.rl.cursor;\n\t\t}\n\t}\n\n\tprotected _clearUserInput(): void {\n\t\tthis.rl?.write(null, { ctrl: true, name: 'u' });\n\t\tthis._setUserInput('');\n\t}\n\n\tprivate onKeypress(char: string | undefined, key: Key) {\n\t\tif (this._track && key.name !== 'return') {\n\t\t\tif (key.name && this._isActionKey(char, key)) {\n\t\t\t\tthis.rl?.write(null, { ctrl: true, name: 'h' });\n\t\t\t}\n\t\t\tthis._cursor = this.rl?.cursor ?? 0;\n\t\t\tthis._setUserInput(this.rl?.line);\n\t\t}\n\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\n\t\t// Call the key event handler and emit the key event\n\t\tthis.emit('key', char?.toLowerCase(), key);\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.userInput);\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\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\twrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split('\\n')\n\t\t\t\t.length - 1;\n\t\tthis.output.write(cursor.move(-999, lines * -1));\n\t}\n\n\tprivate render() {\n\t\tconst frame = wrapAnsi(this._render(this) ?? '', process.stdout.columns, {\n\t\t\thard: true,\n\t\t\ttrim: false,\n\t\t});\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\tconst rows = getRows(this.output);\n\t\t\tthis.restoreCursor();\n\t\t\tif (diff) {\n\t\t\t\tconst diffOffsetAfter = Math.max(0, diff.numLinesAfter - rows);\n\t\t\t\tconst diffOffsetBefore = Math.max(0, diff.numLinesBefore - rows);\n\t\t\t\tlet diffLine = diff.lines.find((line) => line >= diffOffsetAfter);\n\n\t\t\t\tif (diffLine === undefined) {\n\t\t\t\t\tthis._prevFrame = frame;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If a single line has changed, only update that line\n\t\t\t\tif (diff.lines.length === 1) {\n\t\t\t\t\tthis.output.write(cursor.move(0, diffLine - diffOffsetBefore));\n\t\t\t\t\tthis.output.write(erase.lines(1));\n\t\t\t\t\tconst lines = frame.split('\\n');\n\t\t\t\t\tthis.output.write(lines[diffLine]);\n\t\t\t\t\tthis._prevFrame = frame;\n\t\t\t\t\tthis.output.write(cursor.move(0, lines.length - diffLine - 1));\n\t\t\t\t\treturn;\n\t\t\t\t\t// If many lines have changed, rerender everything past the first line\n\t\t\t\t} else if (diff.lines.length > 1) {\n\t\t\t\t\tif (diffOffsetAfter < diffOffsetBefore) {\n\t\t\t\t\t\tdiffLine = diffOffsetAfter;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst adjustedDiffLine = diffLine - diffOffsetBefore;\n\t\t\t\t\t\tif (adjustedDiffLine > 0) {\n\t\t\t\t\t\t\tthis.output.write(cursor.move(0, adjustedDiffLine));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.output.write(erase.down());\n\t\t\t\t\tconst lines = frame.split('\\n');\n\t\t\t\t\tconst newLines = lines.slice(diffLine);\n\t\t\t\t\tthis.output.write(newLines.join('\\n'));\n\t\t\t\t\tthis._prevFrame = frame;\n\t\t\t\t\treturn;\n\t\t\t\t}\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 type { Key } from 'node:readline';\nimport color from 'picocolors';\nimport { findCursor } from '../utils/cursor.js';\nimport Prompt, { type PromptOptions } from './prompt.js';\n\ninterface OptionLike {\n\tvalue: unknown;\n\tlabel?: string;\n\tdisabled?: boolean;\n}\n\ntype FilterFunction<T extends OptionLike> = (search: string, opt: T) => boolean;\n\nfunction getCursorForValue<T extends OptionLike>(\n\tselected: T['value'] | undefined,\n\titems: T[]\n): number {\n\tif (selected === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst currLength = items.length;\n\n\t// If filtering changed the available options, update cursor\n\tif (currLength === 0) {\n\t\treturn 0;\n\t}\n\n\t// Try to maintain the same selected item\n\tconst index = items.findIndex((item) => item.value === selected);\n\treturn index !== -1 ? index : 0;\n}\n\nfunction defaultFilter<T extends OptionLike>(input: string, option: T): boolean {\n\tconst label = option.label ?? String(option.value);\n\treturn label.toLowerCase().includes(input.toLowerCase());\n}\n\nfunction normalisedValue<T>(multiple: boolean, values: T[] | undefined): T | T[] | undefined {\n\tif (!values) {\n\t\treturn undefined;\n\t}\n\tif (multiple) {\n\t\treturn values;\n\t}\n\treturn values[0];\n}\n\nexport interface AutocompleteOptions<T extends OptionLike>\n\textends PromptOptions<T['value'] | T['value'][], AutocompletePrompt<T>> {\n\toptions: T[] | ((this: AutocompletePrompt<T>) => T[]);\n\tfilter?: FilterFunction<T>;\n\tmultiple?: boolean;\n}\n\nexport default class AutocompletePrompt<T extends OptionLike> extends Prompt<\n\tT['value'] | T['value'][]\n> {\n\tfilteredOptions: T[];\n\tmultiple: boolean;\n\tisNavigating = false;\n\tselectedValues: Array<T['value']> = [];\n\n\tfocusedValue: T['value'] | undefined;\n\t#cursor = 0;\n\t#lastUserInput = '';\n\t#filterFn: FilterFunction<T>;\n\t#options: T[] | (() => T[]);\n\n\tget cursor(): number {\n\t\treturn this.#cursor;\n\t}\n\n\tget userInputWithCursor() {\n\t\tif (!this.userInput) {\n\t\t\treturn color.inverse(color.hidden('_'));\n\t\t}\n\t\tif (this._cursor >= this.userInput.length) {\n\t\t\treturn `${this.userInput}█`;\n\t\t}\n\t\tconst s1 = this.userInput.slice(0, this._cursor);\n\t\tconst [s2, ...s3] = this.userInput.slice(this._cursor);\n\t\treturn `${s1}${color.inverse(s2)}${s3.join('')}`;\n\t}\n\n\tget options(): T[] {\n\t\tif (typeof this.#options === 'function') {\n\t\t\treturn this.#options();\n\t\t}\n\t\treturn this.#options;\n\t}\n\n\tconstructor(opts: AutocompleteOptions<T>) {\n\t\tsuper(opts);\n\n\t\tthis.#options = opts.options;\n\t\tconst options = this.options;\n\t\tthis.filteredOptions = [...options];\n\t\tthis.multiple = opts.multiple === true;\n\t\tthis.#filterFn = opts.filter ?? defaultFilter;\n\t\tlet initialValues: unknown[] | undefined;\n\t\tif (opts.initialValue && Array.isArray(opts.initialValue)) {\n\t\t\tif (this.multiple) {\n\t\t\t\tinitialValues = opts.initialValue;\n\t\t\t} else {\n\t\t\t\tinitialValues = opts.initialValue.slice(0, 1);\n\t\t\t}\n\t\t} else {\n\t\t\tif (!this.multiple && this.options.length > 0) {\n\t\t\t\tinitialValues = [this.options[0].value];\n\t\t\t}\n\t\t}\n\n\t\tif (initialValues) {\n\t\t\tfor (const selectedValue of initialValues) {\n\t\t\t\tconst selectedIndex = options.findIndex((opt) => opt.value === selectedValue);\n\t\t\t\tif (selectedIndex !== -1) {\n\t\t\t\t\tthis.toggleSelected(selectedValue);\n\t\t\t\t\tthis.#cursor = selectedIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.focusedValue = this.options[this.#cursor]?.value;\n\n\t\tthis.on('key', (char, key) => this.#onKey(char, key));\n\t\tthis.on('userInput', (value) => this.#onUserInputChanged(value));\n\t}\n\n\tprotected override _isActionKey(char: string | undefined, key: Key): boolean {\n\t\treturn (\n\t\t\tchar === '\\t' ||\n\t\t\t(this.multiple &&\n\t\t\t\tthis.isNavigating &&\n\t\t\t\tkey.name === 'space' &&\n\t\t\t\tchar !== undefined &&\n\t\t\t\tchar !== '')\n\t\t);\n\t}\n\n\t#onKey(_char: string | undefined, key: Key): void {\n\t\tconst isUpKey = key.name === 'up';\n\t\tconst isDownKey = key.name === 'down';\n\t\tconst isReturnKey = key.name === 'return';\n\n\t\t// Start navigation mode with up/down arrows\n\t\tif (isUpKey || isDownKey) {\n\t\t\tthis.#cursor = findCursor(this.#cursor, isUpKey ? -1 : 1, this.filteredOptions);\n\t\t\tthis.focusedValue = this.filteredOptions[this.#cursor]?.value;\n\t\t\tif (!this.multiple) {\n\t\t\t\tthis.selectedValues = [this.focusedValue];\n\t\t\t}\n\t\t\tthis.isNavigating = true;\n\t\t} else if (isReturnKey) {\n\t\t\tthis.value = normalisedValue(this.multiple, this.selectedValues);\n\t\t} else {\n\t\t\tif (this.multiple) {\n\t\t\t\tif (\n\t\t\t\t\tthis.focusedValue !== undefined &&\n\t\t\t\t\t(key.name === 'tab' || (this.isNavigating && key.name === 'space'))\n\t\t\t\t) {\n\t\t\t\t\tthis.toggleSelected(this.focusedValue);\n\t\t\t\t} else {\n\t\t\t\t\tthis.isNavigating = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this.focusedValue) {\n\t\t\t\t\tthis.selectedValues = [this.focusedValue];\n\t\t\t\t}\n\t\t\t\tthis.isNavigating = false;\n\t\t\t}\n\t\t}\n\t}\n\n\tdeselectAll() {\n\t\tthis.selectedValues = [];\n\t}\n\n\ttoggleSelected(value: T['value']) {\n\t\tif (this.filteredOptions.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.multiple) {\n\t\t\tif (this.selectedValues.includes(value)) {\n\t\t\t\tthis.selectedValues = this.selectedValues.filter((v) => v !== value);\n\t\t\t} else {\n\t\t\t\tthis.selectedValues = [...this.selectedValues, value];\n\t\t\t}\n\t\t} else {\n\t\t\tthis.selectedValues = [value];\n\t\t}\n\t}\n\n\t#onUserInputChanged(value: string): void {\n\t\tif (value !== this.#lastUserInput) {\n\t\t\tthis.#lastUserInput = value;\n\n\t\t\tconst options = this.options;\n\n\t\t\tif (value) {\n\t\t\t\tthis.filteredOptions = options.filter((opt) => this.#filterFn(value, opt));\n\t\t\t} else {\n\t\t\t\tthis.filteredOptions = [...options];\n\t\t\t}\n\t\t\tconst valueCursor = getCursorForValue(this.focusedValue, this.filteredOptions);\n\t\t\tthis.#cursor = findCursor(valueCursor, 0, this.filteredOptions);\n\t\t\tconst focusedOption = this.filteredOptions[this.#cursor];\n\t\t\tif (focusedOption && !focusedOption.disabled) {\n\t\t\t\tthis.focusedValue = focusedOption.value;\n\t\t\t} else {\n\t\t\t\tthis.focusedValue = undefined;\n\t\t\t}\n\t\t\tif (!this.multiple) {\n\t\t\t\tif (this.focusedValue !== undefined) {\n\t\t\t\t\tthis.toggleSelected(this.focusedValue);\n\t\t\t\t} else {\n\t\t\t\t\tthis.deselectAll();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { cursor } from 'sisteransi';\nimport Prompt, { type PromptOptions } from './prompt.js';\n\nexport interface ConfirmOptions extends PromptOptions<boolean, ConfirmPrompt> {\n\tactive: string;\n\tinactive: string;\n\tinitialValue?: boolean;\n}\n\nexport default class ConfirmPrompt extends Prompt<boolean> {\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('userInput', () => {\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.js';\n\nexport interface GroupMultiSelectOptions<T extends { value: any }>\n\textends PromptOptions<T['value'][], 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<T['value'][]> {\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\tconst value = this.value;\n\t\tif (value === undefined) {\n\t\t\treturn false;\n\t\t}\n\t\treturn items.every((i) => value.includes(i.value));\n\t}\n\n\tprivate toggleValue() {\n\t\tconst item = this.options[this.cursor];\n\t\tif (this.value === undefined) {\n\t\t\tthis.value = [];\n\t\t}\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 { findCursor } from '../utils/cursor.js';\nimport Prompt, { type PromptOptions } from './prompt.js';\n\ninterface OptionLike {\n\tvalue: any;\n\tdisabled?: boolean;\n}\n\nexport interface MultiSelectOptions<T extends OptionLike>\n\textends PromptOptions<T['value'][], MultiSelectPrompt<T>> {\n\toptions: T[];\n\tinitialValues?: T['value'][];\n\trequired?: boolean;\n\tcursorAt?: T['value'];\n}\nexport default class MultiSelectPrompt<T extends OptionLike> extends Prompt<T['value'][]> {\n\toptions: T[];\n\tcursor = 0;\n\n\tprivate get _value(): T['value'] {\n\t\treturn this.options[this.cursor].value;\n\t}\n\n\tprivate get _enabledOptions(): T[] {\n\t\treturn this.options.filter((option) => option.disabled !== true);\n\t}\n\n\tprivate toggleAll() {\n\t\tconst enabledOptions = this._enabledOptions;\n\t\tconst allSelected = this.value !== undefined && this.value.length === enabledOptions.length;\n\t\tthis.value = allSelected ? [] : enabledOptions.map((v) => v.value);\n\t}\n\n\tprivate toggleInvert() {\n\t\tconst value = this.value;\n\t\tif (!value) {\n\t\t\treturn;\n\t\t}\n\t\tconst notSelected = this._enabledOptions.filter((v) => !value.includes(v.value));\n\t\tthis.value = notSelected.map((v) => v.value);\n\t}\n\n\tprivate toggleValue() {\n\t\tif (this.value === undefined) {\n\t\t\tthis.value = [];\n\t\t}\n\t\tconst selected = this.value.includes(this._value);\n\t\tthis.value = selected\n\t\t\t? this.value.filter((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\tconst cursor = Math.max(\n\t\t\tthis.options.findIndex(({ value }) => value === opts.cursorAt),\n\t\t\t0\n\t\t);\n\t\tthis.cursor = this.options[cursor].disabled ? findCursor<T>(cursor, 1, this.options) : cursor;\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\tif (char === 'i') {\n\t\t\t\tthis.toggleInvert();\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 = findCursor<T>(this.cursor, -1, this.options);\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 = findCursor<T>(this.cursor, 1, this.options);\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.js';\n\nexport interface PasswordOptions extends PromptOptions<string, PasswordPrompt> {\n\tmask?: string;\n}\nexport default class PasswordPrompt extends Prompt<string> {\n\tprivate _mask = '•';\n\tget cursor() {\n\t\treturn this._cursor;\n\t}\n\tget masked() {\n\t\treturn this.userInput.replaceAll(/./g, this._mask);\n\t}\n\tget userInputWithCursor() {\n\t\tif (this.state === 'submit' || this.state === 'cancel') {\n\t\t\treturn this.masked;\n\t\t}\n\t\tconst userInput = this.userInput;\n\t\tif (this.cursor >= userInput.length) {\n\t\t\treturn `${this.masked}${color.inverse(color.hidden('_'))}`;\n\t\t}\n\t\tconst masked = this.masked;\n\t\tconst s1 = masked.slice(0, this.cursor);\n\t\tconst s2 = masked.slice(this.cursor);\n\t\treturn `${s1}${color.inverse(s2[0])}${s2.slice(1)}`;\n\t}\n\tclear() {\n\t\tthis._clearUserInput();\n\t}\n\tconstructor({ mask, ...opts }: PasswordOptions) {\n\t\tsuper(opts);\n\t\tthis._mask = mask ?? '•';\n\t\tthis.on('userInput', (input) => {\n\t\t\tthis._setValue(input);\n\t\t});\n\t}\n}\n","import { findCursor } from '../utils/cursor.js';\nimport Prompt, { type PromptOptions } from './prompt.js';\n\nexport interface SelectOptions<T extends { value: any; disabled?: boolean }>\n\textends PromptOptions<T['value'], SelectPrompt<T>> {\n\toptions: T[];\n\tinitialValue?: T['value'];\n}\nexport default class SelectPrompt<T extends { value: any; disabled?: boolean }> extends Prompt<\n\tT['value']\n> {\n\toptions: T[];\n\tcursor = 0;\n\n\tprivate get _selectedValue() {\n\t\treturn this.options[this.cursor];\n\t}\n\n\tprivate changeValue() {\n\t\tthis.value = this._selectedValue.value;\n\t}\n\n\tconstructor(opts: SelectOptions<T>) {\n\t\tsuper(opts, false);\n\n\t\tthis.options = opts.options;\n\n\t\tconst initialCursor = this.options.findIndex(({ value }) => value === opts.initialValue);\n\t\tconst cursor = initialCursor === -1 ? 0 : initialCursor;\n\t\tthis.cursor = this.options[cursor].disabled ? findCursor<T>(cursor, 1, this.options) : cursor;\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 = findCursor<T>(this.cursor, -1, this.options);\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 = findCursor<T>(this.cursor, 1, this.options);\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.js';\n\nexport interface SelectKeyOptions<T extends { value: string }>\n\textends PromptOptions<T['value'], SelectKeyPrompt<T>> {\n\toptions: T[];\n\tcaseSensitive?: boolean;\n}\nexport default class SelectKeyPrompt<T extends { value: string }> extends Prompt<T['value']> {\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 caseSensitive = opts.caseSensitive === true;\n\t\tconst keys = this.options.map(({ value: [initial] }) => {\n\t\t\treturn caseSensitive ? initial : initial?.toLowerCase();\n\t\t});\n\t\tthis.cursor = Math.max(keys.indexOf(opts.initialValue), 0);\n\n\t\tthis.on('key', (key, keyInfo) => {\n\t\t\tif (!key) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst casedKey = caseSensitive && keyInfo.shift ? key.toUpperCase() : key;\n\t\t\tif (!keys.includes(casedKey)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst value = this.options.find(({ value: [initial] }) => {\n\t\t\t\treturn caseSensitive ? initial === casedKey : initial?.toLowerCase() === key;\n\t\t\t});\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.js';\n\nexport interface TextOptions extends PromptOptions<string, TextPrompt> {\n\tplaceholder?: string;\n\tdefaultValue?: string;\n}\n\nexport default class TextPrompt extends Prompt<string> {\n\tget userInputWithCursor() {\n\t\tif (this.state === 'submit') {\n\t\t\treturn this.userInput;\n\t\t}\n\t\tconst userInput = this.userInput;\n\t\tif (this.cursor >= userInput.length) {\n\t\t\treturn `${this.userInput}█`;\n\t\t}\n\t\tconst s1 = userInput.slice(0, this.cursor);\n\t\tconst [s2, ...s3] = userInput.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({\n\t\t\t...opts,\n\t\t\tinitialUserInput: opts.initialUserInput ?? opts.initialValue,\n\t\t});\n\n\t\tthis.on('userInput', (input) => {\n\t\t\tthis._setValue(input);\n\t\t});\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\tif (this.value === undefined) {\n\t\t\t\tthis.value = '';\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 type { Readable, Writable } from 'node:stream';\nimport type { State } from '@clack/core';\nimport isUnicodeSupported from 'is-unicode-supported';\nimport color from 'picocolors';\n\nexport const unicode = isUnicodeSupported();\nexport const isCI = (): boolean => process.env.CI === 'true';\nexport const isTTY = (output: Writable): boolean => {\n\treturn (output as Writable & { isTTY?: boolean }).isTTY === true;\n};\nexport const unicodeOr = (c: string, fallback: string) => (unicode ? c : fallback);\nexport const S_STEP_ACTIVE = unicodeOr('◆', '*');\nexport const S_STEP_CANCEL = unicodeOr('■', 'x');\nexport const S_STEP_ERROR = unicodeOr('▲', 'x');\nexport const S_STEP_SUBMIT = unicodeOr('◇', 'o');\n\nexport const S_BAR_START = unicodeOr('┌', 'T');\nexport const S_BAR = unicodeOr('│', '|');\nexport const S_BAR_END = unicodeOr('└', '—');\nexport const S_BAR_START_RIGHT = unicodeOr('┐', 'T');\nexport const S_BAR_END_RIGHT = unicodeOr('┘', '—');\n\nexport const S_RADIO_ACTIVE = unicodeOr('●', '>');\nexport const S_RADIO_INACTIVE = unicodeOr('○', ' ');\nexport const S_CHECKBOX_ACTIVE = unicodeOr('◻', '[•]');\nexport const S_CHECKBOX_SELECTED = unicodeOr('◼', '[+]');\nexport const S_CHECKBOX_INACTIVE = unicodeOr('◻', '[ ]');\nexport const S_PASSWORD_MASK = unicodeOr('▪', '•');\n\nexport const S_BAR_H = unicodeOr('─', '-');\nexport const S_CORNER_TOP_RIGHT = unicodeOr('╮', '+');\nexport const S_CONNECT_LEFT = unicodeOr('├', '+');\nexport const S_CORNER_BOTTOM_RIGHT = unicodeOr('╯', '+');\nexport const S_CORNER_BOTTOM_LEFT = unicodeOr('╰', '+');\nexport const S_CORNER_TOP_LEFT = unicodeOr('╭', '+');\n\nexport const S_INFO = unicodeOr('●', '•');\nexport const S_SUCCESS = unicodeOr('◆', '*');\nexport const S_WARN = unicodeOr('▲', '!');\nexport const S_ERROR = unicodeOr('■', 'x');\n\nexport const 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\nexport const symbolBar = (state: State) => {\n\tswitch (state) {\n\t\tcase 'initial':\n\t\tcase 'active':\n\t\t\treturn color.cyan(S_BAR);\n\t\tcase 'cancel':\n\t\t\treturn color.red(S_BAR);\n\t\tcase 'error':\n\t\t\treturn color.yellow(S_BAR);\n\t\tcase 'submit':\n\t\t\treturn color.green(S_BAR);\n\t}\n};\n\nexport interface CommonOptions {\n\tinput?: Readable;\n\toutput?: Writable;\n\tsignal?: AbortSignal;\n\twithGuide?: boolean;\n}\n","/* MAIN */\n//URL: https://github.com/sindresorhus/get-east-asian-width/blob/main/lookup.js\n//LICENSE: https://github.com/sindresorhus/get-east-asian-width/blob/main/license\n//TODO: Replace these with some unicode property classes, if the ones we need exist\nconst isAmbiguous = (x) => {\n return x === 0xA1 || x === 0xA4 || x === 0xA7 || x === 0xA8 || x === 0xAA || x === 0xAD || x === 0xAE || x >= 0xB0 && x <= 0xB4 || x >= 0xB6 && x <= 0xBA || x >= 0xBC && x <= 0xBF || x === 0xC6 || x === 0xD0 || x === 0xD7 || x === 0xD8 || x >= 0xDE && x <= 0xE1 || x === 0xE6 || x >= 0xE8 && x <= 0xEA || x === 0xEC || x === 0xED || x === 0xF0 || x === 0xF2 || x === 0xF3 || x >= 0xF7 && x <= 0xFA || x === 0xFC || x === 0xFE || x === 0x101 || x === 0x111 || x === 0x113 || x === 0x11B || x === 0x126 || x === 0x127 || x === 0x12B || x >= 0x131 && x <= 0x133 || x === 0x138 || x >= 0x13F && x <= 0x142 || x === 0x144 || x >= 0x148 && x <= 0x14B || x === 0x14D || x === 0x152 || x === 0x153 || x === 0x166 || x === 0x167 || x === 0x16B || x === 0x1CE || x === 0x1D0 || x === 0x1D2 || x === 0x1D4 || x === 0x1D6 || x === 0x1D8 || x === 0x1DA || x === 0x1DC || x === 0x251 || x === 0x261 || x === 0x2C4 || x === 0x2C7 || x >= 0x2C9 && x <= 0x2CB || x === 0x2CD || x === 0x2D0 || x >= 0x2D8 && x <= 0x2DB || x === 0x2DD || x === 0x2DF || x >= 0x300 && x <= 0x36F || x >= 0x391 && x <= 0x3A1 || x >= 0x3A3 && x <= 0x3A9 || x >= 0x3B1 && x <= 0x3C1 || x >= 0x3C3 && x <= 0x3C9 || x === 0x401 || x >= 0x410 && x <= 0x44F || x === 0x451 || x === 0x2010 || x >= 0x2013 && x <= 0x2016 || x === 0x2018 || x === 0x2019 || x === 0x201C || x === 0x201D || x >= 0x2020 && x <= 0x2022 || x >= 0x2024 && x <= 0x2027 || x === 0x2030 || x === 0x2032 || x === 0x2033 || x === 0x2035 || x === 0x203B || x === 0x203E || x === 0x2074 || x === 0x207F || x >= 0x2081 && x <= 0x2084 || x === 0x20AC || x === 0x2103 || x === 0x2105 || x === 0x2109 || x === 0x2113 || x === 0x2116 || x === 0x2121 || x === 0x2122 || x === 0x2126 || x === 0x212B || x === 0x2153 || x === 0x2154 || x >= 0x215B && x <= 0x215E || x >= 0x2160 && x <= 0x216B || x >= 0x2170 && x <= 0x2179 || x === 0x2189 || x >= 0x2190 && x <= 0x2199 || x === 0x21B8 || x === 0x21B9 || x === 0x21D2 || x === 0x21D4 || x === 0x21E7 || x === 0x2200 || x === 0x2202 || x === 0x2203 || x === 0x2207 || x === 0x2208 || x === 0x220B || x === 0x220F || x === 0x2211 || x === 0x2215 || x === 0x221A || x >= 0x221D && x <= 0x2220 || x === 0x2223 || x === 0x2225 || x >= 0x2227 && x <= 0x222C || x === 0x222E || x >= 0x2234 && x <= 0x2237 || x === 0x223C || x === 0x223D || x === 0x2248 || x === 0x224C || x === 0x2252 || x === 0x2260 || x === 0x2261 || x >= 0x2264 && x <= 0x2267 || x === 0x226A || x === 0x226B || x === 0x226E || x === 0x226F || x === 0x2282 || x === 0x2283 || x === 0x2286 || x === 0x2287 || x === 0x2295 || x === 0x2299 || x === 0x22A5 || x === 0x22BF || x === 0x2312 || x >= 0x2460 && x <= 0x24E9 || x >= 0x24EB && x <= 0x254B || x >= 0x2550 && x <= 0x2573 || x >= 0x2580 && x <= 0x258F || x >= 0x2592 && x <= 0x2595 || x === 0x25A0 || x === 0x25A1 || x >= 0x25A3 && x <= 0x25A9 || x === 0x25B2 || x === 0x25B3 || x === 0x25B6 || x === 0x25B7 || x === 0x25BC || x === 0x25BD || x === 0x25C0 || x === 0x25C1 || x >= 0x25C6 && x <= 0x25C8 || x === 0x25CB || x >= 0x25CE && x <= 0x25D1 || x >= 0x25E2 && x <= 0x25E5 || x === 0x25EF || x === 0x2605 || x === 0x2606 || x === 0x2609 || x === 0x260E || x === 0x260F || x === 0x261C || x === 0x261E || x === 0x2640 || x === 0x2642 || x === 0x2660 || x === 0x2661 || x >= 0x2663 && x <= 0x2665 || x >= 0x2667 && x <= 0x266A || x === 0x266C || x === 0x266D || x === 0x266F || x === 0x269E || x === 0x269F || x === 0x26BF || x >= 0x26C6 && x <= 0x26CD || x >= 0x26CF && x <= 0x26D3 || x >= 0x26D5 && x <= 0x26E1 || x === 0x26E3 || x === 0x26E8 || x === 0x26E9 || x >= 0x26EB && x <= 0x26F1 || x === 0x26F4 || x >= 0x26F6 && x <= 0x26F9 || x === 0x26FB || x === 0x26FC || x === 0x26FE || x === 0x26FF || x === 0x273D || x >= 0x2776 && x <= 0x277F || x >= 0x2B56 && x <= 0x2B59 || x >= 0x3248 && x <= 0x324F || x >= 0xE000 && x <= 0xF8FF || x >= 0xFE00 && x <= 0xFE0F || x === 0xFFFD || x >= 0x1F100 && x <= 0x1F10A || x >= 0x1F110 && x <= 0x1F12D || x >= 0x1F130 && x <= 0x1F169 || x >= 0x1F170 && x <= 0x1F18D || x === 0x1F18F || x === 0x1F190 || x >= 0x1F19B && x <= 0x1F1AC || x >= 0xE0100 && x <= 0xE01EF || x >= 0xF0000 && x <= 0xFFFFD || x >= 0x100000 && x <= 0x10FFFD;\n};\nconst isFullWidth = (x) => {\n return x === 0x3000 || x >= 0xFF01 && x <= 0xFF60 || x >= 0xFFE0 && x <= 0xFFE6;\n};\nconst isWide = (x) => {\n return x >= 0x1100 && x <= 0x115F || x === 0x231A || x === 0x231B || x === 0x2329 || x === 0x232A || x >= 0x23E9 && x <= 0x23EC || x === 0x23F0 || x === 0x23F3 || x === 0x25FD || x === 0x25FE || x === 0x2614 || x === 0x2615 || x >= 0x2648 && x <= 0x2653 || x === 0x267F || x === 0x2693 || x === 0x26A1 || x === 0x26AA || x === 0x26AB || x === 0x26BD || x === 0x26BE || x === 0x26C4 || x === 0x26C5 || x === 0x26CE || x === 0x26D4 || x === 0x26EA || x === 0x26F2 || x === 0x26F3 || x === 0x26F5 || x === 0x26FA || x === 0x26FD || x === 0x2705 || x === 0x270A || x === 0x270B || x === 0x2728 || x === 0x274C || x === 0x274E || x >= 0x2753 && x <= 0x2755 || x === 0x2757 || x >= 0x2795 && x <= 0x2797 || x === 0x27B0 || x === 0x27BF || x === 0x2B1B || x === 0x2B1C || x === 0x2B50 || x === 0x2B55 || x >= 0x2E80 && x <= 0x2E99 || x >= 0x2E9B && x <= 0x2EF3 || x >= 0x2F00 && x <= 0x2FD5 || x >= 0x2FF0 && x <= 0x2FFF || x >= 0x3001 && x <= 0x303E || x >= 0x3041 && x <= 0x3096 || x >= 0x3099 && x <= 0x30FF || x >= 0x3105 && x <= 0x312F || x >= 0x3131 && x <= 0x318E || x >= 0x3190 && x <= 0x31E3 || x >= 0x31EF && x <= 0x321E || x >= 0x3220 && x <= 0x3247 || x >= 0x3250 && x <= 0x4DBF || x >= 0x4E00 && x <= 0xA48C || x >= 0xA490 && x <= 0xA4C6 || x >= 0xA960 && x <= 0xA97C || x >= 0xAC00 && x <= 0xD7A3 || x >= 0xF900 && x <= 0xFAFF || x >= 0xFE10 && x <= 0xFE19 || x >= 0xFE30 && x <= 0xFE52 || x >= 0xFE54 && x <= 0xFE66 || x >= 0xFE68 && x <= 0xFE6B || x >= 0x16FE0 && x <= 0x16FE4 || x === 0x16FF0 || x === 0x16FF1 || x >= 0x17000 && x <= 0x187F7 || x >= 0x18800 && x <= 0x18CD5 || x >= 0x18D00 && x <= 0x18D08 || x >= 0x1AFF0 && x <= 0x1AFF3 || x >= 0x1AFF5 && x <= 0x1AFFB || x === 0x1AFFD || x === 0x1AFFE || x >= 0x1B000 && x <= 0x1B122 || x === 0x1B132 || x >= 0x1B150 && x <= 0x1B152 || x === 0x1B155 || x >= 0x1B164 && x <= 0x1B167 || x >= 0x1B170 && x <= 0x1B2FB || x === 0x1F004 || x === 0x1F0CF || x === 0x1F18E || x >= 0x1F191 && x <= 0x1F19A || x >= 0x1F200 && x <= 0x1F202 || x >= 0x1F210 && x <= 0x1F23B || x >= 0x1F240 && x <= 0x1F248 || x === 0x1F250 || x === 0x1F251 || x >= 0x1F260 && x <= 0x1F265 || x >= 0x1F300 && x <= 0x1F320 || x >= 0x1F32D && x <= 0x1F335 || x >= 0x1F337 && x <= 0x1F37C || x >= 0x1F37E && x <= 0x1F393 || x >= 0x1F3A0 && x <= 0x1F3CA || x >= 0x1F3CF && x <= 0x1F3D3 || x >= 0x1F3E0 && x <= 0x1F3F0 || x === 0x1F3F4 || x >= 0x1F3F8 && x <= 0x1F43E || x === 0x1F440 || x >= 0x1F442 && x <= 0x1F4FC || x >= 0x1F4FF && x <= 0x1F53D || x >= 0x1F54B && x <= 0x1F54E || x >= 0x1F550 && x <= 0x1F567 || x === 0x1F57A || x === 0x1F595 || x === 0x1F596 || x === 0x1F5A4 || x >= 0x1F5FB && x <= 0x1F64F || x >= 0x1F680 && x <= 0x1F6C5 || x === 0x1F6CC || x >= 0x1F6D0 && x <= 0x1F6D2 || x >= 0x1F6D5 && x <= 0x1F6D7 || x >= 0x1F6DC && x <= 0x1F6DF || x === 0x1F6EB || x === 0x1F6EC || x >= 0x1F6F4 && x <= 0x1F6FC || x >= 0x1F7E0 && x <= 0x1F7EB || x === 0x1F7F0 || x >= 0x1F90C && x <= 0x1F93A || x >= 0x1F93C && x <= 0x1F945 || x >= 0x1F947 && x <= 0x1F9FF || x >= 0x1FA70 && x <= 0x1FA7C || x >= 0x1FA80 && x <= 0x1FA88 || x >= 0x1FA90 && x <= 0x1FABD || x >= 0x1FABF && x <= 0x1FAC5 || x >= 0x1FACE && x <= 0x1FADB || x >= 0x1FAE0 && x <= 0x1FAE8 || x >= 0x1FAF0 && x <= 0x1FAF8 || x >= 0x20000 && x <= 0x2FFFD || x >= 0x30000 && x <= 0x3FFFD;\n};\n/* EXPORT */\nexport { isAmbiguous, isFullWidth, isWide };\n","/* IMPORT */\nimport { isAmbiguous, isFullWidth, isWide } from './utils.js';\n/* HELPERS */\nconst ANSI_RE = /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;\nconst CONTROL_RE = /[\\x00-\\x08\\x0A-\\x1F\\x7F-\\x9F]{1,1000}/y;\nconst TAB_RE = /\\t{1,1000}/y;\nconst EMOJI_RE = /[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*/yu;\nconst LATIN_RE = /(?:[\\x20-\\x7E\\xA0-\\xFF](?!\\uFE0F)){1,1000}/y;\nconst MODIFIER_RE = /\\p{M}+/gu;\nconst NO_TRUNCATION = { limit: Infinity, ellipsis: '' };\n/* MAIN */\n//TODO: Optimize matching non-latin letters\nconst getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {\n /* CONSTANTS */\n const LIMIT = truncationOptions.limit ?? Infinity;\n const ELLIPSIS = truncationOptions.ellipsis ?? '';\n const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);\n const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;\n const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;\n const TAB_WIDTH = widthOptions.tabWidth ?? 8;\n const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;\n const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;\n const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;\n const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;\n const WIDE_WIDTH = widthOptions.wideWidth ?? 2;\n /* STATE */\n let indexPrev = 0;\n let index = 0;\n let length = input.length;\n let lengthExtra = 0;\n let truncationEnabled = false;\n let truncationIndex = length;\n let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);\n let unmatchedStart = 0;\n let unmatchedEnd = 0;\n let width = 0;\n let widthExtra = 0;\n /* PARSE LOOP */\n outer: while (true) {\n /* UNMATCHED */\n if ((unmatchedEnd > unmatchedStart) || (index >= length && index > indexPrev)) {\n const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);\n lengthExtra = 0;\n for (const char of unmatched.replaceAll(MODIFIER_RE, '')) {\n const codePoint = char.codePointAt(0) || 0;\n if (isFullWidth(codePoint)) {\n widthExtra = FULL_WIDTH_WIDTH;\n }\n else if (isWide(codePoint)) {\n widthExtra = WIDE_WIDTH;\n }\n else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {\n widthExtra = AMBIGUOUS_WIDTH;\n }\n else {\n widthExtra = REGULAR_WIDTH;\n }\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break outer;\n }\n lengthExtra += char.length;\n width += widthExtra;\n }\n unmatchedStart = unmatchedEnd = 0;\n }\n /* EXITING */\n if (index >= length)\n break;\n /* LATIN */\n LATIN_RE.lastIndex = index;\n if (LATIN_RE.test(input)) {\n lengthExtra = LATIN_RE.lastIndex - index;\n widthExtra = lengthExtra * REGULAR_WIDTH;\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += widthExtra;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = LATIN_RE.lastIndex;\n continue;\n }\n /* ANSI */\n ANSI_RE.lastIndex = index;\n if (ANSI_RE.test(input)) {\n if ((width + ANSI_WIDTH) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index);\n }\n if ((width + ANSI_WIDTH) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += ANSI_WIDTH;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = ANSI_RE.lastIndex;\n continue;\n }\n /* CONTROL */\n CONTROL_RE.lastIndex = index;\n if (CONTROL_RE.test(input)) {\n lengthExtra = CONTROL_RE.lastIndex - index;\n widthExtra = lengthExtra * CONTROL_WIDTH;\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += widthExtra;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = CONTROL_RE.lastIndex;\n continue;\n }\n /* TAB */\n TAB_RE.lastIndex = index;\n if (TAB_RE.test(input)) {\n lengthExtra = TAB_RE.lastIndex - index;\n widthExtra = lengthExtra * TAB_WIDTH;\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += widthExtra;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = TAB_RE.lastIndex;\n continue;\n }\n /* EMOJI */\n EMOJI_RE.lastIndex = index;\n if (EMOJI_RE.test(input)) {\n if ((width + EMOJI_WIDTH) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index);\n }\n if ((width + EMOJI_WIDTH) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += EMOJI_WIDTH;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = EMOJI_RE.lastIndex;\n continue;\n }\n /* UNMATCHED INDEX */\n index += 1;\n }\n /* RETURN */\n return {\n width: truncationEnabled ? truncationLimit : width,\n index: truncationEnabled ? truncationIndex : length,\n truncated: truncationEnabled,\n ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH\n };\n};\n/* EXPORT */\nexport default getStringTruncatedWidth;\n","/* IMPORT */\nimport fastStringTruncatedWidth from 'fast-string-truncated-width';\n/* HELPERS */\nconst NO_TRUNCATION = {\n limit: Infinity,\n ellipsis: '',\n ellipsisWidth: 0,\n};\n/* MAIN */\nconst fastStringWidth = (input, options = {}) => {\n return fastStringTruncatedWidth(input, NO_TRUNCATION, options).width;\n};\n/* EXPORT */\nexport default fastStringWidth;\n","import stringWidth from 'fast-string-width';\nconst ESC = '\\x1B';\nconst CSI = '\\x9B';\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;;`;\nconst GROUP_REGEX = new RegExp(`(?:\\\\${ANSI_CSI}(?<code>\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, 'y');\nconst getClosingCode = (openingCode) => {\n if (openingCode >= 30 && openingCode <= 37)\n return 39;\n if (openingCode >= 90 && openingCode <= 97)\n return 39;\n if (openingCode >= 40 && openingCode <= 47)\n return 49;\n if (openingCode >= 100 && openingCode <= 107)\n return 49;\n if (openingCode === 1 || openingCode === 2)\n return 22;\n if (openingCode === 3)\n return 23;\n if (openingCode === 4)\n return 24;\n if (openingCode === 7)\n return 27;\n if (openingCode === 8)\n return 28;\n if (openingCode === 9)\n return 29;\n if (openingCode === 0)\n return 0;\n return undefined;\n};\nconst wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;\nconst wordLengths = (words) => words.map((character) => stringWidth(character));\nconst wrapWord = (rows, word, columns) => {\n const characters = word[Symbol.iterator]();\n let isInsideEscape = false;\n let isInsideLinkEscape = false;\n let lastRow = rows.at(-1);\n let visible = lastRow === undefined ? 0 : stringWidth(lastRow);\n let currentCharacter = characters.next();\n let nextCharacter = characters.next();\n let rawCharacterIndex = 0;\n while (!currentCharacter.done) {\n const character = currentCharacter.value;\n const characterLength = stringWidth(character);\n if (visible + characterLength <= columns) {\n rows[rows.length - 1] += character;\n }\n else {\n rows.push(character);\n visible = 0;\n }\n if (character === ESC || character === CSI) {\n isInsideEscape = true;\n isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);\n }\n if (isInsideEscape) {\n if (isInsideLinkEscape) {\n if (character === ANSI_ESCAPE_BELL) {\n isInsideEscape = false;\n isInsideLinkEscape = false;\n }\n }\n else if (character === ANSI_SGR_TERMINATOR) {\n isInsideEscape = false;\n }\n }\n else {\n visible += characterLength;\n if (visible === columns && !nextCharacter.done) {\n rows.push('');\n visible = 0;\n }\n }\n currentCharacter = nextCharacter;\n nextCharacter = characters.next();\n rawCharacterIndex += character.length;\n }\n lastRow = rows.at(-1);\n if (!visible &&\n lastRow !== undefined &&\n lastRow.length > 0 &&\n rows.length > 1) {\n rows[rows.length - 2] += rows.pop();\n }\n};\nconst stringVisibleTrimSpacesRight = (string) => {\n const words = string.split(' ');\n let last = words.length;\n while (last > 0) {\n if (stringWidth(words[last - 1]) > 0) {\n break;\n }\n last--;\n }\n if (last === words.length) {\n return string;\n }\n return words.slice(0, last).join(' ') + words.slice(last).join('');\n};\nconst exec = (string, columns, options = {}) => {\n if (options.trim !== false && string.trim() === '') {\n return '';\n }\n let returnValue = '';\n let escapeCode;\n let escapeUrl;\n const words = string.split(' ');\n const lengths = wordLengths(words);\n let rows = [''];\n for (const [index, word] of words.entries()) {\n if (options.trim !== false) {\n rows[rows.length - 1] = (rows.at(-1) ?? '').trimStart();\n }\n let rowLength = stringWidth(rows.at(-1) ?? '');\n if (index !== 0) {\n if (rowLength >= columns &&\n (options.wordWrap === false || options.trim === false)) {\n rows.push('');\n rowLength = 0;\n }\n if (rowLength > 0 || options.trim === false) {\n rows[rows.length - 1] += ' ';\n rowLength++;\n }\n }\n if (options.hard && lengths[index] > columns) {\n const remainingColumns = columns - rowLength;\n const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);\n const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);\n if (breaksStartingNextLine < breaksStartingThisLine) {\n rows.push('');\n }\n wrapWord(rows, word, columns);\n continue;\n }\n if (rowLength + lengths[index] > columns &&\n rowLength > 0 &&\n lengths[index] > 0) {\n if (options.wordWrap === false && rowLength < columns) {\n wrapWord(rows, word, columns);\n continue;\n }\n rows.push('');\n }\n if (rowLength + lengths[index] > columns && options.wordWrap === false) {\n wrapWord(rows, word, columns);\n continue;\n }\n rows[rows.length - 1] += word;\n }\n if (options.trim !== false) {\n rows = rows.map((row) => stringVisibleTrimSpacesRight(row));\n }\n const preString = rows.join('\\n');\n const pre = preString[Symbol.iterator]();\n let currentPre = pre.next();\n let nextPre = pre.next();\n // We need to keep a separate index as `String#slice()` works on Unicode code units, while `pre` is an array of codepoints.\n let preStringIndex = 0;\n while (!currentPre.done) {\n const character = currentPre.value;\n const nextCharacter = nextPre.value;\n returnValue += character;\n if (character === ESC || character === CSI) {\n GROUP_REGEX.lastIndex = preStringIndex + 1;\n const groupsResult = GROUP_REGEX.exec(preString);\n const groups = groupsResult?.groups;\n if (groups?.code !== undefined) {\n const code = Number.parseFloat(groups.code);\n escapeCode = code === END_CODE ? undefined : code;\n }\n else if (groups?.uri !== undefined) {\n escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n }\n }\n const closingCode = escapeCode ? getClosingCode(escapeCode) : undefined;\n if (nextCharacter === '\\n') {\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink('');\n }\n if (escapeCode && closingCode) {\n returnValue += wrapAnsiCode(closingCode);\n }\n }\n else if (character === '\\n') {\n if (escapeCode && closingCode) {\n returnValue += wrapAnsiCode(escapeCode);\n }\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(escapeUrl);\n }\n }\n preStringIndex += character.length;\n currentPre = nextPre;\n nextPre = pre.next();\n }\n return returnValue;\n};\nexport function wrapAnsi(string, columns, options) {\n return String(string)\n .normalize()\n .replaceAll('\\r\\n', '\\n')\n .split('\\n')\n .map((line) => exec(line, columns, options))\n .join('\\n');\n}\n//# sourceMappingURL=main.js.map","import type { Writable } from 'node:stream';\nimport { getColumns, getRows } from '@clack/core';\nimport { wrapAnsi } from 'fast-wrap-ansi';\nimport color from 'picocolors';\nimport type { CommonOptions } from './common.js';\n\nexport interface LimitOptionsParams<TOption> extends CommonOptions {\n\toptions: TOption[];\n\tmaxItems: number | undefined;\n\tcursor: number;\n\tstyle: (option: TOption, active: boolean) => string;\n\tcolumnPadding?: number;\n\trowPadding?: number;\n}\n\nconst trimLines = (\n\tgroups: Array<string[]>,\n\tinitialLineCount: number,\n\tstartIndex: number,\n\tendIndex: number,\n\tmaxLines: number\n) => {\n\tlet lineCount = initialLineCount;\n\tlet removals = 0;\n\tfor (let i = startIndex; i < endIndex; i++) {\n\t\tconst group = groups[i];\n\t\tlineCount = lineCount - group.length;\n\t\tremovals++;\n\t\tif (lineCount <= maxLines) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn { lineCount, removals };\n};\n\nexport const limitOptions = <TOption>(params: LimitOptionsParams<TOption>): string[] => {\n\tconst { cursor, options, style } = params;\n\tconst output: Writable = params.output ?? process.stdout;\n\tconst columns = getColumns(output);\n\tconst columnPadding = params.columnPadding ?? 0;\n\tconst rowPadding = params.rowPadding ?? 4;\n\tconst maxWidth = columns - columnPadding;\n\tconst rows = getRows(output);\n\tconst overflowFormat = color.dim('...');\n\n\tconst paramMaxItems = params.maxItems ?? Number.POSITIVE_INFINITY;\n\tconst outputMaxItems = Math.max(rows - rowPadding, 0);\n\t// We clamp to minimum 5 because anything less doesn't make sense UX wise\n\tconst maxItems = Math.max(Math.min(paramMaxItems, outputMaxItems), 5);\n\tlet slidingWindowLocation = 0;\n\n\tif (cursor >= maxItems - 3) {\n\t\tslidingWindowLocation = Math.max(Math.min(cursor - maxItems + 3, options.length - maxItems), 0);\n\t}\n\n\tlet shouldRenderTopEllipsis = maxItems < options.length && slidingWindowLocation > 0;\n\tlet shouldRenderBottomEllipsis =\n\t\tmaxItems < options.length && slidingWindowLocation + maxItems < options.length;\n\n\tconst slidingWindowLocationEnd = Math.min(slidingWindowLocation + maxItems, options.length);\n\tconst lineGroups: Array<string[]> = [];\n\tlet lineCount = 0;\n\tif (shouldRenderTopEllipsis) {\n\t\tlineCount++;\n\t}\n\tif (shouldRenderBottomEllipsis) {\n\t\tlineCount++;\n\t}\n\n\tconst slidingWindowLocationWithEllipsis =\n\t\tslidingWindowLocation + (shouldRenderTopEllipsis ? 1 : 0);\n\tconst slidingWindowLocationEndWithEllipsis =\n\t\tslidingWindowLocationEnd - (shouldRenderBottomEllipsis ? 1 : 0);\n\n\tfor (let i = slidingWindowLocationWithEllipsis; i < slidingWindowLocationEndWithEllipsis; i++) {\n\t\tconst wrappedLines = wrapAnsi(style(options[i], i === cursor), maxWidth, {\n\t\t\thard: true,\n\t\t\ttrim: false,\n\t\t}).split('\\n');\n\t\tlineGroups.push(wrappedLines);\n\t\tlineCount += wrappedLines.length;\n\t}\n\n\tif (lineCount > outputMaxItems) {\n\t\tlet precedingRemovals = 0;\n\t\tlet followingRemovals = 0;\n\t\tlet newLineCount = lineCount;\n\t\tconst cursorGroupIndex = cursor - slidingWindowLocationWithEllipsis;\n\t\tconst trimLinesLocal = (startIndex: number, endIndex: number) =>\n\t\t\ttrimLines(lineGroups, newLineCount, startIndex, endIndex, outputMaxItems);\n\n\t\tif (shouldRenderTopEllipsis) {\n\t\t\t({ lineCount: newLineCount, removals: precedingRemovals } = trimLinesLocal(\n\t\t\t\t0,\n\t\t\t\tcursorGroupIndex\n\t\t\t));\n\t\t\tif (newLineCount > outputMaxItems) {\n\t\t\t\t({ lineCount: newLineCount, removals: followingRemovals } = trimLinesLocal(\n\t\t\t\t\tcursorGroupIndex + 1,\n\t\t\t\t\tlineGroups.length\n\t\t\t\t));\n\t\t\t}\n\t\t} else {\n\t\t\t({ lineCount: newLineCount, removals: followingRemovals } = trimLinesLocal(\n\t\t\t\tcursorGroupIndex + 1,\n\t\t\t\tlineGroups.length\n\t\t\t));\n\t\t\tif (newLineCount > outputMaxItems) {\n\t\t\t\t({ lineCount: newLineCount, removals: precedingRemovals } = trimLinesLocal(\n\t\t\t\t\t0,\n\t\t\t\t\tcursorGroupIndex\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\tif (precedingRemovals > 0) {\n\t\t\tshouldRenderTopEllipsis = true;\n\t\t\tlineGroups.splice(0, precedingRemovals);\n\t\t}\n\t\tif (followingRemovals > 0) {\n\t\t\tshouldRenderBottomEllipsis = true;\n\t\t\tlineGroups.splice(lineGroups.length - followingRemovals, followingRemovals);\n\t\t}\n\t}\n\n\tconst result: string[] = [];\n\tif (shouldRenderTopEllipsis) {\n\t\tresult.push(overflowFormat);\n\t}\n\tfor (const lineGroup of lineGroups) {\n\t\tfor (const line of lineGroup) {\n\t\t\tresult.push(line);\n\t\t}\n\t}\n\tif (shouldRenderBottomEllipsis) {\n\t\tresult.push(overflowFormat);\n\t}\n\n\treturn result;\n};\n","import { AutocompletePrompt, settings } from '@clack/core';\nimport color from 'picocolors';\nimport {\n\ttype CommonOptions,\n\tS_BAR,\n\tS_BAR_END,\n\tS_CHECKBOX_INACTIVE,\n\tS_CHECKBOX_SELECTED,\n\tS_RADIO_ACTIVE,\n\tS_RADIO_INACTIVE,\n\tsymbol,\n} from './common.js';\nimport { limitOptions } from './limit-options.js';\nimport type { Option } from './select.js';\n\nfunction getLabel<T>(option: Option<T>) {\n\treturn option.label ?? String(option.value ?? '');\n}\n\nfunction getFilteredOption<T>(searchText: string, option: Option<T>): boolean {\n\tif (!searchText) {\n\t\treturn true;\n\t}\n\tconst label = (option.label ?? String(option.value ?? '')).toLowerCase();\n\tconst hint = (option.hint ?? '').toLowerCase();\n\tconst value = String(option.value).toLowerCase();\n\tconst term = searchText.toLowerCase();\n\n\treturn label.includes(term) || hint.includes(term) || value.includes(term);\n}\n\nfunction getSelectedOptions<T>(values: T[], options: Option<T>[]): Option<T>[] {\n\tconst results: Option<T>[] = [];\n\n\tfor (const option of options) {\n\t\tif (values.includes(option.value)) {\n\t\t\tresults.push(option);\n\t\t}\n\t}\n\n\treturn results;\n}\n\ninterface AutocompleteSharedOptions<Value> extends CommonOptions {\n\t/**\n\t * The message to display to the user.\n\t */\n\tmessage: string;\n\t/**\n\t * Available options for the autocomplete prompt.\n\t */\n\toptions: Option<Value>[] | ((this: AutocompletePrompt<Option<Value>>) => Option<Value>[]);\n\t/**\n\t * Maximum number of items to display at once.\n\t */\n\tmaxItems?: number;\n\t/**\n\t * Placeholder text to display when no input is provided.\n\t */\n\tplaceholder?: string;\n\t/**\n\t * Validates the value\n\t */\n\tvalidate?: (value: Value | Value[] | undefined) => string | Error | undefined;\n\t/**\n\t * Custom filter function to match options against search input.\n\t * If not provided, a default filter that matches label, hint, and value is used.\n\t */\n\tfilter?: (search: string, option: Option<Value>) => boolean;\n}\n\nexport interface AutocompleteOptions<Value> extends AutocompleteSharedOptions<Value> {\n\t/**\n\t * The initial selected value.\n\t */\n\tinitialValue?: Value;\n\t/**\n\t * The initial user input\n\t */\n\tinitialUserInput?: string;\n}\n\nexport const autocomplete = <Value>(opts: AutocompleteOptions<Value>) => {\n\tconst prompt = new AutocompletePrompt({\n\t\toptions: opts.options,\n\t\tinitialValue: opts.initialValue ? [opts.initialValue] : undefined,\n\t\tinitialUserInput: opts.initialUserInput,\n\t\tfilter:\n\t\t\topts.filter ??\n\t\t\t((search: string, opt: Option<Value>) => {\n\t\t\t\treturn getFilteredOption(search, opt);\n\t\t\t}),\n\t\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\toutput: opts.output,\n\t\tvalidate: opts.validate,\n\t\trender() {\n\t\t\tconst hasGuide = opts.withGuide ?? settings.withGuide;\n\t\t\t// Title and message display\n\t\t\tconst headings = hasGuide\n\t\t\t\t? [`${color.gray(S_BAR)}`, `${symbol(this.state)} ${opts.message}`]\n\t\t\t\t: [`${symbol(this.state)} ${opts.message}`];\n\t\t\tconst userInput = this.userInput;\n\t\t\tconst options = this.options;\n\t\t\tconst placeholder = opts.placeholder;\n\t\t\tconst showPlaceholder = userInput === '' && placeholder !== undefined;\n\t\t\tconst opt = (option: Option<Value>, state: 'inactive' | 'active' | 'disabled') => {\n\t\t\t\tconst label = getLabel(option);\n\t\t\t\tconst hint =\n\t\t\t\t\toption.hint && option.value === this.focusedValue ? color.dim(` (${option.hint})`) : '';\n\t\t\t\tswitch (state) {\n\t\t\t\t\tcase 'active':\n\t\t\t\t\t\treturn `${color.green(S_RADIO_ACTIVE)} ${label}${hint}`;\n\t\t\t\t\tcase 'inactive':\n\t\t\t\t\t\treturn `${color.dim(S_RADIO_INACTIVE)} ${color.dim(label)}`;\n\t\t\t\t\tcase 'disabled':\n\t\t\t\t\t\treturn `${color.gray(S_RADIO_INACTIVE)} ${color.strikethrough(color.gray(label))}`;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Handle different states\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\t// Show selected value\n\t\t\t\t\tconst selected = getSelectedOptions(this.selectedValues, options);\n\t\t\t\t\tconst label =\n\t\t\t\t\t\tselected.length > 0 ? ` ${color.dim(selected.map(getLabel).join(', '))}` : '';\n\t\t\t\t\tconst submitPrefix = hasGuide ? color.gray(S_BAR) : '';\n\t\t\t\t\treturn `${headings.join('\\n')}\\n${submitPrefix}${label}`;\n\t\t\t\t}\n\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst userInputText = userInput ? ` ${color.strikethrough(color.dim(userInput))}` : '';\n\t\t\t\t\tconst cancelPrefix = hasGuide ? color.gray(S_BAR) : '';\n\t\t\t\t\treturn `${headings.join('\\n')}\\n${cancelPrefix}${userInputText}`;\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tconst barColor = this.state === 'error' ? color.yellow : color.cyan;\n\t\t\t\t\tconst guidePrefix = hasGuide ? `${barColor(S_BAR)} ` : '';\n\t\t\t\t\tconst guidePrefixEnd = hasGuide ? barColor(S_BAR_END) : '';\n\t\t\t\t\t// Display cursor position - show plain text in navigation mode\n\t\t\t\t\tlet searchText = '';\n\t\t\t\t\tif (this.isNavigating || showPlaceholder) {\n\t\t\t\t\t\tconst searchTextValue = showPlaceholder ? placeholder : userInput;\n\t\t\t\t\t\tsearchText = searchTextValue !== '' ? ` ${color.dim(searchTextValue)}` : '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsearchText = ` ${this.userInputWithCursor}`;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Show match count if filtered\n\t\t\t\t\tconst matches =\n\t\t\t\t\t\tthis.filteredOptions.length !== options.length\n\t\t\t\t\t\t\t? color.dim(\n\t\t\t\t\t\t\t\t\t` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? '' : 'es'})`\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t: '';\n\n\t\t\t\t\t// No matches message\n\t\t\t\t\tconst noResults =\n\t\t\t\t\t\tthis.filteredOptions.length === 0 && userInput\n\t\t\t\t\t\t\t? [`${guidePrefix}${color.yellow('No matches found')}`]\n\t\t\t\t\t\t\t: [];\n\n\t\t\t\t\tconst validationError =\n\t\t\t\t\t\tthis.state === 'error' ? [`${guidePrefix}${color.yellow(this.error)}`] : [];\n\n\t\t\t\t\tif (hasGuide) {\n\t\t\t\t\t\theadings.push(`${guidePrefix.trimEnd()}`);\n\t\t\t\t\t}\n\t\t\t\t\theadings.push(\n\t\t\t\t\t\t`${guidePrefix}${color.dim('Search:')}${searchText}${matches}`,\n\t\t\t\t\t\t...noResults,\n\t\t\t\t\t\t...validationError\n\t\t\t\t\t);\n\n\t\t\t\t\t// Show instructions\n\t\t\t\t\tconst instructions = [\n\t\t\t\t\t\t`${color.dim('↑/↓')} to select`,\n\t\t\t\t\t\t`${color.dim('Enter:')} confirm`,\n\t\t\t\t\t\t`${color.dim('Type:')} to search`,\n\t\t\t\t\t];\n\n\t\t\t\t\tconst footers = [`${guidePrefix}${instructions.join(' • ')}`, guidePrefixEnd];\n\n\t\t\t\t\t// Render options with selection\n\t\t\t\t\tconst displayOptions =\n\t\t\t\t\t\tthis.filteredOptions.length === 0\n\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t: limitOptions({\n\t\t\t\t\t\t\t\t\tcursor: this.cursor,\n\t\t\t\t\t\t\t\t\toptions: this.filteredOptions,\n\t\t\t\t\t\t\t\t\tcolumnPadding: hasGuide ? 3 : 0, // for `| ` when guide is shown\n\t\t\t\t\t\t\t\t\trowPadding: headings.length + footers.length,\n\t\t\t\t\t\t\t\t\tstyle: (option, active) => {\n\t\t\t\t\t\t\t\t\t\treturn opt(\n\t\t\t\t\t\t\t\t\t\t\toption,\n\t\t\t\t\t\t\t\t\t\t\toption.disabled ? 'disabled' : active ? 'active' : 'inactive'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tmaxItems: opts.maxItems,\n\t\t\t\t\t\t\t\t\toutput: opts.output,\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t// Return the formatted prompt\n\t\t\t\t\treturn [\n\t\t\t\t\t\t...headings,\n\t\t\t\t\t\t...displayOptions.map((option) => `${guidePrefix}${option}`),\n\t\t\t\t\t\t...footers,\n\t\t\t\t\t].join('\\n');\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t});\n\n\t// Return the result or cancel symbol\n\treturn prompt.prompt() as Promise<Value | symbol>;\n};\n\n// Type definition for the autocompleteMultiselect component\nexport interface AutocompleteMultiSelectOptions<Value> extends AutocompleteSharedOptions<Value> {\n\t/**\n\t * The initial selected values\n\t */\n\tinitialValues?: Value[];\n\t/**\n\t * If true, at least one option must be selected\n\t */\n\trequired?: boolean;\n}\n\n/**\n * Integrated autocomplete multiselect - combines type-ahead filtering with multiselect in one UI\n */\nexport const autocompleteMultiselect = <Value>(opts: AutocompleteMultiSelectOptions<Value>) => {\n\tconst formatOption = (\n\t\toption: Option<Value>,\n\t\tactive: boolean,\n\t\tselectedValues: Value[],\n\t\tfocusedValue: Value | undefined\n\t) => {\n\t\tconst isSelected = selectedValues.includes(option.value);\n\t\tconst label = option.label ?? String(option.value ?? '');\n\t\tconst hint =\n\t\t\toption.hint && focusedValue !== undefined && option.value === focusedValue\n\t\t\t\t? color.dim(` (${option.hint})`)\n\t\t\t\t: '';\n\t\tconst checkbox = isSelected ? color.green(S_CHECKBOX_SELECTED) : color.dim(S_CHECKBOX_INACTIVE);\n\n\t\tif (option.disabled) {\n\t\t\treturn `${color.gray(S_CHECKBOX_INACTIVE)} ${color.strikethrough(color.gray(label))}`;\n\t\t}\n\t\tif (active) {\n\t\t\treturn `${checkbox} ${label}${hint}`;\n\t\t}\n\t\treturn `${checkbox} ${color.dim(label)}`;\n\t};\n\n\t// Create text prompt which we'll use as foundation\n\tconst prompt = new AutocompletePrompt<Option<Value>>({\n\t\toptions: opts.options,\n\t\tmultiple: true,\n\t\tfilter:\n\t\t\topts.filter ??\n\t\t\t((search, opt) => {\n\t\t\t\treturn getFilteredOption(search, opt);\n\t\t\t}),\n\t\tvalidate: () => {\n\t\t\tif (opts.required && prompt.selectedValues.length === 0) {\n\t\t\t\treturn 'Please select at least one item';\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\t\tinitialValue: opts.initialValues,\n\t\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\toutput: opts.output,\n\t\trender() {\n\t\t\t// Title and symbol\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\t// Selection counter\n\t\t\tconst userInput = this.userInput;\n\t\t\tconst placeholder = opts.placeholder;\n\t\t\tconst showPlaceholder = userInput === '' && placeholder !== undefined;\n\n\t\t\t// Search input display\n\t\t\tconst searchText =\n\t\t\t\tthis.isNavigating || showPlaceholder\n\t\t\t\t\t? color.dim(showPlaceholder ? placeholder : userInput) // Just show plain text when in navigation mode\n\t\t\t\t\t: this.userInputWithCursor;\n\n\t\t\tconst options = this.options;\n\n\t\t\tconst matches =\n\t\t\t\tthis.filteredOptions.length !== options.length\n\t\t\t\t\t? color.dim(\n\t\t\t\t\t\t\t` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? '' : 'es'})`\n\t\t\t\t\t\t)\n\t\t\t\t\t: '';\n\n\t\t\t// Render prompt state\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(`${this.selectedValues.length} items selected`)}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.strikethrough(color.dim(userInput))}`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tconst barColor = this.state === 'error' ? color.yellow : color.cyan;\n\t\t\t\t\t// Instructions\n\t\t\t\t\tconst instructions = [\n\t\t\t\t\t\t`${color.dim('↑/↓')} to navigate`,\n\t\t\t\t\t\t`${color.dim(this.isNavigating ? 'Space/Tab:' : 'Tab:')} select`,\n\t\t\t\t\t\t`${color.dim('Enter:')} confirm`,\n\t\t\t\t\t\t`${color.dim('Type:')} to search`,\n\t\t\t\t\t];\n\n\t\t\t\t\t// No results message\n\t\t\t\t\tconst noResults =\n\t\t\t\t\t\tthis.filteredOptions.length === 0 && userInput\n\t\t\t\t\t\t\t? [`${barColor(S_BAR)} ${color.yellow('No matches found')}`]\n\t\t\t\t\t\t\t: [];\n\n\t\t\t\t\tconst errorMessage =\n\t\t\t\t\t\tthis.state === 'error' ? [`${barColor(S_BAR)} ${color.yellow(this.error)}`] : [];\n\n\t\t\t\t\t// Calculate header and footer line counts for rowPadding\n\t\t\t\t\tconst headerLines = [\n\t\t\t\t\t\t...`${title}${barColor(S_BAR)}`.split('\\n'),\n\t\t\t\t\t\t`${barColor(S_BAR)} ${color.dim('Search:')} ${searchText}${matches}`,\n\t\t\t\t\t\t...noResults,\n\t\t\t\t\t\t...errorMessage,\n\t\t\t\t\t];\n\t\t\t\t\tconst footerLines = [\n\t\t\t\t\t\t`${barColor(S_BAR)} ${instructions.join(' • ')}`,\n\t\t\t\t\t\t`${barColor(S_BAR_END)}`,\n\t\t\t\t\t];\n\n\t\t\t\t\t// Get limited options for display\n\t\t\t\t\tconst displayOptions = limitOptions({\n\t\t\t\t\t\tcursor: this.cursor,\n\t\t\t\t\t\toptions: this.filteredOptions,\n\t\t\t\t\t\tstyle: (option, active) =>\n\t\t\t\t\t\t\tformatOption(option, active, this.selectedValues, this.focusedValue),\n\t\t\t\t\t\tmaxItems: opts.maxItems,\n\t\t\t\t\t\toutput: opts.output,\n\t\t\t\t\t\trowPadding: headerLines.length + footerLines.length,\n\t\t\t\t\t});\n\n\t\t\t\t\t// Build the prompt display\n\t\t\t\t\treturn [\n\t\t\t\t\t\t...headerLines,\n\t\t\t\t\t\t...displayOptions.map((option) => `${barColor(S_BAR)} ${option}`),\n\t\t\t\t\t\t...footerLines,\n\t\t\t\t\t].join('\\n');\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t});\n\n\t// Return the result or cancel symbol\n\treturn prompt.prompt() as Promise<Value[] | symbol>;\n};\n","import type { Writable } from 'node:stream';\nimport { getColumns, settings } from '@clack/core';\nimport stringWidth from 'fast-string-width';\nimport { wrapAnsi } from 'fast-wrap-ansi';\nimport {\n\ttype CommonOptions,\n\tS_BAR,\n\tS_BAR_END,\n\tS_BAR_END_RIGHT,\n\tS_BAR_H,\n\tS_BAR_START,\n\tS_BAR_START_RIGHT,\n\tS_CORNER_BOTTOM_LEFT,\n\tS_CORNER_BOTTOM_RIGHT,\n\tS_CORNER_TOP_LEFT,\n\tS_CORNER_TOP_RIGHT,\n} from './common.js';\n\nexport type BoxAlignment = 'left' | 'center' | 'right';\n\ntype BoxSymbols = [topLeft: string, topRight: string, bottomLeft: string, bottomRight: string];\n\nconst roundedSymbols: BoxSymbols = [\n\tS_CORNER_TOP_LEFT,\n\tS_CORNER_TOP_RIGHT,\n\tS_CORNER_BOTTOM_LEFT,\n\tS_CORNER_BOTTOM_RIGHT,\n];\nconst squareSymbols: BoxSymbols = [S_BAR_START, S_BAR_START_RIGHT, S_BAR_END, S_BAR_END_RIGHT];\n\nexport interface BoxOptions extends CommonOptions {\n\tcontentAlign?: BoxAlignment;\n\ttitleAlign?: BoxAlignment;\n\twidth?: number | 'auto';\n\ttitlePadding?: number;\n\tcontentPadding?: number;\n\trounded?: boolean;\n\tformatBorder?: (text: string) => string;\n}\n\nfunction getPaddingForLine(\n\tlineLength: number,\n\tinnerWidth: number,\n\tpadding: number,\n\tcontentAlign: BoxAlignment | undefined\n): [number, number] {\n\tlet leftPadding = padding;\n\tlet rightPadding = padding;\n\tif (contentAlign === 'center') {\n\t\tleftPadding = Math.floor((innerWidth - lineLength) / 2);\n\t} else if (contentAlign === 'right') {\n\t\tleftPadding = innerWidth - lineLength - padding;\n\t}\n\n\trightPadding = innerWidth - leftPadding - lineLength;\n\n\treturn [leftPadding, rightPadding];\n}\n\nconst defaultFormatBorder = (text: string) => text;\n\nexport const box = (message = '', title = '', opts?: BoxOptions) => {\n\tconst output: Writable = opts?.output ?? process.stdout;\n\tconst columns = getColumns(output);\n\tconst borderWidth = 1;\n\tconst borderTotalWidth = borderWidth * 2;\n\tconst titlePadding = opts?.titlePadding ?? 1;\n\tconst contentPadding = opts?.contentPadding ?? 2;\n\tconst width = opts?.width === undefined || opts.width === 'auto' ? 1 : Math.min(1, opts.width);\n\tconst hasGuide = opts?.withGuide ?? settings.withGuide;\n\tconst linePrefix = !hasGuide ? '' : `${S_BAR} `;\n\tconst formatBorder = opts?.formatBorder ?? defaultFormatBorder;\n\tconst symbols = (opts?.rounded ? roundedSymbols : squareSymbols).map(formatBorder);\n\tconst hSymbol = formatBorder(S_BAR_H);\n\tconst vSymbol = formatBorder(S_BAR);\n\tconst linePrefixWidth = stringWidth(linePrefix);\n\tconst titleWidth = stringWidth(title);\n\tconst maxBoxWidth = columns - linePrefixWidth;\n\tlet boxWidth = Math.floor(columns * width) - linePrefixWidth;\n\tif (opts?.width === 'auto') {\n\t\tconst lines = message.split('\\n');\n\t\tlet longestLine = titleWidth + titlePadding * 2;\n\t\tfor (const line of lines) {\n\t\t\tconst lineWithPadding = stringWidth(line) + contentPadding * 2;\n\t\t\tif (lineWithPadding > longestLine) {\n\t\t\t\tlongestLine = lineWithPadding;\n\t\t\t}\n\t\t}\n\t\tconst longestLineWidth = longestLine + borderTotalWidth;\n\t\tif (longestLineWidth < boxWidth) {\n\t\t\tboxWidth = longestLineWidth;\n\t\t}\n\t}\n\tif (boxWidth % 2 !== 0) {\n\t\tif (boxWidth < maxBoxWidth) {\n\t\t\tboxWidth++;\n\t\t} else {\n\t\t\tboxWidth--;\n\t\t}\n\t}\n\tconst innerWidth = boxWidth - borderTotalWidth;\n\tconst maxTitleLength = innerWidth - titlePadding * 2;\n\tconst truncatedTitle =\n\t\ttitleWidth > maxTitleLength ? `${title.slice(0, maxTitleLength - 3)}...` : title;\n\tconst [titlePaddingLeft, titlePaddingRight] = getPaddingForLine(\n\t\tstringWidth(truncatedTitle),\n\t\tinnerWidth,\n\t\ttitlePadding,\n\t\topts?.titleAlign\n\t);\n\tconst wrappedMessage = wrapAnsi(message, innerWidth - contentPadding * 2, {\n\t\thard: true,\n\t\ttrim: false,\n\t});\n\toutput.write(\n\t\t`${linePrefix}${symbols[0]}${hSymbol.repeat(titlePaddingLeft)}${truncatedTitle}${hSymbol.repeat(titlePaddingRight)}${symbols[1]}\\n`\n\t);\n\tconst wrappedLines = wrappedMessage.split('\\n');\n\tfor (const line of wrappedLines) {\n\t\tconst [leftLinePadding, rightLinePadding] = getPaddingForLine(\n\t\t\tstringWidth(line),\n\t\t\tinnerWidth,\n\t\t\tcontentPadding,\n\t\t\topts?.contentAlign\n\t\t);\n\t\toutput.write(\n\t\t\t`${linePrefix}${vSymbol}${' '.repeat(leftLinePadding)}${line}${' '.repeat(rightLinePadding)}${vSymbol}\\n`\n\t\t);\n\t}\n\toutput.write(`${linePrefix}${symbols[2]}${hSymbol.repeat(innerWidth)}${symbols[3]}\\n`);\n};\n","import { ConfirmPrompt, settings } from '@clack/core';\nimport color from 'picocolors';\nimport {\n\ttype CommonOptions,\n\tS_BAR,\n\tS_BAR_END,\n\tS_RADIO_ACTIVE,\n\tS_RADIO_INACTIVE,\n\tsymbol,\n} from './common.js';\n\nexport interface ConfirmOptions extends CommonOptions {\n\tmessage: string;\n\tactive?: string;\n\tinactive?: string;\n\tinitialValue?: boolean;\n\tvertical?: 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\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\toutput: opts.output,\n\t\tinitialValue: opts.initialValue ?? true,\n\t\trender() {\n\t\t\tconst hasGuide = opts.withGuide ?? settings.withGuide;\n\t\t\tconst title = `${hasGuide ? `${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\tconst submitPrefix = hasGuide ? `${color.gray(S_BAR)} ` : '';\n\t\t\t\t\treturn `${title}${submitPrefix}${color.dim(value)}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst cancelPrefix = hasGuide ? `${color.gray(S_BAR)} ` : '';\n\t\t\t\t\treturn `${title}${cancelPrefix}${color.strikethrough(\n\t\t\t\t\t\tcolor.dim(value)\n\t\t\t\t\t)}${hasGuide ? `\\n${color.gray(S_BAR)}` : ''}`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tconst defaultPrefix = hasGuide ? `${color.cyan(S_BAR)} ` : '';\n\t\t\t\t\tconst defaultPrefixEnd = hasGuide ? color.cyan(S_BAR_END) : '';\n\t\t\t\t\treturn `${title}${defaultPrefix}${\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}${opts.vertical ? (hasGuide ? `\\n${color.cyan(S_BAR)} ` : '\\n') : ` ${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${defaultPrefixEnd}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<boolean | symbol>;\n};\n","import { isCancel } from '@clack/core';\n\ntype Prettify<T> = {\n\t[P in keyof T]: T[P];\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\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","import { GroupMultiSelectPrompt } from '@clack/core';\nimport color from 'picocolors';\nimport {\n\ttype CommonOptions,\n\tS_BAR,\n\tS_BAR_END,\n\tS_CHECKBOX_ACTIVE,\n\tS_CHECKBOX_INACTIVE,\n\tS_CHECKBOX_SELECTED,\n\tsymbol,\n} from './common.js';\nimport type { Option } from './select.js';\n\nexport interface GroupMultiSelectOptions<Value> extends CommonOptions {\n\tmessage: string;\n\toptions: Record<string, Option<Value>[]>;\n\tinitialValues?: Value[];\n\trequired?: boolean;\n\tcursorAt?: Value;\n\tselectableGroups?: boolean;\n\tgroupSpacing?: number;\n}\nexport const groupMultiselect = <Value>(opts: GroupMultiSelectOptions<Value>) => {\n\tconst { selectableGroups = true, groupSpacing = 0 } = opts;\n\tconst opt = (\n\t\toption: Option<Value> & { group: string | boolean },\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> & { group: string | boolean })[] = []\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tconst isItem = typeof option.group === 'string';\n\t\tconst next = isItem && (options[options.indexOf(option) + 1] ?? { group: true });\n\t\tconst isLast = isItem && next && next.group === true;\n\t\tconst prefix = isItem ? (selectableGroups ? `${isLast ? S_BAR_END : S_BAR} ` : ' ') : '';\n\t\tlet spacingPrefix = '';\n\t\tif (groupSpacing > 0 && !isItem) {\n\t\t\tconst spacingPrefixText = `\\n${color.cyan(S_BAR)}`;\n\t\t\tspacingPrefix = `${spacingPrefixText.repeat(groupSpacing - 1)}${spacingPrefixText} `;\n\t\t}\n\n\t\tif (state === 'active') {\n\t\t\treturn `${spacingPrefix}${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 `${spacingPrefix}${prefix}${color.cyan(S_CHECKBOX_ACTIVE)} ${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'group-active-selected') {\n\t\t\treturn `${spacingPrefix}${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 `${spacingPrefix}${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 `${spacingPrefix}${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 `${spacingPrefix}${color.dim(prefix)}${unselectedCheckbox} ${color.dim(label)}`;\n\t};\n\tconst required = opts.required ?? true;\n\n\treturn new GroupMultiSelectPrompt({\n\t\toptions: opts.options,\n\t\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\toutput: opts.output,\n\t\tinitialValues: opts.initialValues,\n\t\trequired,\n\t\tcursorAt: opts.cursorAt,\n\t\tselectableGroups,\n\t\tvalidate(selected: Value[] | undefined) {\n\t\t\tif (required && (selected === undefined || 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\t\t\tconst value = this.value ?? [];\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\tconst selectedOptions = this.options\n\t\t\t\t\t\t.filter(({ value: optionValue }) => value.includes(optionValue))\n\t\t\t\t\t\t.map((option) => opt(option, 'submitted'));\n\t\t\t\t\tconst optionsText =\n\t\t\t\t\t\tselectedOptions.length === 0 ? '' : ` ${selectedOptions.join(color.dim(', '))}`;\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)}${optionsText}`;\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: optionValue }) => value.includes(optionValue))\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\tvalue.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\tconst optionsText = 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\tvalue.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\tlet optionText = '';\n\t\t\t\t\t\t\tif (groupActive) {\n\t\t\t\t\t\t\t\toptionText = opt(\n\t\t\t\t\t\t\t\t\toption,\n\t\t\t\t\t\t\t\t\tselected ? 'group-active-selected' : 'group-active',\n\t\t\t\t\t\t\t\t\toptions\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else if (active && selected) {\n\t\t\t\t\t\t\t\toptionText = opt(option, 'active-selected', options);\n\t\t\t\t\t\t\t} else if (selected) {\n\t\t\t\t\t\t\t\toptionText = opt(option, 'selected', options);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\toptionText = opt(option, active ? 'active' : 'inactive', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst prefix = i !== 0 && !optionText.startsWith('\\n') ? ' ' : '';\n\t\t\t\t\t\t\treturn `${prefix}${optionText}`;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(`\\n${color.cyan(S_BAR)}`);\n\t\t\t\t\tconst optionsPrefix = optionsText.startsWith('\\n') ? '' : ' ';\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)}${optionsPrefix}${optionsText}\\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","import { settings } from '@clack/core';\nimport color from 'picocolors';\nimport {\n\ttype CommonOptions,\n\tS_BAR,\n\tS_ERROR,\n\tS_INFO,\n\tS_STEP_SUBMIT,\n\tS_SUCCESS,\n\tS_WARN,\n} from './common.js';\n\nexport interface LogMessageOptions extends CommonOptions {\n\tsymbol?: string;\n\tspacing?: number;\n\tsecondarySymbol?: string;\n}\n\nexport const log = {\n\tmessage: (\n\t\tmessage: string | string[] = [],\n\t\t{\n\t\t\tsymbol = color.gray(S_BAR),\n\t\t\tsecondarySymbol = color.gray(S_BAR),\n\t\t\toutput = process.stdout,\n\t\t\tspacing = 1,\n\t\t\twithGuide,\n\t\t}: LogMessageOptions = {}\n\t) => {\n\t\tconst parts: string[] = [];\n\t\tconst hasGuide = withGuide ?? settings.withGuide;\n\t\tconst spacingString = !hasGuide ? '' : secondarySymbol;\n\t\tconst prefix = !hasGuide ? '' : `${symbol} `;\n\t\tconst secondaryPrefix = !hasGuide ? '' : `${secondarySymbol} `;\n\n\t\tfor (let i = 0; i < spacing; i++) {\n\t\t\tparts.push(spacingString);\n\t\t}\n\n\t\tconst messageParts = Array.isArray(message) ? message : message.split('\\n');\n\t\tif (messageParts.length > 0) {\n\t\t\tconst [firstLine, ...lines] = messageParts;\n\t\t\tif (firstLine.length > 0) {\n\t\t\t\tparts.push(`${prefix}${firstLine}`);\n\t\t\t} else {\n\t\t\t\tparts.push(hasGuide ? symbol : '');\n\t\t\t}\n\t\t\tfor (const ln of lines) {\n\t\t\t\tif (ln.length > 0) {\n\t\t\t\t\tparts.push(`${secondaryPrefix}${ln}`);\n\t\t\t\t} else {\n\t\t\t\t\tparts.push(hasGuide ? secondarySymbol : '');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\toutput.write(`${parts.join('\\n')}\\n`);\n\t},\n\tinfo: (message: string, opts?: LogMessageOptions) => {\n\t\tlog.message(message, { ...opts, symbol: color.blue(S_INFO) });\n\t},\n\tsuccess: (message: string, opts?: LogMessageOptions) => {\n\t\tlog.message(message, { ...opts, symbol: color.green(S_SUCCESS) });\n\t},\n\tstep: (message: string, opts?: LogMessageOptions) => {\n\t\tlog.message(message, { ...opts, symbol: color.green(S_STEP_SUBMIT) });\n\t},\n\twarn: (message: string, opts?: LogMessageOptions) => {\n\t\tlog.message(message, { ...opts, symbol: color.yellow(S_WARN) });\n\t},\n\t/** alias for `log.warn()`. */\n\twarning: (message: string, opts?: LogMessageOptions) => {\n\t\tlog.warn(message, opts);\n\t},\n\terror: (message: string, opts?: LogMessageOptions) => {\n\t\tlog.message(message, { ...opts, symbol: color.red(S_ERROR) });\n\t},\n};\n","import type { Writable } from 'node:stream';\nimport color from 'picocolors';\nimport { type CommonOptions, S_BAR, S_BAR_END, S_BAR_START } from './common.js';\n\nexport const cancel = (message = '', opts?: CommonOptions) => {\n\tconst output: Writable = opts?.output ?? process.stdout;\n\toutput.write(`${color.gray(S_BAR_END)} ${color.red(message)}\\n\\n`);\n};\n\nexport const intro = (title = '', opts?: CommonOptions) => {\n\tconst output: Writable = opts?.output ?? process.stdout;\n\toutput.write(`${color.gray(S_BAR_START)} ${title}\\n`);\n};\n\nexport const outro = (message = '', opts?: CommonOptions) => {\n\tconst output: Writable = opts?.output ?? process.stdout;\n\toutput.write(`${color.gray(S_BAR)}\\n${color.gray(S_BAR_END)} ${message}\\n\\n`);\n};\n","import { MultiSelectPrompt, wrapTextWithPrefix } from '@clack/core';\nimport color from 'picocolors';\nimport {\n\ttype CommonOptions,\n\tS_BAR,\n\tS_BAR_END,\n\tS_CHECKBOX_ACTIVE,\n\tS_CHECKBOX_INACTIVE,\n\tS_CHECKBOX_SELECTED,\n\tsymbol,\n\tsymbolBar,\n} from './common.js';\nimport { limitOptions } from './limit-options.js';\nimport type { Option } from './select.js';\n\nexport interface MultiSelectOptions<Value> extends CommonOptions {\n\tmessage: string;\n\toptions: Option<Value>[];\n\tinitialValues?: Value[];\n\tmaxItems?: number;\n\trequired?: boolean;\n\tcursorAt?: Value;\n}\nconst computeLabel = (label: string, format: (text: string) => string) => {\n\treturn label\n\t\t.split('\\n')\n\t\t.map((line) => format(line))\n\t\t.join('\\n');\n};\n\nexport const multiselect = <Value>(opts: MultiSelectOptions<Value>) => {\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| 'submitted'\n\t\t\t| 'cancelled'\n\t\t\t| 'disabled'\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tif (state === 'disabled') {\n\t\t\treturn `${color.gray(S_CHECKBOX_INACTIVE)} ${computeLabel(label, (str) => color.strikethrough(color.gray(str)))}${\n\t\t\t\toption.hint ? ` ${color.dim(`(${option.hint ?? 'disabled'})`)}` : ''\n\t\t\t}`;\n\t\t}\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)} ${computeLabel(label, color.dim)}${\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 `${computeLabel(label, (text) => color.strikethrough(color.dim(text)))}`;\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 `${computeLabel(label, color.dim)}`;\n\t\t}\n\t\treturn `${color.dim(S_CHECKBOX_INACTIVE)} ${computeLabel(label, color.dim)}`;\n\t};\n\tconst required = opts.required ?? true;\n\n\treturn new MultiSelectPrompt({\n\t\toptions: opts.options,\n\t\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\toutput: opts.output,\n\t\tinitialValues: opts.initialValues,\n\t\trequired,\n\t\tcursorAt: opts.cursorAt,\n\t\tvalidate(selected: Value[] | undefined) {\n\t\t\tif (required && (selected === undefined || 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 wrappedMessage = wrapTextWithPrefix(\n\t\t\t\topts.output,\n\t\t\t\topts.message,\n\t\t\t\t`${symbolBar(this.state)} `,\n\t\t\t\t`${symbol(this.state)} `\n\t\t\t);\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${wrappedMessage}\\n`;\n\t\t\tconst value = this.value ?? [];\n\n\t\t\tconst styleOption = (option: Option<Value>, active: boolean) => {\n\t\t\t\tif (option.disabled) {\n\t\t\t\t\treturn opt(option, 'disabled');\n\t\t\t\t}\n\t\t\t\tconst selected = 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\tconst submitText =\n\t\t\t\t\t\tthis.options\n\t\t\t\t\t\t\t.filter(({ value: optionValue }) => value.includes(optionValue))\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\tconst wrappedSubmitText = wrapTextWithPrefix(\n\t\t\t\t\t\topts.output,\n\t\t\t\t\t\tsubmitText,\n\t\t\t\t\t\t`${color.gray(S_BAR)} `\n\t\t\t\t\t);\n\t\t\t\t\treturn `${title}${wrappedSubmitText}`;\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: optionValue }) => value.includes(optionValue))\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\tif (label.trim() === '') {\n\t\t\t\t\t\treturn `${title}${color.gray(S_BAR)}`;\n\t\t\t\t\t}\n\t\t\t\t\tconst wrappedLabel = wrapTextWithPrefix(opts.output, label, `${color.gray(S_BAR)} `);\n\t\t\t\t\treturn `${title}${wrappedLabel}\\n${color.gray(S_BAR)}`;\n\t\t\t\t}\n\t\t\t\tcase 'error': {\n\t\t\t\t\tconst prefix = `${color.yellow(S_BAR)} `;\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\t// Calculate rowPadding: title lines + footer lines (error message + trailing newline)\n\t\t\t\t\tconst titleLineCount = title.split('\\n').length;\n\t\t\t\t\tconst footerLineCount = footer.split('\\n').length + 1; // footer + trailing newline\n\t\t\t\t\treturn `${title}${prefix}${limitOptions({\n\t\t\t\t\t\toutput: opts.output,\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\tcolumnPadding: prefix.length,\n\t\t\t\t\t\trowPadding: titleLineCount + footerLineCount,\n\t\t\t\t\t\tstyle: styleOption,\n\t\t\t\t\t}).join(`\\n${prefix}`)}\\n${footer}\\n`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tconst prefix = `${color.cyan(S_BAR)} `;\n\t\t\t\t\t// Calculate rowPadding: title lines + footer lines (S_BAR_END + trailing newline)\n\t\t\t\t\tconst titleLineCount = title.split('\\n').length;\n\t\t\t\t\tconst footerLineCount = 2; // S_BAR_END + trailing newline\n\t\t\t\t\treturn `${title}${prefix}${limitOptions({\n\t\t\t\t\t\toutput: opts.output,\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\tcolumnPadding: prefix.length,\n\t\t\t\t\t\trowPadding: titleLineCount + footerLineCount,\n\t\t\t\t\t\tstyle: styleOption,\n\t\t\t\t\t}).join(`\\n${prefix}`)}\\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","import process from 'node:process';\nimport type { Writable } from 'node:stream';\nimport { getColumns, settings } from '@clack/core';\nimport stringWidth from 'fast-string-width';\nimport { type Options as WrapAnsiOptions, wrapAnsi } from 'fast-wrap-ansi';\nimport color from 'picocolors';\nimport {\n\ttype CommonOptions,\n\tS_BAR,\n\tS_BAR_H,\n\tS_CONNECT_LEFT,\n\tS_CORNER_BOTTOM_LEFT,\n\tS_CORNER_BOTTOM_RIGHT,\n\tS_CORNER_TOP_RIGHT,\n\tS_STEP_SUBMIT,\n} from './common.js';\n\ntype FormatFn = (line: string) => string;\nexport interface NoteOptions extends CommonOptions {\n\tformat?: FormatFn;\n}\n\nconst defaultNoteFormatter = (line: string): string => color.dim(line);\n\nconst wrapWithFormat = (message: string, width: number, format: FormatFn): string => {\n\tconst opts: WrapAnsiOptions = {\n\t\thard: true,\n\t\ttrim: false,\n\t};\n\tconst wrapMsg = wrapAnsi(message, width, opts).split('\\n');\n\tconst maxWidthNormal = wrapMsg.reduce((sum, ln) => Math.max(stringWidth(ln), sum), 0);\n\tconst maxWidthFormat = wrapMsg.map(format).reduce((sum, ln) => Math.max(stringWidth(ln), sum), 0);\n\tconst wrapWidth = width - (maxWidthFormat - maxWidthNormal);\n\treturn wrapAnsi(message, wrapWidth, opts);\n};\n\nexport const note = (message = '', title = '', opts?: NoteOptions) => {\n\tconst output: Writable = opts?.output ?? process.stdout;\n\tconst hasGuide = opts?.withGuide ?? settings.withGuide;\n\tconst format = opts?.format ?? defaultNoteFormatter;\n\tconst wrapMsg = wrapWithFormat(message, getColumns(output) - 6, format);\n\tconst lines = ['', ...wrapMsg.split('\\n').map(format), ''];\n\tconst titleLen = stringWidth(title);\n\tconst len =\n\t\tMath.max(\n\t\t\tlines.reduce((sum, ln) => {\n\t\t\t\tconst width = stringWidth(ln);\n\t\t\t\treturn width > sum ? width : 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) => `${color.gray(S_BAR)} ${ln}${' '.repeat(len - stringWidth(ln))}${color.gray(S_BAR)}`\n\t\t)\n\t\t.join('\\n');\n\tconst leadingBorder = hasGuide ? `${color.gray(S_BAR)}\\n` : '';\n\tconst bottomLeft = hasGuide ? S_CONNECT_LEFT : S_CORNER_BOTTOM_LEFT;\n\toutput.write(\n\t\t`${leadingBorder}${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(bottomLeft + S_BAR_H.repeat(len + 2) + S_CORNER_BOTTOM_RIGHT)}\\n`\n\t);\n};\n","import { PasswordPrompt, settings } from '@clack/core';\nimport color from 'picocolors';\nimport { type CommonOptions, S_BAR, S_BAR_END, S_PASSWORD_MASK, symbol } from './common.js';\n\nexport interface PasswordOptions extends CommonOptions {\n\tmessage: string;\n\tmask?: string;\n\tvalidate?: (value: string | undefined) => string | Error | undefined;\n\tclearOnError?: boolean;\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\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\toutput: opts.output,\n\t\trender() {\n\t\t\tconst hasGuide = opts.withGuide ?? settings.withGuide;\n\t\t\tconst title = `${hasGuide ? `${color.gray(S_BAR)}\\n` : ''}${symbol(this.state)} ${opts.message}\\n`;\n\t\t\tconst userInput = this.userInputWithCursor;\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\tconst errorPrefix = hasGuide ? `${color.yellow(S_BAR)} ` : '';\n\t\t\t\t\tconst errorPrefixEnd = hasGuide ? `${color.yellow(S_BAR_END)} ` : '';\n\t\t\t\t\tconst maskedText = masked ?? '';\n\t\t\t\t\tif (opts.clearOnError) {\n\t\t\t\t\t\tthis.clear();\n\t\t\t\t\t}\n\t\t\t\t\treturn `${title.trim()}\\n${errorPrefix}${maskedText}\\n${errorPrefixEnd}${color.yellow(this.error)}\\n`;\n\t\t\t\t}\n\t\t\t\tcase 'submit': {\n\t\t\t\t\tconst submitPrefix = hasGuide ? `${color.gray(S_BAR)} ` : '';\n\t\t\t\t\tconst maskedText = masked ? color.dim(masked) : '';\n\t\t\t\t\treturn `${title}${submitPrefix}${maskedText}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst cancelPrefix = hasGuide ? `${color.gray(S_BAR)} ` : '';\n\t\t\t\t\tconst maskedText = masked ? color.strikethrough(color.dim(masked)) : '';\n\t\t\t\t\treturn `${title}${cancelPrefix}${maskedText}${\n\t\t\t\t\t\tmasked && hasGuide ? `\\n${color.gray(S_BAR)}` : ''\n\t\t\t\t\t}`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tconst defaultPrefix = hasGuide ? `${color.cyan(S_BAR)} ` : '';\n\t\t\t\t\tconst defaultPrefixEnd = hasGuide ? color.cyan(S_BAR_END) : '';\n\t\t\t\t\treturn `${title}${defaultPrefix}${userInput}\\n${defaultPrefixEnd}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<string | symbol>;\n};\n","import { existsSync, lstatSync, readdirSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { autocomplete } from './autocomplete.js';\nimport type { CommonOptions } from './common.js';\n\nexport interface PathOptions extends CommonOptions {\n\troot?: string;\n\tdirectory?: boolean;\n\tinitialValue?: string;\n\tmessage: string;\n\tvalidate?: (value: string | undefined) => string | Error | undefined;\n}\n\nexport const path = (opts: PathOptions) => {\n\tconst validate = opts.validate;\n\n\treturn autocomplete({\n\t\t...opts,\n\t\tinitialUserInput: opts.initialValue ?? opts.root ?? process.cwd(),\n\t\tmaxItems: 5,\n\t\tvalidate(value) {\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\t// Shouldn't ever happen since we don't enable `multiple: true`\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tif (!value) {\n\t\t\t\treturn 'Please select a path';\n\t\t\t}\n\t\t\tif (validate) {\n\t\t\t\treturn validate(value);\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\t\toptions() {\n\t\t\tconst userInput = this.userInput;\n\t\t\tif (userInput === '') {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tlet searchPath: string;\n\n\t\t\t\tif (!existsSync(userInput)) {\n\t\t\t\t\tsearchPath = dirname(userInput);\n\t\t\t\t} else {\n\t\t\t\t\tconst stat = lstatSync(userInput);\n\t\t\t\t\tif (stat.isDirectory()) {\n\t\t\t\t\t\tsearchPath = userInput;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsearchPath = dirname(userInput);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst items = readdirSync(searchPath)\n\t\t\t\t\t.map((item) => {\n\t\t\t\t\t\tconst path = join(searchPath, item);\n\t\t\t\t\t\tconst stats = lstatSync(path);\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tname: item,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tisDirectory: stats.isDirectory(),\n\t\t\t\t\t\t};\n\t\t\t\t\t})\n\t\t\t\t\t.filter(\n\t\t\t\t\t\t({ path, isDirectory }) =>\n\t\t\t\t\t\t\tpath.startsWith(userInput) && (opts.directory || !isDirectory)\n\t\t\t\t\t);\n\t\t\t\treturn items.map((item) => ({\n\t\t\t\t\tvalue: item.path,\n\t\t\t\t}));\n\t\t\t} catch (_e) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t},\n\t});\n};\n","import { block, getColumns, settings } from '@clack/core';\nimport { wrapAnsi } from 'fast-wrap-ansi';\nimport color from 'picocolors';\nimport { cursor, erase } from 'sisteransi';\nimport {\n\ttype CommonOptions,\n\tisCI as isCIFn,\n\tS_BAR,\n\tS_STEP_CANCEL,\n\tS_STEP_ERROR,\n\tS_STEP_SUBMIT,\n\tunicode,\n} from './common.js';\n\nexport interface SpinnerOptions extends CommonOptions {\n\tindicator?: 'dots' | 'timer';\n\tonCancel?: () => void;\n\tcancelMessage?: string;\n\terrorMessage?: string;\n\tframes?: string[];\n\tdelay?: number;\n\tstyleFrame?: (frame: string) => string;\n}\n\nexport interface SpinnerResult {\n\tstart(msg?: string): void;\n\tstop(msg?: string): void;\n\tcancel(msg?: string): void;\n\terror(msg?: string): void;\n\tmessage(msg?: string): void;\n\tclear(): void;\n\treadonly isCancelled: boolean;\n}\n\nconst defaultStyleFn: SpinnerOptions['styleFrame'] = color.magenta;\n\nexport const spinner = ({\n\tindicator = 'dots',\n\tonCancel,\n\toutput = process.stdout,\n\tcancelMessage,\n\terrorMessage,\n\tframes = unicode ? ['◒', '◐', '◓', '◑'] : ['•', 'o', 'O', '0'],\n\tdelay = unicode ? 80 : 120,\n\tsignal,\n\t...opts\n}: SpinnerOptions = {}): SpinnerResult => {\n\tconst isCI = isCIFn();\n\n\tlet unblock: () => void;\n\tlet loop: NodeJS.Timeout;\n\tlet isSpinnerActive = false;\n\tlet isCancelled = false;\n\tlet _message = '';\n\tlet _prevMessage: string | undefined;\n\tlet _origin: number = performance.now();\n\tconst columns = getColumns(output);\n\tconst styleFn = opts?.styleFrame ?? defaultStyleFn;\n\n\tconst handleExit = (code: number) => {\n\t\tconst msg =\n\t\t\tcode > 1\n\t\t\t\t? (errorMessage ?? settings.messages.error)\n\t\t\t\t: (cancelMessage ?? settings.messages.cancel);\n\t\tisCancelled = code === 1;\n\t\tif (isSpinnerActive) {\n\t\t\t_stop(msg, code);\n\t\t\tif (isCancelled && typeof onCancel === 'function') {\n\t\t\t\tonCancel();\n\t\t\t}\n\t\t}\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\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', signalEventHandler);\n\t\t}\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\n\t\tif (signal) {\n\t\t\tsignal.removeEventListener('abort', signalEventHandler);\n\t\t}\n\t};\n\n\tconst clearPrevMessage = () => {\n\t\tif (_prevMessage === undefined) return;\n\t\tif (isCI) output.write('\\n');\n\t\tconst wrapped = wrapAnsi(_prevMessage, columns, {\n\t\t\thard: true,\n\t\t\ttrim: false,\n\t\t});\n\t\tconst prevLines = wrapped.split('\\n');\n\t\tif (prevLines.length > 1) {\n\t\t\toutput.write(cursor.up(prevLines.length - 1));\n\t\t}\n\t\toutput.write(cursor.to(0));\n\t\toutput.write(erase.down());\n\t};\n\n\tconst removeTrailingDots = (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 hasGuide = opts.withGuide ?? settings.withGuide;\n\n\tconst start = (msg = ''): void => {\n\t\tisSpinnerActive = true;\n\t\tunblock = block({ output });\n\t\t_message = removeTrailingDots(msg);\n\t\t_origin = performance.now();\n\t\tif (hasGuide) {\n\t\t\toutput.write(`${color.gray(S_BAR)}\\n`);\n\t\t}\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 = styleFn(frames[frameIndex]);\n\t\t\tlet outputMessage: string;\n\n\t\t\tif (isCI) {\n\t\t\t\toutputMessage = `${frame} ${_message}...`;\n\t\t\t} else if (indicator === 'timer') {\n\t\t\t\toutputMessage = `${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\toutputMessage = `${frame} ${_message}${loadingDots}`;\n\t\t\t}\n\n\t\t\tconst wrapped = wrapAnsi(outputMessage, columns, {\n\t\t\t\thard: true,\n\t\t\t\ttrim: false,\n\t\t\t});\n\t\t\toutput.write(wrapped);\n\n\t\t\tframeIndex = frameIndex + 1 < frames.length ? frameIndex + 1 : 0;\n\t\t\t// indicator increase by 1 every 8 frames\n\t\t\tindicatorTimer = indicatorTimer < 4 ? indicatorTimer + 0.125 : 0;\n\t\t}, delay);\n\t};\n\n\tconst _stop = (msg = '', code = 0, silent: boolean = false): void => {\n\t\tif (!isSpinnerActive) return;\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 = msg ?? _message;\n\t\tif (!silent) {\n\t\t\tif (indicator === 'timer') {\n\t\t\t\toutput.write(`${step} ${_message} ${formatTimer(_origin)}\\n`);\n\t\t\t} else {\n\t\t\t\toutput.write(`${step} ${_message}\\n`);\n\t\t\t}\n\t\t}\n\t\tclearHooks();\n\t\tunblock();\n\t};\n\n\tconst stop = (msg = ''): void => _stop(msg, 0);\n\tconst cancel = (msg = ''): void => _stop(msg, 1);\n\tconst error = (msg = ''): void => _stop(msg, 2);\n\t// TODO (43081j): this will leave the initial S_BAR since we purposely\n\t// don't erase that in `clearPrevMessage`. In future, we may want to treat\n\t// `clear` as a special case and remove the bar too.\n\tconst clear = (): void => _stop('', 0, true);\n\n\tconst message = (msg = ''): void => {\n\t\t_message = removeTrailingDots(msg ?? _message);\n\t};\n\n\treturn {\n\t\tstart,\n\t\tstop,\n\t\tmessage,\n\t\tcancel,\n\t\terror,\n\t\tclear,\n\t\tget isCancelled() {\n\t\t\treturn isCancelled;\n\t\t},\n\t};\n};\n","import type { State } from '@clack/core';\nimport color from 'picocolors';\nimport { unicodeOr } from './common.js';\nimport { type SpinnerOptions, type SpinnerResult, spinner } from './spinner.js';\n\nconst S_PROGRESS_CHAR: Record<NonNullable<ProgressOptions['style']>, string> = {\n\tlight: unicodeOr('─', '-'),\n\theavy: unicodeOr('━', '='),\n\tblock: unicodeOr('█', '#'),\n};\n\nexport interface ProgressOptions extends SpinnerOptions {\n\tstyle?: 'light' | 'heavy' | 'block';\n\tmax?: number;\n\tsize?: number;\n}\n\nexport interface ProgressResult extends SpinnerResult {\n\tadvance(step?: number, msg?: string): void;\n}\n\nexport function progress({\n\tstyle = 'heavy',\n\tmax: userMax = 100,\n\tsize: userSize = 40,\n\t...spinnerOptions\n}: ProgressOptions = {}): ProgressResult {\n\tconst spin = spinner(spinnerOptions);\n\tlet value = 0;\n\tlet previousMessage = '';\n\n\tconst max = Math.max(1, userMax);\n\tconst size = Math.max(1, userSize);\n\n\tconst activeStyle = (state: State) => {\n\t\tswitch (state) {\n\t\t\tcase 'initial':\n\t\t\tcase 'active':\n\t\t\t\treturn color.magenta;\n\t\t\tcase 'error':\n\t\t\tcase 'cancel':\n\t\t\t\treturn color.red;\n\t\t\tcase 'submit':\n\t\t\t\treturn color.green;\n\t\t\tdefault:\n\t\t\t\treturn color.magenta;\n\t\t}\n\t};\n\tconst drawProgress = (state: State, msg: string) => {\n\t\tconst active = Math.floor((value / max) * size);\n\t\treturn `${activeStyle(state)(S_PROGRESS_CHAR[style].repeat(active))}${color.dim(S_PROGRESS_CHAR[style].repeat(size - active))} ${msg}`;\n\t};\n\n\tconst start = (msg = '') => {\n\t\tpreviousMessage = msg;\n\t\tspin.start(drawProgress('initial', msg));\n\t};\n\tconst advance = (step = 1, msg?: string): void => {\n\t\tvalue = Math.min(max, step + value);\n\t\tspin.message(drawProgress('active', msg ?? previousMessage));\n\t\tpreviousMessage = msg ?? previousMessage;\n\t};\n\treturn {\n\t\tstart,\n\t\tstop: spin.stop,\n\t\tcancel: spin.cancel,\n\t\terror: spin.error,\n\t\tclear: spin.clear,\n\t\tadvance,\n\t\tisCancelled: spin.isCancelled,\n\t\tmessage: (msg: string) => advance(0, msg),\n\t};\n}\n","import { SelectPrompt, settings, wrapTextWithPrefix } from '@clack/core';\nimport color from 'picocolors';\nimport {\n\ttype CommonOptions,\n\tS_BAR,\n\tS_BAR_END,\n\tS_RADIO_ACTIVE,\n\tS_RADIO_INACTIVE,\n\tsymbol,\n\tsymbolBar,\n} from './common.js';\nimport { limitOptions } from './limit-options.js';\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\t/**\n\t\t\t * Whether this option is disabled.\n\t\t\t * Disabled options are visible but cannot be selected.\n\t\t\t *\n\t\t\t * By default, options are not disabled.\n\t\t\t */\n\t\t\tdisabled?: boolean;\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\t/**\n\t\t\t * Whether this option is disabled.\n\t\t\t * Disabled options are visible but cannot be selected.\n\t\t\t *\n\t\t\t * By default, options are not disabled.\n\t\t\t */\n\t\t\tdisabled?: boolean;\n\t\t};\n\nexport interface SelectOptions<Value> extends CommonOptions {\n\tmessage: string;\n\toptions: Option<Value>[];\n\tinitialValue?: Value;\n\tmaxItems?: number;\n}\n\nconst computeLabel = (label: string, format: (text: string) => string) => {\n\tif (!label.includes('\\n')) {\n\t\treturn format(label);\n\t}\n\treturn label\n\t\t.split('\\n')\n\t\t.map((line) => format(line))\n\t\t.join('\\n');\n};\n\nexport const select = <Value>(opts: SelectOptions<Value>) => {\n\tconst opt = (\n\t\toption: Option<Value>,\n\t\tstate: 'inactive' | 'active' | 'selected' | 'cancelled' | 'disabled'\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tswitch (state) {\n\t\t\tcase 'disabled':\n\t\t\t\treturn `${color.gray(S_RADIO_INACTIVE)} ${computeLabel(label, color.gray)}${\n\t\t\t\t\toption.hint ? ` ${color.dim(`(${option.hint ?? 'disabled'})`)}` : ''\n\t\t\t\t}`;\n\t\t\tcase 'selected':\n\t\t\t\treturn `${computeLabel(label, color.dim)}`;\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 `${computeLabel(label, (str) => color.strikethrough(color.dim(str)))}`;\n\t\t\tdefault:\n\t\t\t\treturn `${color.dim(S_RADIO_INACTIVE)} ${computeLabel(label, color.dim)}`;\n\t\t}\n\t};\n\n\treturn new SelectPrompt({\n\t\toptions: opts.options,\n\t\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\toutput: opts.output,\n\t\tinitialValue: opts.initialValue,\n\t\trender() {\n\t\t\tconst hasGuide = opts.withGuide ?? settings.withGuide;\n\t\t\tconst titlePrefix = `${symbol(this.state)} `;\n\t\t\tconst titlePrefixBar = `${symbolBar(this.state)} `;\n\t\t\tconst messageLines = wrapTextWithPrefix(\n\t\t\t\topts.output,\n\t\t\t\topts.message,\n\t\t\t\ttitlePrefixBar,\n\t\t\t\ttitlePrefix\n\t\t\t);\n\t\t\tconst title = `${hasGuide ? `${color.gray(S_BAR)}\\n` : ''}${messageLines}\\n`;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\tconst submitPrefix = hasGuide ? `${color.gray(S_BAR)} ` : '';\n\t\t\t\t\tconst wrappedLines = wrapTextWithPrefix(\n\t\t\t\t\t\topts.output,\n\t\t\t\t\t\topt(this.options[this.cursor], 'selected'),\n\t\t\t\t\t\tsubmitPrefix\n\t\t\t\t\t);\n\t\t\t\t\treturn `${title}${wrappedLines}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst cancelPrefix = hasGuide ? `${color.gray(S_BAR)} ` : '';\n\t\t\t\t\tconst wrappedLines = wrapTextWithPrefix(\n\t\t\t\t\t\topts.output,\n\t\t\t\t\t\topt(this.options[this.cursor], 'cancelled'),\n\t\t\t\t\t\tcancelPrefix\n\t\t\t\t\t);\n\t\t\t\t\treturn `${title}${wrappedLines}${hasGuide ? `\\n${color.gray(S_BAR)}` : ''}`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tconst prefix = hasGuide ? `${color.cyan(S_BAR)} ` : '';\n\t\t\t\t\tconst prefixEnd = hasGuide ? color.cyan(S_BAR_END) : '';\n\t\t\t\t\t// Calculate rowPadding: title lines + footer lines (S_BAR_END + trailing newline)\n\t\t\t\t\tconst titleLineCount = title.split('\\n').length;\n\t\t\t\t\tconst footerLineCount = hasGuide ? 2 : 1; // S_BAR_END + trailing newline (or just trailing newline)\n\t\t\t\t\treturn `${title}${prefix}${limitOptions({\n\t\t\t\t\t\toutput: opts.output,\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\tcolumnPadding: prefix.length,\n\t\t\t\t\t\trowPadding: titleLineCount + footerLineCount,\n\t\t\t\t\t\tstyle: (item, active) =>\n\t\t\t\t\t\t\topt(item, item.disabled ? 'disabled' : active ? 'active' : 'inactive'),\n\t\t\t\t\t}).join(`\\n${prefix}`)}\\n${prefixEnd}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value | symbol>;\n};\n","import { SelectKeyPrompt, settings, wrapTextWithPrefix } from '@clack/core';\nimport color from 'picocolors';\nimport { type CommonOptions, S_BAR, S_BAR_END, symbol } from './common.js';\nimport type { Option } from './select.js';\n\nexport interface SelectKeyOptions<Value extends string> extends CommonOptions {\n\tmessage: string;\n\toptions: Option<Value>[];\n\tinitialValue?: Value;\n\tcaseSensitive?: boolean;\n}\n\nexport const selectKey = <Value extends string>(opts: SelectKeyOptions<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\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\toutput: opts.output,\n\t\tinitialValue: opts.initialValue,\n\t\tcaseSensitive: opts.caseSensitive,\n\t\trender() {\n\t\t\tconst hasGuide = opts.withGuide ?? settings.withGuide;\n\t\t\tconst title = `${hasGuide ? `${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\tconst submitPrefix = hasGuide ? `${color.gray(S_BAR)} ` : '';\n\t\t\t\t\tconst selectedOption =\n\t\t\t\t\t\tthis.options.find((opt) => opt.value === this.value) ?? opts.options[0];\n\t\t\t\t\tconst wrapped = wrapTextWithPrefix(\n\t\t\t\t\t\topts.output,\n\t\t\t\t\t\topt(selectedOption, 'selected'),\n\t\t\t\t\t\tsubmitPrefix\n\t\t\t\t\t);\n\t\t\t\t\treturn `${title}${wrapped}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst cancelPrefix = hasGuide ? `${color.gray(S_BAR)} ` : '';\n\t\t\t\t\tconst wrapped = wrapTextWithPrefix(\n\t\t\t\t\t\topts.output,\n\t\t\t\t\t\topt(this.options[0], 'cancelled'),\n\t\t\t\t\t\tcancelPrefix\n\t\t\t\t\t);\n\t\t\t\t\treturn `${title}${wrapped}${hasGuide ? `\\n${color.gray(S_BAR)}` : ''}`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tconst defaultPrefix = hasGuide ? `${color.cyan(S_BAR)} ` : '';\n\t\t\t\t\tconst defaultPrefixEnd = hasGuide ? color.cyan(S_BAR_END) : '';\n\t\t\t\t\tconst wrapped = this.options\n\t\t\t\t\t\t.map((option, i) =>\n\t\t\t\t\t\t\twrapTextWithPrefix(\n\t\t\t\t\t\t\t\topts.output,\n\t\t\t\t\t\t\t\topt(option, i === this.cursor ? 'active' : 'inactive'),\n\t\t\t\t\t\t\t\tdefaultPrefix\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join('\\n');\n\t\t\t\t\treturn `${title}${wrapped}\\n${defaultPrefixEnd}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value | symbol>;\n};\n","import { stripVTControlCharacters as strip } from 'node:util';\nimport color from 'picocolors';\nimport { S_BAR, S_ERROR, S_INFO, S_STEP_SUBMIT, S_SUCCESS, S_WARN } from './common.js';\nimport type { LogMessageOptions } from './log.js';\n\nconst prefix = `${color.gray(S_BAR)} `;\n\n// TODO (43081j): this currently doesn't support custom `output` writables\n// because we rely on `columns` existing (i.e. `process.stdout.columns).\n//\n// If we want to support `output` being passed in, we will need to use\n// a condition like `if (output insance Writable)` to check if it has columns\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","import type { CommonOptions } from './common.js';\nimport { spinner } from './spinner.js';\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[], opts?: CommonOptions) => {\n\tfor (const task of tasks) {\n\t\tif (task.enabled === false) continue;\n\n\t\tconst s = spinner(opts);\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 type { Writable } from 'node:stream';\nimport { getColumns } from '@clack/core';\nimport color from 'picocolors';\nimport { erase } from 'sisteransi';\nimport {\n\ttype CommonOptions,\n\tisCI as isCIFn,\n\tisTTY as isTTYFn,\n\tS_BAR,\n\tS_STEP_SUBMIT,\n} from './common.js';\nimport { log } from './log.js';\n\nexport interface TaskLogOptions extends CommonOptions {\n\ttitle: string;\n\tlimit?: number;\n\tspacing?: number;\n\tretainLog?: boolean;\n}\n\nexport interface TaskLogMessageOptions {\n\traw?: boolean;\n}\n\nexport interface TaskLogCompletionOptions {\n\tshowLog?: boolean;\n}\n\ninterface BufferEntry {\n\theader?: string;\n\tvalue: string;\n\tfull: string;\n\tresult?: {\n\t\tstatus: 'success' | 'error';\n\t\tmessage: string;\n\t};\n}\n\nconst stripDestructiveANSI = (input: string): string => {\n\t// biome-ignore lint/suspicious/noControlCharactersInRegex: intentional\n\treturn input.replace(/\\x1b\\[(?:\\d+;)*\\d*[ABCDEFGHfJKSTsu]|\\x1b\\[(s|u)/g, '');\n};\n\n/**\n * Renders a log which clears on success and remains on failure\n */\nexport const taskLog = (opts: TaskLogOptions) => {\n\tconst output: Writable = opts.output ?? process.stdout;\n\tconst columns = getColumns(output);\n\tconst secondarySymbol = color.gray(S_BAR);\n\tconst spacing = opts.spacing ?? 1;\n\tconst barSize = 3;\n\tconst retainLog = opts.retainLog === true;\n\tconst isTTY = !isCIFn() && isTTYFn(output);\n\n\toutput.write(`${secondarySymbol}\\n`);\n\toutput.write(`${color.green(S_STEP_SUBMIT)} ${opts.title}\\n`);\n\tfor (let i = 0; i < spacing; i++) {\n\t\toutput.write(`${secondarySymbol}\\n`);\n\t}\n\n\tconst buffers: BufferEntry[] = [\n\t\t{\n\t\t\tvalue: '',\n\t\t\tfull: '',\n\t\t},\n\t];\n\tlet lastMessageWasRaw = false;\n\n\tconst clear = (clearTitle: boolean): void => {\n\t\tif (buffers.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet lines = 0;\n\n\t\tif (clearTitle) {\n\t\t\tlines += spacing + 2;\n\t\t}\n\n\t\tfor (const buffer of buffers) {\n\t\t\tconst { value, result } = buffer;\n\t\t\tlet text = result?.message ?? value;\n\n\t\t\tif (text.length === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (result === undefined && buffer.header !== undefined && buffer.header !== '') {\n\t\t\t\ttext += `\\n${buffer.header}`;\n\t\t\t}\n\n\t\t\tconst bufferHeight = text.split('\\n').reduce((count, line) => {\n\t\t\t\tif (line === '') {\n\t\t\t\t\treturn count + 1;\n\t\t\t\t}\n\t\t\t\treturn count + Math.ceil((line.length + barSize) / columns);\n\t\t\t}, 0);\n\n\t\t\tlines += bufferHeight;\n\t\t}\n\n\t\tif (lines > 0) {\n\t\t\tlines += 1;\n\t\t\toutput.write(erase.lines(lines));\n\t\t}\n\t};\n\tconst printBuffer = (buffer: BufferEntry, messageSpacing?: number, full?: boolean): void => {\n\t\tconst messages = full ? `${buffer.full}\\n${buffer.value}` : buffer.value;\n\t\tif (buffer.header !== undefined && buffer.header !== '') {\n\t\t\tlog.message(buffer.header.split('\\n').map(color.bold), {\n\t\t\t\toutput,\n\t\t\t\tsecondarySymbol,\n\t\t\t\tsymbol: secondarySymbol,\n\t\t\t\tspacing: 0,\n\t\t\t});\n\t\t}\n\t\tlog.message(messages.split('\\n').map(color.dim), {\n\t\t\toutput,\n\t\t\tsecondarySymbol,\n\t\t\tsymbol: secondarySymbol,\n\t\t\tspacing: messageSpacing ?? spacing,\n\t\t});\n\t};\n\tconst renderBuffer = (): void => {\n\t\tfor (const buffer of buffers) {\n\t\t\tconst { header, value, full } = buffer;\n\t\t\tif ((header === undefined || header.length === 0) && value.length === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprintBuffer(buffer, undefined, retainLog === true && full.length > 0);\n\t\t}\n\t};\n\tconst message = (buffer: BufferEntry, msg: string, mopts?: TaskLogMessageOptions) => {\n\t\tclear(false);\n\t\tif ((mopts?.raw !== true || !lastMessageWasRaw) && buffer.value !== '') {\n\t\t\tbuffer.value += '\\n';\n\t\t}\n\t\tbuffer.value += stripDestructiveANSI(msg);\n\t\tlastMessageWasRaw = mopts?.raw === true;\n\t\tif (opts.limit !== undefined) {\n\t\t\tconst lines = buffer.value.split('\\n');\n\t\t\tconst linesToRemove = lines.length - opts.limit;\n\t\t\tif (linesToRemove > 0) {\n\t\t\t\tconst removedLines = lines.splice(0, linesToRemove);\n\t\t\t\tif (retainLog) {\n\t\t\t\t\tbuffer.full += (buffer.full === '' ? '' : '\\n') + removedLines.join('\\n');\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuffer.value = lines.join('\\n');\n\t\t}\n\t\tif (isTTY) {\n\t\t\tprintBuffers();\n\t\t}\n\t};\n\tconst printBuffers = (): void => {\n\t\tfor (const buffer of buffers) {\n\t\t\tif (buffer.result) {\n\t\t\t\tif (buffer.result.status === 'error') {\n\t\t\t\t\tlog.error(buffer.result.message, { output, secondarySymbol, spacing: 0 });\n\t\t\t\t} else {\n\t\t\t\t\tlog.success(buffer.result.message, { output, secondarySymbol, spacing: 0 });\n\t\t\t\t}\n\t\t\t} else if (buffer.value !== '') {\n\t\t\t\tprintBuffer(buffer, 0);\n\t\t\t}\n\t\t}\n\t};\n\tconst completeBuffer = (buffer: BufferEntry, result: BufferEntry['result']): void => {\n\t\tclear(false);\n\n\t\tbuffer.result = result;\n\n\t\tif (isTTY) {\n\t\t\tprintBuffers();\n\t\t}\n\t};\n\n\treturn {\n\t\tmessage(msg: string, mopts?: TaskLogMessageOptions) {\n\t\t\tmessage(buffers[0], msg, mopts);\n\t\t},\n\t\tgroup(name: string) {\n\t\t\tconst buffer: BufferEntry = {\n\t\t\t\theader: name,\n\t\t\t\tvalue: '',\n\t\t\t\tfull: '',\n\t\t\t};\n\t\t\tbuffers.push(buffer);\n\t\t\treturn {\n\t\t\t\tmessage(msg: string, mopts?: TaskLogMessageOptions) {\n\t\t\t\t\tmessage(buffer, msg, mopts);\n\t\t\t\t},\n\t\t\t\terror(message: string) {\n\t\t\t\t\tcompleteBuffer(buffer, {\n\t\t\t\t\t\tstatus: 'error',\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tsuccess(message: string) {\n\t\t\t\t\tcompleteBuffer(buffer, {\n\t\t\t\t\t\tstatus: 'success',\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t\terror(message: string, opts?: TaskLogCompletionOptions): void {\n\t\t\tclear(true);\n\t\t\tlog.error(message, { output, secondarySymbol, spacing: 1 });\n\t\t\tif (opts?.showLog !== false) {\n\t\t\t\trenderBuffer();\n\t\t\t}\n\t\t\t// clear buffer since error is an end state\n\t\t\tbuffers.splice(1, buffers.length - 1);\n\t\t\tbuffers[0].value = '';\n\t\t\tbuffers[0].full = '';\n\t\t},\n\t\tsuccess(message: string, opts?: TaskLogCompletionOptions): void {\n\t\t\tclear(true);\n\t\t\tlog.success(message, { output, secondarySymbol, spacing: 1 });\n\t\t\tif (opts?.showLog === true) {\n\t\t\t\trenderBuffer();\n\t\t\t}\n\t\t\t// clear buffer since success is an end state\n\t\t\tbuffers.splice(1, buffers.length - 1);\n\t\t\tbuffers[0].value = '';\n\t\t\tbuffers[0].full = '';\n\t\t},\n\t};\n};\n","import { settings, TextPrompt } from '@clack/core';\nimport color from 'picocolors';\nimport { type CommonOptions, S_BAR, S_BAR_END, symbol } from './common.js';\n\nexport interface TextOptions extends CommonOptions {\n\tmessage: string;\n\tplaceholder?: string;\n\tdefaultValue?: string;\n\tinitialValue?: string;\n\tvalidate?: (value: string | undefined) => string | Error | undefined;\n}\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\toutput: opts.output,\n\t\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\trender() {\n\t\t\tconst hasGuide = opts?.withGuide ?? settings.withGuide;\n\t\t\tconst titlePrefix = `${hasGuide ? `${color.gray(S_BAR)}\\n` : ''}${symbol(this.state)} `;\n\t\t\tconst title = `${titlePrefix}${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 userInput = !this.userInput ? placeholder : this.userInputWithCursor;\n\t\t\tconst value = this.value ?? '';\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'error': {\n\t\t\t\t\tconst errorText = this.error ? ` ${color.yellow(this.error)}` : '';\n\t\t\t\t\tconst errorPrefix = hasGuide ? `${color.yellow(S_BAR)} ` : '';\n\t\t\t\t\tconst errorPrefixEnd = hasGuide ? color.yellow(S_BAR_END) : '';\n\t\t\t\t\treturn `${title.trim()}\\n${errorPrefix}${userInput}\\n${errorPrefixEnd}${errorText}\\n`;\n\t\t\t\t}\n\t\t\t\tcase 'submit': {\n\t\t\t\t\tconst valueText = value ? ` ${color.dim(value)}` : '';\n\t\t\t\t\tconst submitPrefix = hasGuide ? color.gray(S_BAR) : '';\n\t\t\t\t\treturn `${title}${submitPrefix}${valueText}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst valueText = value ? ` ${color.strikethrough(color.dim(value))}` : '';\n\t\t\t\t\tconst cancelPrefix = hasGuide ? color.gray(S_BAR) : '';\n\t\t\t\t\treturn `${title}${cancelPrefix}${valueText}${value.trim() ? `\\n${cancelPrefix}` : ''}`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tconst defaultPrefix = hasGuide ? `${color.cyan(S_BAR)} ` : '';\n\t\t\t\t\tconst defaultPrefixEnd = hasGuide ? color.cyan(S_BAR_END) : '';\n\t\t\t\t\treturn `${title}${defaultPrefix}${userInput}\\n${defaultPrefixEnd}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<string | symbol>;\n};\n","export interface Meta {\n name: string;\n slug: string;\n agent: string;\n description?: string;\n created_at?: string;\n}\n\nexport interface ToolDefinition {\n /** Path to the agent's global config dir, relative to os.homedir() */\n globalConfigDir: string;\n description: string;\n /** Optional: env var that can also redirect this agent (for reference/compat) */\n envVar?: string;\n}\n\nexport interface Config {\n tools: Record<string, ToolDefinition>;\n}\n\nexport interface CliConfig {\n contentDir?: string; // Path to content directory (relative to configDir or absolute)\n}\n\nexport interface SharedDirectory {\n /** Name of the shared directory (e.g., 'agents') */\n name: string;\n /** Path relative to os.homedir() (e.g., '.agents') */\n globalPath: string;\n /** Name in content dir with underscore prefix (e.g., '_agents') */\n contentDirName: string;\n description: string;\n}\n\nexport const SHARED_DIRECTORIES: Record<string, SharedDirectory> = {\n agents: {\n name: 'agents',\n globalPath: '.agents',\n contentDirName: '_agents',\n description: 'Cross-agent shared resources (skills, etc.)',\n },\n};\n\nexport const BASE_PROFILE_SLUG = '_base';\nexport const SHARED_PROFILE_SLUG = '_shared';\nexport const RESERVED_PROFILE_SLUGS = [BASE_PROFILE_SLUG, SHARED_PROFILE_SLUG] as const;\n\nexport const SUPPORTED_TOOLS: Record<string, ToolDefinition> = {\n claude: {\n globalConfigDir: '.claude',\n description: 'Claude Code',\n envVar: 'CLAUDE_CONFIG_DIR',\n },\n amp: {\n globalConfigDir: '.config/amp',\n description: 'Amp',\n envVar: 'AMP_CONFIG_DIR',\n },\n opencode: {\n globalConfigDir: '.config/opencode',\n description: 'OpenCode',\n envVar: 'OPENCODE_CONFIG_DIR',\n },\n codex: {\n globalConfigDir: '.codex',\n description: 'Codex',\n envVar: 'CODEX_CONFIG_DIR',\n },\n gemini: {\n globalConfigDir: '.gemini',\n description: 'Gemini',\n envVar: 'GEMINI_CONFIG_DIR',\n },\n augment: {\n globalConfigDir: '.augment',\n description: 'Augment',\n envVar: 'AUGMENT_CONFIG_DIR',\n },\n};\n","import { RESERVED_PROFILE_SLUGS } from '../types/index.js';\n\nconst SLUG_REGEX = /^[a-z0-9][a-z0-9._-]*$/;\nconst RESERVED_SLUGS = new Set<string>(RESERVED_PROFILE_SLUGS);\n\nexport function slugify(name: string): string {\n return name\n .trim()\n .toLowerCase()\n .replace(/\\s+/g, '-')\n .replace(/[^a-z0-9._-]/g, '')\n .replace(/-+/g, '-')\n .replace(/^-+|-+$/g, '');\n}\n\nexport function validateProfileName(name: string): string | null {\n const trimmed = name.trim();\n if (trimmed.length === 0) return 'Profile name is required.';\n if (trimmed !== name) return 'Profile name must not include surrounding whitespace.';\n const slug = slugify(name);\n if (slug.length === 0) return 'Profile name must contain at least one letter or number.';\n if (slug.includes('..')) return 'Profile name must not include \"..\".';\n return null;\n}\n\nexport function validateNewProfileName(name: string): string | null {\n const validationError = validateProfileName(name);\n if (validationError) return validationError;\n\n const slug = slugify(name);\n if (RESERVED_SLUGS.has(slug)) {\n return `Profile name '${slug}' is reserved and cannot be used.`;\n }\n\n return null;\n}\n\nexport function validateSlug(slug: string): string | null {\n if (slug.length === 0) return 'Slug is required.';\n if (!SLUG_REGEX.test(slug)) {\n return 'Slug must be lowercase letters, numbers, \".\", \"-\", \"_\".';\n }\n if (slug.includes('..')) return 'Slug must not include \"..\".';\n return null;\n}\n","/**\n * .profileinclude — allow-list format for include-based agents.\n *\n * Format:\n * - Newline-separated paths\n * - Lines starting with `#` (optionally preceded by whitespace) are comments\n * - Trailing `/` denotes a directory entry\n * - Blank lines are ignored\n *\n * Strategy:\n * Agents that have a .profileinclude use the \"inverted per-file symlink\" strategy:\n * the global config dir is left as a real directory, and only allow-listed paths\n * inside it are symlinked to the active profile.\n *\n * Agents without a .profileinclude use the \"directory\" strategy:\n * the entire global config dir is a symlink to the active profile dir (legacy behavior).\n *\n * TODO: getDefaultProfileInclude() currently only consults inline defaults.\n * Once content-dir override support is added, it must check\n * contentDir/{agent}/.profileinclude first, and fall back to defaults second.\n * Until then, user edits to the content-dir copy are not read at runtime.\n */\n\nexport interface ProfileInclude {\n /** Directory names to include (without trailing slash) */\n dirs: string[];\n /** File names/paths to include */\n files: string[];\n}\n\n/**\n * Parse a .profileinclude file's content.\n * - Ignores blank lines\n * - Strips lines where the first non-whitespace character is `#`\n * - Trailing `/` = directory entry; otherwise file entry\n * - Normalizes entries: trims whitespace, skips empty results\n */\nexport function parseProfileInclude(content: string): ProfileInclude {\n const dirs: string[] = [];\n const files: string[] = [];\n\n for (const rawLine of content.split('\\n')) {\n const line = rawLine.trim();\n\n // Skip blank lines and comment lines (# must be first non-whitespace char)\n if (!line || line.startsWith('#')) continue;\n\n if (line.endsWith('/')) {\n const entry = line.slice(0, -1).trim();\n if (entry) dirs.push(entry);\n } else {\n if (line) files.push(line);\n }\n }\n\n return { dirs, files };\n}\n\n/**\n * Generate a deny-all / allow-list .gitignore from a ProfileInclude.\n *\n * The .gitignore lives at the agent content dir level. Profile dirs are one\n * level deeper, so all per-profile patterns use a star-slash prefix.\n * Directory entries get both a dir pattern and a double-star glob so that\n * directory contents are tracked recursively.\n */\nexport function generateGitignore(include: ProfileInclude): string {\n const lines: string[] = [\n '# Generated by agentprofiles from .profileinclude',\n '# Deny-all, then allow only tracked config files',\n '',\n '# Ignore everything at this level, allow profile dirs',\n '*',\n '!*/',\n '',\n '# Ignore everything inside profile dirs',\n '*/*',\n '',\n '# Allow tracked config entries (matches .profileinclude)',\n ];\n\n for (const file of include.files) {\n lines.push(`!*/${file}`);\n }\n\n for (const dir of include.dirs) {\n lines.push(`!*/${dir}/`);\n lines.push(`!*/${dir}/**`);\n }\n\n // Always allow agentprofiles management files\n lines.push('');\n lines.push('# Allow agentprofiles management files');\n lines.push('!*/meta.json');\n lines.push('!.profileinclude');\n lines.push('!.gitignore');\n\n return lines.join('\\n') + '\\n';\n}\n\n// ---------------------------------------------------------------------------\n// Inline default .profileinclude content per agent\n//\n// These are the CLI-shipped defaults. setup copies them to\n// contentDir/{agent}/.profileinclude where the user can edit them.\n//\n// Keys must match keys in SUPPORTED_TOOLS.\n// ---------------------------------------------------------------------------\n\nconst CLAUDE_PROFILEINCLUDE = `# claude .profileinclude\n# Tracked config files for Claude Code profiles.\n# Trailing / = directory. Lines starting with # are comments.\nagents/\nskills/\ncommands/\nhooks/\nCLAUDE.md\nsettings.json\nsettings.local.json\n`;\n\nconst CODEX_PROFILEINCLUDE = `# codex .profileinclude\n# Tracked config files for Codex profiles.\n# Trailing / = directory. Lines starting with # are comments.\nprompts/\nskills/\nAGENTS.md\n`;\n\n/**\n * Map of agent name → default .profileinclude content.\n * Only agents listed here use the \"include\" strategy.\n * Agents absent from this map use the \"directory\" strategy.\n */\nexport const DEFAULT_PROFILE_INCLUDES: Record<string, string> = {\n claude: CLAUDE_PROFILEINCLUDE,\n codex: CODEX_PROFILEINCLUDE,\n};\n\n/**\n * Get the default .profileinclude content for an agent.\n * Returns null if the agent uses the whole-directory strategy.\n */\nexport function getDefaultProfileInclude(agent: string): string | null {\n return DEFAULT_PROFILE_INCLUDES[agent] ?? null;\n}\n\n/**\n * Resolve the ProfileInclude for an agent from its default.\n * Returns null if the agent uses the whole-directory strategy.\n */\nexport function resolveProfileInclude(agent: string): ProfileInclude | null {\n const content = getDefaultProfileInclude(agent);\n if (!content) return null;\n return parseProfileInclude(content);\n}\n\n/**\n * Get the agent's symlink strategy.\n * - 'include': inverted per-file symlinks into a real global dir (claude, codex)\n * - 'directory': whole-directory symlink to the profile dir (amp, opencode, augment, etc.)\n */\nexport function getAgentStrategy(agent: string): 'include' | 'directory' {\n return getDefaultProfileInclude(agent) !== null ? 'include' : 'directory';\n}\n","import { generateGitignore, resolveProfileInclude } from './profileinclude.js';\n\n// ---------------------------------------------------------------------------\n// Gitignore templates for whole-directory (non-include) agents\n// ---------------------------------------------------------------------------\n\nconst OPENCODE_GITIGNORE = `# Generated by agentprofiles\n# Regeneratable from package.json\n*/node_modules/\n`;\n\nconst AMP_GITIGNORE = `# Generated by agentprofiles\n# Keep: settings.json, AGENTS.md, themes/\n# Ignore: oauth tokens, caches, logs, temporary files\n\n# Authentication and sensitive data\noauth/\n\n# Caches and logs\ncache/\nlogs/\n\n# Temporary files\ntmp/\n\n# System files\n.DS_Store\n`;\n\nconst GEMINI_GITIGNORE = `# Generated by agentprofiles\n# Shared Gemini state (all runtime/session data)\n_shared/\n\n# Runtime/session state per profile\n*/antigravity\n*/antigravity-browser-profile\n*/history\n*/installation_id\n*/projects.json\n*/settings.json.orig\n*/state.json\n*/tmp\n*/trustedFolders.json\n*/user_id\n`;\n\nconst AUGMENT_GITIGNORE = `# Generated by agentprofiles\n# Keep: settings.json, agents/, commands/\n# Ignore: session tokens, caches, binaries, internal state, logs\n\n# Session and authentication\n.auggie.json\nsession.json\nsessions/\n\n# Caches and temporary files\ncheckpoint-documents/\ntask-storage/\ntmp/\n\n# Binaries and internal state\nbinaries/\nelectron-node/\nauggie-path\n\n# Logs and debugging\nmcp-debug.log\nmcp-server/\nobservability/\n\n# System files\n.DS_Store\n`;\n\n/**\n * Get the .gitignore content for an agent's content directory.\n *\n * For include-based agents (claude, codex): generates a deny-all / allow-list\n * gitignore derived from the agent's .profileinclude defaults.\n *\n * For directory-based agents: returns the static template.\n */\nexport function getAgentGitignore(agent: string): string {\n // Include-based agents: generate from .profileinclude\n const include = resolveProfileInclude(agent);\n if (include) {\n return generateGitignore(include);\n }\n\n // Directory-based agents: static templates\n switch (agent) {\n case 'opencode':\n return OPENCODE_GITIGNORE;\n case 'amp':\n return AMP_GITIGNORE;\n case 'gemini':\n return GEMINI_GITIGNORE;\n case 'augment':\n return AUGMENT_GITIGNORE;\n default:\n return '';\n }\n}\n","import fs from 'node:fs/promises';\nimport path from 'node:path';\n\n/**\n * Read the target of a symlink.\n * Returns null if the path is not a symlink.\n */\nexport async function readSymlinkTarget(linkPath: string): Promise<string | null> {\n try {\n const stat = await fs.lstat(linkPath);\n if (!stat.isSymbolicLink()) {\n return null;\n }\n return await fs.readlink(linkPath);\n } catch {\n return null;\n }\n}\n\n/**\n * Check if a path is a symlink.\n */\nexport async function isSymlink(linkPath: string): Promise<boolean> {\n try {\n const stat = await fs.lstat(linkPath);\n return stat.isSymbolicLink();\n } catch {\n return false;\n }\n}\n\n/**\n * Create a symlink atomically using the temp + rename pattern.\n * This ensures atomic replacement of an existing symlink.\n *\n * Pattern:\n * 1. Create temp symlink in parent dir\n * 2. Rename temp over target (atomic on POSIX)\n */\nexport async function atomicSymlink(target: string, linkPath: string): Promise<void> {\n const parentDir = path.dirname(linkPath);\n const linkName = path.basename(linkPath);\n const tempLinkName = `.${linkName}-tmp-${Date.now()}`;\n const tempLinkPath = path.join(parentDir, tempLinkName);\n\n try {\n // Create temp symlink\n await fs.symlink(target, tempLinkPath);\n\n // Atomically rename over target\n await fs.rename(tempLinkPath, linkPath);\n } catch (err) {\n // Clean up temp symlink if rename failed\n try {\n await fs.unlink(tempLinkPath);\n } catch {\n // Ignore cleanup errors\n }\n throw err;\n }\n}\n\n/**\n * Move a directory from src to dst.\n * Tries rename() first (fast, same filesystem).\n * Falls back to recursive copy + delete for cross-device moves.\n */\nexport async function moveDirectory(src: string, dst: string): Promise<void> {\n try {\n // Try fast rename first\n await fs.rename(src, dst);\n } catch (err) {\n // Check if it's a cross-device error\n if (err instanceof Error && 'code' in err && err.code === 'EXDEV') {\n // Fall back to copy + delete\n await copyDirectory(src, dst);\n await fs.rm(src, { recursive: true, force: true });\n } else {\n throw err;\n }\n }\n}\n\n/**\n * Recursively copy a directory, preserving symlinks as-is.\n */\nexport async function copyDirectory(src: string, dst: string): Promise<void> {\n await fs.mkdir(dst, { recursive: true });\n\n const entries = await fs.readdir(src, { withFileTypes: true });\n\n for (const entry of entries) {\n const srcPath = path.join(src, entry.name);\n const dstPath = path.join(dst, entry.name);\n\n if (entry.isDirectory()) {\n await copyDirectory(srcPath, dstPath);\n } else if (entry.isSymbolicLink()) {\n // Preserve symlinks as-is\n const target = await fs.readlink(srcPath);\n await fs.symlink(target, dstPath);\n } else {\n await fs.copyFile(srcPath, dstPath);\n }\n }\n}\n","import fs from 'node:fs/promises';\nimport type { Dirent } from 'node:fs';\nimport path from 'node:path';\nimport os from 'node:os';\nimport {\n CliConfig,\n Meta,\n SUPPORTED_TOOLS,\n SHARED_DIRECTORIES,\n BASE_PROFILE_SLUG,\n SHARED_PROFILE_SLUG,\n} from '../types/index.js';\nimport { validateNewProfileName, slugify, validateSlug } from './validation.js';\nimport { getAgentGitignore } from './gitignore.js';\nimport {\n getAgentStrategy as _getAgentStrategy,\n getDefaultProfileInclude,\n resolveProfileInclude,\n type ProfileInclude,\n} from './profileinclude.js';\nimport {\n readSymlinkTarget,\n isSymlink,\n atomicSymlink,\n moveDirectory,\n copyDirectory,\n} from './symlink.js';\n\n// Resolution order for contentDir:\n// 1. AGENTPROFILES_CONTENT_DIR environment variable\n// 2. config.json contentDir setting\n// 3. Default: same as configDir\n\nexport type SymlinkStatus = 'active' | 'unmanaged' | 'missing' | 'broken' | 'external';\n\nexport interface BrokenSymlink {\n linkPath: string;\n target: string;\n}\n\nasync function pathExists(targetPath: string): Promise<boolean> {\n try {\n await fs.access(targetPath);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isSubpath(parent: string, child: string): boolean {\n const relative = path.relative(parent, child);\n return relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));\n}\n\nasync function copyPathDereferenced(sourcePath: string, destinationPath: string): Promise<void> {\n const linkStat = await fs.lstat(sourcePath);\n if (linkStat.isSymbolicLink()) {\n const linkTarget = await fs.readlink(sourcePath);\n const resolvedTarget = path.isAbsolute(linkTarget)\n ? linkTarget\n : path.resolve(path.dirname(sourcePath), linkTarget);\n await copyPathDereferenced(resolvedTarget, destinationPath);\n return;\n }\n\n if (linkStat.isDirectory()) {\n await fs.mkdir(destinationPath, { recursive: true });\n const entries = await fs.readdir(sourcePath, { withFileTypes: true });\n for (const entry of entries) {\n const childSource = path.join(sourcePath, entry.name);\n const childDestination = path.join(destinationPath, entry.name);\n await copyPathDereferenced(childSource, childDestination);\n }\n return;\n }\n\n await fs.mkdir(path.dirname(destinationPath), { recursive: true });\n await fs.copyFile(sourcePath, destinationPath);\n}\n\nasync function movePath(sourcePath: string, destinationPath: string): Promise<void> {\n try {\n await fs.rename(sourcePath, destinationPath);\n } catch (error) {\n if (error instanceof Error && 'code' in error && error.code === 'EXDEV') {\n const stat = await fs.lstat(sourcePath);\n if (stat.isDirectory()) {\n await copyDirectory(sourcePath, destinationPath);\n } else {\n await copyPathDereferenced(sourcePath, destinationPath);\n }\n await fs.rm(sourcePath, { recursive: true, force: true });\n return;\n }\n throw error;\n }\n}\n\nfunction getDefaultConfigDir(): string {\n // AGENTPROFILES_CONFIG_DIR overrides everything\n if (process.env.AGENTPROFILES_CONFIG_DIR) {\n return process.env.AGENTPROFILES_CONFIG_DIR;\n }\n return path.join(os.homedir(), '.config', 'agentprofiles');\n}\n\nexport class ConfigManager {\n private configDir: string;\n private contentDir: string;\n private tools: typeof SUPPORTED_TOOLS;\n private cliConfig: CliConfig | null = null;\n\n constructor() {\n this.configDir = getDefaultConfigDir();\n this.tools = SUPPORTED_TOOLS;\n // contentDir will be resolved lazily or after loading config\n this.contentDir = this.resolveContentDir();\n }\n\n private resolveContentDir(): string {\n // 1. Environment variable takes precedence\n if (process.env.AGENTPROFILES_CONTENT_DIR) {\n return process.env.AGENTPROFILES_CONTENT_DIR;\n }\n // 2. Config file setting (if loaded)\n if (this.cliConfig?.contentDir) {\n const configuredDir = this.cliConfig.contentDir;\n // If relative path, resolve relative to configDir\n if (!path.isAbsolute(configuredDir)) {\n return path.join(this.configDir, configuredDir);\n }\n return configuredDir;\n }\n // 3. Default: same as configDir\n return this.configDir;\n }\n\n private async loadCliConfig(): Promise<CliConfig> {\n const configPath = path.join(this.configDir, 'config.json');\n try {\n const content = await fs.readFile(configPath, 'utf-8');\n return JSON.parse(content) as CliConfig;\n } catch {\n return {};\n }\n }\n\n async init(): Promise<void> {\n this.cliConfig = await this.loadCliConfig();\n this.contentDir = this.resolveContentDir();\n }\n\n private async saveConfig(): Promise<void> {\n const configPath = path.join(this.configDir, 'config.json');\n await fs.writeFile(configPath, JSON.stringify(this.cliConfig || {}, null, 2));\n }\n\n getConfigDir(): string {\n return this.configDir;\n }\n\n getContentDir(): string {\n return this.contentDir;\n }\n\n async setContentDir(contentDir: string): Promise<void> {\n if (!this.cliConfig) {\n this.cliConfig = {};\n }\n this.cliConfig.contentDir = contentDir;\n this.contentDir = contentDir;\n await this.saveConfig();\n }\n\n async ensureConfigDir(): Promise<void> {\n // Create base config directory\n await fs.mkdir(this.configDir, { recursive: true });\n\n // Create config.json if not exists\n const configPath = path.join(this.configDir, 'config.json');\n try {\n await fs.access(configPath);\n // If config already exists, load it so contentDir reflects config.json.\n this.cliConfig = await this.loadCliConfig();\n } catch {\n const defaultConfig: CliConfig = {};\n await fs.writeFile(configPath, JSON.stringify(defaultConfig, null, 2));\n this.cliConfig = defaultConfig;\n }\n\n // Re-resolve content dir after loading/creating config.json.\n this.contentDir = this.resolveContentDir();\n\n // Create content directory (may be same as configDir)\n await fs.mkdir(this.contentDir, { recursive: true });\n\n // Create tool directories inside content dir\n for (const tool of Object.keys(this.tools)) {\n const toolDir = path.join(this.contentDir, tool);\n await fs.mkdir(toolDir, { recursive: true });\n await this.ensureAgentGitignore(toolDir, tool);\n }\n }\n\n private async ensureAgentGitignore(agentDir: string, agent: string) {\n const gitignorePath = path.join(agentDir, '.gitignore');\n try {\n await fs.access(gitignorePath);\n return;\n } catch {\n // continue\n }\n const content = getAgentGitignore(agent);\n if (!content) return;\n await fs.writeFile(gitignorePath, content);\n }\n\n async getProfiles(agent: string): Promise<Meta[]> {\n const agentDir = path.join(this.contentDir, agent);\n try {\n const entries = await fs.readdir(agentDir, { withFileTypes: true });\n const profiles: Meta[] = [];\n\n for (const entry of entries) {\n if (!entry.isDirectory()) continue;\n const dirName = entry.name;\n if (dirName === SHARED_PROFILE_SLUG) continue;\n if (validateSlug(dirName) !== null) continue;\n\n const metaPath = path.join(agentDir, dirName, 'meta.json');\n let meta: Partial<Meta> = {};\n try {\n const content = await fs.readFile(metaPath, 'utf-8');\n meta = JSON.parse(content);\n } catch {\n // No meta.json or invalid JSON - use defaults\n }\n\n profiles.push({\n name: meta.name || dirName,\n slug: dirName,\n agent,\n description: meta.description,\n created_at: meta.created_at,\n });\n }\n return profiles;\n } catch {\n return [];\n }\n }\n\n async createProfile(agent: string, name: string, description?: string): Promise<string> {\n if (!this.tools[agent]) {\n throw new Error(`Unsupported agent: ${agent}`);\n }\n const validationError = validateNewProfileName(name);\n if (validationError) {\n throw new Error(validationError);\n }\n\n const slug = slugify(name);\n const profileDir = path.join(this.contentDir, agent, slug);\n\n try {\n await fs.access(profileDir);\n throw new Error(`Profile '${slug}' already exists for agent '${agent}'`);\n } catch (err) {\n if (err instanceof Error && 'code' in err && err.code !== 'ENOENT') {\n throw err;\n }\n if (err instanceof Error && !('code' in err)) {\n throw err;\n }\n }\n\n await fs.mkdir(profileDir, { recursive: true });\n\n const meta: Meta = {\n name,\n slug,\n agent,\n description,\n created_at: new Date().toISOString(),\n };\n\n await fs.writeFile(path.join(profileDir, 'meta.json'), JSON.stringify(meta, null, 2));\n\n return profileDir;\n }\n\n private async ensureReservedProfile(\n agent: string,\n slug: string,\n description: string\n ): Promise<string> {\n const profileDir = path.join(this.contentDir, agent, slug);\n await fs.mkdir(profileDir, { recursive: true });\n\n const metaPath = path.join(profileDir, 'meta.json');\n if (!(await pathExists(metaPath))) {\n const meta: Meta = {\n name: slug,\n slug,\n agent,\n description,\n created_at: new Date().toISOString(),\n };\n await fs.writeFile(metaPath, JSON.stringify(meta, null, 2));\n }\n\n return profileDir;\n }\n\n async ensureBaseProfile(agent: string): Promise<string> {\n if (!this.tools[agent]) {\n throw new Error(`Unsupported agent: ${agent}`);\n }\n return this.ensureReservedProfile(agent, BASE_PROFILE_SLUG, 'Base profile (created by setup)');\n }\n\n async ensureBaseProfileLayout(agent: string): Promise<void> {\n await this.ensureBaseProfile(agent);\n if (this.getAgentStrategy(agent) === 'include') {\n await this.ensureIncludeAgentFiles(agent);\n await this.ensureIncludeProfileLayout(agent, BASE_PROFILE_SLUG);\n }\n // Directory-strategy agents don't need additional layout scaffolding\n }\n\n // ============================================================================\n // Include-strategy methods (inverted per-file symlinks for messy agents)\n // ============================================================================\n\n /**\n * Write .profileinclude and .gitignore to the agent content directory if missing.\n * Never overwrites user-edited copies.\n */\n private async ensureIncludeAgentFiles(agent: string): Promise<void> {\n const agentDir = path.join(this.contentDir, agent);\n await fs.mkdir(agentDir, { recursive: true });\n\n const includeContent = this.getDefaultProfileIncludeContent(agent);\n if (includeContent) {\n const includePath = path.join(agentDir, '.profileinclude');\n if (!(await pathExists(includePath))) {\n await fs.writeFile(includePath, includeContent);\n }\n }\n\n // .gitignore: reuse the existing per-agent helper (already idempotent)\n await this.ensureAgentGitignore(agentDir, agent);\n }\n\n /**\n * Ensure all allow-listed dir entries exist in a profile directory.\n * - Dir entries: create empty dir + .gitkeep if missing\n * - File entries: skip (user/agent creates them)\n * - Creates parent directories for nested entries\n */\n async ensureIncludeProfileLayout(agent: string, profileSlug: string): Promise<void> {\n const include = this.getProfileInclude(agent);\n if (!include) return;\n\n const profileDir = path.join(this.contentDir, agent, profileSlug);\n if (!(await pathExists(profileDir))) return;\n\n for (const dir of include.dirs) {\n const dirPath = path.join(profileDir, dir);\n await fs.mkdir(dirPath, { recursive: true });\n const gitkeepPath = path.join(dirPath, '.gitkeep');\n if (!(await pathExists(gitkeepPath))) {\n const entries = await fs.readdir(dirPath);\n if (entries.length === 0) {\n await fs.writeFile(gitkeepPath, '');\n }\n }\n }\n // File entries: no action — created by user or agent\n }\n\n /**\n * Adopt an existing real directory for an include-based agent.\n * Leaves the global dir in place. Moves allow-listed real entries to _base\n * and creates per-entry symlinks pointing from globalPath back to _base.\n */\n private async adoptExistingInclude(\n agent: string,\n profileName: string,\n options: { replaceExisting?: boolean } = {}\n ): Promise<void> {\n const globalPath = this.getGlobalConfigPath(agent);\n\n // Ensure global dir is a real directory\n let globalStat: Awaited<ReturnType<typeof fs.lstat>> | null = null;\n try {\n globalStat = await fs.lstat(globalPath);\n } catch {\n // Doesn't exist — create it\n await fs.mkdir(globalPath, { recursive: true });\n globalStat = await fs.lstat(globalPath);\n }\n if (globalStat.isSymbolicLink()) {\n throw new Error(\n `Cannot adopt include-based agent '${agent}': global path is a symlink. Run 'release' first.`\n );\n }\n\n const profileDir = path.join(this.contentDir, agent, profileName);\n\n // Handle existing profile\n try {\n await fs.access(profileDir);\n if (options.replaceExisting) {\n await fs.rm(profileDir, { recursive: true, force: true });\n } else {\n throw new Error(\n `Cannot adopt: profile '${profileName}' already exists for agent '${agent}'`\n );\n }\n } catch (err) {\n if (err instanceof Error && 'code' in err && err.code === 'ENOENT') {\n // Good — profile doesn't exist yet\n } else {\n throw err;\n }\n }\n\n await fs.mkdir(profileDir, { recursive: true });\n\n const include = this.getProfileInclude(agent);\n if (!include) {\n throw new Error(`Agent '${agent}' has no .profileinclude — cannot use include strategy`);\n }\n\n // Process allow-listed entries\n for (const entry of [...include.files, ...include.dirs]) {\n const isDir = include.dirs.includes(entry);\n const globalEntryPath = path.join(globalPath, entry);\n const profileEntryPath = path.join(profileDir, entry);\n\n // Ensure parent dir exists in profile\n await fs.mkdir(path.dirname(profileEntryPath), { recursive: true });\n\n let entryStat: Awaited<ReturnType<typeof fs.lstat>> | null = null;\n try {\n entryStat = await fs.lstat(globalEntryPath);\n } catch {\n // Entry doesn't exist in global dir\n }\n\n if (entryStat?.isSymbolicLink()) {\n // Existing symlink — skip, don't double-link\n continue;\n }\n\n if (entryStat) {\n // Real file or dir: move it into the profile\n await movePath(globalEntryPath, profileEntryPath);\n } else if (isDir) {\n // Dir entry that doesn't exist yet: create empty dir + .gitkeep\n await fs.mkdir(profileEntryPath, { recursive: true });\n await fs.writeFile(path.join(profileEntryPath, '.gitkeep'), '');\n } else {\n // File entry that doesn't exist: skip (don't create dangling symlink)\n continue;\n }\n\n // Create symlink: globalPath/{entry} -> relative path to profile/{entry}\n await fs.mkdir(path.dirname(globalEntryPath), { recursive: true });\n const relTarget = path.relative(path.dirname(globalEntryPath), profileEntryPath);\n await fs.symlink(relTarget, globalEntryPath);\n }\n\n // Write meta.json\n const meta: Meta = {\n name: profileName,\n slug: profileName,\n agent,\n description: 'Base profile (adopted from original config)',\n created_at: new Date().toISOString(),\n };\n await fs.writeFile(path.join(profileDir, 'meta.json'), JSON.stringify(meta, null, 2));\n\n // Write .profileinclude and .gitignore to agent content dir if missing\n await this.ensureIncludeAgentFiles(agent);\n }\n\n /**\n * Get the active profile slug for an include-based agent.\n * Reads the target of the first managed per-entry symlink inside globalPath.\n * Returns null if not managed or no symlinks found.\n */\n async getActiveProfileInclude(agent: string): Promise<string | null> {\n const include = this.getProfileInclude(agent);\n if (!include) return null;\n\n const globalPath = this.getGlobalConfigPath(agent);\n const contentDirAbs = path.resolve(this.contentDir);\n const allEntries = [...include.files, ...include.dirs];\n\n for (const entry of allEntries) {\n const entryPath = path.join(globalPath, entry);\n let entryStat: Awaited<ReturnType<typeof fs.lstat>> | null = null;\n try {\n entryStat = await fs.lstat(entryPath);\n } catch {\n continue;\n }\n if (!entryStat?.isSymbolicLink()) continue;\n\n const target = await fs.readlink(entryPath);\n const absTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(entryPath), target);\n\n if (!isSubpath(contentDirAbs, absTarget)) continue;\n\n // Target is contentDir/{agent}/{slug}/{entry...}\n // Walk up entry depth to find the slug directory\n const entryDepth = entry.split(path.sep).length;\n let slugPath = absTarget;\n for (let i = 0; i < entryDepth; i++) {\n slugPath = path.dirname(slugPath);\n }\n return path.basename(slugPath);\n }\n\n return null;\n }\n\n /**\n * Get the symlink status for an include-based agent.\n * The global dir is a real directory; management is detected via _base + per-entry symlinks.\n */\n async getIncludeSymlinkStatus(agent: string): Promise<SymlinkStatus> {\n const globalPath = this.getGlobalConfigPath(agent);\n\n let globalStat: Awaited<ReturnType<typeof fs.lstat>> | null = null;\n try {\n globalStat = await fs.lstat(globalPath);\n } catch {\n return 'missing';\n }\n\n // If it's a symlink (leftover from old directory-strategy setup)\n if (globalStat.isSymbolicLink()) {\n const target = await readSymlinkTarget(globalPath);\n if (!target) return 'broken';\n try {\n await fs.access(globalPath);\n } catch {\n return 'broken';\n }\n const absTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(globalPath), target);\n const contentDirAbs = path.resolve(this.contentDir);\n return absTarget.startsWith(contentDirAbs + path.sep) ? 'active' : 'external';\n }\n\n // Real directory — check if _base exists (indicates management)\n const basePath = path.join(this.contentDir, agent, BASE_PROFILE_SLUG);\n if (!(await pathExists(basePath))) {\n return 'unmanaged';\n }\n\n // Check for broken per-entry symlinks\n const include = this.getProfileInclude(agent);\n if (include) {\n for (const entry of [...include.files, ...include.dirs]) {\n const entryPath = path.join(globalPath, entry);\n let entryStat: Awaited<ReturnType<typeof fs.lstat>> | null = null;\n try {\n entryStat = await fs.lstat(entryPath);\n } catch {\n continue; // Missing entry — not a broken link\n }\n if (entryStat.isSymbolicLink()) {\n try {\n await fs.access(entryPath); // follows symlink\n } catch {\n return 'broken';\n }\n }\n }\n }\n\n return 'active';\n }\n\n /**\n * Switch the active profile for an include-based agent.\n * Repoints managed per-entry symlinks inside globalPath to the target profile.\n * Leaves real files/dirs and non-managed symlinks untouched.\n */\n async switchProfileInclude(agent: string, profileSlug: string): Promise<void> {\n const include = this.getProfileInclude(agent);\n if (!include) {\n throw new Error(`Agent '${agent}' has no .profileinclude`);\n }\n\n const globalPath = this.getGlobalConfigPath(agent);\n const profileDir = path.join(this.contentDir, agent, profileSlug);\n\n if (!(await pathExists(profileDir))) {\n throw new Error(`Profile '${profileSlug}' does not exist for agent '${agent}'`);\n }\n\n // Scaffold any missing entries in the target profile\n await this.ensureIncludeProfileLayout(agent, profileSlug);\n\n const contentDirAbs = path.resolve(this.contentDir);\n\n for (const entry of [...include.files, ...include.dirs]) {\n const globalEntryPath = path.join(globalPath, entry);\n const profileEntryPath = path.join(profileDir, entry);\n\n // Only create symlink if target exists in the profile\n if (!(await pathExists(profileEntryPath))) continue;\n\n let existingStat: Awaited<ReturnType<typeof fs.lstat>> | null = null;\n try {\n existingStat = await fs.lstat(globalEntryPath);\n } catch {\n // Entry missing — will create symlink below\n }\n\n if (existingStat) {\n if (existingStat.isSymbolicLink()) {\n const target = await fs.readlink(globalEntryPath);\n const absTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(globalEntryPath), target);\n if (!isSubpath(contentDirAbs, absTarget)) {\n continue; // External symlink — leave it\n }\n await fs.unlink(globalEntryPath); // Remove old managed symlink\n } else {\n continue; // Real file/dir — don't clobber\n }\n }\n\n // Create symlink: globalPath/{entry} -> relative path to profile/{entry}\n await fs.mkdir(path.dirname(globalEntryPath), { recursive: true });\n const relTarget = path.relative(path.dirname(globalEntryPath), profileEntryPath);\n await fs.symlink(relTarget, globalEntryPath);\n }\n }\n\n /**\n * Release an include-based agent from management.\n * For each managed per-entry symlink inside globalPath: removes the symlink\n * and copies the real content from the active profile back into globalPath.\n * Does NOT delete the profile directory.\n */\n async unlinkProfileInclude(agent: string): Promise<void> {\n const include = this.getProfileInclude(agent);\n if (!include) {\n throw new Error(`Agent '${agent}' has no .profileinclude`);\n }\n\n const globalPath = this.getGlobalConfigPath(agent);\n const contentDirAbs = path.resolve(this.contentDir);\n\n // Determine the active profile before removing any symlinks\n const activeProfile = await this.getActiveProfileInclude(agent);\n\n for (const entry of [...include.files, ...include.dirs]) {\n const globalEntryPath = path.join(globalPath, entry);\n\n let entryStat: Awaited<ReturnType<typeof fs.lstat>> | null = null;\n try {\n entryStat = await fs.lstat(globalEntryPath);\n } catch {\n continue;\n }\n\n if (!entryStat.isSymbolicLink()) continue; // Real file — leave it\n\n const target = await fs.readlink(globalEntryPath);\n const absTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(globalEntryPath), target);\n\n if (!isSubpath(contentDirAbs, absTarget)) continue; // External symlink — leave it\n\n // Remove the managed symlink\n await fs.unlink(globalEntryPath);\n\n // Copy content from profile back into globalPath\n if (await pathExists(absTarget)) {\n await fs.mkdir(path.dirname(globalEntryPath), { recursive: true });\n const targetStat = await fs.lstat(absTarget);\n if (targetStat.isDirectory()) {\n await copyDirectory(absTarget, globalEntryPath);\n } else {\n await fs.copyFile(absTarget, globalEntryPath);\n }\n }\n }\n\n // Remove the active profile directory so status returns to 'unmanaged'.\n // This mirrors the directory-strategy unlinkProfile behavior and is safe\n // here because unlinkProfile is only called from the release command.\n if (activeProfile) {\n const profileDir = path.join(this.contentDir, agent, activeProfile);\n await fs.rm(profileDir, { recursive: true, force: true });\n }\n }\n\n async findBrokenSymlinks(rootPath: string): Promise<BrokenSymlink[]> {\n const broken: BrokenSymlink[] = [];\n\n const walk = async (currentPath: string): Promise<void> => {\n let entries: Dirent[];\n try {\n entries = await fs.readdir(currentPath, { withFileTypes: true });\n } catch {\n return;\n }\n\n for (const entry of entries) {\n const absolutePath = path.join(currentPath, entry.name);\n\n if (entry.isSymbolicLink()) {\n const target = await readSymlinkTarget(absolutePath);\n if (!target) {\n broken.push({ linkPath: absolutePath, target: '(unreadable target)' });\n continue;\n }\n\n try {\n // Access through the symlink path to detect broken links.\n await fs.access(absolutePath);\n } catch {\n broken.push({ linkPath: absolutePath, target });\n }\n continue;\n }\n\n if (entry.isDirectory()) {\n await walk(absolutePath);\n }\n }\n };\n\n await walk(rootPath);\n return broken;\n }\n\n // ============================================================================\n // Symlink-based profile management\n // ============================================================================\n\n /**\n * Get the symlink strategy for an agent.\n * - 'include': inverted per-file symlinks (messy agents: claude, codex)\n * - 'directory': whole-directory symlink (clean agents: amp, opencode, etc.)\n *\n * TODO: check contentDir/{agent}/.profileinclude first (content-dir override).\n */\n getAgentStrategy(agent: string): 'include' | 'directory' {\n return _getAgentStrategy(agent);\n }\n\n /**\n * Resolve the ProfileInclude for an include-based agent.\n * Returns null for directory-based agents.\n *\n * TODO: read from contentDir/{agent}/.profileinclude when content-dir override\n * is implemented.\n */\n getProfileInclude(agent: string): ProfileInclude | null {\n return resolveProfileInclude(agent);\n }\n\n /**\n * Get the default .profileinclude content string for an agent (for writing to disk).\n * Returns null for directory-based agents.\n */\n getDefaultProfileIncludeContent(agent: string): string | null {\n return getDefaultProfileInclude(agent);\n }\n\n /**\n * Get the absolute path to an agent's global config directory.\n * Resolves relative paths from os.homedir().\n */\n getGlobalConfigPath(agent: string): string {\n const tool = this.tools[agent];\n if (!tool) {\n throw new Error(`Unsupported agent: ${agent}`);\n }\n return path.join(os.homedir(), tool.globalConfigDir);\n }\n\n /**\n * Check the state of an agent's global config directory.\n * Returns one of: 'active', 'unmanaged', 'missing', 'broken', 'external'\n */\n async getSymlinkStatus(agent: string): Promise<SymlinkStatus> {\n if (this.getAgentStrategy(agent) === 'include') {\n return this.getIncludeSymlinkStatus(agent);\n }\n\n const globalPath = this.getGlobalConfigPath(agent);\n\n // Use lstat to check the path itself (doesn't follow symlinks)\n let stat;\n try {\n stat = await fs.lstat(globalPath);\n } catch {\n return 'missing';\n }\n\n // Not a symlink = real directory\n if (!stat.isSymbolicLink()) {\n return 'unmanaged';\n }\n\n // It's a symlink — check if target exists\n const target = await readSymlinkTarget(globalPath);\n if (!target) {\n return 'broken';\n }\n\n // Check if target actually exists (follow the symlink)\n try {\n await fs.access(globalPath);\n } catch {\n return 'broken';\n }\n\n // Resolve target to absolute path\n const absoluteTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(globalPath), target);\n\n // Check if target is in our content dir\n const contentDirAbs = path.resolve(this.contentDir);\n if (!absoluteTarget.startsWith(contentDirAbs + path.sep)) {\n return 'external';\n }\n\n return 'active';\n }\n\n /**\n * Get the active profile slug for an agent.\n * Returns null if the agent is not managed by us.\n */\n async getActiveProfile(agent: string): Promise<string | null> {\n if (this.getAgentStrategy(agent) === 'include') {\n return this.getActiveProfileInclude(agent);\n }\n\n const status = await this.getSymlinkStatus(agent);\n if (status !== 'active') {\n return null;\n }\n\n const globalPath = this.getGlobalConfigPath(agent);\n const target = await readSymlinkTarget(globalPath);\n if (!target) {\n return null;\n }\n\n // Extract profile slug from target path\n // Target is like: /path/to/contentDir/agent/slug\n const absoluteTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(globalPath), target);\n\n const slug = path.basename(absoluteTarget);\n return slug;\n }\n\n /**\n * Adopt an existing real directory as a managed profile.\n * Moves the directory to contentDir/<agent>/_base and creates a symlink back.\n * Throws if _base already exists.\n * If symlink creation fails after move, rolls back by moving the directory back.\n */\n async adoptExisting(\n agent: string,\n profileName: string = BASE_PROFILE_SLUG,\n options: { replaceExisting?: boolean } = {}\n ): Promise<void> {\n if (this.getAgentStrategy(agent) === 'include') {\n return this.adoptExistingInclude(agent, profileName, options);\n }\n\n const globalPath = this.getGlobalConfigPath(agent);\n const status = await this.getSymlinkStatus(agent);\n\n if (status !== 'unmanaged') {\n throw new Error(\n `Cannot adopt: agent '${agent}' status is '${status}' (expected 'unmanaged')`\n );\n }\n\n const profileDir = path.join(this.contentDir, agent, profileName);\n\n // Check if profile already exists\n try {\n await fs.access(profileDir);\n if (options.replaceExisting) {\n await fs.rm(profileDir, { recursive: true, force: true });\n } else {\n throw new Error(\n `Cannot adopt: profile '${profileName}' already exists for agent '${agent}'`\n );\n }\n } catch (err) {\n if (err instanceof Error && 'code' in err && err.code === 'ENOENT') {\n // Good, profile doesn't exist\n } else {\n throw err;\n }\n }\n\n // Move the real directory to profile location\n await moveDirectory(globalPath, profileDir);\n\n // Create meta.json for the adopted profile\n const meta: Meta = {\n name: profileName,\n slug: profileName,\n agent,\n description: 'Base profile (adopted from original config)',\n created_at: new Date().toISOString(),\n };\n await fs.writeFile(path.join(profileDir, 'meta.json'), JSON.stringify(meta, null, 2));\n\n // Create symlink back to the profile with rollback on failure\n try {\n await atomicSymlink(profileDir, globalPath);\n } catch (err) {\n // Rollback: move the directory back to its original location\n try {\n await moveDirectory(profileDir, globalPath);\n } catch (rollbackErr) {\n // If rollback fails, throw both errors\n throw new Error(\n `Failed to create symlink and rollback failed: ${err instanceof Error ? err.message : String(err)}. ` +\n `Rollback error: ${rollbackErr instanceof Error ? rollbackErr.message : String(rollbackErr)}`\n );\n }\n throw err;\n }\n }\n\n /**\n * Verify that an adoption was successful.\n * Checks that the symlink exists and points to the expected profile directory.\n * Returns true if verification passes, false otherwise.\n */\n async verifyAdoption(agent: string, profileName: string = BASE_PROFILE_SLUG): Promise<boolean> {\n const expectedProfileDir = path.join(this.contentDir, agent, profileName);\n\n if (this.getAgentStrategy(agent) === 'include') {\n // For include-based agents: verify that _base exists and at least one\n // managed per-entry symlink points to the expected profile directory.\n if (!(await pathExists(expectedProfileDir))) return false;\n\n const include = this.getProfileInclude(agent);\n if (!include) return false;\n\n const globalPath = this.getGlobalConfigPath(agent);\n const contentDirAbs = path.resolve(this.contentDir);\n const allEntries = [...include.files, ...include.dirs];\n\n // If include list is empty, treat as verified if profile dir exists\n if (allEntries.length === 0) return true;\n\n for (const entry of allEntries) {\n const entryPath = path.join(globalPath, entry);\n let entryStat: Awaited<ReturnType<typeof fs.lstat>> | null = null;\n try {\n entryStat = await fs.lstat(entryPath);\n } catch {\n continue;\n }\n if (!entryStat?.isSymbolicLink()) continue;\n\n const target = await fs.readlink(entryPath);\n const absTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(entryPath), target);\n\n if (!isSubpath(contentDirAbs, absTarget)) continue;\n\n // Check target points to the expected profile\n const expectedEntryPath = path.resolve(expectedProfileDir, entry);\n if (path.resolve(absTarget) === expectedEntryPath) return true;\n }\n\n return false;\n }\n\n const globalPath = this.getGlobalConfigPath(agent);\n\n // Check if global path is a symlink\n const status = await this.getSymlinkStatus(agent);\n if (status !== 'active') {\n return false;\n }\n\n // Check if symlink points to the expected profile directory\n const target = await readSymlinkTarget(globalPath);\n if (!target) {\n return false;\n }\n\n // Resolve target to absolute path for comparison\n const absoluteTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(globalPath), target);\n\n const absoluteExpected = path.resolve(expectedProfileDir);\n\n return absoluteTarget === absoluteExpected;\n }\n\n /**\n * Atomically switch the symlink to point to a different profile.\n * Uses atomic pattern: create temp symlink, then rename over target.\n */\n async switchProfile(agent: string, profileSlug: string): Promise<void> {\n if (profileSlug === SHARED_PROFILE_SLUG) {\n throw new Error(`Profile '${SHARED_PROFILE_SLUG}' is reserved and cannot be activated.`);\n }\n\n if (this.getAgentStrategy(agent) === 'include') {\n return this.switchProfileInclude(agent, profileSlug);\n }\n\n const globalPath = this.getGlobalConfigPath(agent);\n const profileDir = path.join(this.contentDir, agent, profileSlug);\n\n // Verify profile exists\n try {\n await fs.access(profileDir);\n } catch {\n throw new Error(`Profile '${profileSlug}' does not exist for agent '${agent}'`);\n }\n\n // Verify global path is a symlink\n const isLink = await isSymlink(globalPath);\n if (!isLink) {\n throw new Error(`Agent '${agent}' global config is not a symlink (status: unmanaged)`);\n }\n\n // Atomically swap the symlink\n await atomicSymlink(profileDir, globalPath);\n }\n\n /**\n * Unlink a managed profile - move contents back to global config dir.\n * This \"releases\" the agent from management.\n */\n async unlinkProfile(agent: string): Promise<void> {\n if (this.getAgentStrategy(agent) === 'include') {\n return this.unlinkProfileInclude(agent);\n }\n\n const globalPath = this.getGlobalConfigPath(agent);\n const status = await this.getSymlinkStatus(agent);\n\n if (status !== 'active') {\n throw new Error(`Cannot unlink: agent '${agent}' status is '${status}' (expected 'active')`);\n }\n\n const activeProfile = await this.getActiveProfile(agent);\n if (!activeProfile) {\n throw new Error(`Cannot determine active profile for agent '${agent}'`);\n }\n\n const profileDir = path.join(this.contentDir, agent, activeProfile);\n const globalParent = path.dirname(globalPath);\n const globalBaseName = path.basename(globalPath);\n const tempGlobalPath = path.join(globalParent, `.${globalBaseName}-release-${Date.now()}`);\n\n // Copy the profile directory to a temp location (preserving symlinks as copies)\n await copyDirectory(profileDir, tempGlobalPath);\n\n // Remove the managed symlink so the global path can become a real directory.\n await fs.unlink(globalPath);\n\n try {\n await fs.rename(tempGlobalPath, globalPath);\n } catch (error) {\n await fs.rm(tempGlobalPath, { recursive: true, force: true });\n try {\n await atomicSymlink(profileDir, globalPath);\n } catch (restoreError) {\n throw new Error(\n `Failed to restore original symlink after release error: ${restoreError instanceof Error ? restoreError.message : String(restoreError)}`\n );\n }\n throw error;\n }\n\n // Remove profile from managed content after successful release.\n await fs.rm(profileDir, { recursive: true, force: true });\n }\n\n // ============================================================================\n // Shared directory management\n // ============================================================================\n\n /**\n * Get the absolute path to a shared directory.\n */\n getSharedDirGlobalPath(name: string): string {\n const sharedDir = SHARED_DIRECTORIES[name];\n if (!sharedDir) {\n throw new Error(`Unknown shared directory: ${name}`);\n }\n return path.join(os.homedir(), sharedDir.globalPath);\n }\n\n /**\n * Get the content dir path for a shared directory.\n */\n getSharedDirContentPath(name: string): string {\n const sharedDir = SHARED_DIRECTORIES[name];\n if (!sharedDir) {\n throw new Error(`Unknown shared directory: ${name}`);\n }\n return path.join(this.contentDir, sharedDir.contentDirName);\n }\n\n /**\n * Check the state of a shared directory (same as getSymlinkStatus).\n */\n async getSharedDirStatus(name: string): Promise<SymlinkStatus> {\n const globalPath = this.getSharedDirGlobalPath(name);\n\n // Use lstat to check the path itself (doesn't follow symlinks)\n let stat;\n try {\n stat = await fs.lstat(globalPath);\n } catch {\n return 'missing';\n }\n\n // Not a symlink = real directory\n if (!stat.isSymbolicLink()) {\n return 'unmanaged';\n }\n\n // It's a symlink — check if target exists\n const target = await readSymlinkTarget(globalPath);\n if (!target) {\n return 'broken';\n }\n\n // Check if target actually exists (follow the symlink)\n try {\n await fs.access(globalPath);\n } catch {\n return 'broken';\n }\n\n // Resolve target to absolute path\n const absoluteTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(globalPath), target);\n\n // Check if target is in our content dir\n const contentDirAbs = path.resolve(this.contentDir);\n if (!absoluteTarget.startsWith(contentDirAbs + path.sep)) {\n return 'external';\n }\n\n return 'active';\n }\n\n /**\n * Adopt an existing shared directory.\n * Moves it to contentDir/<contentDirName> and creates a symlink back.\n */\n async adoptSharedDir(name: string): Promise<void> {\n const globalPath = this.getSharedDirGlobalPath(name);\n const contentPath = this.getSharedDirContentPath(name);\n const status = await this.getSharedDirStatus(name);\n\n if (status !== 'unmanaged') {\n throw new Error(\n `Cannot adopt shared dir '${name}': status is '${status}' (expected 'unmanaged')`\n );\n }\n\n // Check if content path already exists\n try {\n await fs.access(contentPath);\n throw new Error(`Cannot adopt: shared dir content already exists at ${contentPath}`);\n } catch (err) {\n if (err instanceof Error && 'code' in err && err.code === 'ENOENT') {\n // Good, doesn't exist\n } else {\n throw err;\n }\n }\n\n // Move the real directory to content location\n await moveDirectory(globalPath, contentPath);\n\n // Create symlink back\n await atomicSymlink(contentPath, globalPath);\n }\n\n /**\n * Unlink a managed shared directory.\n * Moves contents back to global location.\n */\n async unlinkSharedDir(name: string): Promise<void> {\n const globalPath = this.getSharedDirGlobalPath(name);\n const contentPath = this.getSharedDirContentPath(name);\n const status = await this.getSharedDirStatus(name);\n\n if (status !== 'active') {\n throw new Error(\n `Cannot unlink shared dir '${name}': status is '${status}' (expected 'active')`\n );\n }\n\n // Remove the symlink\n await fs.unlink(globalPath);\n\n // Move content back to global location\n await moveDirectory(contentPath, globalPath);\n }\n}\n","import fs from 'node:fs/promises';\nimport path from 'node:path';\nimport os from 'node:os';\nimport * as p from '@clack/prompts';\nimport color from 'picocolors';\nimport { ConfigManager } from './config.js';\nimport { SUPPORTED_TOOLS, SHARED_DIRECTORIES, BASE_PROFILE_SLUG } from '../types/index.js';\n\nfunction getDefaultConfigDir(): string {\n if (process.env.AGENTPROFILES_CONFIG_DIR) {\n return process.env.AGENTPROFILES_CONFIG_DIR;\n }\n return path.join(os.homedir(), '.config', 'agentprofiles');\n}\n\nfunction getConfigPath(): string {\n return path.join(getDefaultConfigDir(), 'config.json');\n}\n\nexport function expandTildePath(input: string): string {\n if (input === '~') {\n return os.homedir();\n }\n if (input.startsWith('~/')) {\n return path.join(os.homedir(), input.slice(2));\n }\n if (input.startsWith('~')) {\n return path.join(os.homedir(), input.slice(1));\n }\n return input;\n}\n\nexport async function isInitialized(): Promise<boolean> {\n try {\n await fs.access(getConfigPath());\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function runOnboarding(options: { isRerun?: boolean } = {}): Promise<boolean> {\n const config = new ConfigManager();\n\n if (options.isRerun) {\n p.intro(color.cyan('Re-running agentprofiles setup'));\n } else {\n p.intro(color.cyan('Welcome to agentprofiles!'));\n p.note(\n `This tool manages configuration profiles for LLM agent tools.\\n` +\n `Profiles are stored as symlinks to centralized directories.`,\n 'About'\n );\n }\n\n // Load existing config so getContentDir() reflects what's already configured.\n await config.init();\n\n const configDir = config.getConfigDir();\n p.log.info(`Config directory: ${color.dim(configDir)}`);\n\n const currentContentDir = config.getContentDir();\n\n const contentDirChoice = await p.text({\n message: 'Where should profile contents be stored?',\n placeholder: currentContentDir,\n defaultValue: currentContentDir,\n validate: (value) => {\n if (!value) return 'Please enter a directory path';\n if (!path.isAbsolute(value) && !value.startsWith('~')) {\n return 'Please enter an absolute path';\n }\n return undefined;\n },\n });\n\n if (p.isCancel(contentDirChoice)) {\n p.cancel('Setup cancelled.');\n return false;\n }\n\n let contentDir = contentDirChoice as string;\n contentDir = expandTildePath(contentDir);\n\n const spinner = p.spinner();\n spinner.start('Creating directories...');\n\n try {\n await config.ensureConfigDir();\n\n if (contentDir !== configDir) {\n await config.setContentDir(contentDir);\n await config.ensureConfigDir();\n }\n\n spinner.stop('Directories created');\n } catch (error) {\n spinner.stop('Failed to create directories');\n p.log.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n return false;\n }\n\n // Scan agents for adoption\n const adoptedAgents: string[] = [];\n for (const [agent, toolDef] of Object.entries(SUPPORTED_TOOLS)) {\n const status = await config.getSymlinkStatus(agent);\n\n if (status === 'unmanaged') {\n const globalPath = config.getGlobalConfigPath(agent);\n const shouldAdopt = await p.confirm({\n message: `Found existing ${toolDef.description} config at ${color.dim(globalPath)}. Adopt as _base profile?`,\n initialValue: true,\n });\n\n if (p.isCancel(shouldAdopt)) {\n p.cancel('Setup cancelled.');\n return false;\n }\n\n if (shouldAdopt === true) {\n try {\n await config.adoptExisting(agent, BASE_PROFILE_SLUG);\n\n // Verify adoption was successful\n const verified = await config.verifyAdoption(agent, BASE_PROFILE_SLUG);\n if (!verified) {\n p.log.warn(\n `Adoption of ${agent} may have failed verification. ` +\n `Please check that ${config.getGlobalConfigPath(agent)} is a symlink pointing to the correct profile.`\n );\n } else {\n adoptedAgents.push(agent);\n p.log.success(`Adopted ${toolDef.description} as _base profile`);\n }\n } catch (error) {\n const errorMsg = error instanceof Error ? error.message : String(error);\n\n if (errorMsg.includes('already exists')) {\n const replaceExisting = await p.confirm({\n message: `A _base profile already exists for ${toolDef.description}. Replace it with the current config?`,\n initialValue: false,\n });\n\n if (p.isCancel(replaceExisting)) {\n p.cancel('Setup cancelled.');\n return false;\n }\n\n if (replaceExisting === true) {\n try {\n await config.adoptExisting(agent, BASE_PROFILE_SLUG, { replaceExisting: true });\n const verified = await config.verifyAdoption(agent, BASE_PROFILE_SLUG);\n if (!verified) {\n p.log.warn(\n `Adoption of ${agent} may have failed verification. ` +\n `Please check that ${config.getGlobalConfigPath(agent)} is a symlink pointing to the correct profile.`\n );\n } else {\n adoptedAgents.push(agent);\n p.log.success(`Replaced and adopted ${toolDef.description} as _base profile`);\n }\n } catch (retryError) {\n p.log.error(\n `Failed to adopt ${agent}: ${retryError instanceof Error ? retryError.message : String(retryError)}`\n );\n }\n } else {\n p.log.info(`Skipped ${toolDef.description}`);\n }\n } else {\n p.log.error(`Failed to adopt ${agent}: ${errorMsg}`);\n }\n }\n }\n } else if (status === 'active') {\n p.log.info(`${toolDef.description} is already managed`);\n } else if (status === 'missing') {\n p.log.info(`${toolDef.description} not installed — skipping`);\n } else if (status === 'broken') {\n p.log.warn(\n `${toolDef.description} has a broken symlink at ${color.dim(config.getGlobalConfigPath(agent))}. Run ${color.cyan('agentprofiles doctor')} to repair.`\n );\n } else if (status === 'external') {\n p.log.warn(\n `${toolDef.description} symlink at ${color.dim(config.getGlobalConfigPath(agent))} points outside this content directory — skipping adoption.`\n );\n }\n }\n\n // Scan shared directories for adoption\n const adoptedSharedDirs: string[] = [];\n for (const [name, sharedDir] of Object.entries(SHARED_DIRECTORIES)) {\n const status = await config.getSharedDirStatus(name);\n\n if (status === 'unmanaged') {\n const globalPath = config.getSharedDirGlobalPath(name);\n const shouldAdopt = await p.confirm({\n message: `Found existing ${sharedDir.description} at ${color.dim(globalPath)}. Adopt?`,\n initialValue: true,\n });\n\n if (p.isCancel(shouldAdopt)) {\n p.cancel('Setup cancelled.');\n return false;\n }\n\n if (shouldAdopt === true) {\n try {\n await config.adoptSharedDir(name);\n\n // Verify adoption was successful\n const verified = (await config.getSharedDirStatus(name)) === 'active';\n if (!verified) {\n p.log.warn(\n `Adoption of ${name} may have failed verification. ` +\n `Please check that ${config.getSharedDirGlobalPath(name)} is a symlink pointing to the correct location.`\n );\n } else {\n adoptedSharedDirs.push(name);\n p.log.success(`Adopted ${sharedDir.description}`);\n }\n } catch (error) {\n p.log.error(\n `Failed to adopt ${name}: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n }\n } else if (status === 'active') {\n p.log.info(`${sharedDir.description} is already managed`);\n }\n }\n\n // Ensure every agent has a _base profile scaffold and apply known layout conventions.\n for (const agent of Object.keys(SUPPORTED_TOOLS)) {\n try {\n await config.ensureBaseProfileLayout(agent);\n } catch (error) {\n p.log.warn(\n `Could not finalize base profile layout for ${agent}: ${\n error instanceof Error ? error.message : String(error)\n }`\n );\n }\n }\n\n // Show summary\n let summary = color.green('Setup complete!');\n if (adoptedAgents.length > 0 || adoptedSharedDirs.length > 0) {\n summary += '\\n\\nAdopted:';\n for (const agent of adoptedAgents) {\n const toolDef = SUPPORTED_TOOLS[agent];\n if (toolDef) {\n summary += `\\n • ${toolDef.description} (_base profile)`;\n }\n }\n for (const name of adoptedSharedDirs) {\n const sharedDir = SHARED_DIRECTORIES[name];\n if (sharedDir) {\n summary += `\\n • ${sharedDir.description}`;\n }\n }\n }\n summary += `\\n\\nRun ${color.cyan('agentprofiles add <agent>')} to create additional profiles.`;\n\n p.outro(summary);\n return true;\n}\n\nexport async function ensureInitialized(): Promise<boolean> {\n if (await isInitialized()) {\n return true;\n }\n\n if (!process.stdout.isTTY) {\n console.error(color.red('agentprofiles is not initialized.'));\n console.error(`Run ${color.cyan('agentprofiles setup')} to set up.`);\n process.exit(1);\n }\n\n return runOnboarding();\n}\n","import { defineCommand } from 'citty';\nimport { ConfigManager } from '../lib/config.js';\nimport { SUPPORTED_TOOLS, SHARED_DIRECTORIES } from '../types/index.js';\nimport color from 'picocolors';\n\nexport async function statusCommand() {\n const config = new ConfigManager();\n await config.init();\n\n console.log(color.bold('\\n📊 Agent Profiles Status\\n'));\n\n // Show agent statuses\n console.log(color.bold('Agents:'));\n for (const [agentKey, agentDef] of Object.entries(SUPPORTED_TOOLS)) {\n const status = await config.getSymlinkStatus(agentKey);\n const activeProfile = await config.getActiveProfile(agentKey);\n\n let statusLine = ` ${color.bold(agentDef.description)} (${agentKey})`;\n\n if (status === 'active') {\n const displayName = activeProfile === '_base' ? 'Base profile' : activeProfile;\n statusLine += ` → ${color.cyan(displayName)}`;\n } else if (status === 'unmanaged') {\n statusLine += ` → ${color.dim('Not managed (run setup to adopt)')}`;\n } else if (status === 'missing') {\n statusLine += ` → ${color.dim('Not installed')}`;\n } else if (status === 'broken') {\n statusLine += ` → ${color.red('Broken symlink')}`;\n } else if (status === 'external') {\n statusLine += ` → ${color.yellow('Symlink points outside managed profiles')}`;\n }\n\n console.log(statusLine);\n }\n\n // Show shared directory statuses\n console.log(color.bold('\\nShared Directories:'));\n for (const [, sharedDir] of Object.entries(SHARED_DIRECTORIES)) {\n const status = await config.getSharedDirStatus(sharedDir.name);\n\n let statusLine = ` ${color.bold(sharedDir.description)} (${sharedDir.globalPath})`;\n\n if (status === 'active') {\n statusLine += ` → ${color.cyan('Managed')}`;\n } else if (status === 'unmanaged') {\n statusLine += ` → ${color.dim('Not managed')}`;\n } else if (status === 'missing') {\n statusLine += ` → ${color.dim('Not present')}`;\n } else if (status === 'broken') {\n statusLine += ` → ${color.red('Broken symlink')}`;\n } else if (status === 'external') {\n statusLine += ` → ${color.yellow('Symlink points outside managed location')}`;\n }\n\n console.log(statusLine);\n }\n\n console.log();\n}\n\nexport default defineCommand({\n meta: {\n name: 'status',\n description: 'Show agent profile status',\n },\n async run() {\n await statusCommand();\n },\n});\n","import { defineCommand } from 'citty';\nimport { log, note } from '@clack/prompts';\nimport { ConfigManager } from '../lib/config.js';\nimport { SUPPORTED_TOOLS, BASE_PROFILE_SLUG } from '../types/index.js';\nimport color from 'picocolors';\n\nexport async function listCommand(agent?: string) {\n const config = new ConfigManager();\n await config.init();\n\n if (agent && !SUPPORTED_TOOLS[agent]) {\n console.error(color.red(`Unsupported agent: ${agent}`));\n process.exit(1);\n }\n\n const configDir = config.getConfigDir();\n const contentDir = config.getContentDir();\n\n const configLines = [`Config: ${color.dim(configDir)}`];\n if (contentDir !== configDir) {\n configLines.push(`Content: ${color.dim(contentDir)}`);\n }\n log.info(configLines.join('\\n'));\n\n const agents = agent ? [agent] : Object.keys(SUPPORTED_TOOLS);\n\n for (const a of agents) {\n const profiles = await config.getProfiles(a);\n const activeProfile = await config.getActiveProfile(a);\n const tool = SUPPORTED_TOOLS[a];\n if (!tool) continue;\n\n // Filter out _base from the display list\n const displayProfiles = profiles.filter((p) => p.slug !== BASE_PROFILE_SLUG);\n\n if (displayProfiles.length === 0) {\n note(color.dim('No profiles found'), `${tool.description} Profiles`);\n } else {\n const lines = displayProfiles.map((p) => {\n let label = p.name !== p.slug ? `${p.name} (${p.slug})` : p.name;\n\n if (p.slug === activeProfile) {\n label = `● ${label}`;\n }\n\n if (p.description) {\n return `${color.cyan(label)} ${color.dim('-')} ${p.description}`;\n }\n return color.cyan(label);\n });\n\n // If active profile is _base, show an indicator at the end\n if (activeProfile === BASE_PROFILE_SLUG) {\n lines.push(`● ${color.dim('Base profile')}`);\n }\n\n note(lines.join('\\n'), `${tool.description} Profiles`);\n }\n }\n}\n\nexport default defineCommand({\n meta: {\n name: 'list',\n description: 'List available profiles',\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Filter by agent name',\n required: false,\n },\n },\n async run({ args }) {\n await listCommand(args.agent);\n },\n});\n","var p=[\"accommodating\",\"admirable\",\"adored\",\"adventurous\",\"affable\",\"affectionate\",\"agreeable\",\"alluring\",\"amiable\",\"amicable\",\"amusing\",\"appreciable\",\"appreciated\",\"appreciative\",\"attentive\",\"authentic\",\"balanced\",\"beautiful\",\"benevolent\",\"blessed\",\"blissful\",\"bounteous\",\"bountiful\",\"bright\",\"brilliant\",\"bubbly\",\"calm\",\"caring\",\"charitable\",\"charming\",\"cheerful\",\"cheery\",\"cherished\",\"comforting\",\"committed\",\"compassionate\",\"complimentary\",\"confident\",\"considerate\",\"content\",\"contented\",\"cordial\",\"courageous\",\"creative\",\"credible\",\"dedicated\",\"delighted\",\"delightful\",\"dependable\",\"determined\",\"devoted\",\"diligent\",\"dreamy\",\"eager\",\"earnest\",\"easygoing\",\"ebullient\",\"elated\",\"empowering\",\"encouraging\",\"endearing\",\"energetic\",\"engaging\",\"enthusiastic\",\"exciting\",\"exquisite\",\"extraordinary\",\"exuberant\",\"fabulous\",\"faithful\",\"fervent\",\"festive\",\"forgiving\",\"friendly\",\"funny\",\"generous\",\"gentle\",\"genuine\",\"giggling\",\"giving\",\"gleeful\",\"glowing\",\"good\",\"graceful\",\"gracious\",\"grateful\",\"gratified\",\"gratifying\",\"happy\",\"harmonious\",\"heartening\",\"heartfelt\",\"heartwarming\",\"helpful\",\"honest\",\"honorable\",\"hopeful\",\"hospitable\",\"humorous\",\"illuminating\",\"imaginative\",\"impartial\",\"inclusive\",\"innocent\",\"innovative\",\"inspiring\",\"invigorating\",\"inviting\",\"jolly\",\"jovial\",\"joyful\",\"joyfully\",\"joyous\",\"jubilant\",\"keen\",\"kind\",\"kindhearted\",\"kindly\",\"laughing\",\"liberating\",\"lighthearted\",\"likeable\",\"liked\",\"lively\",\"lovable\",\"lovely\",\"loving\",\"loyal\",\"lucid\",\"luminous\",\"magnanimous\",\"mellow\",\"merry\",\"mindful\",\"mirthful\",\"modest\",\"nice\",\"noble\",\"nourishing\",\"nurturing\",\"obliging\",\"open\",\"openhearted\",\"openminded\",\"optimistic\",\"outgoing\",\"passionate\",\"patient\",\"peaceful\",\"personable\",\"playful\",\"pleasant\",\"pleasing\",\"polite\",\"positive\",\"productive\",\"prosperous\",\"radiant\",\"reassuring\",\"refreshing\",\"rejoicing\",\"relaxed\",\"reliable\",\"resilient\",\"respectable\",\"respectful\",\"responsive\",\"revered\",\"reverent\",\"satisfied\",\"secure\",\"sensational\",\"sensitive\",\"serene\",\"sincere\",\"smiling\",\"sociable\",\"soft\",\"sparkling\",\"spirited\",\"stable\",\"sunny\",\"supportive\",\"sweet\",\"sympathetic\",\"tactful\",\"tenacious\",\"thankful\",\"thoughtful\",\"tolerant\",\"tranquil\",\"true\",\"trusting\",\"trustworthy\",\"truthful\",\"understanding\",\"unique\",\"unselfish\",\"untroubled\",\"upbeat\",\"uplifting\",\"valuable\",\"valued\",\"versatile\",\"vibrant\",\"vigorous\",\"virtuous\",\"vital\",\"vivacious\",\"warm\",\"warmhearted\",\"welcoming\",\"wholehearted\",\"wholesome\",\"willing\",\"winsome\",\"wise\",\"witty\",\"wonderful\",\"xenial\",\"yearning\",\"youthful\",\"yummy\",\"zealous\",\"zestful\",\"zesty\",\"zippy\"];var u=[\"aardvark\",\"albatross\",\"ant\",\"antelope\",\"ape\",\"armadillo\",\"badger\",\"bat\",\"bear\",\"bison\",\"bumblebee\",\"butterfly\",\"camel\",\"capybara\",\"caribou\",\"cassowary\",\"cat\",\"caterpillar\",\"cheetah\",\"chicken\",\"chimpanzee\",\"chinchilla\",\"chipmunk\",\"cougar\",\"cow\",\"coyote\",\"crab\",\"cricket\",\"crow\",\"deer\",\"dingo\",\"dog\",\"dolphin\",\"donkey\",\"dove\",\"duck\",\"eagle\",\"echidna\",\"elephant\",\"falcon\",\"ferret\",\"finch\",\"fish\",\"flamingo\",\"fly\",\"fox\",\"frog\",\"gazelle\",\"gerbil\",\"giraffe\",\"goat\",\"goldfish\",\"goose\",\"gorilla\",\"grasshopper\",\"hamster\",\"hare\",\"hedgehog\",\"heron\",\"hippopotamus\",\"horse\",\"hummingbird\",\"hyena\",\"iguana\",\"impala\",\"jackal\",\"jaguar\",\"jellyfish\",\"kangaroo\",\"kitten\",\"koala\",\"kudu\",\"ladybug\",\"leopard\",\"lion\",\"llama\",\"lobster\",\"locust\",\"lynx\",\"magpie\",\"marten\",\"meerkat\",\"mink\",\"mockingbird\",\"mole\",\"mongoose\",\"monkey\",\"moose\",\"mouse\",\"mynah\",\"narwhal\",\"newt\",\"nuthatch\",\"ocelot\",\"octopus\",\"opossum\",\"orangutan\",\"osprey\",\"ostrich\",\"otter\",\"owl\",\"ox\",\"oyster\",\"panda\",\"pangolin\",\"panther\",\"parakeet\",\"parrot\",\"peacock\",\"pelican\",\"penguin\",\"pheasant\",\"pig\",\"pigeon\",\"pika\",\"platypus\",\"plover\",\"polecat\",\"porcupine\",\"puffin\",\"quail\",\"quokka\",\"rabbit\",\"raccoon\",\"ragdoll\",\"ram\",\"rat\",\"raven\",\"reindeer\",\"rhea\",\"rhinoceros\",\"roo\",\"rooster\",\"saiga\",\"salamander\",\"sambar\",\"sandpiper\",\"sardine\",\"scorpion\",\"seahorse\",\"seal\",\"serval\",\"sheep\",\"shelduck\",\"shrew\",\"shrimp\",\"siskin\",\"skunk\",\"sloth\",\"snail\",\"snapper\",\"sora\",\"sparrow\",\"spoonbill\",\"squirrel\",\"starling\",\"stingray\",\"stork\",\"swan\",\"tadpole\",\"tamarin\",\"tanager\",\"tapir\",\"tarpon\",\"tarsier\",\"tetra\",\"thrush\",\"tiger\",\"toad\",\"toucan\",\"toucanet\",\"towhee\",\"trogon\",\"turaco\",\"turtle\",\"uakari\",\"umbrellabird\",\"urchin\",\"vaquita\",\"vicuna\",\"vireo\",\"vole\",\"vulture\",\"wagtail\",\"wallaby\",\"wallaroo\",\"walrus\",\"warthog\",\"waxwing\",\"whale\",\"whippet\",\"wilddog\",\"wildebeest\",\"wolf\",\"wolverine\",\"wombat\",\"woodpecker\",\"wrasse\",\"xerus\",\"yaffle\",\"yak\",\"zebra\",\"zebu\"];var m=[\"abacus\",\"acroterion\",\"aedicule\",\"aisle\",\"alcove\",\"ambulatory\",\"annex\",\"antechamber\",\"apse\",\"arcade\",\"arch\",\"architrave\",\"archivolt\",\"archway\",\"astragal\",\"atrium\",\"attic\",\"balcony\",\"baldachin\",\"baluster\",\"balustrade\",\"bargeboard\",\"baseboard\",\"basilica\",\"bay\",\"bead\",\"beam\",\"belfry\",\"belvedere\",\"billet\",\"blueprint\",\"bracket\",\"breezeway\",\"brise\",\"buttress\",\"campanile\",\"canopy\",\"cantilever\",\"capital\",\"cartouche\",\"caryatid\",\"casement\",\"casing\",\"castellated\",\"chamfer\",\"chevron\",\"chimney\",\"cladding\",\"clerestory\",\"cloister\",\"colonnade\",\"column\",\"console\",\"coping\",\"corbel\",\"cornice\",\"courtyard\",\"crenellation\",\"cresting\",\"crown\",\"cupola\",\"curtain\",\"cyma\",\"dado\",\"dais\",\"dentil\",\"dome\",\"domed\",\"doric\",\"dormer\",\"dripstone\",\"eaves\",\"echinus\",\"elevation\",\"ell\",\"engaged\",\"entablature\",\"entresol\",\"entryway\",\"facade\",\"fanlight\",\"fascia\",\"fenestration\",\"finial\",\"fluting\",\"foundation\",\"foyer\",\"fresco\",\"frieze\",\"gable\",\"gallery\",\"gargoyle\",\"grille\",\"hall\",\"hammerbeam\",\"hearth\",\"hip\",\"hyphen\",\"impost\",\"inglenook\",\"interior\",\"ionic\",\"jamb\",\"joist\",\"keystone\",\"lancet\",\"lantern\",\"lintel\",\"lobby\",\"loggia\",\"louver\",\"lunette\",\"mansard\",\"metope\",\"mezzanine\",\"minaret\",\"modillion\",\"molding\",\"mullion\",\"muntins\",\"narthex\",\"nave\",\"newel\",\"niche\",\"obelisk\",\"oculus\",\"ogee\",\"oriel\",\"parapet\",\"pavilion\",\"pedestal\",\"pediment\",\"pendentive\",\"pilaster\",\"pillar\",\"pinnacle\",\"plinth\",\"porte\",\"portico\",\"quatrefoil\",\"quoin\",\"rafter\",\"raking\",\"reredos\",\"reveal\",\"ridge\",\"riser\",\"roof\",\"rosette\",\"rotunda\",\"roundel\",\"sash\",\"sconce\",\"sill\",\"skylight\",\"soffit\",\"spandrel\",\"spire\",\"stanchion\",\"steeple\",\"stoa\",\"stucco\",\"stylobate\",\"terrace\",\"tracery\",\"transept\",\"transom\",\"tread\",\"trellis\",\"triforium\",\"triglyph\",\"truss\",\"turret\",\"tympanum\",\"undercroft\",\"vault\",\"veranda\",\"vestibule\",\"volute\",\"voussoir\",\"wainscot\",\"wall\",\"window\",\"ziggurat\"];var d=[\"abstract\",\"acanthus\",\"acrylic\",\"adornment\",\"aesthetic\",\"airbrush\",\"amphora\",\"animation\",\"antiquity\",\"applique\",\"aquarelle\",\"arabesque\",\"armature\",\"artifact\",\"artisan\",\"artistry\",\"artwork\",\"assemblage\",\"atelier\",\"balance\",\"baroque\",\"batik\",\"biennale\",\"blending\",\"bricolage\",\"brushstroke\",\"bust\",\"calligraphy\",\"cameo\",\"canvas\",\"carving\",\"casting\",\"ceramics\",\"charcoal\",\"chasing\",\"chiaroscuro\",\"chisel\",\"chromatic\",\"classical\",\"cloisonne\",\"collage\",\"composition\",\"connoisseur\",\"contour\",\"contrast\",\"craftsmanship\",\"crayon\",\"creativity\",\"critique\",\"cubism\",\"curator\",\"dada\",\"decorative\",\"decoupage\",\"design\",\"diorama\",\"diptych\",\"drapery\",\"drawing\",\"easel\",\"embellishment\",\"embossing\",\"enamel\",\"encaustic\",\"engraving\",\"ensemble\",\"etching\",\"expressionism\",\"fauvism\",\"filigree\",\"fine\",\"finesse\",\"firing\",\"folio\",\"foreshortening\",\"form\",\"gauche\",\"gesso\",\"gilding\",\"glyptic\",\"gouache\",\"graffiti\",\"harmony\",\"hatching\",\"hue\",\"iconography\",\"illustration\",\"impasto\",\"impressionism\",\"ink\",\"installation\",\"intaglio\",\"interpretation\",\"kiln\",\"kilnwork\",\"kinetic\",\"lacquer\",\"landscape\",\"linocut\",\"lithography\",\"luminism\",\"lyrical\",\"mannequin\",\"marbling\",\"masterpiece\",\"medallion\",\"medium\",\"memento\",\"miniature\",\"miniaturist\",\"mobile\",\"modernism\",\"mosaic\",\"mural\",\"museum\",\"naturalism\",\"neoclassicism\",\"neon\",\"nuance\",\"oil\",\"origami\",\"ornament\",\"painting\",\"palette\",\"pastel\",\"patina\",\"pencil\",\"pentimento\",\"perspective\",\"photography\",\"pictorial\",\"pigment\",\"plaster\",\"pointillism\",\"polychrome\",\"portfolio\",\"portrait\",\"print\",\"proportion\",\"provenance\",\"relief\",\"renaissance\",\"rendering\",\"replica\",\"representation\",\"restoration\",\"retrospective\",\"rococo\",\"romanticism\",\"salon\",\"sanguine\",\"saturation\",\"sculpture\",\"sepia\",\"serif\",\"sfumato\",\"sgraffito\",\"shade\",\"shadow\",\"silhouette\",\"simulacrum\",\"sketch\",\"stencil\",\"stippling\",\"stoneware\",\"studio\",\"study\",\"surrealism\",\"symmetry\",\"tableau\",\"technique\",\"tempera\",\"tessellation\",\"texture\",\"tint\",\"triptych\",\"typography\",\"underpainting\",\"varnish\",\"vernissage\",\"virtuoso\",\"visionary\",\"visual\",\"watercolor\",\"weaving\",\"woodcut\"];var h=[\"alabaster\",\"amber\",\"aqua\",\"auburn\",\"azure\",\"beige\",\"bisque\",\"black\",\"blonde\",\"blue\",\"blush\",\"bone\",\"bordeaux\",\"brick\",\"brown\",\"buff\",\"burgundy\",\"cadet\",\"canary\",\"cappuccino\",\"cardinal\",\"carmine\",\"carnelian\",\"celadon\",\"cerulean\",\"champagne\",\"chartreuse\",\"claret\",\"cobalt\",\"cognac\",\"copper\",\"cornflower\",\"crimson\",\"cyan\",\"daffodil\",\"ebony\",\"ecru\",\"eggshell\",\"electric\",\"espresso\",\"fawn\",\"flax\",\"fuchsia\",\"glaucous\",\"gold\",\"goldenrod\",\"graphite\",\"gray\",\"green\",\"gunmetal\",\"heliotrope\",\"hunter\",\"indigo\",\"ivory\",\"jade\",\"jasper\",\"khaki\",\"lapis\",\"lava\",\"magenta\",\"mahogany\",\"maize\",\"malachite\",\"mandarin\",\"maroon\",\"mauve\",\"midnight\",\"mocha\",\"mulberry\",\"navy\",\"obsidian\",\"ochre\",\"onyx\",\"paprika\",\"pearl\",\"periwinkle\",\"pewter\",\"pink\",\"platinum\",\"powder\",\"puce\",\"purple\",\"red\",\"rosewood\",\"ruby\",\"russet\",\"rust\",\"sable\",\"saffron\",\"sangria\",\"scarlet\",\"seafoam\",\"sienna\",\"silver\",\"slate\",\"smoke\",\"snow\",\"steel\",\"tan\",\"taupe\",\"tawny\",\"teal\",\"terracotta\",\"titanium\",\"turquoise\",\"ultramarine\",\"umber\",\"verdigris\",\"vermilion\",\"viridian\",\"white\",\"yellow\",\"zinc\",\"zircon\"];var g=[\"acceptance\",\"admiration\",\"adoration\",\"affection\",\"agitation\",\"agony\",\"alarm\",\"amazement\",\"amusement\",\"anger\",\"anguish\",\"anticipation\",\"anxiety\",\"apathy\",\"apprehension\",\"astonishment\",\"awe\",\"bashfulness\",\"belonging\",\"bewilderment\",\"bitterness\",\"bliss\",\"boredom\",\"caution\",\"cheerfulness\",\"compassion\",\"concern\",\"confidence\",\"confusion\",\"contempt\",\"contentment\",\"courage\",\"craving\",\"curiosity\",\"cynicism\",\"defensiveness\",\"defiance\",\"delight\",\"denial\",\"depression\",\"despair\",\"desperation\",\"determination\",\"devastation\",\"disappointment\",\"disbelief\",\"discomfort\",\"discontent\",\"discouragement\",\"disdain\",\"disgust\",\"disillusionment\",\"dismay\",\"displeasure\",\"distraction\",\"distress\",\"distrust\",\"doom\",\"doubt\",\"dread\",\"eagerness\",\"elation\",\"embarrassment\",\"empathy\",\"emptiness\",\"enchantment\",\"enjoyment\",\"enlightenment\",\"enthusiasm\",\"envy\",\"euphoria\",\"exasperation\",\"excitement\",\"exhaustion\",\"exhilaration\",\"expectation\",\"fascination\",\"fatigue\",\"fear\",\"ferocity\",\"fondness\",\"fright\",\"frustration\",\"fulfillment\",\"fury\",\"gladness\",\"glee\",\"gloom\",\"glumness\",\"gratification\",\"gratitude\",\"greed\",\"grief\",\"grouchiness\",\"grumpiness\",\"guilt\",\"happiness\",\"hatred\",\"heartache\",\"helplessness\",\"hesitation\",\"homesickness\",\"hope\",\"hopelessness\",\"horror\",\"hostility\",\"humiliation\",\"hurt\",\"hysteria\",\"impatience\",\"indifference\",\"indignation\",\"infatuation\",\"insecurity\",\"inspiration\",\"interest\",\"intimidation\",\"intoxication\",\"irritability\",\"irritation\",\"isolation\",\"jealousy\",\"joy\",\"jubilation\",\"kindness\",\"loneliness\",\"longing\",\"loathing\",\"love\",\"melancholy\",\"misery\",\"mortification\",\"negativity\",\"nervousness\",\"numbness\",\"obsession\",\"optimism\",\"outrage\",\"overwhelm\",\"panic\",\"paranoia\",\"patience\",\"peace\",\"pensiveness\",\"perplexity\",\"pessimism\",\"pity\",\"positivity\",\"powerlessness\",\"pride\",\"puzzlement\",\"rage\",\"rapture\",\"reassurance\",\"regret\",\"rejection\",\"relaxation\",\"reluctance\",\"remorse\",\"resentment\",\"resignation\",\"restlessness\",\"reverence\",\"revulsion\",\"sadness\",\"satisfaction\",\"scorn\",\"security\",\"selfpity\",\"serenity\",\"shame\",\"shock\",\"shyness\",\"skepticism\",\"solidarity\",\"sorrow\",\"spite\",\"stubbornness\",\"suffering\",\"sullenness\",\"surprise\",\"suspicion\",\"sympathy\",\"tenderness\",\"tension\",\"terror\",\"thankfulness\",\"thrill\",\"torment\",\"tranquility\",\"triumph\",\"uncertainty\",\"unease\",\"unhappiness\",\"valor\",\"vengeance\",\"vexation\",\"vigilance\",\"vulnerability\",\"warmth\",\"wariness\",\"weariness\",\"wonder\",\"worry\",\"worthlessness\",\"wrath\",\"zeal\",\"zest\"];var b=[\"accessory\",\"apparel\",\"asymmetrical\",\"attire\",\"ballet\",\"bandana\",\"beaded\",\"belt\",\"bespoke\",\"blazer\",\"blouse\",\"bodysuit\",\"boho\",\"bolero\",\"boots\",\"boutique\",\"bracelet\",\"brocade\",\"brooch\",\"button\",\"cape\",\"capri\",\"cardigan\",\"cashmere\",\"casual\",\"chic\",\"chiffon\",\"classic\",\"cloche\",\"clutch\",\"cocktail\",\"collar\",\"collection\",\"corduroy\",\"cotton\",\"couture\",\"cravat\",\"cuff\",\"culottes\",\"dapper\",\"denim\",\"drape\",\"dress\",\"earrings\",\"edgy\",\"elegant\",\"embroidery\",\"empire\",\"epaulette\",\"eyelet\",\"fabric\",\"fashion\",\"faux\",\"fedora\",\"fitted\",\"flair\",\"flannel\",\"flapper\",\"floral\",\"formal\",\"fringe\",\"fur\",\"garment\",\"garter\",\"glamorous\",\"gloves\",\"gown\",\"halter\",\"handbag\",\"haute\",\"headband\",\"heel\",\"hemline\",\"iridescent\",\"jacket\",\"jewelry\",\"jumpsuit\",\"kaftan\",\"kimono\",\"knit\",\"lace\",\"lapel\",\"leather\",\"linen\",\"loafers\",\"luxurious\",\"material\",\"merino\",\"moccasin\",\"modern\",\"mule\",\"necklace\",\"outfit\",\"oxford\",\"palazzo\",\"pants\",\"pashmina\",\"patent\",\"pattern\",\"pearls\",\"peplum\",\"plaid\",\"platform\",\"pleat\",\"pleated\",\"pocket\",\"poncho\",\"preppy\",\"puff\",\"pumps\",\"purse\",\"quilted\",\"retro\",\"robe\",\"ruched\",\"ruffle\",\"sandals\",\"sartorial\",\"satin\",\"scarf\",\"seamstress\",\"sequin\",\"shawl\",\"sheath\",\"shift\",\"shirt\",\"shoes\",\"shorts\",\"silk\",\"skirt\",\"sleek\",\"sleeve\",\"slippers\",\"sneakers\",\"socks\",\"sophisticated\",\"stiletto\",\"stole\",\"strappy\",\"striped\",\"stylish\",\"suede\",\"suit\",\"sundress\",\"sunglasses\",\"sweater\",\"taffeta\",\"textile\",\"tiara\",\"tie\",\"tote\",\"trend\",\"trim\",\"trousers\",\"tulle\",\"tunic\",\"turtleneck\",\"tweed\",\"uniform\",\"velvet\",\"vest\",\"vintage\",\"vogue\",\"wardrobe\",\"watch\",\"wedge\",\"wool\",\"woven\",\"wrap\"];var y=[\"almond\",\"apple\",\"apricot\",\"artichoke\",\"asparagus\",\"avocado\",\"bacon\",\"bagel\",\"barley\",\"basil\",\"bean\",\"beef\",\"beet\",\"berry\",\"biscuit\",\"blueberry\",\"bread\",\"broccoli\",\"brusselsprout\",\"bun\",\"butter\",\"cabbage\",\"cake\",\"candy\",\"cantaloupe\",\"caramel\",\"carrot\",\"cashew\",\"cauliflower\",\"caviar\",\"celery\",\"cheese\",\"chickpea\",\"chili\",\"chocolate\",\"chutney\",\"cider\",\"cinnamon\",\"citrus\",\"clam\",\"cocoa\",\"coconut\",\"coffee\",\"cookie\",\"corn\",\"cranberry\",\"cupcake\",\"currant\",\"curry\",\"date\",\"dill\",\"doughnut\",\"egg\",\"eggplant\",\"endive\",\"fennel\",\"fig\",\"flour\",\"garlic\",\"gelatin\",\"ginger\",\"grape\",\"grapefruit\",\"gravy\",\"greenbean\",\"guava\",\"halibut\",\"ham\",\"hamburger\",\"hazelnut\",\"honey\",\"honeydew\",\"horseradish\",\"iceberg\",\"jalapeno\",\"jam\",\"jelly\",\"kale\",\"ketchup\",\"kiwi\",\"lamb\",\"leek\",\"lemon\",\"lentil\",\"lettuce\",\"lime\",\"lychee\",\"macadamia\",\"macaroni\",\"mango\",\"maple\",\"margarine\",\"mayonnaise\",\"milk\",\"mint\",\"molasses\",\"muffin\",\"mushroom\",\"mustard\",\"nectarine\",\"noodle\",\"nutmeg\",\"oat\",\"olive\",\"onion\",\"orange\",\"oregano\",\"pancake\",\"papaya\",\"parsley\",\"parsnip\",\"pasta\",\"peach\",\"peanut\",\"pear\",\"pecan\",\"pepper\",\"persimmon\",\"pickle\",\"pie\",\"pineapple\",\"pistachio\",\"plum\",\"pomegranate\",\"popcorn\",\"pork\",\"potato\",\"pretzel\",\"prune\",\"pudding\",\"pumpkin\",\"quince\",\"radicchio\",\"radish\",\"raisin\",\"raspberry\",\"ravioli\",\"relish\",\"rhubarb\",\"rice\",\"rosemary\",\"rye\",\"sage\",\"salad\",\"salami\",\"salmon\",\"salsa\",\"salt\",\"sandwich\",\"scallop\",\"seaweed\",\"slaw\",\"sorbet\",\"soy\",\"spaghetti\",\"spinach\",\"squash\",\"steak\",\"strawberry\",\"sundae\",\"sushi\",\"taco\",\"tangerine\",\"tart\",\"tea\",\"thyme\",\"toast\",\"tomato\",\"trout\",\"tuna\",\"turkey\",\"turnip\",\"vanilla\",\"veal\",\"venison\",\"vinegar\",\"waffle\",\"walnut\",\"watercress\",\"watermelon\",\"wheat\",\"whipped\",\"wine\",\"yam\",\"yogurt\",\"zucchini\"];var f=[\"academia\",\"accomplishment\",\"achievement\",\"advancement\",\"ancestor\",\"ancient\",\"anthropology\",\"antiquarian\",\"antique\",\"archaeology\",\"archive\",\"aristocracy\",\"bronze\",\"bygone\",\"calendar\",\"cartography\",\"castle\",\"cathedral\",\"century\",\"ceremony\",\"chronicle\",\"chronographer\",\"citadel\",\"civilization\",\"coins\",\"commemoration\",\"compilation\",\"conquest\",\"conservation\",\"coronation\",\"culture\",\"cuneiform\",\"customs\",\"decade\",\"decree\",\"deeds\",\"diplomacy\",\"discovery\",\"document\",\"dynasty\",\"edict\",\"encyclopedia\",\"eon\",\"epoch\",\"era\",\"events\",\"excavation\",\"exhibit\",\"expedition\",\"exploration\",\"feudal\",\"fossil\",\"founder\",\"genealogy\",\"generation\",\"golden\",\"governance\",\"heraldry\",\"heritage\",\"hieratic\",\"hieroglyphs\",\"history\",\"imperial\",\"inscription\",\"institute\",\"invention\",\"journal\",\"kingdom\",\"knowledge\",\"landmark\",\"legacy\",\"lineage\",\"lore\",\"medieval\",\"memorabilia\",\"memorial\",\"memories\",\"methodology\",\"migration\",\"millennium\",\"monarchy\",\"monastery\",\"monument\",\"mummy\",\"mythology\",\"nation\",\"nobility\",\"nostalgia\",\"origin\",\"palace\",\"paleography\",\"paleontology\",\"papyrus\",\"parchment\",\"past\",\"patriarch\",\"periodization\",\"pharaoh\",\"pilgrimage\",\"prehistoric\",\"preservation\",\"primary\",\"progeny\",\"progress\",\"pyramid\",\"realm\",\"reconstruction\",\"record\",\"reign\",\"relic\",\"remembrance\",\"repository\",\"research\",\"revolution\",\"royal\",\"ruins\",\"scholar\",\"scroll\",\"secondary\",\"settlement\",\"society\",\"stone\",\"storytelling\",\"tapestry\",\"temple\",\"throne\",\"timeline\",\"tradition\",\"treaty\",\"university\",\"vellum\"];var v=[\"allegory\",\"alliteration\",\"allusion\",\"almanac\",\"analogy\",\"anecdote\",\"annotation\",\"antagonist\",\"anthology\",\"antihero\",\"aphorism\",\"appendix\",\"archetype\",\"assonance\",\"autobiography\",\"ballad\",\"bibliography\",\"bildungsroman\",\"biography\",\"blurb\",\"bookmark\",\"canon\",\"canto\",\"caricature\",\"catharsis\",\"chapter\",\"characterization\",\"chronology\",\"cliche\",\"codex\",\"comedy\",\"commentary\",\"conflict\",\"connotation\",\"consonance\",\"couplet\",\"dedication\",\"denouement\",\"deus\",\"dialect\",\"dialogue\",\"diary\",\"diction\",\"didactic\",\"drama\",\"dramatis\",\"dystopia\",\"editorial\",\"elegy\",\"ellipsis\",\"enigma\",\"enjambment\",\"epilogue\",\"epiphany\",\"epistolary\",\"epitaph\",\"epithet\",\"essay\",\"euphemism\",\"excerpt\",\"exposition\",\"fable\",\"fairytale\",\"fantasy\",\"farce\",\"fiction\",\"figurative\",\"flashback\",\"flashforward\",\"foil\",\"folklore\",\"footnote\",\"foreshadowing\",\"foreword\",\"frame\",\"genre\",\"glossary\",\"haiku\",\"hardcover\",\"heroine\",\"hubris\",\"hyperbole\",\"idiom\",\"imagery\",\"index\",\"intertextuality\",\"introduction\",\"invective\",\"irony\",\"jargon\",\"juxtaposition\",\"legend\",\"leitmotif\",\"libretto\",\"limerick\",\"literary\",\"literature\",\"litotes\",\"lyric\",\"manuscript\",\"memoir\",\"metaphor\",\"meter\",\"metonymy\",\"monograph\",\"monologue\",\"mood\",\"motif\",\"mystery\",\"narration\",\"narrative\",\"narrator\",\"nonfiction\",\"novella\",\"ode\",\"omniscient\",\"onomatopoeia\",\"opus\",\"oxymoron\",\"parable\",\"paradox\",\"paragraph\",\"parody\",\"passage\",\"pastiche\",\"pastoral\",\"pathetic\",\"pentameter\",\"persona\",\"personification\",\"plot\",\"poem\",\"poetics\",\"poetry\",\"point\",\"postscript\",\"preface\",\"premise\",\"prologue\",\"propaganda\",\"prose\",\"protagonist\",\"pseudonym\",\"publisher\",\"quatrain\",\"quest\",\"quotation\",\"reader\",\"realism\",\"refrain\",\"resolution\",\"rhetoric\",\"rhyme\",\"rhythm\",\"romance\",\"saga\",\"sarcasm\",\"satire\",\"scene\",\"scribe\",\"sequel\",\"serial\",\"setting\",\"simile\",\"soliloquy\",\"sonnet\",\"stanza\",\"storyline\",\"stream\",\"structure\",\"style\",\"subplot\",\"subtext\",\"summary\",\"suspense\",\"symbol\",\"symbolism\",\"synopsis\",\"syntax\",\"tale\",\"tanka\",\"text\",\"theme\",\"thesis\",\"thriller\",\"title\",\"tome\",\"tone\",\"tragedy\",\"trope\",\"understatement\",\"utopia\",\"verse\",\"vignette\",\"villain\",\"voice\",\"wordplay\"];var k=[\"accordion\",\"acoustic\",\"adagio\",\"allegro\",\"alto\",\"amplifier\",\"andante\",\"anthem\",\"aria\",\"arpeggio\",\"arrangement\",\"band\",\"banjo\",\"baritone\",\"bass\",\"bassoon\",\"baton\",\"beat\",\"bell\",\"blues\",\"bongo\",\"brass\",\"cadence\",\"cantata\",\"capriccio\",\"cello\",\"chimes\",\"chorale\",\"chord\",\"chorus\",\"clarinet\",\"clef\",\"coda\",\"composer\",\"concert\",\"concerto\",\"conductor\",\"counterpoint\",\"crescendo\",\"cymbal\",\"decrescendo\",\"ditty\",\"drum\",\"duet\",\"dynamics\",\"etude\",\"euphonium\",\"falsetto\",\"fanfare\",\"fermata\",\"fiddler\",\"flute\",\"folk\",\"forte\",\"fortissimo\",\"fretboard\",\"fugue\",\"glissando\",\"glockenspiel\",\"gospel\",\"groove\",\"guitar\",\"harmonica\",\"harmonics\",\"harp\",\"harpsichord\",\"horn\",\"hymn\",\"improvisation\",\"instrument\",\"interlude\",\"interval\",\"jazz\",\"jingle\",\"key\",\"keyboard\",\"legato\",\"lullaby\",\"lute\",\"madrigal\",\"maestro\",\"major\",\"mandolin\",\"march\",\"measure\",\"melody\",\"metronome\",\"microphone\",\"minuet\",\"musical\",\"musicianship\",\"nocturne\",\"oboe\",\"octave\",\"opera\",\"oratorio\",\"orchestra\",\"orchestration\",\"organ\",\"ostinato\",\"overture\",\"panpipes\",\"percussion\",\"piano\",\"piccolo\",\"pitch\",\"pizzicato\",\"polka\",\"prelude\",\"quartet\",\"quintet\",\"recital\",\"recorder\",\"requiem\",\"rhapsody\",\"riff\",\"rondo\",\"samba\",\"scale\",\"score\",\"serenade\",\"sharp\",\"singer\",\"solfege\",\"solo\",\"sonata\",\"song\",\"sonorous\",\"soprano\",\"staccato\",\"staff\",\"strings\",\"suite\",\"symphony\",\"syncopation\",\"tambourine\",\"tango\",\"tempo\",\"tenor\",\"timbre\",\"tonality\",\"treble\",\"triad\",\"trill\",\"trio\",\"trombone\",\"trumpet\",\"tune\",\"tuner\",\"ukulele\",\"unison\",\"variation\",\"vibrato\",\"viola\",\"violin\",\"vivace\",\"vocalise\",\"waltz\",\"woodwind\",\"xylophone\",\"yodel\",\"zither\"];var w=[\"achilles\",\"aeolus\",\"aesculapius\",\"aether\",\"agamemnon\",\"ajax\",\"amalthea\",\"ambrosia\",\"amphitrite\",\"andromeda\",\"antaeus\",\"antigone\",\"apollo\",\"aquilo\",\"ares\",\"argo\",\"argus\",\"ariadne\",\"artemis\",\"asclepius\",\"athena\",\"atlas\",\"atropos\",\"aurora\",\"bacchus\",\"bellerophon\",\"bellona\",\"boreas\",\"briseis\",\"cadmus\",\"calliope\",\"calypso\",\"cassandra\",\"cassiopeia\",\"castor\",\"centaurs\",\"cerberus\",\"ceres\",\"chaos\",\"charon\",\"charybdis\",\"chimera\",\"clio\",\"clotho\",\"cupid\",\"cybele\",\"cynthia\",\"daedalus\",\"daphne\",\"diana\",\"dido\",\"diomedes\",\"dionysus\",\"dryads\",\"egeria\",\"electra\",\"elysium\",\"endymion\",\"eos\",\"eris\",\"europa\",\"eurydice\",\"euterpe\",\"fates\",\"faunus\",\"flora\",\"fortuna\",\"gaea\",\"galatea\",\"ganymede\",\"gorgons\",\"graces\",\"griffin\",\"hector\",\"helios\",\"hephaestus\",\"hera\",\"hercules\",\"hermes\",\"hero\",\"hestia\",\"hydra\",\"hyperion\",\"icarus\",\"io\",\"iris\",\"janus\",\"jason\",\"juno\",\"jupiter\",\"lachesis\",\"leda\",\"leto\",\"liber\",\"maenads\",\"mars\",\"medea\",\"medusa\",\"melampus\",\"memnon\",\"mercury\",\"midas\",\"minerva\",\"minos\",\"minotaur\",\"moirae\",\"momus\",\"morpheus\",\"muses\",\"nemesis\",\"neptune\",\"nereus\",\"nike\",\"nymphs\",\"odysseus\",\"olympus\",\"orion\",\"orpheus\",\"pallas\",\"pan\",\"pandora\",\"paris\",\"pegasus\",\"penelope\",\"persephone\",\"perseus\",\"phaedra\",\"phaeton\",\"phoebe\",\"phoenix\",\"pluto\",\"pollux\",\"polyphemus\",\"poseidon\",\"priam\",\"prometheus\",\"proserpina\",\"proteus\",\"psyche\",\"pygmalion\",\"python\",\"romulus\",\"saturn\",\"scylla\",\"selene\",\"sibyl\",\"silenus\",\"sol\",\"sphinx\",\"styx\",\"tartarus\",\"terpsichore\",\"theseus\",\"thetis\",\"thisbe\",\"tiresias\",\"titan\",\"triton\",\"troy\",\"venus\",\"vesta\",\"vulcan\",\"zephyr\",\"zeus\"];var x=[\"acacia\",\"acorn\",\"alder\",\"alpine\",\"amaryllis\",\"amethyst\",\"anemone\",\"aquamarine\",\"arboretum\",\"aspen\",\"autumn\",\"avalanche\",\"azalea\",\"bamboo\",\"banyan\",\"baobab\",\"bark\",\"basalt\",\"beach\",\"beech\",\"birch\",\"blossom\",\"bluff\",\"bog\",\"boulder\",\"bracken\",\"branch\",\"breeze\",\"briar\",\"brook\",\"buckeye\",\"bud\",\"butte\",\"cactus\",\"camellia\",\"canyon\",\"carnation\",\"cascade\",\"cave\",\"cedar\",\"chamomile\",\"chestnut\",\"chrysanthemum\",\"citrine\",\"cliff\",\"cloud\",\"clover\",\"coast\",\"conifer\",\"coral\",\"cove\",\"creek\",\"crystal\",\"cypress\",\"dahlia\",\"dandelion\",\"dawn\",\"delta\",\"desert\",\"dew\",\"driftwood\",\"dune\",\"earth\",\"eclipse\",\"ecosystem\",\"elm\",\"emerald\",\"eucalyptus\",\"everglades\",\"evergreen\",\"fern\",\"firefly\",\"fjord\",\"flint\",\"flower\",\"fog\",\"foothill\",\"forest\",\"galaxy\",\"garden\",\"geyser\",\"ginkgo\",\"glacier\",\"glade\",\"gorge\",\"granite\",\"grass\",\"grotto\",\"grove\",\"harbor\",\"harvest\",\"haze\",\"hazel\",\"heath\",\"heather\",\"hemlock\",\"hibiscus\",\"hill\",\"holly\",\"honeysuckle\",\"horizon\",\"hyacinth\",\"island\",\"ivy\",\"jasmine\",\"jungle\",\"juniper\",\"kelp\",\"lagoon\",\"lake\",\"lavender\",\"leaf\",\"lichen\",\"lighthouse\",\"lilac\",\"lily\",\"lotus\",\"magnolia\",\"mangrove\",\"marigold\",\"marsh\",\"meadow\",\"meteor\",\"mimosa\",\"mist\",\"monsoon\",\"moon\",\"moonstone\",\"moss\",\"mountain\",\"nest\",\"oak\",\"oasis\",\"ocean\",\"opal\",\"orchard\",\"orchid\",\"palm\",\"pampas\",\"pebble\",\"peony\",\"petal\",\"phlox\",\"pine\",\"planet\",\"plateau\",\"pond\",\"poppy\",\"prairie\",\"primrose\",\"quartz\",\"rainbow\",\"raindrop\",\"rainforest\",\"redwood\",\"reef\",\"rhododendron\",\"river\",\"rock\",\"rose\",\"sand\",\"sapphire\",\"savanna\",\"sea\",\"seashell\",\"seed\",\"sequoia\",\"shore\",\"sky\",\"snapdragon\",\"snowdrop\",\"snowflake\",\"spring\",\"sprout\",\"spruce\",\"star\",\"steppe\",\"summit\",\"sun\",\"sunbeam\",\"sunflower\",\"sunrise\",\"sunset\",\"sycamore\",\"taiga\",\"thistle\",\"tide\",\"topaz\",\"tree\",\"tulip\",\"tundra\",\"valley\",\"violet\",\"volcano\",\"waterfall\",\"wave\",\"willow\",\"wind\",\"wisteria\",\"woodland\",\"yucca\",\"zinnia\"];var j=[\"accountant\",\"acrobat\",\"actuary\",\"administrator\",\"advisor\",\"advocate\",\"agronomist\",\"analyst\",\"animator\",\"anthropologist\",\"appraiser\",\"apprentice\",\"arbitrator\",\"archaeologist\",\"architect\",\"archivist\",\"astronomer\",\"attorney\",\"auctioneer\",\"auditor\",\"author\",\"baker\",\"banker\",\"barber\",\"barista\",\"bartender\",\"biologist\",\"blacksmith\",\"blogger\",\"bookkeeper\",\"botanist\",\"brewer\",\"broadcaster\",\"broker\",\"builder\",\"butcher\",\"buyer\",\"cabinetmaker\",\"calligrapher\",\"caregiver\",\"carpenter\",\"cartographer\",\"cashier\",\"caterer\",\"chemist\",\"chiropractor\",\"cinematographer\",\"clerk\",\"cobbler\",\"columnist\",\"comedian\",\"commissioner\",\"consultant\",\"contractor\",\"copywriter\",\"coroner\",\"correspondent\",\"counselor\",\"courier\",\"craftsman\",\"critic\",\"cryptographer\",\"custodian\",\"dancer\",\"dealer\",\"dentist\",\"dermatologist\",\"designer\",\"detective\",\"developer\",\"dietitian\",\"diplomat\",\"director\",\"dispatcher\",\"diver\",\"doctor\",\"doorman\",\"drafter\",\"dramatist\",\"driver\",\"ecologist\",\"economist\",\"editor\",\"educator\",\"electrician\",\"embalmer\",\"engineer\",\"engraver\",\"entrepreneur\",\"epidemiologist\",\"essayist\",\"estimator\",\"ethnographer\",\"evangelist\",\"examiner\",\"executive\",\"explorer\",\"exporter\",\"fabricator\",\"facilitator\",\"farmer\",\"financier\",\"firefighter\",\"fisherman\",\"florist\",\"foreman\",\"forester\",\"fundraiser\",\"gamekeeper\",\"gardener\",\"gemologist\",\"geneticist\",\"geographer\",\"geologist\",\"glazier\",\"goldsmith\",\"governor\",\"grocer\",\"groundskeeper\",\"guide\",\"hairdresser\",\"handyman\",\"herbalist\",\"historian\",\"host\",\"housekeeper\",\"illustrator\",\"importer\",\"inspector\",\"instructor\",\"interpreter\",\"interviewer\",\"inventor\",\"investigator\",\"ironworker\",\"jeweler\",\"journalist\",\"judge\",\"laborer\",\"landscaper\",\"lawyer\",\"lecturer\",\"librarian\",\"lifeguard\",\"linguist\",\"lithographer\",\"lobbyist\",\"locksmith\",\"machinist\",\"magician\",\"magistrate\",\"manager\",\"manufacturer\",\"marketer\",\"mason\",\"mathematician\",\"mechanic\",\"mediator\",\"meteorologist\",\"midwife\",\"milliner\",\"miner\",\"minister\",\"model\",\"mortician\",\"musician\",\"nanny\",\"navigator\",\"negotiator\",\"neurologist\",\"notary\",\"novelist\",\"nurse\",\"nutritionist\",\"obstetrician\",\"oceanographer\",\"oncologist\",\"operator\",\"ophthalmologist\",\"optician\",\"optometrist\",\"orator\",\"ornithologist\",\"orthodontist\",\"painter\",\"paleontologist\",\"paralegal\",\"paramedic\",\"pathologist\",\"pediatrician\",\"perfumer\",\"pharmacist\",\"philosopher\",\"photographer\",\"physician\",\"physicist\",\"physiotherapist\",\"pilot\",\"plasterer\",\"playwright\",\"plumber\",\"podiatrist\",\"poet\",\"politician\",\"porter\",\"potter\",\"preacher\",\"principal\",\"printer\",\"producer\",\"professor\",\"programmer\",\"promoter\",\"proofreader\",\"prosecutor\",\"prosthetist\",\"psychiatrist\",\"psychologist\",\"publicist\",\"puppeteer\",\"rabbi\",\"radiologist\",\"rancher\",\"realtor\",\"receptionist\",\"recruiter\",\"registrar\",\"reporter\",\"researcher\",\"retailer\",\"roofer\",\"sailor\",\"salesperson\",\"sanitarian\",\"scientist\",\"screenwriter\",\"sculptor\",\"secretary\",\"senator\",\"server\",\"shepherd\",\"sheriff\",\"sociologist\",\"soldier\",\"sommelier\",\"speechwriter\",\"spokesperson\",\"statistician\",\"stockbroker\",\"stonemason\",\"strategist\",\"stylist\",\"superintendent\",\"supervisor\",\"supplier\",\"surgeon\",\"surveyor\",\"tailor\",\"taxidermist\",\"teacher\",\"technician\",\"therapist\",\"tiler\",\"toxicologist\",\"trader\",\"translator\",\"treasurer\",\"tutor\",\"typist\",\"underwriter\",\"upholsterer\",\"urologist\",\"usher\",\"valet\",\"vendor\",\"veterinarian\",\"videographer\",\"vintner\",\"virologist\",\"volunteer\",\"waiter\",\"warden\",\"weaver\",\"welder\",\"wholesaler\",\"woodworker\",\"writer\",\"zoologist\"];var z=[\"acceleration\",\"acid\",\"alkaline\",\"allele\",\"alloy\",\"amoeba\",\"amplitude\",\"anatomy\",\"antibiotic\",\"antibody\",\"antigen\",\"antioxidant\",\"aqueous\",\"assay\",\"atom\",\"atomic\",\"bacteria\",\"barometer\",\"base\",\"beaker\",\"biome\",\"biopsy\",\"biosynthesis\",\"bond\",\"botany\",\"calibration\",\"capillary\",\"carbohydrate\",\"carbon\",\"catalyst\",\"cathode\",\"cell\",\"cellular\",\"centrifuge\",\"chlorophyll\",\"chromosome\",\"circuit\",\"coagulation\",\"coefficient\",\"colloid\",\"combustion\",\"compound\",\"condensation\",\"conductivity\",\"covalent\",\"cytoplasm\",\"data\",\"decay\",\"decomposition\",\"density\",\"diffusion\",\"dilution\",\"dipole\",\"dissection\",\"dissolution\",\"distillation\",\"dna\",\"electrode\",\"electrolyte\",\"electron\",\"element\",\"embryo\",\"emission\",\"endothermic\",\"enzyme\",\"equation\",\"equilibrium\",\"evaporation\",\"evolution\",\"exothermic\",\"experiment\",\"exponential\",\"fermentation\",\"filament\",\"filtration\",\"fission\",\"flask\",\"formula\",\"frequency\",\"friction\",\"fungus\",\"fusion\",\"gamete\",\"gas\",\"gene\",\"genome\",\"geology\",\"geothermal\",\"germ\",\"glucose\",\"gradient\",\"gravitational\",\"halogen\",\"heredity\",\"hormone\",\"hybrid\",\"hydrogen\",\"hydrolysis\",\"hypothesis\",\"immunity\",\"induction\",\"inertia\",\"inoculation\",\"insulation\",\"ion\",\"isomer\",\"laboratory\",\"laser\",\"latent\",\"lattice\",\"lens\",\"lipid\",\"liquid\",\"locus\",\"magnet\",\"magnetic\",\"magnetism\",\"mass\",\"membrane\",\"metabolism\",\"metallurgy\",\"microscope\",\"mitochondria\",\"mitosis\",\"molecular\",\"molecule\",\"momentum\",\"monomer\",\"morphology\",\"mutation\",\"neuron\",\"neutralization\",\"nitrogen\",\"nutrient\",\"observation\",\"optics\",\"orbital\",\"organic\",\"oscillation\",\"osmosis\",\"oxidation\",\"oxygen\",\"ozone\",\"parasite\",\"particle\",\"pathogen\",\"peptide\",\"periodic\",\"permeability\",\"petri\",\"phenotype\",\"phosphate\",\"photosynthesis\",\"physics\",\"pipette\",\"plankton\",\"polymer\",\"potential\",\"precipitate\",\"pressure\",\"prism\",\"prokaryote\",\"protein\",\"quantum\",\"radioactive\",\"reactant\",\"reaction\",\"reagent\",\"receptor\",\"recessive\",\"reduction\",\"reflection\",\"refraction\",\"replication\",\"resistance\",\"resonance\",\"respiration\",\"ribosome\",\"rna\",\"salinity\",\"saturated\",\"sediment\",\"semiconductor\",\"serum\",\"solid\",\"solubility\",\"solute\",\"solution\",\"solvent\",\"speciation\",\"specimen\",\"spectrometer\",\"spore\",\"stimulus\",\"stoichiometry\",\"substrate\",\"suspension\",\"symbiosis\",\"synthesis\",\"taxonomy\",\"temperature\",\"theorem\",\"theory\",\"thermal\",\"thermodynamics\",\"titration\",\"tissue\",\"toxin\",\"transcription\",\"translation\",\"transmitter\",\"ultraviolet\",\"valence\",\"vapor\",\"variable\",\"vector\",\"velocity\",\"virus\",\"viscosity\",\"voltage\",\"volume\",\"wavelength\",\"zoology\"];var q=[\"aperture\",\"apogee\",\"asterism\",\"asteroid\",\"astrology\",\"astronaut\",\"astronomy\",\"atmosphere\",\"axis\",\"betelgeuse\",\"bigbang\",\"binary\",\"bolide\",\"canopus\",\"capsule\",\"celestial\",\"centauri\",\"centaurus\",\"cepheid\",\"cetus\",\"chiron\",\"cluster\",\"comet\",\"constellation\",\"copernicus\",\"corona\",\"cosmic\",\"cosmonaut\",\"crater\",\"cygnus\",\"draco\",\"dwarf\",\"einstein\",\"equinox\",\"eridanus\",\"exoplanet\",\"fermi\",\"galactic\",\"galileo\",\"gemini\",\"gravity\",\"hades\",\"halley\",\"heliocentric\",\"hubble\",\"hypernova\",\"infrared\",\"interstellar\",\"isotope\",\"jansky\",\"kbo\",\"kepler\",\"kuiper\",\"laplace\",\"larissa\",\"libration\",\"lightyear\",\"lunar\",\"lyra\",\"magnetar\",\"messier\",\"meteorite\",\"meteoroid\",\"milkyway\",\"mimas\",\"nadir\",\"naiad\",\"nebula\",\"nereid\",\"neutron\",\"nix\",\"nova\",\"nucleus\",\"oberon\",\"occultation\",\"oort\",\"orbit\",\"parsec\",\"perigee\",\"perihelion\",\"perseid\",\"phobos\",\"photon\",\"pioneer\",\"plasma\",\"polar\",\"polaris\",\"proton\",\"puck\",\"pulsar\",\"quasar\",\"radar\",\"radiation\",\"radioscope\",\"retrograde\",\"rocket\",\"sagittarius\",\"satellite\",\"satyr\",\"sideral\",\"sirius\",\"skylab\",\"solar\",\"solstice\",\"space\",\"spaceship\",\"spectrum\",\"starlight\",\"starship\",\"stellar\",\"supernova\",\"taurid\",\"telescope\",\"tethys\",\"thule\",\"titania\",\"ufo\",\"ulysses\",\"umbra\",\"universe\",\"uranus\",\"ursa\",\"vacuum\",\"vega\",\"vernal\",\"voyager\",\"wormhole\",\"xenon\",\"yttrium\",\"zenith\",\"zodiac\"];var E=[\"aerobics\",\"archery\",\"athlete\",\"backstroke\",\"badminton\",\"baseball\",\"basketball\",\"bench\",\"biathlon\",\"billiards\",\"birdie\",\"bobsled\",\"bocce\",\"bogey\",\"bowling\",\"boxing\",\"captain\",\"champion\",\"cheerleading\",\"cleats\",\"climbing\",\"competition\",\"court\",\"crawl\",\"croquet\",\"curling\",\"cycling\",\"darts\",\"decathlon\",\"defense\",\"diving\",\"dodgeball\",\"dribble\",\"dugout\",\"dunk\",\"equestrian\",\"fairway\",\"fencing\",\"field\",\"fitness\",\"football\",\"freestyle\",\"futsal\",\"goal\",\"goalie\",\"goalkeeper\",\"golf\",\"gymnastics\",\"halftime\",\"handball\",\"heptathlon\",\"hiking\",\"hockey\",\"hurdles\",\"javelin\",\"jersey\",\"jogging\",\"judo\",\"karate\",\"kickball\",\"kickboxing\",\"lacrosse\",\"league\",\"luge\",\"marathon\",\"medal\",\"medalist\",\"medley\",\"midfielder\",\"netball\",\"offense\",\"olympics\",\"overtime\",\"paddleboarding\",\"paintball\",\"par\",\"parkour\",\"passing\",\"penalty\",\"pentathlon\",\"pickleball\",\"pilates\",\"pingpong\",\"playoff\",\"podium\",\"polo\",\"qualifier\",\"racket\",\"racquetball\",\"rally\",\"rebounding\",\"referee\",\"relay\",\"rink\",\"rowing\",\"rugby\",\"running\",\"sailing\",\"scoreboard\",\"scoring\",\"scrimmage\",\"serve\",\"shot\",\"sideline\",\"skating\",\"skeleton\",\"skiing\",\"slalom\",\"sled\",\"snooker\",\"snowboarding\",\"soccer\",\"softball\",\"sparring\",\"speedskating\",\"spike\",\"sprint\",\"stadium\",\"steeplechase\",\"striker\",\"surfing\",\"swimming\",\"table\",\"tackling\",\"taekwondo\",\"teammate\",\"tennis\",\"throwing\",\"timeout\",\"tournament\",\"track\",\"trainer\",\"trampolining\",\"triathlete\",\"triathlon\",\"trophy\",\"tryout\",\"tumbling\",\"umpire\",\"varsity\",\"victory\",\"volleyball\",\"wakeboarding\",\"walking\",\"warmup\",\"waterpolo\",\"weightlifting\",\"wicket\",\"windsurfing\",\"workout\",\"wrestling\",\"yoga\",\"zone\",\"zumba\"];var N=[\"aircraft\",\"airliner\",\"airplane\",\"airport\",\"ambulance\",\"amphibious\",\"armored\",\"autobus\",\"automobile\",\"aviation\",\"balloon\",\"barge\",\"biplane\",\"boat\",\"boxcar\",\"buggy\",\"bullet\",\"bus\",\"cab\",\"cable\",\"caboose\",\"camper\",\"canoe\",\"caravan\",\"cargo\",\"carriage\",\"carrier\",\"cart\",\"catamaran\",\"chairlift\",\"chariot\",\"chopper\",\"clipper\",\"coach\",\"cockpit\",\"commuter\",\"convertible\",\"coupe\",\"cruiser\",\"deckboat\",\"delivery\",\"diesel\",\"dinghy\",\"dirigible\",\"dolly\",\"draisine\",\"dray\",\"drifter\",\"engine\",\"express\",\"ferry\",\"flatbed\",\"fleet\",\"floatplane\",\"flyover\",\"freighter\",\"fuselage\",\"galleon\",\"galley\",\"glider\",\"gondola\",\"gunboat\",\"gyrocopter\",\"hangar\",\"hatchback\",\"hauler\",\"hearse\",\"helicopter\",\"highway\",\"hopper\",\"houseboat\",\"hovercraft\",\"hydrofoil\",\"hydroplane\",\"icebreaker\",\"inflatable\",\"interstate\",\"jet\",\"jetliner\",\"jetpack\",\"jetski\",\"jitney\",\"junction\",\"kayak\",\"ketch\",\"landau\",\"landing\",\"launch\",\"lifeboat\",\"limousine\",\"liner\",\"locomotive\",\"maglev\",\"metro\",\"minibus\",\"minivan\",\"moped\",\"monorail\",\"mooring\",\"motorbike\",\"motorboat\",\"motorcycle\",\"motorhome\",\"narrowboat\",\"outboard\",\"outrigger\",\"paddleboat\",\"parachute\",\"parasail\",\"passenger\",\"patrol\",\"pedalo\",\"pickup\",\"pier\",\"pontoon\",\"propeller\",\"pullman\",\"quadcopter\",\"raft\",\"railcar\",\"railroad\",\"railway\",\"rickshaw\",\"roadster\",\"ropeway\",\"rotorcraft\",\"rowboat\",\"runway\",\"sailboat\",\"schooner\",\"scooter\",\"seaplane\",\"sedan\",\"semitrailer\",\"ship\",\"shuttle\",\"skateboard\",\"skiff\",\"sleigh\",\"snowmobile\",\"speedboat\",\"station\",\"steamboat\",\"steamer\",\"steamship\",\"streetcar\",\"submarine\",\"subwaycar\",\"tandem\",\"tanker\",\"taxi\",\"taxicab\",\"tender\",\"terminal\",\"tiller\",\"toboggan\",\"tractor\",\"trailer\",\"train\",\"tram\",\"tramcar\",\"tramway\",\"transport\",\"trawler\",\"tricycle\",\"trolley\",\"trolleybus\",\"truck\",\"tugboat\",\"turboprop\",\"ultralight\",\"unicycle\",\"van\",\"vehicle\",\"vessel\",\"wagon\",\"watercraft\",\"wharf\",\"wheelbarrow\",\"windjammer\",\"yacht\",\"yawl\",\"zeppelin\"];var T=2,B=[...p,...h],O=[u,m,d,g,b,y,f,v,k,w,x,j,z,q,E,N],n=a=>a[Math.floor(Math.random()*a.length)],L=(a,e,r)=>{if(a<2)throw new Error(\"Need at least 2 words\");if(!e)throw new Error(\"Need a separator\");if(r!==void 0&&(!Number.isInteger(r)||r<=0))throw new Error(\"maxLength must be a positive integer\")},s=(a,e)=>{let r=n(O),i=e===void 0?r:r.filter(t=>t.length<=e);if(i.length===0)return s(a,e);let o=n(i);return a.includes(o)?s(a,e):o},Q=(a,e)=>{let r=[n(B)];for(let i=1;i<a;i+=1)r.push(s(r));return r.join(e)},I=(a,e,r)=>new Error(`maxLength ${a} is too short to generate ${e} segments with separator \"${r}\"`),X=(a,e)=>{let r=a-(e-1)*T,i=B.filter(o=>o.length<=r);return i.length===0?void 0:n(i)},Z=(a,e,r)=>{let i=e-r*T;return O.flat().some(t=>t.length<=i)?s(a,i):void 0},ee=(a,e,r,i,o)=>{let t=r;for(let l=1;l<e;l+=1){let c=Z(a,t,e-l-1);if(!c)throw I(i,e,o);a.push(c),t-=c.length}return t},ae=(a,e,r)=>{let i=r-(a-1)*e.length,o=X(i,a);if(!o)throw I(r,a,e);let t=[o];return ee(t,a,i-o.length,r,e),t.join(e)},Pe=(a={})=>{let{maxLength:e,segments:r=2,separator:i=\"-\"}=a;return L(r,i,e),e===void 0?Q(r,i):ae(r,i,e)};export{Pe as joyful};\n","import { select, isCancel, cancel } from '@clack/prompts';\nimport { SUPPORTED_TOOLS, BASE_PROFILE_SLUG } from '../types/index.js';\nimport { ConfigManager } from './config.js';\n\nexport async function promptForAgent(message = 'Select an agent:'): Promise<string> {\n const options = Object.entries(SUPPORTED_TOOLS).map(([key, tool]) => ({\n value: key,\n label: tool.description,\n hint: key,\n }));\n\n const response = await select({\n message,\n options,\n });\n\n if (isCancel(response)) {\n cancel('Operation cancelled.');\n process.exit(0);\n }\n\n return response as string;\n}\n\nexport async function promptForProfile(\n config: ConfigManager,\n agent: string,\n message = 'Select a profile:'\n): Promise<string | null> {\n const profiles = await config.getProfiles(agent);\n\n if (profiles.length === 0) {\n return null;\n }\n\n const activeProfile = await config.getActiveProfile(agent);\n\n const response = await select({\n message,\n options: profiles.map((p) => {\n let label = p.name;\n let hint = p.description;\n\n // Mark active profile\n if (p.slug === activeProfile) {\n label = `● ${label}`;\n }\n\n // Label _base profile\n if (p.slug === BASE_PROFILE_SLUG) {\n hint = 'Base profile';\n }\n\n return {\n value: p.slug,\n label,\n hint,\n };\n }),\n });\n\n if (isCancel(response)) {\n cancel('Operation cancelled.');\n process.exit(0);\n }\n\n return response as string;\n}\n","import { defineCommand } from 'citty';\nimport { outro, text, isCancel, cancel, confirm } from '@clack/prompts';\nimport { ConfigManager } from '../lib/config.js';\nimport { SUPPORTED_TOOLS, BASE_PROFILE_SLUG } from '../types/index.js';\nimport color from 'picocolors';\nimport { validateNewProfileName, slugify } from '../lib/validation.js';\nimport { joyful } from 'joyful';\nimport { promptForAgent } from '../lib/prompts.js';\nimport { copyDirectory } from '../lib/symlink.js';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\n\nexport async function addCommand(agent?: string, name?: string, from?: string) {\n let resolvedAgent = agent;\n\n if (!resolvedAgent) {\n resolvedAgent = await promptForAgent('Select agent to create profile for:');\n }\n\n if (!SUPPORTED_TOOLS[resolvedAgent]) {\n console.error(color.red(`Unsupported agent: ${resolvedAgent}`));\n process.exit(1);\n }\n\n if (!name) {\n const suggestedName = joyful();\n const response = await text({\n message: 'Enter profile name:',\n placeholder: suggestedName,\n initialValue: suggestedName,\n validate(value) {\n if (!value) return 'Profile name is required.';\n return validateNewProfileName(value) || undefined;\n },\n });\n\n if (isCancel(response)) {\n cancel('Operation cancelled.');\n process.exit(0);\n }\n name = response;\n }\n const validationError = validateNewProfileName(name);\n if (validationError) {\n console.error(color.red(validationError));\n process.exit(1);\n }\n\n const config = new ConfigManager();\n await config.init();\n try {\n const profileDir = await config.createProfile(resolvedAgent, name);\n const slug = slugify(name);\n\n // Determine source profile directory\n let sourceDir: string;\n if (from) {\n // Use the specified source profile\n const sourceSlug = slugify(from);\n sourceDir = path.join(config.getContentDir(), resolvedAgent, sourceSlug);\n try {\n await fs.access(sourceDir);\n } catch {\n console.error(\n color.red(`Source profile '${from}' does not exist for agent '${resolvedAgent}'`)\n );\n process.exit(1);\n }\n } else {\n // Default to _base\n sourceDir = path.join(config.getContentDir(), resolvedAgent, BASE_PROFILE_SLUG);\n }\n\n // Copy from source profile if it exists\n try {\n await fs.access(sourceDir);\n // Source exists, copy its contents to the new profile (preserving symlinks)\n await copyDirectory(sourceDir, profileDir);\n // Overwrite meta.json with the new profile's metadata\n const metaPath = path.join(profileDir, 'meta.json');\n const meta = {\n name,\n slug,\n agent: resolvedAgent,\n created_at: new Date().toISOString(),\n };\n await fs.writeFile(metaPath, JSON.stringify(meta, null, 2));\n } catch {\n // Source doesn't exist, that's fine (only happens if --from not specified and _base doesn't exist)\n }\n\n // Scaffold include-list dir entries for include-based agents.\n await config.ensureIncludeProfileLayout(resolvedAgent, slug);\n\n outro(`Profile created at ${color.cyan(profileDir)}`);\n\n // Offer to switch to the new profile\n const shouldSwitch = await confirm({\n message: 'Switch to this profile now?',\n initialValue: true,\n });\n\n if (isCancel(shouldSwitch)) {\n process.exit(0);\n }\n\n if (shouldSwitch) {\n await config.switchProfile(resolvedAgent, slug);\n outro(`Switched to profile ${color.cyan(name)}`);\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n console.error(color.red(message));\n process.exit(1);\n }\n}\n\nexport default defineCommand({\n meta: {\n name: 'add',\n description: 'Create a new profile (alias: create)',\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Agent name',\n required: false,\n },\n name: {\n type: 'positional',\n description: 'Profile name',\n required: false,\n },\n from: {\n type: 'string',\n description: 'Source profile to clone from (defaults to _base)',\n required: false,\n },\n },\n async run({ args }) {\n await addCommand(args.agent, args.name, args.from);\n },\n});\n","import { defineCommand } from 'citty';\nimport { outro, select, text, isCancel, cancel, note } from '@clack/prompts';\nimport { ConfigManager } from '../lib/config.js';\nimport { SUPPORTED_TOOLS, BASE_PROFILE_SLUG } from '../types/index.js';\nimport color from 'picocolors';\nimport { validateNewProfileName, validateProfileName, slugify } from '../lib/validation.js';\nimport { joyful } from 'joyful';\nimport { promptForAgent } from '../lib/prompts.js';\n\nasync function batchSwitchAll(profileName: string): Promise<void> {\n const config = new ConfigManager();\n await config.init();\n const resolvedProfileName =\n profileName === 'base' || profileName === 'unset' ? BASE_PROFILE_SLUG : profileName;\n\n const results = {\n switched: [] as string[],\n skipped: [] as string[],\n errors: [] as { agent: string; error: string }[],\n };\n\n for (const agent of Object.keys(SUPPORTED_TOOLS)) {\n try {\n // Check if agent is managed\n const status = await config.getSymlinkStatus(agent);\n if (status !== 'active' && status !== 'broken') {\n results.skipped.push(`${agent} (not managed)`);\n continue;\n }\n\n // Check if profile exists for this agent\n const profiles = await config.getProfiles(agent);\n const profileExists = profiles.some((p) => p.slug === resolvedProfileName);\n\n if (!profileExists) {\n results.skipped.push(`${agent} (profile '${resolvedProfileName}' not found)`);\n continue;\n }\n\n // Switch the profile\n await config.switchProfile(agent, resolvedProfileName);\n results.switched.push(agent);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n results.errors.push({ agent, error: message });\n }\n }\n\n // Print summary\n if (results.switched.length > 0) {\n console.log(color.green(`✓ Switched ${results.switched.length} agent(s):`));\n results.switched.forEach((agent) => console.log(` - ${agent}`));\n }\n\n if (results.skipped.length > 0) {\n console.log(color.dim(`⊘ Skipped ${results.skipped.length} agent(s):`));\n results.skipped.forEach((msg) => console.log(` - ${msg}`));\n }\n\n if (results.errors.length > 0) {\n console.log(color.red(`✗ Errors (${results.errors.length}):`));\n results.errors.forEach(({ agent, error }) => console.log(` - ${agent}: ${error}`));\n process.exit(1);\n }\n\n outro(\n `Activated ${color.cyan(resolvedProfileName)} profile for ${results.switched.length} agent(s).`\n );\n}\n\nexport async function setCommand(agent?: string, name?: string) {\n const resolvedAgent: string = agent ?? (await promptForAgent('Select agent to set profile for:'));\n\n if (!SUPPORTED_TOOLS[resolvedAgent]) {\n console.error(color.red(`Unsupported agent: ${resolvedAgent}`));\n process.exit(1);\n }\n\n const config = new ConfigManager();\n await config.init();\n\n // Check that agent is managed\n const status = await config.getSymlinkStatus(resolvedAgent);\n if (status === 'unmanaged') {\n console.error(\n color.red(`Agent '${resolvedAgent}' is not managed. Run 'agentprofiles setup' first.`)\n );\n process.exit(1);\n }\n if (status === 'missing') {\n console.error(color.red(`Agent '${resolvedAgent}' is not installed.`));\n process.exit(1);\n }\n\n let resolvedName: string | undefined = name;\n\n if (!resolvedName) {\n const profiles = await config.getProfiles(resolvedAgent);\n const activeProfile = await config.getActiveProfile(resolvedAgent);\n\n if (profiles.length === 0) {\n note(`No profiles found for ${resolvedAgent}. Let's create one.`, 'New Profile');\n\n const suggestedName = joyful();\n const nameResponse = await text({\n message: 'Enter a name for this profile:',\n placeholder: suggestedName,\n initialValue: suggestedName,\n validate(value) {\n if (!value) return 'Profile name is required.';\n return validateNewProfileName(value) || undefined;\n },\n });\n\n if (isCancel(nameResponse)) {\n cancel('Operation cancelled.');\n process.exit(0);\n }\n\n const newName = nameResponse as string;\n await config.createProfile(resolvedAgent, newName);\n note(`Created profile ${color.cyan(newName)}`, 'Profile Created');\n resolvedName = slugify(newName);\n } else {\n const selectableProfiles = profiles.filter((p) => p.slug !== BASE_PROFILE_SLUG);\n const response = await select({\n message: 'Select a profile to activate:',\n options: [\n {\n value: BASE_PROFILE_SLUG,\n label: 'Unset (reset to base profile)',\n hint: activeProfile === BASE_PROFILE_SLUG ? '(active)' : 'switch to _base',\n },\n ...selectableProfiles.map((p) => ({\n value: p.slug,\n label: p.name,\n hint: p.slug === activeProfile ? '(active)' : p.description,\n })),\n ],\n });\n\n if (isCancel(response)) {\n cancel('Operation cancelled.');\n process.exit(0);\n }\n resolvedName = response as string;\n }\n } else {\n // Handle 'base' alias for BASE_PROFILE_SLUG\n if (resolvedName === 'base' || resolvedName === 'unset') {\n resolvedName = BASE_PROFILE_SLUG;\n } else {\n const validationError = validateProfileName(resolvedName);\n if (validationError) {\n console.error(color.red(validationError));\n process.exit(1);\n }\n resolvedName = slugify(resolvedName);\n }\n }\n\n if (!resolvedName) {\n console.error(color.red('Profile name is required.'));\n process.exit(1);\n }\n\n try {\n if (resolvedName === BASE_PROFILE_SLUG) {\n await config.ensureBaseProfileLayout(resolvedAgent);\n }\n await config.switchProfile(resolvedAgent, resolvedName);\n outro(`Activated ${color.cyan(resolvedName)} profile for ${resolvedAgent}.`);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n console.error(color.red(message));\n process.exit(1);\n }\n}\n\nexport default defineCommand({\n meta: {\n name: 'set',\n description: 'Set the active profile for an agent',\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Agent name',\n required: false,\n },\n name: {\n type: 'positional',\n description: 'Profile name (or \"base\"/\"unset\" for base profile)',\n required: false,\n },\n all: {\n type: 'boolean',\n description: 'Switch all managed agents to the same profile',\n required: false,\n },\n },\n async run({ args }) {\n // Handle --all flag: agentprofiles set --all <profile>\n if (args.all) {\n const profileName = args.agent; // When --all is used, first positional is the profile name\n if (!profileName) {\n console.error(color.red('Profile name is required when using --all flag'));\n process.exit(1);\n }\n await batchSwitchAll(profileName);\n return;\n }\n\n // Handle shorthand: agentprofiles set <profile> (no agent arg, treated as --all)\n if (args.agent && !args.name) {\n // Check if this looks like a profile name (not an agent name)\n // If agent is not in SUPPORTED_TOOLS, treat it as a profile name for --all\n if (!SUPPORTED_TOOLS[args.agent]) {\n await batchSwitchAll(args.agent);\n return;\n }\n }\n\n // Normal flow: agentprofiles set <agent> [name]\n await setCommand(args.agent, args.name);\n },\n});\n","import { defineCommand } from 'citty';\nimport { outro } from '@clack/prompts';\nimport { SUPPORTED_TOOLS, BASE_PROFILE_SLUG } from '../types/index.js';\nimport color from 'picocolors';\nimport { promptForAgent } from '../lib/prompts.js';\nimport { ConfigManager } from '../lib/config.js';\n\nexport async function unsetCommand(agent?: string) {\n const resolvedAgent: string = agent ?? (await promptForAgent('Select agent to unset:'));\n\n if (!SUPPORTED_TOOLS[resolvedAgent]) {\n console.error(color.red(`Unsupported agent: ${resolvedAgent}`));\n process.exit(1);\n }\n\n const config = new ConfigManager();\n await config.init();\n\n // Check that agent is managed\n const status = await config.getSymlinkStatus(resolvedAgent);\n if (status === 'unmanaged') {\n console.error(color.red(`Agent '${resolvedAgent}' is not managed.`));\n process.exit(1);\n }\n if (status === 'missing') {\n console.error(color.red(`Agent '${resolvedAgent}' is not installed.`));\n process.exit(1);\n }\n\n try {\n await config.switchProfile(resolvedAgent, BASE_PROFILE_SLUG);\n outro(`Switched ${resolvedAgent} to base profile.`);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n console.error(color.red(message));\n process.exit(1);\n }\n}\n\nexport default defineCommand({\n meta: {\n name: 'unset',\n description: 'Switch an agent back to its base profile',\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Agent name',\n required: false,\n },\n },\n async run({ args }) {\n await unsetCommand(args.agent);\n },\n});\n","import { defineCommand } from 'citty';\nimport { outro, note } from '@clack/prompts';\nimport { ConfigManager } from '../lib/config.js';\nimport { SUPPORTED_TOOLS } from '../types/index.js';\nimport color from 'picocolors';\nimport { spawn } from 'node:child_process';\nimport path from 'node:path';\nimport { promptForAgent, promptForProfile } from '../lib/prompts.js';\n\nexport function parseEditorValue(editor: string): { command: string; args: string[] } {\n const trimmed = editor.trim();\n if (!trimmed) {\n return { command: '', args: [] };\n }\n\n const tokens = trimmed.match(/(\".*?\"|'.*?'|\\S+)/g) ?? [];\n\n if (tokens.length === 0) {\n return { command: '', args: [] };\n }\n\n const stripQuotes = (value: string) => {\n if (\n (value.startsWith('\"') && value.endsWith('\"')) ||\n (value.startsWith(\"'\") && value.endsWith(\"'\"))\n ) {\n return value.slice(1, -1);\n }\n return value;\n };\n\n const [commandToken, ...argTokens] = tokens;\n\n if (!commandToken) {\n return { command: '', args: [] };\n }\n\n return {\n command: stripQuotes(commandToken),\n args: argTokens.map(stripQuotes),\n };\n}\n\nexport async function editCommand(agent?: string, name?: string) {\n const resolvedAgent: string = agent ?? (await promptForAgent('Select agent:'));\n\n if (!SUPPORTED_TOOLS[resolvedAgent]) {\n console.error(color.red(`Unsupported agent: ${resolvedAgent}`));\n process.exit(1);\n }\n\n const config = new ConfigManager();\n await config.init();\n\n let resolvedName: string;\n if (name) {\n resolvedName = name;\n } else {\n const selected = await promptForProfile(config, resolvedAgent, 'Select profile to edit:');\n if (!selected) {\n note(\n `No profiles found for ${resolvedAgent}. Create one first with: agentprofiles add ${resolvedAgent}`,\n 'No Profiles'\n );\n process.exit(0);\n }\n resolvedName = selected;\n }\n\n const profileDir = path.join(config.getContentDir(), resolvedAgent, resolvedName);\n\n const editorEnv = process.env.EDITOR?.trim();\n if (editorEnv) {\n const { command, args } = parseEditorValue(editorEnv);\n if (command) {\n const child = spawn(command, [...args, profileDir], { stdio: 'inherit' });\n child.on('exit', () => {\n outro('Editor closed');\n });\n return;\n }\n }\n\n const platform = process.platform;\n const openCommand = platform === 'darwin' ? 'open' : platform === 'linux' ? 'xdg-open' : null;\n\n if (!openCommand) {\n console.log(profileDir);\n return;\n }\n\n const child = spawn(openCommand, [profileDir], { stdio: 'inherit' });\n child.on('error', () => {\n console.log(profileDir);\n });\n}\n\nexport default defineCommand({\n meta: {\n name: 'edit',\n description: 'Edit a profile configuration',\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Agent name',\n required: false,\n },\n name: {\n type: 'positional',\n description: 'Profile name',\n required: false,\n },\n },\n async run({ args }) {\n await editCommand(args.agent, args.name);\n },\n});\n","import { defineCommand } from 'citty';\nimport { outro, confirm, isCancel, cancel, note } from '@clack/prompts';\nimport { ConfigManager } from '../lib/config.js';\nimport { SUPPORTED_TOOLS, BASE_PROFILE_SLUG, SHARED_PROFILE_SLUG } from '../types/index.js';\nimport color from 'picocolors';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport { promptForAgent, promptForProfile } from '../lib/prompts.js';\n\nexport async function removeCommand(agent?: string, name?: string) {\n const resolvedAgent: string = agent ?? (await promptForAgent('Select agent:'));\n\n if (!SUPPORTED_TOOLS[resolvedAgent]) {\n console.error(color.red(`Unsupported agent: ${resolvedAgent}`));\n process.exit(1);\n }\n\n const config = new ConfigManager();\n await config.init();\n const profiles = await config.getProfiles(resolvedAgent);\n\n if (profiles.length === 0) {\n note(`No profiles found for ${resolvedAgent}. Nothing to remove.`, 'No Profiles');\n process.exit(0);\n }\n\n let resolvedName: string;\n if (name) {\n resolvedName = name;\n } else {\n const selected = await promptForProfile(config, resolvedAgent, 'Select a profile to remove:');\n if (!selected) {\n note(`No profiles found for ${resolvedAgent}.`, 'No Profiles');\n process.exit(0);\n }\n resolvedName = selected;\n }\n\n // Block removal of _base\n if (resolvedName === BASE_PROFILE_SLUG) {\n console.error(color.red(`Cannot remove the base profile (${BASE_PROFILE_SLUG}).`));\n process.exit(1);\n }\n\n // Block removal of reserved non-profile directories\n if (resolvedName === SHARED_PROFILE_SLUG) {\n console.error(color.red(`Cannot remove reserved directory (${SHARED_PROFILE_SLUG}).`));\n process.exit(1);\n }\n\n // Block removal of active profile\n const activeProfile = await config.getActiveProfile(resolvedAgent);\n if (activeProfile === resolvedName) {\n console.error(\n color.red(\n `Cannot remove the active profile. Switch to a different profile first.\\nUse: agentprofiles set ${resolvedAgent} <profile-name>`\n )\n );\n process.exit(1);\n }\n\n const profileDir = path.join(config.getContentDir(), resolvedAgent, resolvedName);\n try {\n await fs.access(profileDir);\n } catch {\n console.error(color.red(`Profile '${resolvedName}' not found for agent '${resolvedAgent}'`));\n process.exit(1);\n }\n\n const shouldDelete = await confirm({\n message: `Are you sure you want to delete the profile ${color.cyan(resolvedName)}? This cannot be undone.`,\n initialValue: false,\n });\n\n if (isCancel(shouldDelete) || !shouldDelete) {\n cancel('Operation cancelled.');\n process.exit(0);\n }\n\n await fs.rm(profileDir, { recursive: true, force: true });\n\n outro(`Deleted profile ${color.cyan(resolvedName)} for ${resolvedAgent}.`);\n}\n\nexport default defineCommand({\n meta: {\n name: 'remove',\n description: 'Remove a profile (alias: rm)',\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Agent name',\n required: false,\n },\n name: {\n type: 'positional',\n description: 'Profile name',\n required: false,\n },\n },\n async run({ args }) {\n await removeCommand(args.agent, args.name);\n },\n});\n","import { defineCommand } from 'citty';\nimport { confirm, outro, cancel } from '@clack/prompts';\nimport { SUPPORTED_TOOLS } from '../types/index.js';\nimport color from 'picocolors';\nimport { promptForAgent } from '../lib/prompts.js';\nimport { ConfigManager } from '../lib/config.js';\n\nexport async function releaseCommand(agent?: string) {\n const resolvedAgent: string = agent ?? (await promptForAgent('Select agent to release:'));\n\n if (!SUPPORTED_TOOLS[resolvedAgent]) {\n console.error(color.red(`Unsupported agent: ${resolvedAgent}`));\n process.exit(1);\n }\n\n const config = new ConfigManager();\n await config.init();\n\n // Check that agent is managed\n const status = await config.getSymlinkStatus(resolvedAgent);\n if (status === 'unmanaged') {\n console.error(color.red(`Agent '${resolvedAgent}' is not managed.`));\n process.exit(1);\n }\n if (status === 'missing') {\n console.error(color.red(`Agent '${resolvedAgent}' is not installed.`));\n process.exit(1);\n }\n\n // Get the active profile to show what will happen\n const activeProfile = await config.getActiveProfile(resolvedAgent);\n const globalPath = config.getGlobalConfigPath(resolvedAgent);\n\n const shouldRelease = await confirm({\n message: `Release ${color.cyan(resolvedAgent)} from management? This will move the active profile (${color.cyan(activeProfile || 'unknown')}) back to ${color.cyan(globalPath)} and remove the symlink.`,\n initialValue: false,\n });\n\n if (!shouldRelease) {\n cancel('Operation cancelled.');\n process.exit(0);\n }\n\n try {\n await config.unlinkProfile(resolvedAgent);\n outro(\n `Released ${color.cyan(resolvedAgent)} from management. Profile restored to ${color.cyan(globalPath)}.`\n );\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n console.error(color.red(message));\n process.exit(1);\n }\n}\n\nexport default defineCommand({\n meta: {\n name: 'release',\n description: 'Release an agent from management (stop managing profiles)',\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Agent name',\n required: false,\n },\n },\n async run({ args }) {\n await releaseCommand(args.agent);\n },\n});\n","import { defineCommand } from 'citty';\nimport { confirm, select } from '@clack/prompts';\nimport { ConfigManager } from '../lib/config.js';\nimport { SUPPORTED_TOOLS, SHARED_DIRECTORIES, BASE_PROFILE_SLUG } from '../types/index.js';\nimport color from 'picocolors';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\n\nexport async function doctorCommand() {\n const config = new ConfigManager();\n await config.init();\n\n console.log(color.bold('\\n🔧 Agent Profiles Doctor\\n'));\n\n const issues: string[] = [];\n const fixes: string[] = [];\n\n // Check each agent\n for (const [agentKey, agentDef] of Object.entries(SUPPORTED_TOOLS)) {\n const status = await config.getSymlinkStatus(agentKey);\n const strategy = config.getAgentStrategy(agentKey);\n\n if (status === 'broken') {\n const globalPath = config.getGlobalConfigPath(agentKey);\n\n if (strategy === 'include') {\n // Include agents: 'broken' means one or more per-entry symlinks inside globalPath\n // are broken. The fix is to switch to _base which re-creates all managed entries.\n issues.push(\n `${agentDef.description} (${agentKey}): broken per-entry symlink(s) in ${globalPath}`\n );\n\n const choice = await select({\n message: `Fix broken include symlinks for ${color.cyan(agentKey)}?`,\n options: [\n { value: 'switch_base', label: 'Switch to _base profile (re-creates managed entries)' },\n { value: 'skip', label: 'Skip' },\n ],\n });\n\n if (choice === 'switch_base') {\n try {\n const baseDir = path.join(config.getContentDir(), agentKey, BASE_PROFILE_SLUG);\n await fs.access(baseDir);\n await config.switchProfile(agentKey, BASE_PROFILE_SLUG);\n fixes.push(`Switched ${agentKey} to _base profile (repaired broken entries)`);\n } catch {\n console.error(color.red(` Error: _base profile not found for ${agentKey}`));\n }\n }\n } else {\n // Directory agents: 'broken' means the directory-level symlink is broken.\n issues.push(`${agentDef.description} (${agentKey}): broken symlink`);\n\n const choice = await select({\n message: `Fix broken symlink for ${color.cyan(agentKey)}?`,\n options: [\n { value: 'switch_base', label: 'Switch to _base profile' },\n { value: 'remove', label: 'Remove the symlink' },\n { value: 'skip', label: 'Skip' },\n ],\n });\n\n if (choice === 'switch_base') {\n try {\n const baseDir = path.join(config.getContentDir(), agentKey, BASE_PROFILE_SLUG);\n await fs.access(baseDir);\n await config.switchProfile(agentKey, BASE_PROFILE_SLUG);\n fixes.push(`Switched ${agentKey} to _base profile`);\n } catch {\n console.error(color.red(` Error: _base profile not found for ${agentKey}`));\n }\n } else if (choice === 'remove') {\n try {\n await fs.unlink(globalPath);\n fixes.push(`Removed broken symlink for ${agentKey}`);\n } catch (error) {\n const msg = error instanceof Error ? error.message : String(error);\n console.error(color.red(` Error removing symlink: ${msg}`));\n }\n }\n }\n }\n }\n\n // Check for missing _base profiles\n for (const [agentKey, agentDef] of Object.entries(SUPPORTED_TOOLS)) {\n const status = await config.getSymlinkStatus(agentKey);\n if (status === 'active') {\n const baseDir = path.join(config.getContentDir(), agentKey, BASE_PROFILE_SLUG);\n try {\n await fs.access(baseDir);\n } catch {\n issues.push(`${agentDef.description} (${agentKey}): missing _base profile`);\n const shouldCreate = await confirm({\n message: `Create empty _base profile for ${color.cyan(agentKey)}?`,\n initialValue: false,\n });\n if (shouldCreate) {\n try {\n await fs.mkdir(baseDir, { recursive: true });\n const meta = {\n name: BASE_PROFILE_SLUG,\n slug: BASE_PROFILE_SLUG,\n agent: agentKey,\n description: 'Base profile (created by doctor)',\n created_at: new Date().toISOString(),\n };\n await fs.writeFile(path.join(baseDir, 'meta.json'), JSON.stringify(meta, null, 2));\n fixes.push(`Created _base profile for ${agentKey}`);\n } catch (error) {\n const msg = error instanceof Error ? error.message : String(error);\n console.error(color.red(` Error creating _base: ${msg}`));\n }\n }\n }\n }\n }\n\n // Check for missing meta.json in active profiles\n for (const [agentKey] of Object.entries(SUPPORTED_TOOLS)) {\n const status = await config.getSymlinkStatus(agentKey);\n if (status === 'active') {\n const activeProfile = await config.getActiveProfile(agentKey);\n if (activeProfile) {\n const profileDir = path.join(config.getContentDir(), agentKey, activeProfile);\n const metaPath = path.join(profileDir, 'meta.json');\n try {\n await fs.access(metaPath);\n } catch {\n issues.push(`${agentKey}: missing meta.json in ${activeProfile} profile`);\n const shouldCreate = await confirm({\n message: `Create meta.json for ${color.cyan(agentKey)}/${color.cyan(activeProfile)}?`,\n initialValue: false,\n });\n if (shouldCreate) {\n try {\n const meta = {\n name: activeProfile,\n slug: activeProfile,\n agent: agentKey,\n description: 'Profile metadata (created by doctor)',\n created_at: new Date().toISOString(),\n };\n await fs.writeFile(metaPath, JSON.stringify(meta, null, 2));\n fixes.push(`Created meta.json for ${agentKey}/${activeProfile}`);\n } catch (error) {\n const msg = error instanceof Error ? error.message : String(error);\n console.error(color.red(` Error creating meta.json: ${msg}`));\n }\n }\n }\n }\n }\n }\n\n // Check shared directories\n for (const [, sharedDir] of Object.entries(SHARED_DIRECTORIES)) {\n const status = await config.getSharedDirStatus(sharedDir.name);\n if (status === 'broken') {\n issues.push(`Shared directory ${sharedDir.description}: broken symlink`);\n const shouldRemove = await confirm({\n message: `Remove broken symlink for ${color.cyan(sharedDir.globalPath)}?`,\n initialValue: false,\n });\n if (shouldRemove) {\n try {\n const globalPath = config.getSharedDirGlobalPath(sharedDir.name);\n await fs.unlink(globalPath);\n fixes.push(`Removed broken symlink for ${sharedDir.description}`);\n } catch (error) {\n const msg = error instanceof Error ? error.message : String(error);\n console.error(color.red(` Error: ${msg}`));\n }\n }\n }\n }\n\n // Recursively scan all managed profile content for broken symlinks.\n const contentDir = config.getContentDir();\n const brokenSymlinks = await config.findBrokenSymlinks(contentDir);\n if (brokenSymlinks.length > 0) {\n issues.push(`Managed content: ${brokenSymlinks.length} broken symlink(s) found`);\n\n for (const link of brokenSymlinks) {\n const relativePath = path.relative(contentDir, link.linkPath);\n issues.push(`Broken symlink: ${relativePath} -> ${link.target}`);\n }\n\n const shouldRemove = await confirm({\n message: `Remove ${brokenSymlinks.length} broken symlink(s) found under managed content?`,\n initialValue: false,\n });\n\n if (shouldRemove) {\n for (const link of brokenSymlinks) {\n try {\n await fs.unlink(link.linkPath);\n const relativePath = path.relative(contentDir, link.linkPath);\n fixes.push(`Removed broken symlink ${relativePath}`);\n } catch (error) {\n const msg = error instanceof Error ? error.message : String(error);\n console.error(color.red(` Error removing broken symlink ${link.linkPath}: ${msg}`));\n }\n }\n }\n }\n\n // Summary\n console.log(color.bold('\\n📋 Summary\\n'));\n if (issues.length === 0) {\n console.log(color.green('✓ No issues found!'));\n } else {\n console.log(color.yellow(`Found ${issues.length} issue(s):`));\n issues.forEach((issue) => console.log(` • ${issue}`));\n }\n\n if (fixes.length > 0) {\n console.log(color.green(`\\nFixed ${fixes.length} issue(s):`));\n fixes.forEach((fix) => console.log(` ✓ ${fix}`));\n }\n\n console.log();\n}\n\nexport default defineCommand({\n meta: {\n name: 'doctor',\n description: 'Scan for and repair issues with profiles and symlinks',\n },\n async run() {\n await doctorCommand();\n },\n});\n","import { select, isCancel, cancel } from '@clack/prompts';\n\ntype MenuAction =\n | 'status'\n | 'list'\n | 'add'\n | 'set'\n | 'unset'\n | 'edit'\n | 'remove'\n | 'release'\n | 'doctor';\n\nconst menuOptions: Array<{ value: MenuAction; label: string; hint: string }> = [\n { value: 'status', label: 'Status', hint: 'Show agent profile status' },\n { value: 'list', label: 'List profiles', hint: 'Show all profiles' },\n { value: 'add', label: 'Add profile', hint: 'Create a new profile' },\n { value: 'set', label: 'Set profile', hint: 'Activate a profile for an agent' },\n { value: 'unset', label: 'Unset profile', hint: 'Switch an agent to base profile' },\n { value: 'edit', label: 'Edit profile', hint: 'Open a profile in your editor' },\n { value: 'remove', label: 'Remove profile', hint: 'Delete a profile' },\n { value: 'release', label: 'Release agent', hint: 'Stop managing an agent' },\n { value: 'doctor', label: 'Doctor / Repair', hint: 'Scan for and repair issues' },\n];\n\nexport async function showMainMenu(): Promise<void> {\n const response = await select({\n message: 'What would you like to do?',\n options: menuOptions,\n });\n\n if (isCancel(response)) {\n cancel('Goodbye!');\n process.exit(0);\n }\n\n const action = response as MenuAction;\n\n switch (action) {\n case 'status': {\n const { statusCommand } = await import('../commands/status.js');\n await statusCommand();\n break;\n }\n case 'list': {\n const { listCommand } = await import('../commands/list.js');\n await listCommand();\n break;\n }\n case 'add': {\n const { addCommand } = await import('../commands/add.js');\n await addCommand();\n break;\n }\n case 'set': {\n const { setCommand } = await import('../commands/set.js');\n await setCommand();\n break;\n }\n case 'unset': {\n const { unsetCommand } = await import('../commands/unset.js');\n await unsetCommand();\n break;\n }\n case 'edit': {\n const { editCommand } = await import('../commands/edit.js');\n await editCommand();\n break;\n }\n case 'remove': {\n const { removeCommand } = await import('../commands/remove.js');\n await removeCommand();\n break;\n }\n case 'release': {\n const { releaseCommand } = await import('../commands/release.js');\n await releaseCommand();\n break;\n }\n case 'doctor': {\n const { doctorCommand } = await import('../commands/doctor.js');\n await doctorCommand();\n break;\n }\n }\n}\n","import { defineCommand } from 'citty';\nimport { runOnboarding } from '../lib/onboarding.js';\n\nexport async function setupCommand(): Promise<void> {\n const success = await runOnboarding({ isRerun: true });\n if (!success) {\n process.exit(1);\n }\n}\n\nexport default defineCommand({\n meta: {\n name: 'setup',\n description: 'Initialize the agentprofiles system (alias: init)',\n },\n async run() {\n await setupCommand();\n },\n});\n","import { defineCommand } from 'citty';\nimport { setupCommand } from './setup.js';\n\nexport default defineCommand({\n meta: {\n name: 'init',\n hidden: true,\n },\n async run() {\n await setupCommand();\n },\n});\n","import { defineCommand } from 'citty';\nimport { addCommand } from './add.js';\n\nexport default defineCommand({\n meta: {\n name: 'create',\n description: 'Create a new profile (alias for add)',\n hidden: true,\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Agent name (claude/opencode)',\n required: false,\n },\n name: {\n type: 'positional',\n description: 'Profile name',\n required: false,\n },\n },\n async run({ args }) {\n await addCommand(args.agent, args.name);\n },\n});\n","import { defineCommand } from 'citty';\nimport { removeCommand } from './remove.js';\n\nexport default defineCommand({\n meta: {\n name: 'rm',\n hidden: true,\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Agent name (claude/opencode)',\n required: true,\n },\n name: {\n type: 'positional',\n description: 'Profile name',\n required: false,\n },\n },\n async run({ args }) {\n await removeCommand(args.agent, args.name);\n },\n});\n","import { defineCommand, runMain } from 'citty';\nimport { createRequire } from 'node:module';\nimport { renderBanner, renderInfo } from './lib/banner.js';\nimport { checkForUpdates } from './lib/update.js';\n\nconst require = createRequire(import.meta.url);\nconst pkg = require('../package.json');\n\nconst isQuiet = process.argv.includes('--quiet') || process.argv.includes('-q');\n\nif (!isQuiet) {\n renderBanner();\n renderInfo(pkg);\n}\n\ncheckForUpdates(pkg).catch(() => {});\n\nconst knownSubcommands = [\n 'setup',\n 'init',\n 'list',\n 'add',\n 'create',\n 'edit',\n 'remove',\n 'rm',\n 'set',\n 'unset',\n 'status',\n 'release',\n 'doctor',\n];\n\nconst args = process.argv.slice(2);\nconst hasSubcommand = args.some(\n (arg) => knownSubcommands.includes(arg) || arg === '--help' || arg === '-h'\n);\nconst isHelpOrVersion = args.some(\n (arg) => arg === '--help' || arg === '-h' || arg === '--version' || arg === '-V'\n);\nconst isInitCommand = args.some((arg) => arg === 'init' || arg === 'setup');\n\nif (!isInitCommand && !isHelpOrVersion) {\n const { ensureInitialized } = await import('./lib/onboarding.js');\n await ensureInitialized();\n}\n\nif (!hasSubcommand && !isHelpOrVersion) {\n const { showMainMenu } = await import('./lib/main-menu.js');\n await showMainMenu();\n} else {\n const main = defineCommand({\n meta: {\n name: 'agentprofiles',\n version: pkg.version,\n description: pkg.description,\n },\n subCommands: {\n setup: () => import('./commands/setup.js').then((m) => m.default),\n init: () => import('./commands/init.js').then((m) => m.default),\n list: () => import('./commands/list.js').then((m) => m.default),\n add: () => import('./commands/add.js').then((m) => m.default),\n create: () => import('./commands/create.js').then((m) => m.default),\n edit: () => import('./commands/edit.js').then((m) => m.default),\n remove: () => import('./commands/remove.js').then((m) => m.default),\n rm: () => import('./commands/rm.js').then((m) => m.default),\n set: () => import('./commands/set.js').then((m) => m.default),\n unset: () => import('./commands/unset.js').then((m) => m.default),\n status: () => import('./commands/status.js').then((m) => m.default),\n release: () => import('./commands/release.js').then((m) => m.default),\n doctor: () => import('./commands/doctor.js').then((m) => m.default),\n },\n });\n\n runMain(main);\n}\n","import color from 'picocolors';\n\ndeclare const __DEV__: boolean;\ndeclare const __BUILD_TIME__: string;\ndeclare const __GIT_SHA__: string;\nconst isDev = typeof __DEV__ !== 'undefined' ? __DEV__ : true;\nconst buildTime = typeof __BUILD_TIME__ !== 'undefined' ? __BUILD_TIME__ : '';\nconst gitSha = typeof __GIT_SHA__ !== 'undefined' ? __GIT_SHA__ : '';\n\n// Pre-generated banner (cfonts tiny/candy)\n// Regenerate with: cfonts \"agentprofiles\" -f tiny -c candy\nconst BANNER =\n '\\n\\u001b[93m \\u001b[39m\\u001b[94m▄▀█\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[35m█▀▀\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[92m█▀▀\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[36m█▄ █\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[92m▀█▀\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[91m█▀█\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[36m█▀█\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[92m█▀█\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[92m█▀▀\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[32m█\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[92m█ \\u001b[39m\\u001b[93m \\u001b[39m\\u001b[92m█▀▀\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[31m█▀▀\\u001b[39m\\n\\u001b[31m \\u001b[39m\\u001b[95m█▀█\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[35m█▄█\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[32m██▄\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[33m█ ▀█\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[36m █ \\u001b[39m\\u001b[31m \\u001b[39m\\u001b[36m█▀▀\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[35m█▀▄\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[91m█▄█\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[95m█▀ \\u001b[39m\\u001b[31m \\u001b[39m\\u001b[31m█\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[92m█▄▄\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[32m██▄\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[95m▄▄█\\u001b[39m\\n';\n\nexport function renderBanner(): void {\n console.log(BANNER);\n}\n\nexport function renderInfo(pkg: { name: string; version: string; description?: string }): void {\n const devMetaParts: string[] = [];\n if (gitSha) devMetaParts.push(gitSha);\n if (buildTime) devMetaParts.push(`@ ${buildTime}`);\n const devLabel = devMetaParts.length > 0 ? `dev ${devMetaParts.join(' ')}` : 'dev';\n const devTag = isDev ? color.yellow(` (${devLabel})`) : '';\n const info = `${color.dim(pkg.name)} ${color.cyan(`v${pkg.version}`)}${devTag}`;\n // Use a clean description\n const desc = pkg.description\n ? color.dim(` — Manage configuration profiles for LLM agent tools`)\n : '';\n console.log(`${info}${desc}\\n`);\n}\n","import { execSync } from 'node:child_process';\nimport fs from 'node:fs';\n\ntype PackageManager = 'npm' | 'pnpm' | 'yarn' | 'volta' | 'unknown';\n\ninterface DetectionResult {\n manager: PackageManager;\n updateCommand: string;\n}\n\nfunction getInstallLocation(binName: string): string | null {\n try {\n const whichResult = execSync(`which ${binName}`, { encoding: 'utf-8' }).trim();\n return fs.realpathSync(whichResult);\n } catch {\n return null;\n }\n}\n\nfunction detectPackageManager(installPath: string | null, pkgName: string): DetectionResult {\n if (!installPath) {\n return { manager: 'unknown', updateCommand: `npm i -g ${pkgName}` };\n }\n\n const path = installPath.toLowerCase();\n\n if (path.includes('pnpm/global') || path.includes('.local/share/pnpm')) {\n return { manager: 'pnpm', updateCommand: `pnpm add -g ${pkgName}` };\n }\n\n if (path.includes('yarn/global') || path.includes('.yarn')) {\n return { manager: 'yarn', updateCommand: `yarn global add ${pkgName}` };\n }\n\n if (path.includes('.volta/')) {\n return { manager: 'volta', updateCommand: `volta install ${pkgName}` };\n }\n\n return { manager: 'npm', updateCommand: `npm i -g ${pkgName}` };\n}\n\nexport async function checkForUpdates(pkg: { name: string; version: string }): Promise<void> {\n const { default: updateNotifier } = await import('update-notifier');\n\n const installPath = getInstallLocation('agentprofiles');\n const { updateCommand } = detectPackageManager(installPath, pkg.name);\n\n const notifier = updateNotifier({\n pkg,\n updateCheckInterval: 1000 * 60 * 60 * 24,\n });\n\n notifier.notify({\n message: `Update available {currentVersion} → {latestVersion}\\nRun ${updateCommand} to update`,\n defer: true,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAF9B;AAAA;AAAA;AAAA;AAAA;;;ACOA,SAAS,YAAY,OAAO,IAAI;AAC/B,MAAI,eAAe,KAAK,IAAI,EAAG;AAC/B,SAAO,SAAS,KAAK,YAAY;AAClC;AACA,SAAS,YAAY,KAAK,YAAY;AACrC,QAAM,YAAY,cAAc;AAChC,QAAM,QAAQ,CAAC;AACf,MAAI,CAAC,OAAO,OAAO,QAAQ,SAAU,QAAO;AAC5C,MAAI,OAAO;AACX,MAAI;AACJ,MAAI;AACJ,aAAW,QAAQ,KAAK;AACvB,UAAM,aAAa,UAAU,SAAS,IAAI;AAC1C,QAAI,eAAe,MAAM;AACxB,YAAM,KAAK,IAAI;AACf,aAAO;AACP,sBAAgB;AAChB;AAAA,IACD;AACA,UAAM,UAAU,YAAY,IAAI;AAChC,QAAI,qBAAqB,OAAO;AAC/B,UAAI,kBAAkB,SAAS,YAAY,MAAM;AAChD,cAAM,KAAK,IAAI;AACf,eAAO;AACP,wBAAgB;AAChB;AAAA,MACD;AACA,UAAI,kBAAkB,QAAQ,YAAY,SAAS,KAAK,SAAS,GAAG;AACnE,cAAM,WAAW,KAAK,GAAG,EAAE;AAC3B,cAAM,KAAK,KAAK,MAAM,GAAG,KAAK,IAAI,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC;AACtD,eAAO,WAAW;AAClB,wBAAgB;AAChB;AAAA,MACD;AAAA,IACD;AACA,YAAQ;AACR,oBAAgB;AAChB,uBAAmB;AAAA,EACpB;AACA,QAAM,KAAK,IAAI;AACf,SAAO;AACR;AACA,SAAS,WAAW,KAAK;AACxB,SAAO,MAAM,IAAI,CAAC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AE,OAAO;AAAA,MAC9D,QAAQ,MAAM,8DAA+B,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,MAClE,IAAI,MAAM,sDAA2B,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,MAC1D,KAAK,MAAM,wDAA4B,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,MAC5D,OAAO,MAAM,4DAA8B,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,MAChE,QAAQ,MAAM,8DAA+B,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,MAClE,SAAS,MAAM,gEAAgC,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,MACpE,QAAQ,MAAM,8DAA+B,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,IACpE;AAAA,EACF,CAAC;AAED,UAAQ,IAAI;AACd;","names":["p","args","p","f","x","y","findCursor","cursor","delta","options","opt","newCursor","maxCursor","clampedCursor","wrapAnsi","string","columns","line","exec","isActionKey","key","action","settings","value","diffLines","a","b","aLines","bLines","numLines","diff","i","isCancel","CANCEL_SYMBOL","setRawMode","input","block","stdin","output","stdout","overwrite","hideCursor","rl","readline","ReadStream","clear","data","name","sequence","str","dx","dy","isWindows","wrapTextWithPrefix","text","prefix","startPrefix","getColumns","index","isAmbiguous","isFullWidth","isWide","ANSI_RE","CONTROL_RE","TAB_RE","EMOJI_RE","LATIN_RE","MODIFIER_RE","NO_TRUNCATION","getStringTruncatedWidth","fastStringWidth","ESC","CSI","END_CODE","ANSI_ESCAPE_BELL","ANSI_CSI","ANSI_OSC","ANSI_SGR_TERMINATOR","ANSI_ESCAPE_LINK","GROUP_REGEX","getClosingCode","wrapAnsiCode","wrapAnsiHyperlink","wordLengths","wrapWord","stringVisibleTrimSpacesRight","actions","getRows","Prompt","ConfirmPrompt","SelectPrompt","TextPrompt","x","truncationOptions","widthOptions","LIMIT","ELLIPSIS","ELLIPSIS_WIDTH","ANSI_WIDTH","CONTROL_WIDTH","TAB_WIDTH","AMBIGUOUS_WIDTH","EMOJI_WIDTH","FULL_WIDTH_WIDTH","REGULAR_WIDTH","WIDE_WIDTH","indexPrev","length","lengthExtra","truncationEnabled","truncationIndex","truncationLimit","unmatchedStart","unmatchedEnd","width","widthExtra","outer","unmatched","char","codePoint","fastStringTruncatedWidth","openingCode","code","url","words","character","stringWidth","rows","word","characters","isInsideEscape","isInsideLinkEscape","lastRow","visible","currentCharacter","nextCharacter","rawCharacterIndex","characterLength","last","returnValue","escapeCode","escapeUrl","lengths","rowLength","remainingColumns","breaksStartingThisLine","row","preString","pre","currentPre","nextPre","preStringIndex","groups","closingCode","trackValue","render","signal","opts","event","params","cb","cbs","cleanup","subscriber","resolve","_key","write","problem","lines","frame","diffOffsetAfter","diffOffsetBefore","diffLine","erase","adjustedDiffLine","newLines","confirm","initialCursor","userInput","s1","s2","s3","color","isUnicodeSupported","process","wrapAnsi","string","columns","options","line","exec","unicode","isCI","unicodeOr","S_STEP_ACTIVE","S_STEP_CANCEL","S_STEP_ERROR","S_STEP_SUBMIT","S_BAR_START","S_BAR","S_BAR_END","S_BAR_START_RIGHT","S_BAR_END_RIGHT","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_CORNER_BOTTOM_LEFT","S_CORNER_TOP_LEFT","S_INFO","S_SUCCESS","S_WARN","S_ERROR","symbol","symbolBar","isAmbiguous","isFullWidth","isWide","ANSI_RE","CONTROL_RE","TAB_RE","EMOJI_RE","LATIN_RE","MODIFIER_RE","NO_TRUNCATION","getStringTruncatedWidth","fastStringWidth","ESC","CSI","END_CODE","ANSI_ESCAPE_BELL","ANSI_CSI","ANSI_OSC","ANSI_SGR_TERMINATOR","ANSI_ESCAPE_LINK","GROUP_REGEX","getClosingCode","wrapAnsiCode","wrapAnsiHyperlink","wordLengths","wrapWord","stringVisibleTrimSpacesRight","trimLines","limitOptions","confirm","log","cancel","intro","outro","defaultNoteFormatter","wrapWithFormat","note","defaultStyleFn","spinner","S_PROGRESS_CHAR","computeLabel","select","prefix","text","c","fallback","state","color","x","input","truncationOptions","widthOptions","LIMIT","ELLIPSIS","ELLIPSIS_WIDTH","ANSI_WIDTH","CONTROL_WIDTH","TAB_WIDTH","AMBIGUOUS_WIDTH","EMOJI_WIDTH","FULL_WIDTH_WIDTH","REGULAR_WIDTH","WIDE_WIDTH","indexPrev","index","length","lengthExtra","truncationEnabled","truncationIndex","truncationLimit","unmatchedStart","unmatchedEnd","width","widthExtra","outer","unmatched","char","codePoint","fastStringTruncatedWidth","openingCode","code","url","words","character","stringWidth","rows","word","characters","isInsideEscape","isInsideLinkEscape","lastRow","visible","currentCharacter","nextCharacter","rawCharacterIndex","characterLength","last","returnValue","escapeCode","escapeUrl","lengths","rowLength","remainingColumns","breaksStartingThisLine","row","preString","pre","currentPre","nextPre","preStringIndex","groups","closingCode","initialLineCount","startIndex","endIndex","maxLines","lineCount","removals","i","group","params","cursor","style","output","getColumns","columnPadding","rowPadding","maxWidth","getRows","overflowFormat","paramMaxItems","outputMaxItems","maxItems","slidingWindowLocation","shouldRenderTopEllipsis","shouldRenderBottomEllipsis","slidingWindowLocationEnd","lineGroups","slidingWindowLocationWithEllipsis","slidingWindowLocationEndWithEllipsis","wrappedLines","precedingRemovals","followingRemovals","newLineCount","cursorGroupIndex","trimLinesLocal","result","lineGroup","opts","active","inactive","ConfirmPrompt","hasGuide","settings","title","value","submitPrefix","cancelPrefix","defaultPrefix","defaultPrefixEnd","message","secondarySymbol","spacing","withGuide","parts","spacingString","secondaryPrefix","messageParts","firstLine","lines","ln","format","wrapMsg","maxWidthNormal","sum","maxWidthFormat","wrapWidth","titleLen","len","msg","leadingBorder","bottomLeft","indicator","onCancel","cancelMessage","errorMessage","frames","delay","signal","isCIFn","unblock","loop","isSpinnerActive","isCancelled","_message","_prevMessage","_origin","styleFn","handleExit","_stop","errorEventHandler","signalEventHandler","registerHooks","clearHooks","clearPrevMessage","prevLines","erase","removeTrailingDots","formatTimer","origin","duration","min","secs","start","block","frameIndex","indicatorTimer","frame","outputMessage","loadingDots","wrapped","silent","step","label","opt","option","str","SelectPrompt","titlePrefix","titlePrefixBar","messageLines","wrapTextWithPrefix","prefixEnd","titleLineCount","footerLineCount","item","TextPrompt","placeholder","userInput","errorText","errorPrefix","errorPrefixEnd","valueText","fs","path","fs","path","globalPath","target","fs","path","os","getDefaultConfigDir","color","R","bt","import_picocolors","init_dist","color","import_picocolors","color","R","p","import_picocolors","init_dist","args","d","y","k","x","j","z","q","N","T","B","O","L","Q","I","X","Z","init_dist","e","p","init_dist","fs","path","color","import_picocolors","init_dist","args","p","color","import_picocolors","init_dist","args","color","import_picocolors","init_dist","args","path","color","args","child","import_picocolors","init_dist","fs","path","color","import_picocolors","init_dist","args","color","import_picocolors","init_dist","args","fs","path","color","import_picocolors","init_dist","statusCommand","listCommand","addCommand","setCommand","unsetCommand","editCommand","removeCommand","releaseCommand","doctorCommand","init_dist","args","args","pkg","color","path","pkg","require","ensureInitialized","showMainMenu","m"]}
|
|
1
|
+
{"version":3,"sources":["../node_modules/tsup/assets/esm_shims.js","../node_modules/citty/dist/_chunks/libs/scule.mjs","../node_modules/citty/dist/index.mjs","../node_modules/picocolors/picocolors.js","../node_modules/sisteransi/src/index.js","../node_modules/@clack/core/src/utils/cursor.ts","../node_modules/node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js","../node_modules/node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js","../node_modules/node_modules/.pnpm/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js","../node_modules/node_modules/.pnpm/fast-wrap-ansi@0.1.3/node_modules/fast-wrap-ansi/lib/main.js","../node_modules/@clack/core/src/utils/settings.ts","../node_modules/@clack/core/src/utils/string.ts","../node_modules/@clack/core/src/utils/index.ts","../node_modules/@clack/core/src/prompts/prompt.ts","../node_modules/@clack/core/src/prompts/autocomplete.ts","../node_modules/@clack/core/src/prompts/confirm.ts","../node_modules/@clack/core/src/prompts/group-multiselect.ts","../node_modules/@clack/core/src/prompts/multi-select.ts","../node_modules/@clack/core/src/prompts/password.ts","../node_modules/@clack/core/src/prompts/select.ts","../node_modules/@clack/core/src/prompts/select-key.ts","../node_modules/@clack/core/src/prompts/text.ts","../node_modules/node_modules/.pnpm/is-unicode-supported@1.3.0/node_modules/is-unicode-supported/index.js","../node_modules/@clack/prompts/src/common.ts","../node_modules/node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js","../node_modules/node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js","../node_modules/node_modules/.pnpm/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js","../node_modules/node_modules/.pnpm/fast-wrap-ansi@0.1.3/node_modules/fast-wrap-ansi/lib/main.js","../node_modules/@clack/prompts/src/limit-options.ts","../node_modules/@clack/prompts/src/autocomplete.ts","../node_modules/@clack/prompts/src/box.ts","../node_modules/@clack/prompts/src/confirm.ts","../node_modules/@clack/prompts/src/group.ts","../node_modules/@clack/prompts/src/group-multi-select.ts","../node_modules/@clack/prompts/src/log.ts","../node_modules/@clack/prompts/src/messages.ts","../node_modules/@clack/prompts/src/multi-select.ts","../node_modules/@clack/prompts/src/note.ts","../node_modules/@clack/prompts/src/password.ts","../node_modules/@clack/prompts/src/path.ts","../node_modules/@clack/prompts/src/spinner.ts","../node_modules/@clack/prompts/src/progress-bar.ts","../node_modules/@clack/prompts/src/select.ts","../node_modules/@clack/prompts/src/select-key.ts","../node_modules/@clack/prompts/src/stream.ts","../node_modules/@clack/prompts/src/task.ts","../node_modules/@clack/prompts/src/task-log.ts","../node_modules/@clack/prompts/src/text.ts","../src/types/index.ts","../src/lib/validation.ts","../src/lib/profileinclude.ts","../src/lib/gitignore.ts","../src/lib/symlink.ts","../src/lib/config.ts","../src/lib/onboarding.ts","../src/commands/status.ts","../src/commands/list.ts","../node_modules/joyful/dist/index.mjs","../src/lib/prompts.ts","../src/commands/add.ts","../src/commands/set.ts","../src/commands/unset.ts","../src/commands/edit.ts","../src/commands/remove.ts","../src/commands/release.ts","../src/commands/doctor.ts","../src/lib/main-menu.ts","../src/commands/setup.ts","../src/commands/init.ts","../src/commands/create.ts","../src/commands/rm.ts","../src/index.ts","../src/lib/banner.ts","../src/lib/update.ts"],"sourcesContent":["// Shim globals in esm bundle\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","const NUMBER_CHAR_RE = /\\d/;\nconst STR_SPLITTERS = [\n\t\"-\",\n\t\"_\",\n\t\"/\",\n\t\".\"\n];\nfunction isUppercase(char = \"\") {\n\tif (NUMBER_CHAR_RE.test(char)) return;\n\treturn char !== char.toLowerCase();\n}\nfunction splitByCase(str, separators) {\n\tconst splitters = separators ?? STR_SPLITTERS;\n\tconst parts = [];\n\tif (!str || typeof str !== \"string\") return parts;\n\tlet buff = \"\";\n\tlet previousUpper;\n\tlet previousSplitter;\n\tfor (const char of str) {\n\t\tconst isSplitter = splitters.includes(char);\n\t\tif (isSplitter === true) {\n\t\t\tparts.push(buff);\n\t\t\tbuff = \"\";\n\t\t\tpreviousUpper = void 0;\n\t\t\tcontinue;\n\t\t}\n\t\tconst isUpper = isUppercase(char);\n\t\tif (previousSplitter === false) {\n\t\t\tif (previousUpper === false && isUpper === true) {\n\t\t\t\tparts.push(buff);\n\t\t\t\tbuff = char;\n\t\t\t\tpreviousUpper = isUpper;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (previousUpper === true && isUpper === false && buff.length > 1) {\n\t\t\t\tconst lastChar = buff.at(-1);\n\t\t\t\tparts.push(buff.slice(0, Math.max(0, buff.length - 1)));\n\t\t\t\tbuff = lastChar + char;\n\t\t\t\tpreviousUpper = isUpper;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tbuff += char;\n\t\tpreviousUpper = isUpper;\n\t\tpreviousSplitter = isSplitter;\n\t}\n\tparts.push(buff);\n\treturn parts;\n}\nfunction upperFirst(str) {\n\treturn str ? str[0].toUpperCase() + str.slice(1) : \"\";\n}\nfunction lowerFirst(str) {\n\treturn str ? str[0].toLowerCase() + str.slice(1) : \"\";\n}\nfunction pascalCase(str, opts) {\n\treturn str ? (Array.isArray(str) ? str : splitByCase(str)).map((p) => upperFirst(opts?.normalize ? p.toLowerCase() : p)).join(\"\") : \"\";\n}\nfunction camelCase(str, opts) {\n\treturn lowerFirst(pascalCase(str || \"\", opts));\n}\nfunction kebabCase(str, joiner) {\n\treturn str ? (Array.isArray(str) ? str : splitByCase(str)).map((p) => p.toLowerCase()).join(joiner ?? \"-\") : \"\";\n}\nexport { kebabCase as n, camelCase as t };\n","import { n as kebabCase, t as camelCase } from \"./_chunks/libs/scule.mjs\";\nimport { parseArgs as parseArgs$1 } from \"node:util\";\nfunction toArray(val) {\n\tif (Array.isArray(val)) return val;\n\treturn val === void 0 ? [] : [val];\n}\nfunction formatLineColumns(lines, linePrefix = \"\") {\n\tconst maxLength = [];\n\tfor (const line of lines) for (const [i, element] of line.entries()) maxLength[i] = Math.max(maxLength[i] || 0, element.length);\n\treturn lines.map((l) => l.map((c, i) => linePrefix + c[i === 0 ? \"padStart\" : \"padEnd\"](maxLength[i])).join(\" \")).join(\"\\n\");\n}\nfunction resolveValue(input) {\n\treturn typeof input === \"function\" ? input() : input;\n}\nvar CLIError = class extends Error {\n\tcode;\n\tconstructor(message, code) {\n\t\tsuper(message);\n\t\tthis.name = \"CLIError\";\n\t\tthis.code = code;\n\t}\n};\nfunction parseRawArgs(args = [], opts = {}) {\n\tconst booleans = new Set(opts.boolean || []);\n\tconst strings = new Set(opts.string || []);\n\tconst aliasMap = opts.alias || {};\n\tconst defaults = opts.default || {};\n\tconst aliasToMain = /* @__PURE__ */ new Map();\n\tconst mainToAliases = /* @__PURE__ */ new Map();\n\tfor (const [key, value] of Object.entries(aliasMap)) {\n\t\tconst targets = value;\n\t\tfor (const target of targets) {\n\t\t\taliasToMain.set(key, target);\n\t\t\tif (!mainToAliases.has(target)) mainToAliases.set(target, []);\n\t\t\tmainToAliases.get(target).push(key);\n\t\t\taliasToMain.set(target, key);\n\t\t\tif (!mainToAliases.has(key)) mainToAliases.set(key, []);\n\t\t\tmainToAliases.get(key).push(target);\n\t\t}\n\t}\n\tconst options = {};\n\tfunction getType(name) {\n\t\tif (booleans.has(name)) return \"boolean\";\n\t\tconst aliases = mainToAliases.get(name) || [];\n\t\tfor (const alias of aliases) if (booleans.has(alias)) return \"boolean\";\n\t\treturn \"string\";\n\t}\n\tconst allOptions = new Set([\n\t\t...booleans,\n\t\t...strings,\n\t\t...Object.keys(aliasMap),\n\t\t...Object.values(aliasMap).flat(),\n\t\t...Object.keys(defaults)\n\t]);\n\tfor (const name of allOptions) if (!options[name]) options[name] = {\n\t\ttype: getType(name),\n\t\tdefault: defaults[name]\n\t};\n\tfor (const [alias, main] of aliasToMain.entries()) if (alias.length === 1 && options[main] && !options[main].short) options[main].short = alias;\n\tconst processedArgs = [];\n\tconst negatedFlags = {};\n\tfor (let i = 0; i < args.length; i++) {\n\t\tconst arg = args[i];\n\t\tif (arg === \"--\") {\n\t\t\tprocessedArgs.push(...args.slice(i));\n\t\t\tbreak;\n\t\t}\n\t\tif (arg.startsWith(\"--no-\")) {\n\t\t\tconst flagName = arg.slice(5);\n\t\t\tnegatedFlags[flagName] = true;\n\t\t\tcontinue;\n\t\t}\n\t\tprocessedArgs.push(arg);\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = parseArgs$1({\n\t\t\targs: processedArgs,\n\t\t\toptions: Object.keys(options).length > 0 ? options : void 0,\n\t\t\tallowPositionals: true,\n\t\t\tstrict: false\n\t\t});\n\t} catch {\n\t\tparsed = {\n\t\t\tvalues: {},\n\t\t\tpositionals: processedArgs\n\t\t};\n\t}\n\tconst out = { _: [] };\n\tout._ = parsed.positionals;\n\tfor (const [key, value] of Object.entries(parsed.values)) out[key] = value;\n\tfor (const [name] of Object.entries(negatedFlags)) {\n\t\tout[name] = false;\n\t\tconst mainName = aliasToMain.get(name);\n\t\tif (mainName) out[mainName] = false;\n\t\tconst aliases = mainToAliases.get(name);\n\t\tif (aliases) for (const alias of aliases) out[alias] = false;\n\t}\n\tfor (const [alias, main] of aliasToMain.entries()) {\n\t\tif (out[alias] !== void 0 && out[main] === void 0) out[main] = out[alias];\n\t\tif (out[main] !== void 0 && out[alias] === void 0) out[alias] = out[main];\n\t}\n\treturn out;\n}\nconst noColor = /* @__PURE__ */ (() => {\n\tconst env = globalThis.process?.env ?? {};\n\treturn env.NO_COLOR === \"1\" || env.TERM === \"dumb\" || env.TEST || env.CI;\n})();\nconst _c = (c, r = 39) => (t) => noColor ? t : `\\u001B[${c}m${t}\\u001B[${r}m`;\nconst bold = /* @__PURE__ */ _c(1, 22);\nconst cyan = /* @__PURE__ */ _c(36);\nconst gray = /* @__PURE__ */ _c(90);\nconst underline = /* @__PURE__ */ _c(4, 24);\nfunction parseArgs(rawArgs, argsDef) {\n\tconst parseOptions = {\n\t\tboolean: [],\n\t\tstring: [],\n\t\talias: {},\n\t\tdefault: {}\n\t};\n\tconst args = resolveArgs(argsDef);\n\tfor (const arg of args) {\n\t\tif (arg.type === \"positional\") continue;\n\t\tif (arg.type === \"string\" || arg.type === \"enum\") parseOptions.string.push(arg.name);\n\t\telse if (arg.type === \"boolean\") parseOptions.boolean.push(arg.name);\n\t\tif (arg.default !== void 0) parseOptions.default[arg.name] = arg.default;\n\t\tif (arg.alias) parseOptions.alias[arg.name] = arg.alias;\n\t\tconst camelName = camelCase(arg.name);\n\t\tconst kebabName = kebabCase(arg.name);\n\t\tif (camelName !== arg.name || kebabName !== arg.name) {\n\t\t\tconst existingAliases = toArray(parseOptions.alias[arg.name] || []);\n\t\t\tif (camelName !== arg.name && !existingAliases.includes(camelName)) existingAliases.push(camelName);\n\t\t\tif (kebabName !== arg.name && !existingAliases.includes(kebabName)) existingAliases.push(kebabName);\n\t\t\tif (existingAliases.length > 0) parseOptions.alias[arg.name] = existingAliases;\n\t\t}\n\t}\n\tconst parsed = parseRawArgs(rawArgs, parseOptions);\n\tconst [ ...positionalArguments] = parsed._;\n\tconst parsedArgsProxy = new Proxy(parsed, { get(target, prop) {\n\t\treturn target[prop] ?? target[camelCase(prop)] ?? target[kebabCase(prop)];\n\t} });\n\tfor (const [, arg] of args.entries()) if (arg.type === \"positional\") {\n\t\tconst nextPositionalArgument = positionalArguments.shift();\n\t\tif (nextPositionalArgument !== void 0) parsedArgsProxy[arg.name] = nextPositionalArgument;\n\t\telse if (arg.default === void 0 && arg.required !== false) throw new CLIError(`Missing required positional argument: ${arg.name.toUpperCase()}`, \"EARG\");\n\t\telse parsedArgsProxy[arg.name] = arg.default;\n\t} else if (arg.type === \"enum\") {\n\t\tconst argument = parsedArgsProxy[arg.name];\n\t\tconst options = arg.options || [];\n\t\tif (argument !== void 0 && options.length > 0 && !options.includes(argument)) throw new CLIError(`Invalid value for argument: ${cyan(`--${arg.name}`)} (${cyan(argument)}). Expected one of: ${options.map((o) => cyan(o)).join(\", \")}.`, \"EARG\");\n\t} else if (arg.required && parsedArgsProxy[arg.name] === void 0) throw new CLIError(`Missing required argument: --${arg.name}`, \"EARG\");\n\treturn parsedArgsProxy;\n}\nfunction resolveArgs(argsDef) {\n\tconst args = [];\n\tfor (const [name, argDef] of Object.entries(argsDef || {})) args.push({\n\t\t...argDef,\n\t\tname,\n\t\talias: toArray(argDef.alias)\n\t});\n\treturn args;\n}\nfunction defineCommand(def) {\n\treturn def;\n}\nasync function runCommand(cmd, opts) {\n\tconst cmdArgs = await resolveValue(cmd.args || {});\n\tconst parsedArgs = parseArgs(opts.rawArgs, cmdArgs);\n\tconst context = {\n\t\trawArgs: opts.rawArgs,\n\t\targs: parsedArgs,\n\t\tdata: opts.data,\n\t\tcmd\n\t};\n\tif (typeof cmd.setup === \"function\") await cmd.setup(context);\n\tlet result;\n\ttry {\n\t\tconst subCommands = await resolveValue(cmd.subCommands);\n\t\tif (subCommands && Object.keys(subCommands).length > 0) {\n\t\t\tconst subCommandArgIndex = opts.rawArgs.findIndex((arg) => !arg.startsWith(\"-\"));\n\t\t\tconst subCommandName = opts.rawArgs[subCommandArgIndex];\n\t\t\tif (subCommandName) {\n\t\t\t\tif (!subCommands[subCommandName]) throw new CLIError(`Unknown command ${cyan(subCommandName)}`, \"E_UNKNOWN_COMMAND\");\n\t\t\t\tconst subCommand = await resolveValue(subCommands[subCommandName]);\n\t\t\t\tif (subCommand) await runCommand(subCommand, { rawArgs: opts.rawArgs.slice(subCommandArgIndex + 1) });\n\t\t\t} else if (!cmd.run) throw new CLIError(`No command specified.`, \"E_NO_COMMAND\");\n\t\t}\n\t\tif (typeof cmd.run === \"function\") result = await cmd.run(context);\n\t} finally {\n\t\tif (typeof cmd.cleanup === \"function\") await cmd.cleanup(context);\n\t}\n\treturn { result };\n}\nasync function resolveSubCommand(cmd, rawArgs, parent) {\n\tconst subCommands = await resolveValue(cmd.subCommands);\n\tif (subCommands && Object.keys(subCommands).length > 0) {\n\t\tconst subCommandArgIndex = rawArgs.findIndex((arg) => !arg.startsWith(\"-\"));\n\t\tconst subCommandName = rawArgs[subCommandArgIndex];\n\t\tconst subCommand = await resolveValue(subCommands[subCommandName]);\n\t\tif (subCommand) return resolveSubCommand(subCommand, rawArgs.slice(subCommandArgIndex + 1), cmd);\n\t}\n\treturn [cmd, parent];\n}\nasync function showUsage(cmd, parent) {\n\ttry {\n\t\tconsole.log(await renderUsage(cmd, parent) + \"\\n\");\n\t} catch (error) {\n\t\tconsole.error(error);\n\t}\n}\nconst negativePrefixRe = /^no[-A-Z]/;\nasync function renderUsage(cmd, parent) {\n\tconst cmdMeta = await resolveValue(cmd.meta || {});\n\tconst cmdArgs = resolveArgs(await resolveValue(cmd.args || {}));\n\tconst parentMeta = await resolveValue(parent?.meta || {});\n\tconst commandName = `${parentMeta.name ? `${parentMeta.name} ` : \"\"}` + (cmdMeta.name || process.argv[1]);\n\tconst argLines = [];\n\tconst posLines = [];\n\tconst commandsLines = [];\n\tconst usageLine = [];\n\tfor (const arg of cmdArgs) if (arg.type === \"positional\") {\n\t\tconst name = arg.name.toUpperCase();\n\t\tconst isRequired = arg.required !== false && arg.default === void 0;\n\t\tconst defaultHint = arg.default ? `=\"${arg.default}\"` : \"\";\n\t\tposLines.push([\n\t\t\tcyan(name + defaultHint),\n\t\t\targ.description || \"\",\n\t\t\targ.valueHint ? `<${arg.valueHint}>` : \"\"\n\t\t]);\n\t\tusageLine.push(isRequired ? `<${name}>` : `[${name}]`);\n\t} else {\n\t\tconst isRequired = arg.required === true && arg.default === void 0;\n\t\tconst argStr = [...(arg.alias || []).map((a) => `-${a}`), `--${arg.name}`].join(\", \") + (arg.type === \"string\" && (arg.valueHint || arg.default) ? `=${arg.valueHint ? `<${arg.valueHint}>` : `\"${arg.default || \"\"}\"`}` : \"\") + (arg.type === \"enum\" && arg.options ? `=<${arg.options.join(\"|\")}>` : \"\");\n\t\targLines.push([cyan(argStr + (isRequired ? \" (required)\" : \"\")), arg.description || \"\"]);\n\t\tif (arg.type === \"boolean\" && (arg.default === true || arg.negativeDescription) && !negativePrefixRe.test(arg.name)) {\n\t\t\tconst negativeArgStr = [...(arg.alias || []).map((a) => `--no-${a}`), `--no-${arg.name}`].join(\", \");\n\t\t\targLines.push([cyan(negativeArgStr + (isRequired ? \" (required)\" : \"\")), arg.negativeDescription || \"\"]);\n\t\t}\n\t\tif (isRequired) usageLine.push(argStr);\n\t}\n\tif (cmd.subCommands) {\n\t\tconst commandNames = [];\n\t\tconst subCommands = await resolveValue(cmd.subCommands);\n\t\tfor (const [name, sub] of Object.entries(subCommands)) {\n\t\t\tconst meta = await resolveValue((await resolveValue(sub))?.meta);\n\t\t\tif (meta?.hidden) continue;\n\t\t\tcommandsLines.push([cyan(name), meta?.description || \"\"]);\n\t\t\tcommandNames.push(name);\n\t\t}\n\t\tusageLine.push(commandNames.join(\"|\"));\n\t}\n\tconst usageLines = [];\n\tconst version = cmdMeta.version || parentMeta.version;\n\tusageLines.push(gray(`${cmdMeta.description} (${commandName + (version ? ` v${version}` : \"\")})`), \"\");\n\tconst hasOptions = argLines.length > 0 || posLines.length > 0;\n\tusageLines.push(`${underline(bold(\"USAGE\"))} ${cyan(`${commandName}${hasOptions ? \" [OPTIONS]\" : \"\"} ${usageLine.join(\" \")}`)}`, \"\");\n\tif (posLines.length > 0) {\n\t\tusageLines.push(underline(bold(\"ARGUMENTS\")), \"\");\n\t\tusageLines.push(formatLineColumns(posLines, \" \"));\n\t\tusageLines.push(\"\");\n\t}\n\tif (argLines.length > 0) {\n\t\tusageLines.push(underline(bold(\"OPTIONS\")), \"\");\n\t\tusageLines.push(formatLineColumns(argLines, \" \"));\n\t\tusageLines.push(\"\");\n\t}\n\tif (commandsLines.length > 0) {\n\t\tusageLines.push(underline(bold(\"COMMANDS\")), \"\");\n\t\tusageLines.push(formatLineColumns(commandsLines, \" \"));\n\t\tusageLines.push(\"\", `Use ${cyan(`${commandName} <command> --help`)} for more information about a command.`);\n\t}\n\treturn usageLines.filter((l) => typeof l === \"string\").join(\"\\n\");\n}\nasync function runMain(cmd, opts = {}) {\n\tconst rawArgs = opts.rawArgs || process.argv.slice(2);\n\tconst showUsage$1 = opts.showUsage || showUsage;\n\ttry {\n\t\tif (rawArgs.includes(\"--help\") || rawArgs.includes(\"-h\")) {\n\t\t\tawait showUsage$1(...await resolveSubCommand(cmd, rawArgs));\n\t\t\tprocess.exit(0);\n\t\t} else if (rawArgs.length === 1 && rawArgs[0] === \"--version\") {\n\t\t\tconst meta = typeof cmd.meta === \"function\" ? await cmd.meta() : await cmd.meta;\n\t\t\tif (!meta?.version) throw new CLIError(\"No version specified\", \"E_NO_VERSION\");\n\t\t\tconsole.log(meta.version);\n\t\t} else await runCommand(cmd, { rawArgs });\n\t} catch (error) {\n\t\tif (error instanceof CLIError) {\n\t\t\tawait showUsage$1(...await resolveSubCommand(cmd, rawArgs));\n\t\t\tconsole.error(error.message);\n\t\t} else console.error(error, \"\\n\");\n\t\tprocess.exit(1);\n\t}\n}\nfunction createMain(cmd) {\n\treturn (opts = {}) => runMain(cmd, opts);\n}\nexport { createMain, defineCommand, parseArgs, renderUsage, runCommand, runMain, showUsage };\n","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 function findCursor<T extends { disabled?: boolean }>(\n\tcursor: number,\n\tdelta: number,\n\toptions: T[]\n) {\n\tconst hasEnabledOptions = options.some((opt) => !opt.disabled);\n\tif (!hasEnabledOptions) {\n\t\treturn cursor;\n\t}\n\tconst newCursor = cursor + delta;\n\tconst maxCursor = Math.max(options.length - 1, 0);\n\tconst clampedCursor = newCursor < 0 ? maxCursor : newCursor > maxCursor ? 0 : newCursor;\n\tconst newOption = options[clampedCursor];\n\tif (newOption.disabled) {\n\t\treturn findCursor(clampedCursor, delta < 0 ? -1 : 1, options);\n\t}\n\treturn clampedCursor;\n}\n","/* MAIN */\n//URL: https://github.com/sindresorhus/get-east-asian-width/blob/main/lookup.js\n//LICENSE: https://github.com/sindresorhus/get-east-asian-width/blob/main/license\n//TODO: Replace these with some unicode property classes, if the ones we need exist\nconst isAmbiguous = (x) => {\n return x === 0xA1 || x === 0xA4 || x === 0xA7 || x === 0xA8 || x === 0xAA || x === 0xAD || x === 0xAE || x >= 0xB0 && x <= 0xB4 || x >= 0xB6 && x <= 0xBA || x >= 0xBC && x <= 0xBF || x === 0xC6 || x === 0xD0 || x === 0xD7 || x === 0xD8 || x >= 0xDE && x <= 0xE1 || x === 0xE6 || x >= 0xE8 && x <= 0xEA || x === 0xEC || x === 0xED || x === 0xF0 || x === 0xF2 || x === 0xF3 || x >= 0xF7 && x <= 0xFA || x === 0xFC || x === 0xFE || x === 0x101 || x === 0x111 || x === 0x113 || x === 0x11B || x === 0x126 || x === 0x127 || x === 0x12B || x >= 0x131 && x <= 0x133 || x === 0x138 || x >= 0x13F && x <= 0x142 || x === 0x144 || x >= 0x148 && x <= 0x14B || x === 0x14D || x === 0x152 || x === 0x153 || x === 0x166 || x === 0x167 || x === 0x16B || x === 0x1CE || x === 0x1D0 || x === 0x1D2 || x === 0x1D4 || x === 0x1D6 || x === 0x1D8 || x === 0x1DA || x === 0x1DC || x === 0x251 || x === 0x261 || x === 0x2C4 || x === 0x2C7 || x >= 0x2C9 && x <= 0x2CB || x === 0x2CD || x === 0x2D0 || x >= 0x2D8 && x <= 0x2DB || x === 0x2DD || x === 0x2DF || x >= 0x300 && x <= 0x36F || x >= 0x391 && x <= 0x3A1 || x >= 0x3A3 && x <= 0x3A9 || x >= 0x3B1 && x <= 0x3C1 || x >= 0x3C3 && x <= 0x3C9 || x === 0x401 || x >= 0x410 && x <= 0x44F || x === 0x451 || x === 0x2010 || x >= 0x2013 && x <= 0x2016 || x === 0x2018 || x === 0x2019 || x === 0x201C || x === 0x201D || x >= 0x2020 && x <= 0x2022 || x >= 0x2024 && x <= 0x2027 || x === 0x2030 || x === 0x2032 || x === 0x2033 || x === 0x2035 || x === 0x203B || x === 0x203E || x === 0x2074 || x === 0x207F || x >= 0x2081 && x <= 0x2084 || x === 0x20AC || x === 0x2103 || x === 0x2105 || x === 0x2109 || x === 0x2113 || x === 0x2116 || x === 0x2121 || x === 0x2122 || x === 0x2126 || x === 0x212B || x === 0x2153 || x === 0x2154 || x >= 0x215B && x <= 0x215E || x >= 0x2160 && x <= 0x216B || x >= 0x2170 && x <= 0x2179 || x === 0x2189 || x >= 0x2190 && x <= 0x2199 || x === 0x21B8 || x === 0x21B9 || x === 0x21D2 || x === 0x21D4 || x === 0x21E7 || x === 0x2200 || x === 0x2202 || x === 0x2203 || x === 0x2207 || x === 0x2208 || x === 0x220B || x === 0x220F || x === 0x2211 || x === 0x2215 || x === 0x221A || x >= 0x221D && x <= 0x2220 || x === 0x2223 || x === 0x2225 || x >= 0x2227 && x <= 0x222C || x === 0x222E || x >= 0x2234 && x <= 0x2237 || x === 0x223C || x === 0x223D || x === 0x2248 || x === 0x224C || x === 0x2252 || x === 0x2260 || x === 0x2261 || x >= 0x2264 && x <= 0x2267 || x === 0x226A || x === 0x226B || x === 0x226E || x === 0x226F || x === 0x2282 || x === 0x2283 || x === 0x2286 || x === 0x2287 || x === 0x2295 || x === 0x2299 || x === 0x22A5 || x === 0x22BF || x === 0x2312 || x >= 0x2460 && x <= 0x24E9 || x >= 0x24EB && x <= 0x254B || x >= 0x2550 && x <= 0x2573 || x >= 0x2580 && x <= 0x258F || x >= 0x2592 && x <= 0x2595 || x === 0x25A0 || x === 0x25A1 || x >= 0x25A3 && x <= 0x25A9 || x === 0x25B2 || x === 0x25B3 || x === 0x25B6 || x === 0x25B7 || x === 0x25BC || x === 0x25BD || x === 0x25C0 || x === 0x25C1 || x >= 0x25C6 && x <= 0x25C8 || x === 0x25CB || x >= 0x25CE && x <= 0x25D1 || x >= 0x25E2 && x <= 0x25E5 || x === 0x25EF || x === 0x2605 || x === 0x2606 || x === 0x2609 || x === 0x260E || x === 0x260F || x === 0x261C || x === 0x261E || x === 0x2640 || x === 0x2642 || x === 0x2660 || x === 0x2661 || x >= 0x2663 && x <= 0x2665 || x >= 0x2667 && x <= 0x266A || x === 0x266C || x === 0x266D || x === 0x266F || x === 0x269E || x === 0x269F || x === 0x26BF || x >= 0x26C6 && x <= 0x26CD || x >= 0x26CF && x <= 0x26D3 || x >= 0x26D5 && x <= 0x26E1 || x === 0x26E3 || x === 0x26E8 || x === 0x26E9 || x >= 0x26EB && x <= 0x26F1 || x === 0x26F4 || x >= 0x26F6 && x <= 0x26F9 || x === 0x26FB || x === 0x26FC || x === 0x26FE || x === 0x26FF || x === 0x273D || x >= 0x2776 && x <= 0x277F || x >= 0x2B56 && x <= 0x2B59 || x >= 0x3248 && x <= 0x324F || x >= 0xE000 && x <= 0xF8FF || x >= 0xFE00 && x <= 0xFE0F || x === 0xFFFD || x >= 0x1F100 && x <= 0x1F10A || x >= 0x1F110 && x <= 0x1F12D || x >= 0x1F130 && x <= 0x1F169 || x >= 0x1F170 && x <= 0x1F18D || x === 0x1F18F || x === 0x1F190 || x >= 0x1F19B && x <= 0x1F1AC || x >= 0xE0100 && x <= 0xE01EF || x >= 0xF0000 && x <= 0xFFFFD || x >= 0x100000 && x <= 0x10FFFD;\n};\nconst isFullWidth = (x) => {\n return x === 0x3000 || x >= 0xFF01 && x <= 0xFF60 || x >= 0xFFE0 && x <= 0xFFE6;\n};\nconst isWide = (x) => {\n return x >= 0x1100 && x <= 0x115F || x === 0x231A || x === 0x231B || x === 0x2329 || x === 0x232A || x >= 0x23E9 && x <= 0x23EC || x === 0x23F0 || x === 0x23F3 || x === 0x25FD || x === 0x25FE || x === 0x2614 || x === 0x2615 || x >= 0x2648 && x <= 0x2653 || x === 0x267F || x === 0x2693 || x === 0x26A1 || x === 0x26AA || x === 0x26AB || x === 0x26BD || x === 0x26BE || x === 0x26C4 || x === 0x26C5 || x === 0x26CE || x === 0x26D4 || x === 0x26EA || x === 0x26F2 || x === 0x26F3 || x === 0x26F5 || x === 0x26FA || x === 0x26FD || x === 0x2705 || x === 0x270A || x === 0x270B || x === 0x2728 || x === 0x274C || x === 0x274E || x >= 0x2753 && x <= 0x2755 || x === 0x2757 || x >= 0x2795 && x <= 0x2797 || x === 0x27B0 || x === 0x27BF || x === 0x2B1B || x === 0x2B1C || x === 0x2B50 || x === 0x2B55 || x >= 0x2E80 && x <= 0x2E99 || x >= 0x2E9B && x <= 0x2EF3 || x >= 0x2F00 && x <= 0x2FD5 || x >= 0x2FF0 && x <= 0x2FFF || x >= 0x3001 && x <= 0x303E || x >= 0x3041 && x <= 0x3096 || x >= 0x3099 && x <= 0x30FF || x >= 0x3105 && x <= 0x312F || x >= 0x3131 && x <= 0x318E || x >= 0x3190 && x <= 0x31E3 || x >= 0x31EF && x <= 0x321E || x >= 0x3220 && x <= 0x3247 || x >= 0x3250 && x <= 0x4DBF || x >= 0x4E00 && x <= 0xA48C || x >= 0xA490 && x <= 0xA4C6 || x >= 0xA960 && x <= 0xA97C || x >= 0xAC00 && x <= 0xD7A3 || x >= 0xF900 && x <= 0xFAFF || x >= 0xFE10 && x <= 0xFE19 || x >= 0xFE30 && x <= 0xFE52 || x >= 0xFE54 && x <= 0xFE66 || x >= 0xFE68 && x <= 0xFE6B || x >= 0x16FE0 && x <= 0x16FE4 || x === 0x16FF0 || x === 0x16FF1 || x >= 0x17000 && x <= 0x187F7 || x >= 0x18800 && x <= 0x18CD5 || x >= 0x18D00 && x <= 0x18D08 || x >= 0x1AFF0 && x <= 0x1AFF3 || x >= 0x1AFF5 && x <= 0x1AFFB || x === 0x1AFFD || x === 0x1AFFE || x >= 0x1B000 && x <= 0x1B122 || x === 0x1B132 || x >= 0x1B150 && x <= 0x1B152 || x === 0x1B155 || x >= 0x1B164 && x <= 0x1B167 || x >= 0x1B170 && x <= 0x1B2FB || x === 0x1F004 || x === 0x1F0CF || x === 0x1F18E || x >= 0x1F191 && x <= 0x1F19A || x >= 0x1F200 && x <= 0x1F202 || x >= 0x1F210 && x <= 0x1F23B || x >= 0x1F240 && x <= 0x1F248 || x === 0x1F250 || x === 0x1F251 || x >= 0x1F260 && x <= 0x1F265 || x >= 0x1F300 && x <= 0x1F320 || x >= 0x1F32D && x <= 0x1F335 || x >= 0x1F337 && x <= 0x1F37C || x >= 0x1F37E && x <= 0x1F393 || x >= 0x1F3A0 && x <= 0x1F3CA || x >= 0x1F3CF && x <= 0x1F3D3 || x >= 0x1F3E0 && x <= 0x1F3F0 || x === 0x1F3F4 || x >= 0x1F3F8 && x <= 0x1F43E || x === 0x1F440 || x >= 0x1F442 && x <= 0x1F4FC || x >= 0x1F4FF && x <= 0x1F53D || x >= 0x1F54B && x <= 0x1F54E || x >= 0x1F550 && x <= 0x1F567 || x === 0x1F57A || x === 0x1F595 || x === 0x1F596 || x === 0x1F5A4 || x >= 0x1F5FB && x <= 0x1F64F || x >= 0x1F680 && x <= 0x1F6C5 || x === 0x1F6CC || x >= 0x1F6D0 && x <= 0x1F6D2 || x >= 0x1F6D5 && x <= 0x1F6D7 || x >= 0x1F6DC && x <= 0x1F6DF || x === 0x1F6EB || x === 0x1F6EC || x >= 0x1F6F4 && x <= 0x1F6FC || x >= 0x1F7E0 && x <= 0x1F7EB || x === 0x1F7F0 || x >= 0x1F90C && x <= 0x1F93A || x >= 0x1F93C && x <= 0x1F945 || x >= 0x1F947 && x <= 0x1F9FF || x >= 0x1FA70 && x <= 0x1FA7C || x >= 0x1FA80 && x <= 0x1FA88 || x >= 0x1FA90 && x <= 0x1FABD || x >= 0x1FABF && x <= 0x1FAC5 || x >= 0x1FACE && x <= 0x1FADB || x >= 0x1FAE0 && x <= 0x1FAE8 || x >= 0x1FAF0 && x <= 0x1FAF8 || x >= 0x20000 && x <= 0x2FFFD || x >= 0x30000 && x <= 0x3FFFD;\n};\n/* EXPORT */\nexport { isAmbiguous, isFullWidth, isWide };\n","/* IMPORT */\nimport { isAmbiguous, isFullWidth, isWide } from './utils.js';\n/* HELPERS */\nconst ANSI_RE = /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;\nconst CONTROL_RE = /[\\x00-\\x08\\x0A-\\x1F\\x7F-\\x9F]{1,1000}/y;\nconst TAB_RE = /\\t{1,1000}/y;\nconst EMOJI_RE = /[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*/yu;\nconst LATIN_RE = /(?:[\\x20-\\x7E\\xA0-\\xFF](?!\\uFE0F)){1,1000}/y;\nconst MODIFIER_RE = /\\p{M}+/gu;\nconst NO_TRUNCATION = { limit: Infinity, ellipsis: '' };\n/* MAIN */\n//TODO: Optimize matching non-latin letters\nconst getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {\n /* CONSTANTS */\n const LIMIT = truncationOptions.limit ?? Infinity;\n const ELLIPSIS = truncationOptions.ellipsis ?? '';\n const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);\n const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;\n const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;\n const TAB_WIDTH = widthOptions.tabWidth ?? 8;\n const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;\n const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;\n const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;\n const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;\n const WIDE_WIDTH = widthOptions.wideWidth ?? 2;\n /* STATE */\n let indexPrev = 0;\n let index = 0;\n let length = input.length;\n let lengthExtra = 0;\n let truncationEnabled = false;\n let truncationIndex = length;\n let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);\n let unmatchedStart = 0;\n let unmatchedEnd = 0;\n let width = 0;\n let widthExtra = 0;\n /* PARSE LOOP */\n outer: while (true) {\n /* UNMATCHED */\n if ((unmatchedEnd > unmatchedStart) || (index >= length && index > indexPrev)) {\n const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);\n lengthExtra = 0;\n for (const char of unmatched.replaceAll(MODIFIER_RE, '')) {\n const codePoint = char.codePointAt(0) || 0;\n if (isFullWidth(codePoint)) {\n widthExtra = FULL_WIDTH_WIDTH;\n }\n else if (isWide(codePoint)) {\n widthExtra = WIDE_WIDTH;\n }\n else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {\n widthExtra = AMBIGUOUS_WIDTH;\n }\n else {\n widthExtra = REGULAR_WIDTH;\n }\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break outer;\n }\n lengthExtra += char.length;\n width += widthExtra;\n }\n unmatchedStart = unmatchedEnd = 0;\n }\n /* EXITING */\n if (index >= length)\n break;\n /* LATIN */\n LATIN_RE.lastIndex = index;\n if (LATIN_RE.test(input)) {\n lengthExtra = LATIN_RE.lastIndex - index;\n widthExtra = lengthExtra * REGULAR_WIDTH;\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += widthExtra;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = LATIN_RE.lastIndex;\n continue;\n }\n /* ANSI */\n ANSI_RE.lastIndex = index;\n if (ANSI_RE.test(input)) {\n if ((width + ANSI_WIDTH) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index);\n }\n if ((width + ANSI_WIDTH) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += ANSI_WIDTH;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = ANSI_RE.lastIndex;\n continue;\n }\n /* CONTROL */\n CONTROL_RE.lastIndex = index;\n if (CONTROL_RE.test(input)) {\n lengthExtra = CONTROL_RE.lastIndex - index;\n widthExtra = lengthExtra * CONTROL_WIDTH;\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += widthExtra;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = CONTROL_RE.lastIndex;\n continue;\n }\n /* TAB */\n TAB_RE.lastIndex = index;\n if (TAB_RE.test(input)) {\n lengthExtra = TAB_RE.lastIndex - index;\n widthExtra = lengthExtra * TAB_WIDTH;\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += widthExtra;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = TAB_RE.lastIndex;\n continue;\n }\n /* EMOJI */\n EMOJI_RE.lastIndex = index;\n if (EMOJI_RE.test(input)) {\n if ((width + EMOJI_WIDTH) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index);\n }\n if ((width + EMOJI_WIDTH) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += EMOJI_WIDTH;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = EMOJI_RE.lastIndex;\n continue;\n }\n /* UNMATCHED INDEX */\n index += 1;\n }\n /* RETURN */\n return {\n width: truncationEnabled ? truncationLimit : width,\n index: truncationEnabled ? truncationIndex : length,\n truncated: truncationEnabled,\n ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH\n };\n};\n/* EXPORT */\nexport default getStringTruncatedWidth;\n","/* IMPORT */\nimport fastStringTruncatedWidth from 'fast-string-truncated-width';\n/* HELPERS */\nconst NO_TRUNCATION = {\n limit: Infinity,\n ellipsis: '',\n ellipsisWidth: 0,\n};\n/* MAIN */\nconst fastStringWidth = (input, options = {}) => {\n return fastStringTruncatedWidth(input, NO_TRUNCATION, options).width;\n};\n/* EXPORT */\nexport default fastStringWidth;\n","import stringWidth from 'fast-string-width';\nconst ESC = '\\x1B';\nconst CSI = '\\x9B';\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;;`;\nconst GROUP_REGEX = new RegExp(`(?:\\\\${ANSI_CSI}(?<code>\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, 'y');\nconst getClosingCode = (openingCode) => {\n if (openingCode >= 30 && openingCode <= 37)\n return 39;\n if (openingCode >= 90 && openingCode <= 97)\n return 39;\n if (openingCode >= 40 && openingCode <= 47)\n return 49;\n if (openingCode >= 100 && openingCode <= 107)\n return 49;\n if (openingCode === 1 || openingCode === 2)\n return 22;\n if (openingCode === 3)\n return 23;\n if (openingCode === 4)\n return 24;\n if (openingCode === 7)\n return 27;\n if (openingCode === 8)\n return 28;\n if (openingCode === 9)\n return 29;\n if (openingCode === 0)\n return 0;\n return undefined;\n};\nconst wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;\nconst wordLengths = (words) => words.map((character) => stringWidth(character));\nconst wrapWord = (rows, word, columns) => {\n const characters = word[Symbol.iterator]();\n let isInsideEscape = false;\n let isInsideLinkEscape = false;\n let lastRow = rows.at(-1);\n let visible = lastRow === undefined ? 0 : stringWidth(lastRow);\n let currentCharacter = characters.next();\n let nextCharacter = characters.next();\n let rawCharacterIndex = 0;\n while (!currentCharacter.done) {\n const character = currentCharacter.value;\n const characterLength = stringWidth(character);\n if (visible + characterLength <= columns) {\n rows[rows.length - 1] += character;\n }\n else {\n rows.push(character);\n visible = 0;\n }\n if (character === ESC || character === CSI) {\n isInsideEscape = true;\n isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);\n }\n if (isInsideEscape) {\n if (isInsideLinkEscape) {\n if (character === ANSI_ESCAPE_BELL) {\n isInsideEscape = false;\n isInsideLinkEscape = false;\n }\n }\n else if (character === ANSI_SGR_TERMINATOR) {\n isInsideEscape = false;\n }\n }\n else {\n visible += characterLength;\n if (visible === columns && !nextCharacter.done) {\n rows.push('');\n visible = 0;\n }\n }\n currentCharacter = nextCharacter;\n nextCharacter = characters.next();\n rawCharacterIndex += character.length;\n }\n lastRow = rows.at(-1);\n if (!visible &&\n lastRow !== undefined &&\n lastRow.length > 0 &&\n rows.length > 1) {\n rows[rows.length - 2] += rows.pop();\n }\n};\nconst stringVisibleTrimSpacesRight = (string) => {\n const words = string.split(' ');\n let last = words.length;\n while (last > 0) {\n if (stringWidth(words[last - 1]) > 0) {\n break;\n }\n last--;\n }\n if (last === words.length) {\n return string;\n }\n return words.slice(0, last).join(' ') + words.slice(last).join('');\n};\nconst exec = (string, columns, options = {}) => {\n if (options.trim !== false && string.trim() === '') {\n return '';\n }\n let returnValue = '';\n let escapeCode;\n let escapeUrl;\n const words = string.split(' ');\n const lengths = wordLengths(words);\n let rows = [''];\n for (const [index, word] of words.entries()) {\n if (options.trim !== false) {\n rows[rows.length - 1] = (rows.at(-1) ?? '').trimStart();\n }\n let rowLength = stringWidth(rows.at(-1) ?? '');\n if (index !== 0) {\n if (rowLength >= columns &&\n (options.wordWrap === false || options.trim === false)) {\n rows.push('');\n rowLength = 0;\n }\n if (rowLength > 0 || options.trim === false) {\n rows[rows.length - 1] += ' ';\n rowLength++;\n }\n }\n if (options.hard && lengths[index] > columns) {\n const remainingColumns = columns - rowLength;\n const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);\n const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);\n if (breaksStartingNextLine < breaksStartingThisLine) {\n rows.push('');\n }\n wrapWord(rows, word, columns);\n continue;\n }\n if (rowLength + lengths[index] > columns &&\n rowLength > 0 &&\n lengths[index] > 0) {\n if (options.wordWrap === false && rowLength < columns) {\n wrapWord(rows, word, columns);\n continue;\n }\n rows.push('');\n }\n if (rowLength + lengths[index] > columns && options.wordWrap === false) {\n wrapWord(rows, word, columns);\n continue;\n }\n rows[rows.length - 1] += word;\n }\n if (options.trim !== false) {\n rows = rows.map((row) => stringVisibleTrimSpacesRight(row));\n }\n const preString = rows.join('\\n');\n const pre = preString[Symbol.iterator]();\n let currentPre = pre.next();\n let nextPre = pre.next();\n // We need to keep a separate index as `String#slice()` works on Unicode code units, while `pre` is an array of codepoints.\n let preStringIndex = 0;\n while (!currentPre.done) {\n const character = currentPre.value;\n const nextCharacter = nextPre.value;\n returnValue += character;\n if (character === ESC || character === CSI) {\n GROUP_REGEX.lastIndex = preStringIndex + 1;\n const groupsResult = GROUP_REGEX.exec(preString);\n const groups = groupsResult?.groups;\n if (groups?.code !== undefined) {\n const code = Number.parseFloat(groups.code);\n escapeCode = code === END_CODE ? undefined : code;\n }\n else if (groups?.uri !== undefined) {\n escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n }\n }\n const closingCode = escapeCode ? getClosingCode(escapeCode) : undefined;\n if (nextCharacter === '\\n') {\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink('');\n }\n if (escapeCode && closingCode) {\n returnValue += wrapAnsiCode(closingCode);\n }\n }\n else if (character === '\\n') {\n if (escapeCode && closingCode) {\n returnValue += wrapAnsiCode(escapeCode);\n }\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(escapeUrl);\n }\n }\n preStringIndex += character.length;\n currentPre = nextPre;\n nextPre = pre.next();\n }\n return returnValue;\n};\nexport function wrapAnsi(string, columns, options) {\n return String(string)\n .normalize()\n .replaceAll('\\r\\n', '\\n')\n .split('\\n')\n .map((line) => exec(line, columns, options))\n .join('\\n');\n}\n//# sourceMappingURL=main.js.map","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\tmessages: {\n\t\tcancel: string;\n\t\terror: string;\n\t};\n\twithGuide: boolean;\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\tmessages: {\n\t\tcancel: 'Canceled',\n\t\terror: 'Something went wrong',\n\t},\n\twithGuide: true,\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\t/**\n\t * Custom messages for prompts\n\t */\n\tmessages?: {\n\t\t/**\n\t\t * Custom message to display when a spinner is cancelled\n\t\t * @default \"Canceled\"\n\t\t */\n\t\tcancel?: string;\n\t\t/**\n\t\t * Custom message to display when a spinner encounters an error\n\t\t * @default \"Something went wrong\"\n\t\t */\n\t\terror?: string;\n\t};\n\n\twithGuide?: boolean;\n}\n\nexport function updateSettings(updates: ClackSettings) {\n\t// Handle each property in the updates\n\tif (updates.aliases !== undefined) {\n\t\tconst aliases = updates.aliases;\n\t\tfor (const alias in aliases) {\n\t\t\tif (!Object.hasOwn(aliases, alias)) continue;\n\n\t\t\tconst action = aliases[alias];\n\t\t\tif (!settings.actions.has(action)) continue;\n\n\t\t\tif (!settings.aliases.has(alias)) {\n\t\t\t\tsettings.aliases.set(alias, action);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (updates.messages !== undefined) {\n\t\tconst messages = updates.messages;\n\t\tif (messages.cancel !== undefined) {\n\t\t\tsettings.messages.cancel = messages.cancel;\n\t\t}\n\t\tif (messages.error !== undefined) {\n\t\t\tsettings.messages.error = messages.error;\n\t\t}\n\t}\n\n\tif (updates.withGuide !== undefined) {\n\t\tsettings.withGuide = updates.withGuide !== false;\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 numLines = Math.max(aLines.length, bLines.length);\n\tconst diff: number[] = [];\n\n\tfor (let i = 0; i < numLines; i++) {\n\t\tif (aLines[i] !== bLines[i]) diff.push(i);\n\t}\n\n\treturn {\n\t\tlines: diff,\n\t\tnumLinesBefore: aLines.length,\n\t\tnumLinesAfter: bLines.length,\n\t\tnumLines,\n\t};\n}\n","import { stdin, stdout } from 'node:process';\nimport type { Key } from 'node:readline';\nimport * as readline from 'node:readline';\nimport type { Readable, Writable } from 'node:stream';\nimport { ReadStream } from 'node:tty';\nimport { wrapAnsi } from 'fast-wrap-ansi';\nimport { cursor } from 'sisteransi';\nimport { isActionKey } from './settings.js';\n\nexport * from './settings.js';\nexport * from './string.js';\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\ninterface BlockOptions {\n\tinput?: Readable;\n\toutput?: Writable;\n\toverwrite?: boolean;\n\thideCursor?: boolean;\n}\n\nexport function block({\n\tinput = stdin,\n\toutput = stdout,\n\toverwrite = true,\n\thideCursor = true,\n}: BlockOptions = {}) {\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\n\tif (input instanceof ReadStream && input.isTTY) {\n\t\tinput.setRawMode(true);\n\t}\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 instanceof ReadStream && input.isTTY && !isWindows) {\n\t\t\tinput.setRawMode(false);\n\t\t}\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\nexport const getColumns = (output: Writable): number => {\n\tif ('columns' in output && typeof output.columns === 'number') {\n\t\treturn output.columns;\n\t}\n\treturn 80;\n};\n\nexport const getRows = (output: Writable): number => {\n\tif ('rows' in output && typeof output.rows === 'number') {\n\t\treturn output.rows;\n\t}\n\treturn 20;\n};\n\nexport function wrapTextWithPrefix(\n\toutput: Writable | undefined,\n\ttext: string,\n\tprefix: string,\n\tstartPrefix: string = prefix\n): string {\n\tconst columns = getColumns(output ?? stdout);\n\tconst wrapped = wrapAnsi(text, columns - prefix.length, {\n\t\thard: true,\n\t\ttrim: false,\n\t});\n\tconst lines = wrapped\n\t\t.split('\\n')\n\t\t.map((line, index) => {\n\t\t\treturn `${index === 0 ? startPrefix : prefix}${line}`;\n\t\t})\n\t\t.join('\\n');\n\treturn lines;\n}\n","import { stdin, stdout } from 'node:process';\nimport readline, { type Key, type ReadLine } from 'node:readline';\nimport type { Readable, Writable } from 'node:stream';\nimport { wrapAnsi } from 'fast-wrap-ansi';\nimport { cursor, erase } from 'sisteransi';\nimport type { ClackEvents, ClackState } from '../types.js';\nimport type { Action } from '../utils/index.js';\nimport {\n\tCANCEL_SYMBOL,\n\tdiffLines,\n\tgetRows,\n\tisActionKey,\n\tsetRawMode,\n\tsettings,\n} from '../utils/index.js';\n\nexport interface PromptOptions<TValue, Self extends Prompt<TValue>> {\n\trender(this: Omit<Self, 'prompt'>): string | undefined;\n\tinitialValue?: any;\n\tinitialUserInput?: string;\n\tvalidate?: ((value: TValue | undefined) => string | Error | undefined) | undefined;\n\tinput?: Readable;\n\toutput?: Writable;\n\tdebug?: boolean;\n\tsignal?: AbortSignal;\n}\n\nexport default class Prompt<TValue> {\n\tprotected input: Readable;\n\tprotected output: Writable;\n\tprivate _abortSignal?: AbortSignal;\n\n\tprivate rl: ReadLine | undefined;\n\tprivate opts: Omit<PromptOptions<TValue, Prompt<TValue>>, 'render' | 'input' | 'output'>;\n\tprivate _render: (context: Omit<Prompt<TValue>, '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: TValue | undefined;\n\tpublic userInput = '';\n\n\tconstructor(options: PromptOptions<TValue, Prompt<TValue>>, 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<TValue>>(\n\t\tevent: T,\n\t\topts: { cb: ClackEvents<TValue>[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<TValue>>(event: T, cb: ClackEvents<TValue>[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<TValue>>(event: T, cb: ClackEvents<TValue>[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<TValue>>(\n\t\tevent: T,\n\t\t...data: Parameters<ClackEvents<TValue>[T]>\n\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<TValue | symbol | undefined>((resolve) => {\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\tthis.rl = readline.createInterface({\n\t\t\t\tinput: this.input,\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\tthis.rl.prompt();\n\n\t\t\tif (this.opts.initialUserInput !== undefined) {\n\t\t\t\tthis._setUserInput(this.opts.initialUserInput, true);\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\tprotected _isActionKey(char: string | undefined, _key: Key): boolean {\n\t\treturn char === '\\t';\n\t}\n\n\tprotected _setValue(value: TValue | undefined): void {\n\t\tthis.value = value;\n\t\tthis.emit('value', this.value);\n\t}\n\n\tprotected _setUserInput(value: string | undefined, write?: boolean): void {\n\t\tthis.userInput = value ?? '';\n\t\tthis.emit('userInput', this.userInput);\n\t\tif (write && this._track && this.rl) {\n\t\t\tthis.rl.write(this.userInput);\n\t\t\tthis._cursor = this.rl.cursor;\n\t\t}\n\t}\n\n\tprotected _clearUserInput(): void {\n\t\tthis.rl?.write(null, { ctrl: true, name: 'u' });\n\t\tthis._setUserInput('');\n\t}\n\n\tprivate onKeypress(char: string | undefined, key: Key) {\n\t\tif (this._track && key.name !== 'return') {\n\t\t\tif (key.name && this._isActionKey(char, key)) {\n\t\t\t\tthis.rl?.write(null, { ctrl: true, name: 'h' });\n\t\t\t}\n\t\t\tthis._cursor = this.rl?.cursor ?? 0;\n\t\t\tthis._setUserInput(this.rl?.line);\n\t\t}\n\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\n\t\t// Call the key event handler and emit the key event\n\t\tthis.emit('key', char?.toLowerCase(), key);\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.userInput);\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\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\twrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split('\\n')\n\t\t\t\t.length - 1;\n\t\tthis.output.write(cursor.move(-999, lines * -1));\n\t}\n\n\tprivate render() {\n\t\tconst frame = wrapAnsi(this._render(this) ?? '', process.stdout.columns, {\n\t\t\thard: true,\n\t\t\ttrim: false,\n\t\t});\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\tconst rows = getRows(this.output);\n\t\t\tthis.restoreCursor();\n\t\t\tif (diff) {\n\t\t\t\tconst diffOffsetAfter = Math.max(0, diff.numLinesAfter - rows);\n\t\t\t\tconst diffOffsetBefore = Math.max(0, diff.numLinesBefore - rows);\n\t\t\t\tlet diffLine = diff.lines.find((line) => line >= diffOffsetAfter);\n\n\t\t\t\tif (diffLine === undefined) {\n\t\t\t\t\tthis._prevFrame = frame;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If a single line has changed, only update that line\n\t\t\t\tif (diff.lines.length === 1) {\n\t\t\t\t\tthis.output.write(cursor.move(0, diffLine - diffOffsetBefore));\n\t\t\t\t\tthis.output.write(erase.lines(1));\n\t\t\t\t\tconst lines = frame.split('\\n');\n\t\t\t\t\tthis.output.write(lines[diffLine]);\n\t\t\t\t\tthis._prevFrame = frame;\n\t\t\t\t\tthis.output.write(cursor.move(0, lines.length - diffLine - 1));\n\t\t\t\t\treturn;\n\t\t\t\t\t// If many lines have changed, rerender everything past the first line\n\t\t\t\t} else if (diff.lines.length > 1) {\n\t\t\t\t\tif (diffOffsetAfter < diffOffsetBefore) {\n\t\t\t\t\t\tdiffLine = diffOffsetAfter;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst adjustedDiffLine = diffLine - diffOffsetBefore;\n\t\t\t\t\t\tif (adjustedDiffLine > 0) {\n\t\t\t\t\t\t\tthis.output.write(cursor.move(0, adjustedDiffLine));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.output.write(erase.down());\n\t\t\t\t\tconst lines = frame.split('\\n');\n\t\t\t\t\tconst newLines = lines.slice(diffLine);\n\t\t\t\t\tthis.output.write(newLines.join('\\n'));\n\t\t\t\t\tthis._prevFrame = frame;\n\t\t\t\t\treturn;\n\t\t\t\t}\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 type { Key } from 'node:readline';\nimport color from 'picocolors';\nimport { findCursor } from '../utils/cursor.js';\nimport Prompt, { type PromptOptions } from './prompt.js';\n\ninterface OptionLike {\n\tvalue: unknown;\n\tlabel?: string;\n\tdisabled?: boolean;\n}\n\ntype FilterFunction<T extends OptionLike> = (search: string, opt: T) => boolean;\n\nfunction getCursorForValue<T extends OptionLike>(\n\tselected: T['value'] | undefined,\n\titems: T[]\n): number {\n\tif (selected === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst currLength = items.length;\n\n\t// If filtering changed the available options, update cursor\n\tif (currLength === 0) {\n\t\treturn 0;\n\t}\n\n\t// Try to maintain the same selected item\n\tconst index = items.findIndex((item) => item.value === selected);\n\treturn index !== -1 ? index : 0;\n}\n\nfunction defaultFilter<T extends OptionLike>(input: string, option: T): boolean {\n\tconst label = option.label ?? String(option.value);\n\treturn label.toLowerCase().includes(input.toLowerCase());\n}\n\nfunction normalisedValue<T>(multiple: boolean, values: T[] | undefined): T | T[] | undefined {\n\tif (!values) {\n\t\treturn undefined;\n\t}\n\tif (multiple) {\n\t\treturn values;\n\t}\n\treturn values[0];\n}\n\nexport interface AutocompleteOptions<T extends OptionLike>\n\textends PromptOptions<T['value'] | T['value'][], AutocompletePrompt<T>> {\n\toptions: T[] | ((this: AutocompletePrompt<T>) => T[]);\n\tfilter?: FilterFunction<T>;\n\tmultiple?: boolean;\n}\n\nexport default class AutocompletePrompt<T extends OptionLike> extends Prompt<\n\tT['value'] | T['value'][]\n> {\n\tfilteredOptions: T[];\n\tmultiple: boolean;\n\tisNavigating = false;\n\tselectedValues: Array<T['value']> = [];\n\n\tfocusedValue: T['value'] | undefined;\n\t#cursor = 0;\n\t#lastUserInput = '';\n\t#filterFn: FilterFunction<T>;\n\t#options: T[] | (() => T[]);\n\n\tget cursor(): number {\n\t\treturn this.#cursor;\n\t}\n\n\tget userInputWithCursor() {\n\t\tif (!this.userInput) {\n\t\t\treturn color.inverse(color.hidden('_'));\n\t\t}\n\t\tif (this._cursor >= this.userInput.length) {\n\t\t\treturn `${this.userInput}█`;\n\t\t}\n\t\tconst s1 = this.userInput.slice(0, this._cursor);\n\t\tconst [s2, ...s3] = this.userInput.slice(this._cursor);\n\t\treturn `${s1}${color.inverse(s2)}${s3.join('')}`;\n\t}\n\n\tget options(): T[] {\n\t\tif (typeof this.#options === 'function') {\n\t\t\treturn this.#options();\n\t\t}\n\t\treturn this.#options;\n\t}\n\n\tconstructor(opts: AutocompleteOptions<T>) {\n\t\tsuper(opts);\n\n\t\tthis.#options = opts.options;\n\t\tconst options = this.options;\n\t\tthis.filteredOptions = [...options];\n\t\tthis.multiple = opts.multiple === true;\n\t\tthis.#filterFn = opts.filter ?? defaultFilter;\n\t\tlet initialValues: unknown[] | undefined;\n\t\tif (opts.initialValue && Array.isArray(opts.initialValue)) {\n\t\t\tif (this.multiple) {\n\t\t\t\tinitialValues = opts.initialValue;\n\t\t\t} else {\n\t\t\t\tinitialValues = opts.initialValue.slice(0, 1);\n\t\t\t}\n\t\t} else {\n\t\t\tif (!this.multiple && this.options.length > 0) {\n\t\t\t\tinitialValues = [this.options[0].value];\n\t\t\t}\n\t\t}\n\n\t\tif (initialValues) {\n\t\t\tfor (const selectedValue of initialValues) {\n\t\t\t\tconst selectedIndex = options.findIndex((opt) => opt.value === selectedValue);\n\t\t\t\tif (selectedIndex !== -1) {\n\t\t\t\t\tthis.toggleSelected(selectedValue);\n\t\t\t\t\tthis.#cursor = selectedIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.focusedValue = this.options[this.#cursor]?.value;\n\n\t\tthis.on('key', (char, key) => this.#onKey(char, key));\n\t\tthis.on('userInput', (value) => this.#onUserInputChanged(value));\n\t}\n\n\tprotected override _isActionKey(char: string | undefined, key: Key): boolean {\n\t\treturn (\n\t\t\tchar === '\\t' ||\n\t\t\t(this.multiple &&\n\t\t\t\tthis.isNavigating &&\n\t\t\t\tkey.name === 'space' &&\n\t\t\t\tchar !== undefined &&\n\t\t\t\tchar !== '')\n\t\t);\n\t}\n\n\t#onKey(_char: string | undefined, key: Key): void {\n\t\tconst isUpKey = key.name === 'up';\n\t\tconst isDownKey = key.name === 'down';\n\t\tconst isReturnKey = key.name === 'return';\n\n\t\t// Start navigation mode with up/down arrows\n\t\tif (isUpKey || isDownKey) {\n\t\t\tthis.#cursor = findCursor(this.#cursor, isUpKey ? -1 : 1, this.filteredOptions);\n\t\t\tthis.focusedValue = this.filteredOptions[this.#cursor]?.value;\n\t\t\tif (!this.multiple) {\n\t\t\t\tthis.selectedValues = [this.focusedValue];\n\t\t\t}\n\t\t\tthis.isNavigating = true;\n\t\t} else if (isReturnKey) {\n\t\t\tthis.value = normalisedValue(this.multiple, this.selectedValues);\n\t\t} else {\n\t\t\tif (this.multiple) {\n\t\t\t\tif (\n\t\t\t\t\tthis.focusedValue !== undefined &&\n\t\t\t\t\t(key.name === 'tab' || (this.isNavigating && key.name === 'space'))\n\t\t\t\t) {\n\t\t\t\t\tthis.toggleSelected(this.focusedValue);\n\t\t\t\t} else {\n\t\t\t\t\tthis.isNavigating = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this.focusedValue) {\n\t\t\t\t\tthis.selectedValues = [this.focusedValue];\n\t\t\t\t}\n\t\t\t\tthis.isNavigating = false;\n\t\t\t}\n\t\t}\n\t}\n\n\tdeselectAll() {\n\t\tthis.selectedValues = [];\n\t}\n\n\ttoggleSelected(value: T['value']) {\n\t\tif (this.filteredOptions.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.multiple) {\n\t\t\tif (this.selectedValues.includes(value)) {\n\t\t\t\tthis.selectedValues = this.selectedValues.filter((v) => v !== value);\n\t\t\t} else {\n\t\t\t\tthis.selectedValues = [...this.selectedValues, value];\n\t\t\t}\n\t\t} else {\n\t\t\tthis.selectedValues = [value];\n\t\t}\n\t}\n\n\t#onUserInputChanged(value: string): void {\n\t\tif (value !== this.#lastUserInput) {\n\t\t\tthis.#lastUserInput = value;\n\n\t\t\tconst options = this.options;\n\n\t\t\tif (value) {\n\t\t\t\tthis.filteredOptions = options.filter((opt) => this.#filterFn(value, opt));\n\t\t\t} else {\n\t\t\t\tthis.filteredOptions = [...options];\n\t\t\t}\n\t\t\tconst valueCursor = getCursorForValue(this.focusedValue, this.filteredOptions);\n\t\t\tthis.#cursor = findCursor(valueCursor, 0, this.filteredOptions);\n\t\t\tconst focusedOption = this.filteredOptions[this.#cursor];\n\t\t\tif (focusedOption && !focusedOption.disabled) {\n\t\t\t\tthis.focusedValue = focusedOption.value;\n\t\t\t} else {\n\t\t\t\tthis.focusedValue = undefined;\n\t\t\t}\n\t\t\tif (!this.multiple) {\n\t\t\t\tif (this.focusedValue !== undefined) {\n\t\t\t\t\tthis.toggleSelected(this.focusedValue);\n\t\t\t\t} else {\n\t\t\t\t\tthis.deselectAll();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { cursor } from 'sisteransi';\nimport Prompt, { type PromptOptions } from './prompt.js';\n\nexport interface ConfirmOptions extends PromptOptions<boolean, ConfirmPrompt> {\n\tactive: string;\n\tinactive: string;\n\tinitialValue?: boolean;\n}\n\nexport default class ConfirmPrompt extends Prompt<boolean> {\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('userInput', () => {\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.js';\n\nexport interface GroupMultiSelectOptions<T extends { value: any }>\n\textends PromptOptions<T['value'][], 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<T['value'][]> {\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\tconst value = this.value;\n\t\tif (value === undefined) {\n\t\t\treturn false;\n\t\t}\n\t\treturn items.every((i) => value.includes(i.value));\n\t}\n\n\tprivate toggleValue() {\n\t\tconst item = this.options[this.cursor];\n\t\tif (this.value === undefined) {\n\t\t\tthis.value = [];\n\t\t}\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 { findCursor } from '../utils/cursor.js';\nimport Prompt, { type PromptOptions } from './prompt.js';\n\ninterface OptionLike {\n\tvalue: any;\n\tdisabled?: boolean;\n}\n\nexport interface MultiSelectOptions<T extends OptionLike>\n\textends PromptOptions<T['value'][], MultiSelectPrompt<T>> {\n\toptions: T[];\n\tinitialValues?: T['value'][];\n\trequired?: boolean;\n\tcursorAt?: T['value'];\n}\nexport default class MultiSelectPrompt<T extends OptionLike> extends Prompt<T['value'][]> {\n\toptions: T[];\n\tcursor = 0;\n\n\tprivate get _value(): T['value'] {\n\t\treturn this.options[this.cursor].value;\n\t}\n\n\tprivate get _enabledOptions(): T[] {\n\t\treturn this.options.filter((option) => option.disabled !== true);\n\t}\n\n\tprivate toggleAll() {\n\t\tconst enabledOptions = this._enabledOptions;\n\t\tconst allSelected = this.value !== undefined && this.value.length === enabledOptions.length;\n\t\tthis.value = allSelected ? [] : enabledOptions.map((v) => v.value);\n\t}\n\n\tprivate toggleInvert() {\n\t\tconst value = this.value;\n\t\tif (!value) {\n\t\t\treturn;\n\t\t}\n\t\tconst notSelected = this._enabledOptions.filter((v) => !value.includes(v.value));\n\t\tthis.value = notSelected.map((v) => v.value);\n\t}\n\n\tprivate toggleValue() {\n\t\tif (this.value === undefined) {\n\t\t\tthis.value = [];\n\t\t}\n\t\tconst selected = this.value.includes(this._value);\n\t\tthis.value = selected\n\t\t\t? this.value.filter((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\tconst cursor = Math.max(\n\t\t\tthis.options.findIndex(({ value }) => value === opts.cursorAt),\n\t\t\t0\n\t\t);\n\t\tthis.cursor = this.options[cursor].disabled ? findCursor<T>(cursor, 1, this.options) : cursor;\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\tif (char === 'i') {\n\t\t\t\tthis.toggleInvert();\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 = findCursor<T>(this.cursor, -1, this.options);\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 = findCursor<T>(this.cursor, 1, this.options);\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.js';\n\nexport interface PasswordOptions extends PromptOptions<string, PasswordPrompt> {\n\tmask?: string;\n}\nexport default class PasswordPrompt extends Prompt<string> {\n\tprivate _mask = '•';\n\tget cursor() {\n\t\treturn this._cursor;\n\t}\n\tget masked() {\n\t\treturn this.userInput.replaceAll(/./g, this._mask);\n\t}\n\tget userInputWithCursor() {\n\t\tif (this.state === 'submit' || this.state === 'cancel') {\n\t\t\treturn this.masked;\n\t\t}\n\t\tconst userInput = this.userInput;\n\t\tif (this.cursor >= userInput.length) {\n\t\t\treturn `${this.masked}${color.inverse(color.hidden('_'))}`;\n\t\t}\n\t\tconst masked = this.masked;\n\t\tconst s1 = masked.slice(0, this.cursor);\n\t\tconst s2 = masked.slice(this.cursor);\n\t\treturn `${s1}${color.inverse(s2[0])}${s2.slice(1)}`;\n\t}\n\tclear() {\n\t\tthis._clearUserInput();\n\t}\n\tconstructor({ mask, ...opts }: PasswordOptions) {\n\t\tsuper(opts);\n\t\tthis._mask = mask ?? '•';\n\t\tthis.on('userInput', (input) => {\n\t\t\tthis._setValue(input);\n\t\t});\n\t}\n}\n","import { findCursor } from '../utils/cursor.js';\nimport Prompt, { type PromptOptions } from './prompt.js';\n\nexport interface SelectOptions<T extends { value: any; disabled?: boolean }>\n\textends PromptOptions<T['value'], SelectPrompt<T>> {\n\toptions: T[];\n\tinitialValue?: T['value'];\n}\nexport default class SelectPrompt<T extends { value: any; disabled?: boolean }> extends Prompt<\n\tT['value']\n> {\n\toptions: T[];\n\tcursor = 0;\n\n\tprivate get _selectedValue() {\n\t\treturn this.options[this.cursor];\n\t}\n\n\tprivate changeValue() {\n\t\tthis.value = this._selectedValue.value;\n\t}\n\n\tconstructor(opts: SelectOptions<T>) {\n\t\tsuper(opts, false);\n\n\t\tthis.options = opts.options;\n\n\t\tconst initialCursor = this.options.findIndex(({ value }) => value === opts.initialValue);\n\t\tconst cursor = initialCursor === -1 ? 0 : initialCursor;\n\t\tthis.cursor = this.options[cursor].disabled ? findCursor<T>(cursor, 1, this.options) : cursor;\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 = findCursor<T>(this.cursor, -1, this.options);\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 = findCursor<T>(this.cursor, 1, this.options);\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.js';\n\nexport interface SelectKeyOptions<T extends { value: string }>\n\textends PromptOptions<T['value'], SelectKeyPrompt<T>> {\n\toptions: T[];\n\tcaseSensitive?: boolean;\n}\nexport default class SelectKeyPrompt<T extends { value: string }> extends Prompt<T['value']> {\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 caseSensitive = opts.caseSensitive === true;\n\t\tconst keys = this.options.map(({ value: [initial] }) => {\n\t\t\treturn caseSensitive ? initial : initial?.toLowerCase();\n\t\t});\n\t\tthis.cursor = Math.max(keys.indexOf(opts.initialValue), 0);\n\n\t\tthis.on('key', (key, keyInfo) => {\n\t\t\tif (!key) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst casedKey = caseSensitive && keyInfo.shift ? key.toUpperCase() : key;\n\t\t\tif (!keys.includes(casedKey)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst value = this.options.find(({ value: [initial] }) => {\n\t\t\t\treturn caseSensitive ? initial === casedKey : initial?.toLowerCase() === key;\n\t\t\t});\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.js';\n\nexport interface TextOptions extends PromptOptions<string, TextPrompt> {\n\tplaceholder?: string;\n\tdefaultValue?: string;\n}\n\nexport default class TextPrompt extends Prompt<string> {\n\tget userInputWithCursor() {\n\t\tif (this.state === 'submit') {\n\t\t\treturn this.userInput;\n\t\t}\n\t\tconst userInput = this.userInput;\n\t\tif (this.cursor >= userInput.length) {\n\t\t\treturn `${this.userInput}█`;\n\t\t}\n\t\tconst s1 = userInput.slice(0, this.cursor);\n\t\tconst [s2, ...s3] = userInput.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({\n\t\t\t...opts,\n\t\t\tinitialUserInput: opts.initialUserInput ?? opts.initialValue,\n\t\t});\n\n\t\tthis.on('userInput', (input) => {\n\t\t\tthis._setValue(input);\n\t\t});\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\tif (this.value === undefined) {\n\t\t\t\tthis.value = '';\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 type { Readable, Writable } from 'node:stream';\nimport type { State } from '@clack/core';\nimport isUnicodeSupported from 'is-unicode-supported';\nimport color from 'picocolors';\n\nexport const unicode = isUnicodeSupported();\nexport const isCI = (): boolean => process.env.CI === 'true';\nexport const isTTY = (output: Writable): boolean => {\n\treturn (output as Writable & { isTTY?: boolean }).isTTY === true;\n};\nexport const unicodeOr = (c: string, fallback: string) => (unicode ? c : fallback);\nexport const S_STEP_ACTIVE = unicodeOr('◆', '*');\nexport const S_STEP_CANCEL = unicodeOr('■', 'x');\nexport const S_STEP_ERROR = unicodeOr('▲', 'x');\nexport const S_STEP_SUBMIT = unicodeOr('◇', 'o');\n\nexport const S_BAR_START = unicodeOr('┌', 'T');\nexport const S_BAR = unicodeOr('│', '|');\nexport const S_BAR_END = unicodeOr('└', '—');\nexport const S_BAR_START_RIGHT = unicodeOr('┐', 'T');\nexport const S_BAR_END_RIGHT = unicodeOr('┘', '—');\n\nexport const S_RADIO_ACTIVE = unicodeOr('●', '>');\nexport const S_RADIO_INACTIVE = unicodeOr('○', ' ');\nexport const S_CHECKBOX_ACTIVE = unicodeOr('◻', '[•]');\nexport const S_CHECKBOX_SELECTED = unicodeOr('◼', '[+]');\nexport const S_CHECKBOX_INACTIVE = unicodeOr('◻', '[ ]');\nexport const S_PASSWORD_MASK = unicodeOr('▪', '•');\n\nexport const S_BAR_H = unicodeOr('─', '-');\nexport const S_CORNER_TOP_RIGHT = unicodeOr('╮', '+');\nexport const S_CONNECT_LEFT = unicodeOr('├', '+');\nexport const S_CORNER_BOTTOM_RIGHT = unicodeOr('╯', '+');\nexport const S_CORNER_BOTTOM_LEFT = unicodeOr('╰', '+');\nexport const S_CORNER_TOP_LEFT = unicodeOr('╭', '+');\n\nexport const S_INFO = unicodeOr('●', '•');\nexport const S_SUCCESS = unicodeOr('◆', '*');\nexport const S_WARN = unicodeOr('▲', '!');\nexport const S_ERROR = unicodeOr('■', 'x');\n\nexport const 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\nexport const symbolBar = (state: State) => {\n\tswitch (state) {\n\t\tcase 'initial':\n\t\tcase 'active':\n\t\t\treturn color.cyan(S_BAR);\n\t\tcase 'cancel':\n\t\t\treturn color.red(S_BAR);\n\t\tcase 'error':\n\t\t\treturn color.yellow(S_BAR);\n\t\tcase 'submit':\n\t\t\treturn color.green(S_BAR);\n\t}\n};\n\nexport interface CommonOptions {\n\tinput?: Readable;\n\toutput?: Writable;\n\tsignal?: AbortSignal;\n\twithGuide?: boolean;\n}\n","/* MAIN */\n//URL: https://github.com/sindresorhus/get-east-asian-width/blob/main/lookup.js\n//LICENSE: https://github.com/sindresorhus/get-east-asian-width/blob/main/license\n//TODO: Replace these with some unicode property classes, if the ones we need exist\nconst isAmbiguous = (x) => {\n return x === 0xA1 || x === 0xA4 || x === 0xA7 || x === 0xA8 || x === 0xAA || x === 0xAD || x === 0xAE || x >= 0xB0 && x <= 0xB4 || x >= 0xB6 && x <= 0xBA || x >= 0xBC && x <= 0xBF || x === 0xC6 || x === 0xD0 || x === 0xD7 || x === 0xD8 || x >= 0xDE && x <= 0xE1 || x === 0xE6 || x >= 0xE8 && x <= 0xEA || x === 0xEC || x === 0xED || x === 0xF0 || x === 0xF2 || x === 0xF3 || x >= 0xF7 && x <= 0xFA || x === 0xFC || x === 0xFE || x === 0x101 || x === 0x111 || x === 0x113 || x === 0x11B || x === 0x126 || x === 0x127 || x === 0x12B || x >= 0x131 && x <= 0x133 || x === 0x138 || x >= 0x13F && x <= 0x142 || x === 0x144 || x >= 0x148 && x <= 0x14B || x === 0x14D || x === 0x152 || x === 0x153 || x === 0x166 || x === 0x167 || x === 0x16B || x === 0x1CE || x === 0x1D0 || x === 0x1D2 || x === 0x1D4 || x === 0x1D6 || x === 0x1D8 || x === 0x1DA || x === 0x1DC || x === 0x251 || x === 0x261 || x === 0x2C4 || x === 0x2C7 || x >= 0x2C9 && x <= 0x2CB || x === 0x2CD || x === 0x2D0 || x >= 0x2D8 && x <= 0x2DB || x === 0x2DD || x === 0x2DF || x >= 0x300 && x <= 0x36F || x >= 0x391 && x <= 0x3A1 || x >= 0x3A3 && x <= 0x3A9 || x >= 0x3B1 && x <= 0x3C1 || x >= 0x3C3 && x <= 0x3C9 || x === 0x401 || x >= 0x410 && x <= 0x44F || x === 0x451 || x === 0x2010 || x >= 0x2013 && x <= 0x2016 || x === 0x2018 || x === 0x2019 || x === 0x201C || x === 0x201D || x >= 0x2020 && x <= 0x2022 || x >= 0x2024 && x <= 0x2027 || x === 0x2030 || x === 0x2032 || x === 0x2033 || x === 0x2035 || x === 0x203B || x === 0x203E || x === 0x2074 || x === 0x207F || x >= 0x2081 && x <= 0x2084 || x === 0x20AC || x === 0x2103 || x === 0x2105 || x === 0x2109 || x === 0x2113 || x === 0x2116 || x === 0x2121 || x === 0x2122 || x === 0x2126 || x === 0x212B || x === 0x2153 || x === 0x2154 || x >= 0x215B && x <= 0x215E || x >= 0x2160 && x <= 0x216B || x >= 0x2170 && x <= 0x2179 || x === 0x2189 || x >= 0x2190 && x <= 0x2199 || x === 0x21B8 || x === 0x21B9 || x === 0x21D2 || x === 0x21D4 || x === 0x21E7 || x === 0x2200 || x === 0x2202 || x === 0x2203 || x === 0x2207 || x === 0x2208 || x === 0x220B || x === 0x220F || x === 0x2211 || x === 0x2215 || x === 0x221A || x >= 0x221D && x <= 0x2220 || x === 0x2223 || x === 0x2225 || x >= 0x2227 && x <= 0x222C || x === 0x222E || x >= 0x2234 && x <= 0x2237 || x === 0x223C || x === 0x223D || x === 0x2248 || x === 0x224C || x === 0x2252 || x === 0x2260 || x === 0x2261 || x >= 0x2264 && x <= 0x2267 || x === 0x226A || x === 0x226B || x === 0x226E || x === 0x226F || x === 0x2282 || x === 0x2283 || x === 0x2286 || x === 0x2287 || x === 0x2295 || x === 0x2299 || x === 0x22A5 || x === 0x22BF || x === 0x2312 || x >= 0x2460 && x <= 0x24E9 || x >= 0x24EB && x <= 0x254B || x >= 0x2550 && x <= 0x2573 || x >= 0x2580 && x <= 0x258F || x >= 0x2592 && x <= 0x2595 || x === 0x25A0 || x === 0x25A1 || x >= 0x25A3 && x <= 0x25A9 || x === 0x25B2 || x === 0x25B3 || x === 0x25B6 || x === 0x25B7 || x === 0x25BC || x === 0x25BD || x === 0x25C0 || x === 0x25C1 || x >= 0x25C6 && x <= 0x25C8 || x === 0x25CB || x >= 0x25CE && x <= 0x25D1 || x >= 0x25E2 && x <= 0x25E5 || x === 0x25EF || x === 0x2605 || x === 0x2606 || x === 0x2609 || x === 0x260E || x === 0x260F || x === 0x261C || x === 0x261E || x === 0x2640 || x === 0x2642 || x === 0x2660 || x === 0x2661 || x >= 0x2663 && x <= 0x2665 || x >= 0x2667 && x <= 0x266A || x === 0x266C || x === 0x266D || x === 0x266F || x === 0x269E || x === 0x269F || x === 0x26BF || x >= 0x26C6 && x <= 0x26CD || x >= 0x26CF && x <= 0x26D3 || x >= 0x26D5 && x <= 0x26E1 || x === 0x26E3 || x === 0x26E8 || x === 0x26E9 || x >= 0x26EB && x <= 0x26F1 || x === 0x26F4 || x >= 0x26F6 && x <= 0x26F9 || x === 0x26FB || x === 0x26FC || x === 0x26FE || x === 0x26FF || x === 0x273D || x >= 0x2776 && x <= 0x277F || x >= 0x2B56 && x <= 0x2B59 || x >= 0x3248 && x <= 0x324F || x >= 0xE000 && x <= 0xF8FF || x >= 0xFE00 && x <= 0xFE0F || x === 0xFFFD || x >= 0x1F100 && x <= 0x1F10A || x >= 0x1F110 && x <= 0x1F12D || x >= 0x1F130 && x <= 0x1F169 || x >= 0x1F170 && x <= 0x1F18D || x === 0x1F18F || x === 0x1F190 || x >= 0x1F19B && x <= 0x1F1AC || x >= 0xE0100 && x <= 0xE01EF || x >= 0xF0000 && x <= 0xFFFFD || x >= 0x100000 && x <= 0x10FFFD;\n};\nconst isFullWidth = (x) => {\n return x === 0x3000 || x >= 0xFF01 && x <= 0xFF60 || x >= 0xFFE0 && x <= 0xFFE6;\n};\nconst isWide = (x) => {\n return x >= 0x1100 && x <= 0x115F || x === 0x231A || x === 0x231B || x === 0x2329 || x === 0x232A || x >= 0x23E9 && x <= 0x23EC || x === 0x23F0 || x === 0x23F3 || x === 0x25FD || x === 0x25FE || x === 0x2614 || x === 0x2615 || x >= 0x2648 && x <= 0x2653 || x === 0x267F || x === 0x2693 || x === 0x26A1 || x === 0x26AA || x === 0x26AB || x === 0x26BD || x === 0x26BE || x === 0x26C4 || x === 0x26C5 || x === 0x26CE || x === 0x26D4 || x === 0x26EA || x === 0x26F2 || x === 0x26F3 || x === 0x26F5 || x === 0x26FA || x === 0x26FD || x === 0x2705 || x === 0x270A || x === 0x270B || x === 0x2728 || x === 0x274C || x === 0x274E || x >= 0x2753 && x <= 0x2755 || x === 0x2757 || x >= 0x2795 && x <= 0x2797 || x === 0x27B0 || x === 0x27BF || x === 0x2B1B || x === 0x2B1C || x === 0x2B50 || x === 0x2B55 || x >= 0x2E80 && x <= 0x2E99 || x >= 0x2E9B && x <= 0x2EF3 || x >= 0x2F00 && x <= 0x2FD5 || x >= 0x2FF0 && x <= 0x2FFF || x >= 0x3001 && x <= 0x303E || x >= 0x3041 && x <= 0x3096 || x >= 0x3099 && x <= 0x30FF || x >= 0x3105 && x <= 0x312F || x >= 0x3131 && x <= 0x318E || x >= 0x3190 && x <= 0x31E3 || x >= 0x31EF && x <= 0x321E || x >= 0x3220 && x <= 0x3247 || x >= 0x3250 && x <= 0x4DBF || x >= 0x4E00 && x <= 0xA48C || x >= 0xA490 && x <= 0xA4C6 || x >= 0xA960 && x <= 0xA97C || x >= 0xAC00 && x <= 0xD7A3 || x >= 0xF900 && x <= 0xFAFF || x >= 0xFE10 && x <= 0xFE19 || x >= 0xFE30 && x <= 0xFE52 || x >= 0xFE54 && x <= 0xFE66 || x >= 0xFE68 && x <= 0xFE6B || x >= 0x16FE0 && x <= 0x16FE4 || x === 0x16FF0 || x === 0x16FF1 || x >= 0x17000 && x <= 0x187F7 || x >= 0x18800 && x <= 0x18CD5 || x >= 0x18D00 && x <= 0x18D08 || x >= 0x1AFF0 && x <= 0x1AFF3 || x >= 0x1AFF5 && x <= 0x1AFFB || x === 0x1AFFD || x === 0x1AFFE || x >= 0x1B000 && x <= 0x1B122 || x === 0x1B132 || x >= 0x1B150 && x <= 0x1B152 || x === 0x1B155 || x >= 0x1B164 && x <= 0x1B167 || x >= 0x1B170 && x <= 0x1B2FB || x === 0x1F004 || x === 0x1F0CF || x === 0x1F18E || x >= 0x1F191 && x <= 0x1F19A || x >= 0x1F200 && x <= 0x1F202 || x >= 0x1F210 && x <= 0x1F23B || x >= 0x1F240 && x <= 0x1F248 || x === 0x1F250 || x === 0x1F251 || x >= 0x1F260 && x <= 0x1F265 || x >= 0x1F300 && x <= 0x1F320 || x >= 0x1F32D && x <= 0x1F335 || x >= 0x1F337 && x <= 0x1F37C || x >= 0x1F37E && x <= 0x1F393 || x >= 0x1F3A0 && x <= 0x1F3CA || x >= 0x1F3CF && x <= 0x1F3D3 || x >= 0x1F3E0 && x <= 0x1F3F0 || x === 0x1F3F4 || x >= 0x1F3F8 && x <= 0x1F43E || x === 0x1F440 || x >= 0x1F442 && x <= 0x1F4FC || x >= 0x1F4FF && x <= 0x1F53D || x >= 0x1F54B && x <= 0x1F54E || x >= 0x1F550 && x <= 0x1F567 || x === 0x1F57A || x === 0x1F595 || x === 0x1F596 || x === 0x1F5A4 || x >= 0x1F5FB && x <= 0x1F64F || x >= 0x1F680 && x <= 0x1F6C5 || x === 0x1F6CC || x >= 0x1F6D0 && x <= 0x1F6D2 || x >= 0x1F6D5 && x <= 0x1F6D7 || x >= 0x1F6DC && x <= 0x1F6DF || x === 0x1F6EB || x === 0x1F6EC || x >= 0x1F6F4 && x <= 0x1F6FC || x >= 0x1F7E0 && x <= 0x1F7EB || x === 0x1F7F0 || x >= 0x1F90C && x <= 0x1F93A || x >= 0x1F93C && x <= 0x1F945 || x >= 0x1F947 && x <= 0x1F9FF || x >= 0x1FA70 && x <= 0x1FA7C || x >= 0x1FA80 && x <= 0x1FA88 || x >= 0x1FA90 && x <= 0x1FABD || x >= 0x1FABF && x <= 0x1FAC5 || x >= 0x1FACE && x <= 0x1FADB || x >= 0x1FAE0 && x <= 0x1FAE8 || x >= 0x1FAF0 && x <= 0x1FAF8 || x >= 0x20000 && x <= 0x2FFFD || x >= 0x30000 && x <= 0x3FFFD;\n};\n/* EXPORT */\nexport { isAmbiguous, isFullWidth, isWide };\n","/* IMPORT */\nimport { isAmbiguous, isFullWidth, isWide } from './utils.js';\n/* HELPERS */\nconst ANSI_RE = /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;\nconst CONTROL_RE = /[\\x00-\\x08\\x0A-\\x1F\\x7F-\\x9F]{1,1000}/y;\nconst TAB_RE = /\\t{1,1000}/y;\nconst EMOJI_RE = /[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*/yu;\nconst LATIN_RE = /(?:[\\x20-\\x7E\\xA0-\\xFF](?!\\uFE0F)){1,1000}/y;\nconst MODIFIER_RE = /\\p{M}+/gu;\nconst NO_TRUNCATION = { limit: Infinity, ellipsis: '' };\n/* MAIN */\n//TODO: Optimize matching non-latin letters\nconst getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {\n /* CONSTANTS */\n const LIMIT = truncationOptions.limit ?? Infinity;\n const ELLIPSIS = truncationOptions.ellipsis ?? '';\n const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);\n const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;\n const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;\n const TAB_WIDTH = widthOptions.tabWidth ?? 8;\n const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;\n const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;\n const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;\n const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;\n const WIDE_WIDTH = widthOptions.wideWidth ?? 2;\n /* STATE */\n let indexPrev = 0;\n let index = 0;\n let length = input.length;\n let lengthExtra = 0;\n let truncationEnabled = false;\n let truncationIndex = length;\n let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);\n let unmatchedStart = 0;\n let unmatchedEnd = 0;\n let width = 0;\n let widthExtra = 0;\n /* PARSE LOOP */\n outer: while (true) {\n /* UNMATCHED */\n if ((unmatchedEnd > unmatchedStart) || (index >= length && index > indexPrev)) {\n const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);\n lengthExtra = 0;\n for (const char of unmatched.replaceAll(MODIFIER_RE, '')) {\n const codePoint = char.codePointAt(0) || 0;\n if (isFullWidth(codePoint)) {\n widthExtra = FULL_WIDTH_WIDTH;\n }\n else if (isWide(codePoint)) {\n widthExtra = WIDE_WIDTH;\n }\n else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {\n widthExtra = AMBIGUOUS_WIDTH;\n }\n else {\n widthExtra = REGULAR_WIDTH;\n }\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break outer;\n }\n lengthExtra += char.length;\n width += widthExtra;\n }\n unmatchedStart = unmatchedEnd = 0;\n }\n /* EXITING */\n if (index >= length)\n break;\n /* LATIN */\n LATIN_RE.lastIndex = index;\n if (LATIN_RE.test(input)) {\n lengthExtra = LATIN_RE.lastIndex - index;\n widthExtra = lengthExtra * REGULAR_WIDTH;\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += widthExtra;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = LATIN_RE.lastIndex;\n continue;\n }\n /* ANSI */\n ANSI_RE.lastIndex = index;\n if (ANSI_RE.test(input)) {\n if ((width + ANSI_WIDTH) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index);\n }\n if ((width + ANSI_WIDTH) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += ANSI_WIDTH;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = ANSI_RE.lastIndex;\n continue;\n }\n /* CONTROL */\n CONTROL_RE.lastIndex = index;\n if (CONTROL_RE.test(input)) {\n lengthExtra = CONTROL_RE.lastIndex - index;\n widthExtra = lengthExtra * CONTROL_WIDTH;\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += widthExtra;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = CONTROL_RE.lastIndex;\n continue;\n }\n /* TAB */\n TAB_RE.lastIndex = index;\n if (TAB_RE.test(input)) {\n lengthExtra = TAB_RE.lastIndex - index;\n widthExtra = lengthExtra * TAB_WIDTH;\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += widthExtra;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = TAB_RE.lastIndex;\n continue;\n }\n /* EMOJI */\n EMOJI_RE.lastIndex = index;\n if (EMOJI_RE.test(input)) {\n if ((width + EMOJI_WIDTH) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index);\n }\n if ((width + EMOJI_WIDTH) > LIMIT) {\n truncationEnabled = true;\n break;\n }\n width += EMOJI_WIDTH;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = EMOJI_RE.lastIndex;\n continue;\n }\n /* UNMATCHED INDEX */\n index += 1;\n }\n /* RETURN */\n return {\n width: truncationEnabled ? truncationLimit : width,\n index: truncationEnabled ? truncationIndex : length,\n truncated: truncationEnabled,\n ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH\n };\n};\n/* EXPORT */\nexport default getStringTruncatedWidth;\n","/* IMPORT */\nimport fastStringTruncatedWidth from 'fast-string-truncated-width';\n/* HELPERS */\nconst NO_TRUNCATION = {\n limit: Infinity,\n ellipsis: '',\n ellipsisWidth: 0,\n};\n/* MAIN */\nconst fastStringWidth = (input, options = {}) => {\n return fastStringTruncatedWidth(input, NO_TRUNCATION, options).width;\n};\n/* EXPORT */\nexport default fastStringWidth;\n","import stringWidth from 'fast-string-width';\nconst ESC = '\\x1B';\nconst CSI = '\\x9B';\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;;`;\nconst GROUP_REGEX = new RegExp(`(?:\\\\${ANSI_CSI}(?<code>\\\\d+)m|\\\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, 'y');\nconst getClosingCode = (openingCode) => {\n if (openingCode >= 30 && openingCode <= 37)\n return 39;\n if (openingCode >= 90 && openingCode <= 97)\n return 39;\n if (openingCode >= 40 && openingCode <= 47)\n return 49;\n if (openingCode >= 100 && openingCode <= 107)\n return 49;\n if (openingCode === 1 || openingCode === 2)\n return 22;\n if (openingCode === 3)\n return 23;\n if (openingCode === 4)\n return 24;\n if (openingCode === 7)\n return 27;\n if (openingCode === 8)\n return 28;\n if (openingCode === 9)\n return 29;\n if (openingCode === 0)\n return 0;\n return undefined;\n};\nconst wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;\nconst wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;\nconst wordLengths = (words) => words.map((character) => stringWidth(character));\nconst wrapWord = (rows, word, columns) => {\n const characters = word[Symbol.iterator]();\n let isInsideEscape = false;\n let isInsideLinkEscape = false;\n let lastRow = rows.at(-1);\n let visible = lastRow === undefined ? 0 : stringWidth(lastRow);\n let currentCharacter = characters.next();\n let nextCharacter = characters.next();\n let rawCharacterIndex = 0;\n while (!currentCharacter.done) {\n const character = currentCharacter.value;\n const characterLength = stringWidth(character);\n if (visible + characterLength <= columns) {\n rows[rows.length - 1] += character;\n }\n else {\n rows.push(character);\n visible = 0;\n }\n if (character === ESC || character === CSI) {\n isInsideEscape = true;\n isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);\n }\n if (isInsideEscape) {\n if (isInsideLinkEscape) {\n if (character === ANSI_ESCAPE_BELL) {\n isInsideEscape = false;\n isInsideLinkEscape = false;\n }\n }\n else if (character === ANSI_SGR_TERMINATOR) {\n isInsideEscape = false;\n }\n }\n else {\n visible += characterLength;\n if (visible === columns && !nextCharacter.done) {\n rows.push('');\n visible = 0;\n }\n }\n currentCharacter = nextCharacter;\n nextCharacter = characters.next();\n rawCharacterIndex += character.length;\n }\n lastRow = rows.at(-1);\n if (!visible &&\n lastRow !== undefined &&\n lastRow.length > 0 &&\n rows.length > 1) {\n rows[rows.length - 2] += rows.pop();\n }\n};\nconst stringVisibleTrimSpacesRight = (string) => {\n const words = string.split(' ');\n let last = words.length;\n while (last > 0) {\n if (stringWidth(words[last - 1]) > 0) {\n break;\n }\n last--;\n }\n if (last === words.length) {\n return string;\n }\n return words.slice(0, last).join(' ') + words.slice(last).join('');\n};\nconst exec = (string, columns, options = {}) => {\n if (options.trim !== false && string.trim() === '') {\n return '';\n }\n let returnValue = '';\n let escapeCode;\n let escapeUrl;\n const words = string.split(' ');\n const lengths = wordLengths(words);\n let rows = [''];\n for (const [index, word] of words.entries()) {\n if (options.trim !== false) {\n rows[rows.length - 1] = (rows.at(-1) ?? '').trimStart();\n }\n let rowLength = stringWidth(rows.at(-1) ?? '');\n if (index !== 0) {\n if (rowLength >= columns &&\n (options.wordWrap === false || options.trim === false)) {\n rows.push('');\n rowLength = 0;\n }\n if (rowLength > 0 || options.trim === false) {\n rows[rows.length - 1] += ' ';\n rowLength++;\n }\n }\n if (options.hard && lengths[index] > columns) {\n const remainingColumns = columns - rowLength;\n const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);\n const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);\n if (breaksStartingNextLine < breaksStartingThisLine) {\n rows.push('');\n }\n wrapWord(rows, word, columns);\n continue;\n }\n if (rowLength + lengths[index] > columns &&\n rowLength > 0 &&\n lengths[index] > 0) {\n if (options.wordWrap === false && rowLength < columns) {\n wrapWord(rows, word, columns);\n continue;\n }\n rows.push('');\n }\n if (rowLength + lengths[index] > columns && options.wordWrap === false) {\n wrapWord(rows, word, columns);\n continue;\n }\n rows[rows.length - 1] += word;\n }\n if (options.trim !== false) {\n rows = rows.map((row) => stringVisibleTrimSpacesRight(row));\n }\n const preString = rows.join('\\n');\n const pre = preString[Symbol.iterator]();\n let currentPre = pre.next();\n let nextPre = pre.next();\n // We need to keep a separate index as `String#slice()` works on Unicode code units, while `pre` is an array of codepoints.\n let preStringIndex = 0;\n while (!currentPre.done) {\n const character = currentPre.value;\n const nextCharacter = nextPre.value;\n returnValue += character;\n if (character === ESC || character === CSI) {\n GROUP_REGEX.lastIndex = preStringIndex + 1;\n const groupsResult = GROUP_REGEX.exec(preString);\n const groups = groupsResult?.groups;\n if (groups?.code !== undefined) {\n const code = Number.parseFloat(groups.code);\n escapeCode = code === END_CODE ? undefined : code;\n }\n else if (groups?.uri !== undefined) {\n escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;\n }\n }\n const closingCode = escapeCode ? getClosingCode(escapeCode) : undefined;\n if (nextCharacter === '\\n') {\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink('');\n }\n if (escapeCode && closingCode) {\n returnValue += wrapAnsiCode(closingCode);\n }\n }\n else if (character === '\\n') {\n if (escapeCode && closingCode) {\n returnValue += wrapAnsiCode(escapeCode);\n }\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(escapeUrl);\n }\n }\n preStringIndex += character.length;\n currentPre = nextPre;\n nextPre = pre.next();\n }\n return returnValue;\n};\nexport function wrapAnsi(string, columns, options) {\n return String(string)\n .normalize()\n .replaceAll('\\r\\n', '\\n')\n .split('\\n')\n .map((line) => exec(line, columns, options))\n .join('\\n');\n}\n//# sourceMappingURL=main.js.map","import type { Writable } from 'node:stream';\nimport { getColumns, getRows } from '@clack/core';\nimport { wrapAnsi } from 'fast-wrap-ansi';\nimport color from 'picocolors';\nimport type { CommonOptions } from './common.js';\n\nexport interface LimitOptionsParams<TOption> extends CommonOptions {\n\toptions: TOption[];\n\tmaxItems: number | undefined;\n\tcursor: number;\n\tstyle: (option: TOption, active: boolean) => string;\n\tcolumnPadding?: number;\n\trowPadding?: number;\n}\n\nconst trimLines = (\n\tgroups: Array<string[]>,\n\tinitialLineCount: number,\n\tstartIndex: number,\n\tendIndex: number,\n\tmaxLines: number\n) => {\n\tlet lineCount = initialLineCount;\n\tlet removals = 0;\n\tfor (let i = startIndex; i < endIndex; i++) {\n\t\tconst group = groups[i];\n\t\tlineCount = lineCount - group.length;\n\t\tremovals++;\n\t\tif (lineCount <= maxLines) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn { lineCount, removals };\n};\n\nexport const limitOptions = <TOption>(params: LimitOptionsParams<TOption>): string[] => {\n\tconst { cursor, options, style } = params;\n\tconst output: Writable = params.output ?? process.stdout;\n\tconst columns = getColumns(output);\n\tconst columnPadding = params.columnPadding ?? 0;\n\tconst rowPadding = params.rowPadding ?? 4;\n\tconst maxWidth = columns - columnPadding;\n\tconst rows = getRows(output);\n\tconst overflowFormat = color.dim('...');\n\n\tconst paramMaxItems = params.maxItems ?? Number.POSITIVE_INFINITY;\n\tconst outputMaxItems = Math.max(rows - rowPadding, 0);\n\t// We clamp to minimum 5 because anything less doesn't make sense UX wise\n\tconst maxItems = Math.max(Math.min(paramMaxItems, outputMaxItems), 5);\n\tlet slidingWindowLocation = 0;\n\n\tif (cursor >= maxItems - 3) {\n\t\tslidingWindowLocation = Math.max(Math.min(cursor - maxItems + 3, options.length - maxItems), 0);\n\t}\n\n\tlet shouldRenderTopEllipsis = maxItems < options.length && slidingWindowLocation > 0;\n\tlet shouldRenderBottomEllipsis =\n\t\tmaxItems < options.length && slidingWindowLocation + maxItems < options.length;\n\n\tconst slidingWindowLocationEnd = Math.min(slidingWindowLocation + maxItems, options.length);\n\tconst lineGroups: Array<string[]> = [];\n\tlet lineCount = 0;\n\tif (shouldRenderTopEllipsis) {\n\t\tlineCount++;\n\t}\n\tif (shouldRenderBottomEllipsis) {\n\t\tlineCount++;\n\t}\n\n\tconst slidingWindowLocationWithEllipsis =\n\t\tslidingWindowLocation + (shouldRenderTopEllipsis ? 1 : 0);\n\tconst slidingWindowLocationEndWithEllipsis =\n\t\tslidingWindowLocationEnd - (shouldRenderBottomEllipsis ? 1 : 0);\n\n\tfor (let i = slidingWindowLocationWithEllipsis; i < slidingWindowLocationEndWithEllipsis; i++) {\n\t\tconst wrappedLines = wrapAnsi(style(options[i], i === cursor), maxWidth, {\n\t\t\thard: true,\n\t\t\ttrim: false,\n\t\t}).split('\\n');\n\t\tlineGroups.push(wrappedLines);\n\t\tlineCount += wrappedLines.length;\n\t}\n\n\tif (lineCount > outputMaxItems) {\n\t\tlet precedingRemovals = 0;\n\t\tlet followingRemovals = 0;\n\t\tlet newLineCount = lineCount;\n\t\tconst cursorGroupIndex = cursor - slidingWindowLocationWithEllipsis;\n\t\tconst trimLinesLocal = (startIndex: number, endIndex: number) =>\n\t\t\ttrimLines(lineGroups, newLineCount, startIndex, endIndex, outputMaxItems);\n\n\t\tif (shouldRenderTopEllipsis) {\n\t\t\t({ lineCount: newLineCount, removals: precedingRemovals } = trimLinesLocal(\n\t\t\t\t0,\n\t\t\t\tcursorGroupIndex\n\t\t\t));\n\t\t\tif (newLineCount > outputMaxItems) {\n\t\t\t\t({ lineCount: newLineCount, removals: followingRemovals } = trimLinesLocal(\n\t\t\t\t\tcursorGroupIndex + 1,\n\t\t\t\t\tlineGroups.length\n\t\t\t\t));\n\t\t\t}\n\t\t} else {\n\t\t\t({ lineCount: newLineCount, removals: followingRemovals } = trimLinesLocal(\n\t\t\t\tcursorGroupIndex + 1,\n\t\t\t\tlineGroups.length\n\t\t\t));\n\t\t\tif (newLineCount > outputMaxItems) {\n\t\t\t\t({ lineCount: newLineCount, removals: precedingRemovals } = trimLinesLocal(\n\t\t\t\t\t0,\n\t\t\t\t\tcursorGroupIndex\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\tif (precedingRemovals > 0) {\n\t\t\tshouldRenderTopEllipsis = true;\n\t\t\tlineGroups.splice(0, precedingRemovals);\n\t\t}\n\t\tif (followingRemovals > 0) {\n\t\t\tshouldRenderBottomEllipsis = true;\n\t\t\tlineGroups.splice(lineGroups.length - followingRemovals, followingRemovals);\n\t\t}\n\t}\n\n\tconst result: string[] = [];\n\tif (shouldRenderTopEllipsis) {\n\t\tresult.push(overflowFormat);\n\t}\n\tfor (const lineGroup of lineGroups) {\n\t\tfor (const line of lineGroup) {\n\t\t\tresult.push(line);\n\t\t}\n\t}\n\tif (shouldRenderBottomEllipsis) {\n\t\tresult.push(overflowFormat);\n\t}\n\n\treturn result;\n};\n","import { AutocompletePrompt, settings } from '@clack/core';\nimport color from 'picocolors';\nimport {\n\ttype CommonOptions,\n\tS_BAR,\n\tS_BAR_END,\n\tS_CHECKBOX_INACTIVE,\n\tS_CHECKBOX_SELECTED,\n\tS_RADIO_ACTIVE,\n\tS_RADIO_INACTIVE,\n\tsymbol,\n} from './common.js';\nimport { limitOptions } from './limit-options.js';\nimport type { Option } from './select.js';\n\nfunction getLabel<T>(option: Option<T>) {\n\treturn option.label ?? String(option.value ?? '');\n}\n\nfunction getFilteredOption<T>(searchText: string, option: Option<T>): boolean {\n\tif (!searchText) {\n\t\treturn true;\n\t}\n\tconst label = (option.label ?? String(option.value ?? '')).toLowerCase();\n\tconst hint = (option.hint ?? '').toLowerCase();\n\tconst value = String(option.value).toLowerCase();\n\tconst term = searchText.toLowerCase();\n\n\treturn label.includes(term) || hint.includes(term) || value.includes(term);\n}\n\nfunction getSelectedOptions<T>(values: T[], options: Option<T>[]): Option<T>[] {\n\tconst results: Option<T>[] = [];\n\n\tfor (const option of options) {\n\t\tif (values.includes(option.value)) {\n\t\t\tresults.push(option);\n\t\t}\n\t}\n\n\treturn results;\n}\n\ninterface AutocompleteSharedOptions<Value> extends CommonOptions {\n\t/**\n\t * The message to display to the user.\n\t */\n\tmessage: string;\n\t/**\n\t * Available options for the autocomplete prompt.\n\t */\n\toptions: Option<Value>[] | ((this: AutocompletePrompt<Option<Value>>) => Option<Value>[]);\n\t/**\n\t * Maximum number of items to display at once.\n\t */\n\tmaxItems?: number;\n\t/**\n\t * Placeholder text to display when no input is provided.\n\t */\n\tplaceholder?: string;\n\t/**\n\t * Validates the value\n\t */\n\tvalidate?: (value: Value | Value[] | undefined) => string | Error | undefined;\n\t/**\n\t * Custom filter function to match options against search input.\n\t * If not provided, a default filter that matches label, hint, and value is used.\n\t */\n\tfilter?: (search: string, option: Option<Value>) => boolean;\n}\n\nexport interface AutocompleteOptions<Value> extends AutocompleteSharedOptions<Value> {\n\t/**\n\t * The initial selected value.\n\t */\n\tinitialValue?: Value;\n\t/**\n\t * The initial user input\n\t */\n\tinitialUserInput?: string;\n}\n\nexport const autocomplete = <Value>(opts: AutocompleteOptions<Value>) => {\n\tconst prompt = new AutocompletePrompt({\n\t\toptions: opts.options,\n\t\tinitialValue: opts.initialValue ? [opts.initialValue] : undefined,\n\t\tinitialUserInput: opts.initialUserInput,\n\t\tfilter:\n\t\t\topts.filter ??\n\t\t\t((search: string, opt: Option<Value>) => {\n\t\t\t\treturn getFilteredOption(search, opt);\n\t\t\t}),\n\t\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\toutput: opts.output,\n\t\tvalidate: opts.validate,\n\t\trender() {\n\t\t\tconst hasGuide = opts.withGuide ?? settings.withGuide;\n\t\t\t// Title and message display\n\t\t\tconst headings = hasGuide\n\t\t\t\t? [`${color.gray(S_BAR)}`, `${symbol(this.state)} ${opts.message}`]\n\t\t\t\t: [`${symbol(this.state)} ${opts.message}`];\n\t\t\tconst userInput = this.userInput;\n\t\t\tconst options = this.options;\n\t\t\tconst placeholder = opts.placeholder;\n\t\t\tconst showPlaceholder = userInput === '' && placeholder !== undefined;\n\t\t\tconst opt = (option: Option<Value>, state: 'inactive' | 'active' | 'disabled') => {\n\t\t\t\tconst label = getLabel(option);\n\t\t\t\tconst hint =\n\t\t\t\t\toption.hint && option.value === this.focusedValue ? color.dim(` (${option.hint})`) : '';\n\t\t\t\tswitch (state) {\n\t\t\t\t\tcase 'active':\n\t\t\t\t\t\treturn `${color.green(S_RADIO_ACTIVE)} ${label}${hint}`;\n\t\t\t\t\tcase 'inactive':\n\t\t\t\t\t\treturn `${color.dim(S_RADIO_INACTIVE)} ${color.dim(label)}`;\n\t\t\t\t\tcase 'disabled':\n\t\t\t\t\t\treturn `${color.gray(S_RADIO_INACTIVE)} ${color.strikethrough(color.gray(label))}`;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Handle different states\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\t// Show selected value\n\t\t\t\t\tconst selected = getSelectedOptions(this.selectedValues, options);\n\t\t\t\t\tconst label =\n\t\t\t\t\t\tselected.length > 0 ? ` ${color.dim(selected.map(getLabel).join(', '))}` : '';\n\t\t\t\t\tconst submitPrefix = hasGuide ? color.gray(S_BAR) : '';\n\t\t\t\t\treturn `${headings.join('\\n')}\\n${submitPrefix}${label}`;\n\t\t\t\t}\n\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst userInputText = userInput ? ` ${color.strikethrough(color.dim(userInput))}` : '';\n\t\t\t\t\tconst cancelPrefix = hasGuide ? color.gray(S_BAR) : '';\n\t\t\t\t\treturn `${headings.join('\\n')}\\n${cancelPrefix}${userInputText}`;\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tconst barColor = this.state === 'error' ? color.yellow : color.cyan;\n\t\t\t\t\tconst guidePrefix = hasGuide ? `${barColor(S_BAR)} ` : '';\n\t\t\t\t\tconst guidePrefixEnd = hasGuide ? barColor(S_BAR_END) : '';\n\t\t\t\t\t// Display cursor position - show plain text in navigation mode\n\t\t\t\t\tlet searchText = '';\n\t\t\t\t\tif (this.isNavigating || showPlaceholder) {\n\t\t\t\t\t\tconst searchTextValue = showPlaceholder ? placeholder : userInput;\n\t\t\t\t\t\tsearchText = searchTextValue !== '' ? ` ${color.dim(searchTextValue)}` : '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsearchText = ` ${this.userInputWithCursor}`;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Show match count if filtered\n\t\t\t\t\tconst matches =\n\t\t\t\t\t\tthis.filteredOptions.length !== options.length\n\t\t\t\t\t\t\t? color.dim(\n\t\t\t\t\t\t\t\t\t` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? '' : 'es'})`\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t: '';\n\n\t\t\t\t\t// No matches message\n\t\t\t\t\tconst noResults =\n\t\t\t\t\t\tthis.filteredOptions.length === 0 && userInput\n\t\t\t\t\t\t\t? [`${guidePrefix}${color.yellow('No matches found')}`]\n\t\t\t\t\t\t\t: [];\n\n\t\t\t\t\tconst validationError =\n\t\t\t\t\t\tthis.state === 'error' ? [`${guidePrefix}${color.yellow(this.error)}`] : [];\n\n\t\t\t\t\tif (hasGuide) {\n\t\t\t\t\t\theadings.push(`${guidePrefix.trimEnd()}`);\n\t\t\t\t\t}\n\t\t\t\t\theadings.push(\n\t\t\t\t\t\t`${guidePrefix}${color.dim('Search:')}${searchText}${matches}`,\n\t\t\t\t\t\t...noResults,\n\t\t\t\t\t\t...validationError\n\t\t\t\t\t);\n\n\t\t\t\t\t// Show instructions\n\t\t\t\t\tconst instructions = [\n\t\t\t\t\t\t`${color.dim('↑/↓')} to select`,\n\t\t\t\t\t\t`${color.dim('Enter:')} confirm`,\n\t\t\t\t\t\t`${color.dim('Type:')} to search`,\n\t\t\t\t\t];\n\n\t\t\t\t\tconst footers = [`${guidePrefix}${instructions.join(' • ')}`, guidePrefixEnd];\n\n\t\t\t\t\t// Render options with selection\n\t\t\t\t\tconst displayOptions =\n\t\t\t\t\t\tthis.filteredOptions.length === 0\n\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t: limitOptions({\n\t\t\t\t\t\t\t\t\tcursor: this.cursor,\n\t\t\t\t\t\t\t\t\toptions: this.filteredOptions,\n\t\t\t\t\t\t\t\t\tcolumnPadding: hasGuide ? 3 : 0, // for `| ` when guide is shown\n\t\t\t\t\t\t\t\t\trowPadding: headings.length + footers.length,\n\t\t\t\t\t\t\t\t\tstyle: (option, active) => {\n\t\t\t\t\t\t\t\t\t\treturn opt(\n\t\t\t\t\t\t\t\t\t\t\toption,\n\t\t\t\t\t\t\t\t\t\t\toption.disabled ? 'disabled' : active ? 'active' : 'inactive'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tmaxItems: opts.maxItems,\n\t\t\t\t\t\t\t\t\toutput: opts.output,\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t// Return the formatted prompt\n\t\t\t\t\treturn [\n\t\t\t\t\t\t...headings,\n\t\t\t\t\t\t...displayOptions.map((option) => `${guidePrefix}${option}`),\n\t\t\t\t\t\t...footers,\n\t\t\t\t\t].join('\\n');\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t});\n\n\t// Return the result or cancel symbol\n\treturn prompt.prompt() as Promise<Value | symbol>;\n};\n\n// Type definition for the autocompleteMultiselect component\nexport interface AutocompleteMultiSelectOptions<Value> extends AutocompleteSharedOptions<Value> {\n\t/**\n\t * The initial selected values\n\t */\n\tinitialValues?: Value[];\n\t/**\n\t * If true, at least one option must be selected\n\t */\n\trequired?: boolean;\n}\n\n/**\n * Integrated autocomplete multiselect - combines type-ahead filtering with multiselect in one UI\n */\nexport const autocompleteMultiselect = <Value>(opts: AutocompleteMultiSelectOptions<Value>) => {\n\tconst formatOption = (\n\t\toption: Option<Value>,\n\t\tactive: boolean,\n\t\tselectedValues: Value[],\n\t\tfocusedValue: Value | undefined\n\t) => {\n\t\tconst isSelected = selectedValues.includes(option.value);\n\t\tconst label = option.label ?? String(option.value ?? '');\n\t\tconst hint =\n\t\t\toption.hint && focusedValue !== undefined && option.value === focusedValue\n\t\t\t\t? color.dim(` (${option.hint})`)\n\t\t\t\t: '';\n\t\tconst checkbox = isSelected ? color.green(S_CHECKBOX_SELECTED) : color.dim(S_CHECKBOX_INACTIVE);\n\n\t\tif (option.disabled) {\n\t\t\treturn `${color.gray(S_CHECKBOX_INACTIVE)} ${color.strikethrough(color.gray(label))}`;\n\t\t}\n\t\tif (active) {\n\t\t\treturn `${checkbox} ${label}${hint}`;\n\t\t}\n\t\treturn `${checkbox} ${color.dim(label)}`;\n\t};\n\n\t// Create text prompt which we'll use as foundation\n\tconst prompt = new AutocompletePrompt<Option<Value>>({\n\t\toptions: opts.options,\n\t\tmultiple: true,\n\t\tfilter:\n\t\t\topts.filter ??\n\t\t\t((search, opt) => {\n\t\t\t\treturn getFilteredOption(search, opt);\n\t\t\t}),\n\t\tvalidate: () => {\n\t\t\tif (opts.required && prompt.selectedValues.length === 0) {\n\t\t\t\treturn 'Please select at least one item';\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\t\tinitialValue: opts.initialValues,\n\t\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\toutput: opts.output,\n\t\trender() {\n\t\t\t// Title and symbol\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${symbol(this.state)} ${opts.message}\\n`;\n\n\t\t\t// Selection counter\n\t\t\tconst userInput = this.userInput;\n\t\t\tconst placeholder = opts.placeholder;\n\t\t\tconst showPlaceholder = userInput === '' && placeholder !== undefined;\n\n\t\t\t// Search input display\n\t\t\tconst searchText =\n\t\t\t\tthis.isNavigating || showPlaceholder\n\t\t\t\t\t? color.dim(showPlaceholder ? placeholder : userInput) // Just show plain text when in navigation mode\n\t\t\t\t\t: this.userInputWithCursor;\n\n\t\t\tconst options = this.options;\n\n\t\t\tconst matches =\n\t\t\t\tthis.filteredOptions.length !== options.length\n\t\t\t\t\t? color.dim(\n\t\t\t\t\t\t\t` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? '' : 'es'})`\n\t\t\t\t\t\t)\n\t\t\t\t\t: '';\n\n\t\t\t// Render prompt state\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(`${this.selectedValues.length} items selected`)}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)} ${color.strikethrough(color.dim(userInput))}`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tconst barColor = this.state === 'error' ? color.yellow : color.cyan;\n\t\t\t\t\t// Instructions\n\t\t\t\t\tconst instructions = [\n\t\t\t\t\t\t`${color.dim('↑/↓')} to navigate`,\n\t\t\t\t\t\t`${color.dim(this.isNavigating ? 'Space/Tab:' : 'Tab:')} select`,\n\t\t\t\t\t\t`${color.dim('Enter:')} confirm`,\n\t\t\t\t\t\t`${color.dim('Type:')} to search`,\n\t\t\t\t\t];\n\n\t\t\t\t\t// No results message\n\t\t\t\t\tconst noResults =\n\t\t\t\t\t\tthis.filteredOptions.length === 0 && userInput\n\t\t\t\t\t\t\t? [`${barColor(S_BAR)} ${color.yellow('No matches found')}`]\n\t\t\t\t\t\t\t: [];\n\n\t\t\t\t\tconst errorMessage =\n\t\t\t\t\t\tthis.state === 'error' ? [`${barColor(S_BAR)} ${color.yellow(this.error)}`] : [];\n\n\t\t\t\t\t// Calculate header and footer line counts for rowPadding\n\t\t\t\t\tconst headerLines = [\n\t\t\t\t\t\t...`${title}${barColor(S_BAR)}`.split('\\n'),\n\t\t\t\t\t\t`${barColor(S_BAR)} ${color.dim('Search:')} ${searchText}${matches}`,\n\t\t\t\t\t\t...noResults,\n\t\t\t\t\t\t...errorMessage,\n\t\t\t\t\t];\n\t\t\t\t\tconst footerLines = [\n\t\t\t\t\t\t`${barColor(S_BAR)} ${instructions.join(' • ')}`,\n\t\t\t\t\t\t`${barColor(S_BAR_END)}`,\n\t\t\t\t\t];\n\n\t\t\t\t\t// Get limited options for display\n\t\t\t\t\tconst displayOptions = limitOptions({\n\t\t\t\t\t\tcursor: this.cursor,\n\t\t\t\t\t\toptions: this.filteredOptions,\n\t\t\t\t\t\tstyle: (option, active) =>\n\t\t\t\t\t\t\tformatOption(option, active, this.selectedValues, this.focusedValue),\n\t\t\t\t\t\tmaxItems: opts.maxItems,\n\t\t\t\t\t\toutput: opts.output,\n\t\t\t\t\t\trowPadding: headerLines.length + footerLines.length,\n\t\t\t\t\t});\n\n\t\t\t\t\t// Build the prompt display\n\t\t\t\t\treturn [\n\t\t\t\t\t\t...headerLines,\n\t\t\t\t\t\t...displayOptions.map((option) => `${barColor(S_BAR)} ${option}`),\n\t\t\t\t\t\t...footerLines,\n\t\t\t\t\t].join('\\n');\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t});\n\n\t// Return the result or cancel symbol\n\treturn prompt.prompt() as Promise<Value[] | symbol>;\n};\n","import type { Writable } from 'node:stream';\nimport { getColumns, settings } from '@clack/core';\nimport stringWidth from 'fast-string-width';\nimport { wrapAnsi } from 'fast-wrap-ansi';\nimport {\n\ttype CommonOptions,\n\tS_BAR,\n\tS_BAR_END,\n\tS_BAR_END_RIGHT,\n\tS_BAR_H,\n\tS_BAR_START,\n\tS_BAR_START_RIGHT,\n\tS_CORNER_BOTTOM_LEFT,\n\tS_CORNER_BOTTOM_RIGHT,\n\tS_CORNER_TOP_LEFT,\n\tS_CORNER_TOP_RIGHT,\n} from './common.js';\n\nexport type BoxAlignment = 'left' | 'center' | 'right';\n\ntype BoxSymbols = [topLeft: string, topRight: string, bottomLeft: string, bottomRight: string];\n\nconst roundedSymbols: BoxSymbols = [\n\tS_CORNER_TOP_LEFT,\n\tS_CORNER_TOP_RIGHT,\n\tS_CORNER_BOTTOM_LEFT,\n\tS_CORNER_BOTTOM_RIGHT,\n];\nconst squareSymbols: BoxSymbols = [S_BAR_START, S_BAR_START_RIGHT, S_BAR_END, S_BAR_END_RIGHT];\n\nexport interface BoxOptions extends CommonOptions {\n\tcontentAlign?: BoxAlignment;\n\ttitleAlign?: BoxAlignment;\n\twidth?: number | 'auto';\n\ttitlePadding?: number;\n\tcontentPadding?: number;\n\trounded?: boolean;\n\tformatBorder?: (text: string) => string;\n}\n\nfunction getPaddingForLine(\n\tlineLength: number,\n\tinnerWidth: number,\n\tpadding: number,\n\tcontentAlign: BoxAlignment | undefined\n): [number, number] {\n\tlet leftPadding = padding;\n\tlet rightPadding = padding;\n\tif (contentAlign === 'center') {\n\t\tleftPadding = Math.floor((innerWidth - lineLength) / 2);\n\t} else if (contentAlign === 'right') {\n\t\tleftPadding = innerWidth - lineLength - padding;\n\t}\n\n\trightPadding = innerWidth - leftPadding - lineLength;\n\n\treturn [leftPadding, rightPadding];\n}\n\nconst defaultFormatBorder = (text: string) => text;\n\nexport const box = (message = '', title = '', opts?: BoxOptions) => {\n\tconst output: Writable = opts?.output ?? process.stdout;\n\tconst columns = getColumns(output);\n\tconst borderWidth = 1;\n\tconst borderTotalWidth = borderWidth * 2;\n\tconst titlePadding = opts?.titlePadding ?? 1;\n\tconst contentPadding = opts?.contentPadding ?? 2;\n\tconst width = opts?.width === undefined || opts.width === 'auto' ? 1 : Math.min(1, opts.width);\n\tconst hasGuide = opts?.withGuide ?? settings.withGuide;\n\tconst linePrefix = !hasGuide ? '' : `${S_BAR} `;\n\tconst formatBorder = opts?.formatBorder ?? defaultFormatBorder;\n\tconst symbols = (opts?.rounded ? roundedSymbols : squareSymbols).map(formatBorder);\n\tconst hSymbol = formatBorder(S_BAR_H);\n\tconst vSymbol = formatBorder(S_BAR);\n\tconst linePrefixWidth = stringWidth(linePrefix);\n\tconst titleWidth = stringWidth(title);\n\tconst maxBoxWidth = columns - linePrefixWidth;\n\tlet boxWidth = Math.floor(columns * width) - linePrefixWidth;\n\tif (opts?.width === 'auto') {\n\t\tconst lines = message.split('\\n');\n\t\tlet longestLine = titleWidth + titlePadding * 2;\n\t\tfor (const line of lines) {\n\t\t\tconst lineWithPadding = stringWidth(line) + contentPadding * 2;\n\t\t\tif (lineWithPadding > longestLine) {\n\t\t\t\tlongestLine = lineWithPadding;\n\t\t\t}\n\t\t}\n\t\tconst longestLineWidth = longestLine + borderTotalWidth;\n\t\tif (longestLineWidth < boxWidth) {\n\t\t\tboxWidth = longestLineWidth;\n\t\t}\n\t}\n\tif (boxWidth % 2 !== 0) {\n\t\tif (boxWidth < maxBoxWidth) {\n\t\t\tboxWidth++;\n\t\t} else {\n\t\t\tboxWidth--;\n\t\t}\n\t}\n\tconst innerWidth = boxWidth - borderTotalWidth;\n\tconst maxTitleLength = innerWidth - titlePadding * 2;\n\tconst truncatedTitle =\n\t\ttitleWidth > maxTitleLength ? `${title.slice(0, maxTitleLength - 3)}...` : title;\n\tconst [titlePaddingLeft, titlePaddingRight] = getPaddingForLine(\n\t\tstringWidth(truncatedTitle),\n\t\tinnerWidth,\n\t\ttitlePadding,\n\t\topts?.titleAlign\n\t);\n\tconst wrappedMessage = wrapAnsi(message, innerWidth - contentPadding * 2, {\n\t\thard: true,\n\t\ttrim: false,\n\t});\n\toutput.write(\n\t\t`${linePrefix}${symbols[0]}${hSymbol.repeat(titlePaddingLeft)}${truncatedTitle}${hSymbol.repeat(titlePaddingRight)}${symbols[1]}\\n`\n\t);\n\tconst wrappedLines = wrappedMessage.split('\\n');\n\tfor (const line of wrappedLines) {\n\t\tconst [leftLinePadding, rightLinePadding] = getPaddingForLine(\n\t\t\tstringWidth(line),\n\t\t\tinnerWidth,\n\t\t\tcontentPadding,\n\t\t\topts?.contentAlign\n\t\t);\n\t\toutput.write(\n\t\t\t`${linePrefix}${vSymbol}${' '.repeat(leftLinePadding)}${line}${' '.repeat(rightLinePadding)}${vSymbol}\\n`\n\t\t);\n\t}\n\toutput.write(`${linePrefix}${symbols[2]}${hSymbol.repeat(innerWidth)}${symbols[3]}\\n`);\n};\n","import { ConfirmPrompt, settings } from '@clack/core';\nimport color from 'picocolors';\nimport {\n\ttype CommonOptions,\n\tS_BAR,\n\tS_BAR_END,\n\tS_RADIO_ACTIVE,\n\tS_RADIO_INACTIVE,\n\tsymbol,\n} from './common.js';\n\nexport interface ConfirmOptions extends CommonOptions {\n\tmessage: string;\n\tactive?: string;\n\tinactive?: string;\n\tinitialValue?: boolean;\n\tvertical?: 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\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\toutput: opts.output,\n\t\tinitialValue: opts.initialValue ?? true,\n\t\trender() {\n\t\t\tconst hasGuide = opts.withGuide ?? settings.withGuide;\n\t\t\tconst title = `${hasGuide ? `${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\tconst submitPrefix = hasGuide ? `${color.gray(S_BAR)} ` : '';\n\t\t\t\t\treturn `${title}${submitPrefix}${color.dim(value)}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst cancelPrefix = hasGuide ? `${color.gray(S_BAR)} ` : '';\n\t\t\t\t\treturn `${title}${cancelPrefix}${color.strikethrough(\n\t\t\t\t\t\tcolor.dim(value)\n\t\t\t\t\t)}${hasGuide ? `\\n${color.gray(S_BAR)}` : ''}`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tconst defaultPrefix = hasGuide ? `${color.cyan(S_BAR)} ` : '';\n\t\t\t\t\tconst defaultPrefixEnd = hasGuide ? color.cyan(S_BAR_END) : '';\n\t\t\t\t\treturn `${title}${defaultPrefix}${\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}${opts.vertical ? (hasGuide ? `\\n${color.cyan(S_BAR)} ` : '\\n') : ` ${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${defaultPrefixEnd}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<boolean | symbol>;\n};\n","import { isCancel } from '@clack/core';\n\ntype Prettify<T> = {\n\t[P in keyof T]: T[P];\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\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","import { GroupMultiSelectPrompt } from '@clack/core';\nimport color from 'picocolors';\nimport {\n\ttype CommonOptions,\n\tS_BAR,\n\tS_BAR_END,\n\tS_CHECKBOX_ACTIVE,\n\tS_CHECKBOX_INACTIVE,\n\tS_CHECKBOX_SELECTED,\n\tsymbol,\n} from './common.js';\nimport type { Option } from './select.js';\n\nexport interface GroupMultiSelectOptions<Value> extends CommonOptions {\n\tmessage: string;\n\toptions: Record<string, Option<Value>[]>;\n\tinitialValues?: Value[];\n\trequired?: boolean;\n\tcursorAt?: Value;\n\tselectableGroups?: boolean;\n\tgroupSpacing?: number;\n}\nexport const groupMultiselect = <Value>(opts: GroupMultiSelectOptions<Value>) => {\n\tconst { selectableGroups = true, groupSpacing = 0 } = opts;\n\tconst opt = (\n\t\toption: Option<Value> & { group: string | boolean },\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> & { group: string | boolean })[] = []\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tconst isItem = typeof option.group === 'string';\n\t\tconst next = isItem && (options[options.indexOf(option) + 1] ?? { group: true });\n\t\tconst isLast = isItem && next && next.group === true;\n\t\tconst prefix = isItem ? (selectableGroups ? `${isLast ? S_BAR_END : S_BAR} ` : ' ') : '';\n\t\tlet spacingPrefix = '';\n\t\tif (groupSpacing > 0 && !isItem) {\n\t\t\tconst spacingPrefixText = `\\n${color.cyan(S_BAR)}`;\n\t\t\tspacingPrefix = `${spacingPrefixText.repeat(groupSpacing - 1)}${spacingPrefixText} `;\n\t\t}\n\n\t\tif (state === 'active') {\n\t\t\treturn `${spacingPrefix}${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 `${spacingPrefix}${prefix}${color.cyan(S_CHECKBOX_ACTIVE)} ${color.dim(label)}`;\n\t\t}\n\t\tif (state === 'group-active-selected') {\n\t\t\treturn `${spacingPrefix}${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 `${spacingPrefix}${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 `${spacingPrefix}${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 `${spacingPrefix}${color.dim(prefix)}${unselectedCheckbox} ${color.dim(label)}`;\n\t};\n\tconst required = opts.required ?? true;\n\n\treturn new GroupMultiSelectPrompt({\n\t\toptions: opts.options,\n\t\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\toutput: opts.output,\n\t\tinitialValues: opts.initialValues,\n\t\trequired,\n\t\tcursorAt: opts.cursorAt,\n\t\tselectableGroups,\n\t\tvalidate(selected: Value[] | undefined) {\n\t\t\tif (required && (selected === undefined || 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\t\t\tconst value = this.value ?? [];\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\tconst selectedOptions = this.options\n\t\t\t\t\t\t.filter(({ value: optionValue }) => value.includes(optionValue))\n\t\t\t\t\t\t.map((option) => opt(option, 'submitted'));\n\t\t\t\t\tconst optionsText =\n\t\t\t\t\t\tselectedOptions.length === 0 ? '' : ` ${selectedOptions.join(color.dim(', '))}`;\n\t\t\t\t\treturn `${title}${color.gray(S_BAR)}${optionsText}`;\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: optionValue }) => value.includes(optionValue))\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\tvalue.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\tconst optionsText = 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\tvalue.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\tlet optionText = '';\n\t\t\t\t\t\t\tif (groupActive) {\n\t\t\t\t\t\t\t\toptionText = opt(\n\t\t\t\t\t\t\t\t\toption,\n\t\t\t\t\t\t\t\t\tselected ? 'group-active-selected' : 'group-active',\n\t\t\t\t\t\t\t\t\toptions\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else if (active && selected) {\n\t\t\t\t\t\t\t\toptionText = opt(option, 'active-selected', options);\n\t\t\t\t\t\t\t} else if (selected) {\n\t\t\t\t\t\t\t\toptionText = opt(option, 'selected', options);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\toptionText = opt(option, active ? 'active' : 'inactive', options);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst prefix = i !== 0 && !optionText.startsWith('\\n') ? ' ' : '';\n\t\t\t\t\t\t\treturn `${prefix}${optionText}`;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(`\\n${color.cyan(S_BAR)}`);\n\t\t\t\t\tconst optionsPrefix = optionsText.startsWith('\\n') ? '' : ' ';\n\t\t\t\t\treturn `${title}${color.cyan(S_BAR)}${optionsPrefix}${optionsText}\\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","import { settings } from '@clack/core';\nimport color from 'picocolors';\nimport {\n\ttype CommonOptions,\n\tS_BAR,\n\tS_ERROR,\n\tS_INFO,\n\tS_STEP_SUBMIT,\n\tS_SUCCESS,\n\tS_WARN,\n} from './common.js';\n\nexport interface LogMessageOptions extends CommonOptions {\n\tsymbol?: string;\n\tspacing?: number;\n\tsecondarySymbol?: string;\n}\n\nexport const log = {\n\tmessage: (\n\t\tmessage: string | string[] = [],\n\t\t{\n\t\t\tsymbol = color.gray(S_BAR),\n\t\t\tsecondarySymbol = color.gray(S_BAR),\n\t\t\toutput = process.stdout,\n\t\t\tspacing = 1,\n\t\t\twithGuide,\n\t\t}: LogMessageOptions = {}\n\t) => {\n\t\tconst parts: string[] = [];\n\t\tconst hasGuide = withGuide ?? settings.withGuide;\n\t\tconst spacingString = !hasGuide ? '' : secondarySymbol;\n\t\tconst prefix = !hasGuide ? '' : `${symbol} `;\n\t\tconst secondaryPrefix = !hasGuide ? '' : `${secondarySymbol} `;\n\n\t\tfor (let i = 0; i < spacing; i++) {\n\t\t\tparts.push(spacingString);\n\t\t}\n\n\t\tconst messageParts = Array.isArray(message) ? message : message.split('\\n');\n\t\tif (messageParts.length > 0) {\n\t\t\tconst [firstLine, ...lines] = messageParts;\n\t\t\tif (firstLine.length > 0) {\n\t\t\t\tparts.push(`${prefix}${firstLine}`);\n\t\t\t} else {\n\t\t\t\tparts.push(hasGuide ? symbol : '');\n\t\t\t}\n\t\t\tfor (const ln of lines) {\n\t\t\t\tif (ln.length > 0) {\n\t\t\t\t\tparts.push(`${secondaryPrefix}${ln}`);\n\t\t\t\t} else {\n\t\t\t\t\tparts.push(hasGuide ? secondarySymbol : '');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\toutput.write(`${parts.join('\\n')}\\n`);\n\t},\n\tinfo: (message: string, opts?: LogMessageOptions) => {\n\t\tlog.message(message, { ...opts, symbol: color.blue(S_INFO) });\n\t},\n\tsuccess: (message: string, opts?: LogMessageOptions) => {\n\t\tlog.message(message, { ...opts, symbol: color.green(S_SUCCESS) });\n\t},\n\tstep: (message: string, opts?: LogMessageOptions) => {\n\t\tlog.message(message, { ...opts, symbol: color.green(S_STEP_SUBMIT) });\n\t},\n\twarn: (message: string, opts?: LogMessageOptions) => {\n\t\tlog.message(message, { ...opts, symbol: color.yellow(S_WARN) });\n\t},\n\t/** alias for `log.warn()`. */\n\twarning: (message: string, opts?: LogMessageOptions) => {\n\t\tlog.warn(message, opts);\n\t},\n\terror: (message: string, opts?: LogMessageOptions) => {\n\t\tlog.message(message, { ...opts, symbol: color.red(S_ERROR) });\n\t},\n};\n","import type { Writable } from 'node:stream';\nimport color from 'picocolors';\nimport { type CommonOptions, S_BAR, S_BAR_END, S_BAR_START } from './common.js';\n\nexport const cancel = (message = '', opts?: CommonOptions) => {\n\tconst output: Writable = opts?.output ?? process.stdout;\n\toutput.write(`${color.gray(S_BAR_END)} ${color.red(message)}\\n\\n`);\n};\n\nexport const intro = (title = '', opts?: CommonOptions) => {\n\tconst output: Writable = opts?.output ?? process.stdout;\n\toutput.write(`${color.gray(S_BAR_START)} ${title}\\n`);\n};\n\nexport const outro = (message = '', opts?: CommonOptions) => {\n\tconst output: Writable = opts?.output ?? process.stdout;\n\toutput.write(`${color.gray(S_BAR)}\\n${color.gray(S_BAR_END)} ${message}\\n\\n`);\n};\n","import { MultiSelectPrompt, wrapTextWithPrefix } from '@clack/core';\nimport color from 'picocolors';\nimport {\n\ttype CommonOptions,\n\tS_BAR,\n\tS_BAR_END,\n\tS_CHECKBOX_ACTIVE,\n\tS_CHECKBOX_INACTIVE,\n\tS_CHECKBOX_SELECTED,\n\tsymbol,\n\tsymbolBar,\n} from './common.js';\nimport { limitOptions } from './limit-options.js';\nimport type { Option } from './select.js';\n\nexport interface MultiSelectOptions<Value> extends CommonOptions {\n\tmessage: string;\n\toptions: Option<Value>[];\n\tinitialValues?: Value[];\n\tmaxItems?: number;\n\trequired?: boolean;\n\tcursorAt?: Value;\n}\nconst computeLabel = (label: string, format: (text: string) => string) => {\n\treturn label\n\t\t.split('\\n')\n\t\t.map((line) => format(line))\n\t\t.join('\\n');\n};\n\nexport const multiselect = <Value>(opts: MultiSelectOptions<Value>) => {\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| 'submitted'\n\t\t\t| 'cancelled'\n\t\t\t| 'disabled'\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tif (state === 'disabled') {\n\t\t\treturn `${color.gray(S_CHECKBOX_INACTIVE)} ${computeLabel(label, (str) => color.strikethrough(color.gray(str)))}${\n\t\t\t\toption.hint ? ` ${color.dim(`(${option.hint ?? 'disabled'})`)}` : ''\n\t\t\t}`;\n\t\t}\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)} ${computeLabel(label, color.dim)}${\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 `${computeLabel(label, (text) => color.strikethrough(color.dim(text)))}`;\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 `${computeLabel(label, color.dim)}`;\n\t\t}\n\t\treturn `${color.dim(S_CHECKBOX_INACTIVE)} ${computeLabel(label, color.dim)}`;\n\t};\n\tconst required = opts.required ?? true;\n\n\treturn new MultiSelectPrompt({\n\t\toptions: opts.options,\n\t\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\toutput: opts.output,\n\t\tinitialValues: opts.initialValues,\n\t\trequired,\n\t\tcursorAt: opts.cursorAt,\n\t\tvalidate(selected: Value[] | undefined) {\n\t\t\tif (required && (selected === undefined || 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 wrappedMessage = wrapTextWithPrefix(\n\t\t\t\topts.output,\n\t\t\t\topts.message,\n\t\t\t\t`${symbolBar(this.state)} `,\n\t\t\t\t`${symbol(this.state)} `\n\t\t\t);\n\t\t\tconst title = `${color.gray(S_BAR)}\\n${wrappedMessage}\\n`;\n\t\t\tconst value = this.value ?? [];\n\n\t\t\tconst styleOption = (option: Option<Value>, active: boolean) => {\n\t\t\t\tif (option.disabled) {\n\t\t\t\t\treturn opt(option, 'disabled');\n\t\t\t\t}\n\t\t\t\tconst selected = 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\tconst submitText =\n\t\t\t\t\t\tthis.options\n\t\t\t\t\t\t\t.filter(({ value: optionValue }) => value.includes(optionValue))\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\tconst wrappedSubmitText = wrapTextWithPrefix(\n\t\t\t\t\t\topts.output,\n\t\t\t\t\t\tsubmitText,\n\t\t\t\t\t\t`${color.gray(S_BAR)} `\n\t\t\t\t\t);\n\t\t\t\t\treturn `${title}${wrappedSubmitText}`;\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: optionValue }) => value.includes(optionValue))\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\tif (label.trim() === '') {\n\t\t\t\t\t\treturn `${title}${color.gray(S_BAR)}`;\n\t\t\t\t\t}\n\t\t\t\t\tconst wrappedLabel = wrapTextWithPrefix(opts.output, label, `${color.gray(S_BAR)} `);\n\t\t\t\t\treturn `${title}${wrappedLabel}\\n${color.gray(S_BAR)}`;\n\t\t\t\t}\n\t\t\t\tcase 'error': {\n\t\t\t\t\tconst prefix = `${color.yellow(S_BAR)} `;\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\t// Calculate rowPadding: title lines + footer lines (error message + trailing newline)\n\t\t\t\t\tconst titleLineCount = title.split('\\n').length;\n\t\t\t\t\tconst footerLineCount = footer.split('\\n').length + 1; // footer + trailing newline\n\t\t\t\t\treturn `${title}${prefix}${limitOptions({\n\t\t\t\t\t\toutput: opts.output,\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\tcolumnPadding: prefix.length,\n\t\t\t\t\t\trowPadding: titleLineCount + footerLineCount,\n\t\t\t\t\t\tstyle: styleOption,\n\t\t\t\t\t}).join(`\\n${prefix}`)}\\n${footer}\\n`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tconst prefix = `${color.cyan(S_BAR)} `;\n\t\t\t\t\t// Calculate rowPadding: title lines + footer lines (S_BAR_END + trailing newline)\n\t\t\t\t\tconst titleLineCount = title.split('\\n').length;\n\t\t\t\t\tconst footerLineCount = 2; // S_BAR_END + trailing newline\n\t\t\t\t\treturn `${title}${prefix}${limitOptions({\n\t\t\t\t\t\toutput: opts.output,\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\tcolumnPadding: prefix.length,\n\t\t\t\t\t\trowPadding: titleLineCount + footerLineCount,\n\t\t\t\t\t\tstyle: styleOption,\n\t\t\t\t\t}).join(`\\n${prefix}`)}\\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","import process from 'node:process';\nimport type { Writable } from 'node:stream';\nimport { getColumns, settings } from '@clack/core';\nimport stringWidth from 'fast-string-width';\nimport { type Options as WrapAnsiOptions, wrapAnsi } from 'fast-wrap-ansi';\nimport color from 'picocolors';\nimport {\n\ttype CommonOptions,\n\tS_BAR,\n\tS_BAR_H,\n\tS_CONNECT_LEFT,\n\tS_CORNER_BOTTOM_LEFT,\n\tS_CORNER_BOTTOM_RIGHT,\n\tS_CORNER_TOP_RIGHT,\n\tS_STEP_SUBMIT,\n} from './common.js';\n\ntype FormatFn = (line: string) => string;\nexport interface NoteOptions extends CommonOptions {\n\tformat?: FormatFn;\n}\n\nconst defaultNoteFormatter = (line: string): string => color.dim(line);\n\nconst wrapWithFormat = (message: string, width: number, format: FormatFn): string => {\n\tconst opts: WrapAnsiOptions = {\n\t\thard: true,\n\t\ttrim: false,\n\t};\n\tconst wrapMsg = wrapAnsi(message, width, opts).split('\\n');\n\tconst maxWidthNormal = wrapMsg.reduce((sum, ln) => Math.max(stringWidth(ln), sum), 0);\n\tconst maxWidthFormat = wrapMsg.map(format).reduce((sum, ln) => Math.max(stringWidth(ln), sum), 0);\n\tconst wrapWidth = width - (maxWidthFormat - maxWidthNormal);\n\treturn wrapAnsi(message, wrapWidth, opts);\n};\n\nexport const note = (message = '', title = '', opts?: NoteOptions) => {\n\tconst output: Writable = opts?.output ?? process.stdout;\n\tconst hasGuide = opts?.withGuide ?? settings.withGuide;\n\tconst format = opts?.format ?? defaultNoteFormatter;\n\tconst wrapMsg = wrapWithFormat(message, getColumns(output) - 6, format);\n\tconst lines = ['', ...wrapMsg.split('\\n').map(format), ''];\n\tconst titleLen = stringWidth(title);\n\tconst len =\n\t\tMath.max(\n\t\t\tlines.reduce((sum, ln) => {\n\t\t\t\tconst width = stringWidth(ln);\n\t\t\t\treturn width > sum ? width : 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) => `${color.gray(S_BAR)} ${ln}${' '.repeat(len - stringWidth(ln))}${color.gray(S_BAR)}`\n\t\t)\n\t\t.join('\\n');\n\tconst leadingBorder = hasGuide ? `${color.gray(S_BAR)}\\n` : '';\n\tconst bottomLeft = hasGuide ? S_CONNECT_LEFT : S_CORNER_BOTTOM_LEFT;\n\toutput.write(\n\t\t`${leadingBorder}${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(bottomLeft + S_BAR_H.repeat(len + 2) + S_CORNER_BOTTOM_RIGHT)}\\n`\n\t);\n};\n","import { PasswordPrompt, settings } from '@clack/core';\nimport color from 'picocolors';\nimport { type CommonOptions, S_BAR, S_BAR_END, S_PASSWORD_MASK, symbol } from './common.js';\n\nexport interface PasswordOptions extends CommonOptions {\n\tmessage: string;\n\tmask?: string;\n\tvalidate?: (value: string | undefined) => string | Error | undefined;\n\tclearOnError?: boolean;\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\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\toutput: opts.output,\n\t\trender() {\n\t\t\tconst hasGuide = opts.withGuide ?? settings.withGuide;\n\t\t\tconst title = `${hasGuide ? `${color.gray(S_BAR)}\\n` : ''}${symbol(this.state)} ${opts.message}\\n`;\n\t\t\tconst userInput = this.userInputWithCursor;\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\tconst errorPrefix = hasGuide ? `${color.yellow(S_BAR)} ` : '';\n\t\t\t\t\tconst errorPrefixEnd = hasGuide ? `${color.yellow(S_BAR_END)} ` : '';\n\t\t\t\t\tconst maskedText = masked ?? '';\n\t\t\t\t\tif (opts.clearOnError) {\n\t\t\t\t\t\tthis.clear();\n\t\t\t\t\t}\n\t\t\t\t\treturn `${title.trim()}\\n${errorPrefix}${maskedText}\\n${errorPrefixEnd}${color.yellow(this.error)}\\n`;\n\t\t\t\t}\n\t\t\t\tcase 'submit': {\n\t\t\t\t\tconst submitPrefix = hasGuide ? `${color.gray(S_BAR)} ` : '';\n\t\t\t\t\tconst maskedText = masked ? color.dim(masked) : '';\n\t\t\t\t\treturn `${title}${submitPrefix}${maskedText}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst cancelPrefix = hasGuide ? `${color.gray(S_BAR)} ` : '';\n\t\t\t\t\tconst maskedText = masked ? color.strikethrough(color.dim(masked)) : '';\n\t\t\t\t\treturn `${title}${cancelPrefix}${maskedText}${\n\t\t\t\t\t\tmasked && hasGuide ? `\\n${color.gray(S_BAR)}` : ''\n\t\t\t\t\t}`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tconst defaultPrefix = hasGuide ? `${color.cyan(S_BAR)} ` : '';\n\t\t\t\t\tconst defaultPrefixEnd = hasGuide ? color.cyan(S_BAR_END) : '';\n\t\t\t\t\treturn `${title}${defaultPrefix}${userInput}\\n${defaultPrefixEnd}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<string | symbol>;\n};\n","import { existsSync, lstatSync, readdirSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { autocomplete } from './autocomplete.js';\nimport type { CommonOptions } from './common.js';\n\nexport interface PathOptions extends CommonOptions {\n\troot?: string;\n\tdirectory?: boolean;\n\tinitialValue?: string;\n\tmessage: string;\n\tvalidate?: (value: string | undefined) => string | Error | undefined;\n}\n\nexport const path = (opts: PathOptions) => {\n\tconst validate = opts.validate;\n\n\treturn autocomplete({\n\t\t...opts,\n\t\tinitialUserInput: opts.initialValue ?? opts.root ?? process.cwd(),\n\t\tmaxItems: 5,\n\t\tvalidate(value) {\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\t// Shouldn't ever happen since we don't enable `multiple: true`\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tif (!value) {\n\t\t\t\treturn 'Please select a path';\n\t\t\t}\n\t\t\tif (validate) {\n\t\t\t\treturn validate(value);\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\t\toptions() {\n\t\t\tconst userInput = this.userInput;\n\t\t\tif (userInput === '') {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tlet searchPath: string;\n\n\t\t\t\tif (!existsSync(userInput)) {\n\t\t\t\t\tsearchPath = dirname(userInput);\n\t\t\t\t} else {\n\t\t\t\t\tconst stat = lstatSync(userInput);\n\t\t\t\t\tif (stat.isDirectory()) {\n\t\t\t\t\t\tsearchPath = userInput;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsearchPath = dirname(userInput);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst items = readdirSync(searchPath)\n\t\t\t\t\t.map((item) => {\n\t\t\t\t\t\tconst path = join(searchPath, item);\n\t\t\t\t\t\tconst stats = lstatSync(path);\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tname: item,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tisDirectory: stats.isDirectory(),\n\t\t\t\t\t\t};\n\t\t\t\t\t})\n\t\t\t\t\t.filter(\n\t\t\t\t\t\t({ path, isDirectory }) =>\n\t\t\t\t\t\t\tpath.startsWith(userInput) && (opts.directory || !isDirectory)\n\t\t\t\t\t);\n\t\t\t\treturn items.map((item) => ({\n\t\t\t\t\tvalue: item.path,\n\t\t\t\t}));\n\t\t\t} catch (_e) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t},\n\t});\n};\n","import { block, getColumns, settings } from '@clack/core';\nimport { wrapAnsi } from 'fast-wrap-ansi';\nimport color from 'picocolors';\nimport { cursor, erase } from 'sisteransi';\nimport {\n\ttype CommonOptions,\n\tisCI as isCIFn,\n\tS_BAR,\n\tS_STEP_CANCEL,\n\tS_STEP_ERROR,\n\tS_STEP_SUBMIT,\n\tunicode,\n} from './common.js';\n\nexport interface SpinnerOptions extends CommonOptions {\n\tindicator?: 'dots' | 'timer';\n\tonCancel?: () => void;\n\tcancelMessage?: string;\n\terrorMessage?: string;\n\tframes?: string[];\n\tdelay?: number;\n\tstyleFrame?: (frame: string) => string;\n}\n\nexport interface SpinnerResult {\n\tstart(msg?: string): void;\n\tstop(msg?: string): void;\n\tcancel(msg?: string): void;\n\terror(msg?: string): void;\n\tmessage(msg?: string): void;\n\tclear(): void;\n\treadonly isCancelled: boolean;\n}\n\nconst defaultStyleFn: SpinnerOptions['styleFrame'] = color.magenta;\n\nexport const spinner = ({\n\tindicator = 'dots',\n\tonCancel,\n\toutput = process.stdout,\n\tcancelMessage,\n\terrorMessage,\n\tframes = unicode ? ['◒', '◐', '◓', '◑'] : ['•', 'o', 'O', '0'],\n\tdelay = unicode ? 80 : 120,\n\tsignal,\n\t...opts\n}: SpinnerOptions = {}): SpinnerResult => {\n\tconst isCI = isCIFn();\n\n\tlet unblock: () => void;\n\tlet loop: NodeJS.Timeout;\n\tlet isSpinnerActive = false;\n\tlet isCancelled = false;\n\tlet _message = '';\n\tlet _prevMessage: string | undefined;\n\tlet _origin: number = performance.now();\n\tconst columns = getColumns(output);\n\tconst styleFn = opts?.styleFrame ?? defaultStyleFn;\n\n\tconst handleExit = (code: number) => {\n\t\tconst msg =\n\t\t\tcode > 1\n\t\t\t\t? (errorMessage ?? settings.messages.error)\n\t\t\t\t: (cancelMessage ?? settings.messages.cancel);\n\t\tisCancelled = code === 1;\n\t\tif (isSpinnerActive) {\n\t\t\t_stop(msg, code);\n\t\t\tif (isCancelled && typeof onCancel === 'function') {\n\t\t\t\tonCancel();\n\t\t\t}\n\t\t}\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\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', signalEventHandler);\n\t\t}\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\n\t\tif (signal) {\n\t\t\tsignal.removeEventListener('abort', signalEventHandler);\n\t\t}\n\t};\n\n\tconst clearPrevMessage = () => {\n\t\tif (_prevMessage === undefined) return;\n\t\tif (isCI) output.write('\\n');\n\t\tconst wrapped = wrapAnsi(_prevMessage, columns, {\n\t\t\thard: true,\n\t\t\ttrim: false,\n\t\t});\n\t\tconst prevLines = wrapped.split('\\n');\n\t\tif (prevLines.length > 1) {\n\t\t\toutput.write(cursor.up(prevLines.length - 1));\n\t\t}\n\t\toutput.write(cursor.to(0));\n\t\toutput.write(erase.down());\n\t};\n\n\tconst removeTrailingDots = (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 hasGuide = opts.withGuide ?? settings.withGuide;\n\n\tconst start = (msg = ''): void => {\n\t\tisSpinnerActive = true;\n\t\tunblock = block({ output });\n\t\t_message = removeTrailingDots(msg);\n\t\t_origin = performance.now();\n\t\tif (hasGuide) {\n\t\t\toutput.write(`${color.gray(S_BAR)}\\n`);\n\t\t}\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 = styleFn(frames[frameIndex]);\n\t\t\tlet outputMessage: string;\n\n\t\t\tif (isCI) {\n\t\t\t\toutputMessage = `${frame} ${_message}...`;\n\t\t\t} else if (indicator === 'timer') {\n\t\t\t\toutputMessage = `${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\toutputMessage = `${frame} ${_message}${loadingDots}`;\n\t\t\t}\n\n\t\t\tconst wrapped = wrapAnsi(outputMessage, columns, {\n\t\t\t\thard: true,\n\t\t\t\ttrim: false,\n\t\t\t});\n\t\t\toutput.write(wrapped);\n\n\t\t\tframeIndex = frameIndex + 1 < frames.length ? frameIndex + 1 : 0;\n\t\t\t// indicator increase by 1 every 8 frames\n\t\t\tindicatorTimer = indicatorTimer < 4 ? indicatorTimer + 0.125 : 0;\n\t\t}, delay);\n\t};\n\n\tconst _stop = (msg = '', code = 0, silent: boolean = false): void => {\n\t\tif (!isSpinnerActive) return;\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 = msg ?? _message;\n\t\tif (!silent) {\n\t\t\tif (indicator === 'timer') {\n\t\t\t\toutput.write(`${step} ${_message} ${formatTimer(_origin)}\\n`);\n\t\t\t} else {\n\t\t\t\toutput.write(`${step} ${_message}\\n`);\n\t\t\t}\n\t\t}\n\t\tclearHooks();\n\t\tunblock();\n\t};\n\n\tconst stop = (msg = ''): void => _stop(msg, 0);\n\tconst cancel = (msg = ''): void => _stop(msg, 1);\n\tconst error = (msg = ''): void => _stop(msg, 2);\n\t// TODO (43081j): this will leave the initial S_BAR since we purposely\n\t// don't erase that in `clearPrevMessage`. In future, we may want to treat\n\t// `clear` as a special case and remove the bar too.\n\tconst clear = (): void => _stop('', 0, true);\n\n\tconst message = (msg = ''): void => {\n\t\t_message = removeTrailingDots(msg ?? _message);\n\t};\n\n\treturn {\n\t\tstart,\n\t\tstop,\n\t\tmessage,\n\t\tcancel,\n\t\terror,\n\t\tclear,\n\t\tget isCancelled() {\n\t\t\treturn isCancelled;\n\t\t},\n\t};\n};\n","import type { State } from '@clack/core';\nimport color from 'picocolors';\nimport { unicodeOr } from './common.js';\nimport { type SpinnerOptions, type SpinnerResult, spinner } from './spinner.js';\n\nconst S_PROGRESS_CHAR: Record<NonNullable<ProgressOptions['style']>, string> = {\n\tlight: unicodeOr('─', '-'),\n\theavy: unicodeOr('━', '='),\n\tblock: unicodeOr('█', '#'),\n};\n\nexport interface ProgressOptions extends SpinnerOptions {\n\tstyle?: 'light' | 'heavy' | 'block';\n\tmax?: number;\n\tsize?: number;\n}\n\nexport interface ProgressResult extends SpinnerResult {\n\tadvance(step?: number, msg?: string): void;\n}\n\nexport function progress({\n\tstyle = 'heavy',\n\tmax: userMax = 100,\n\tsize: userSize = 40,\n\t...spinnerOptions\n}: ProgressOptions = {}): ProgressResult {\n\tconst spin = spinner(spinnerOptions);\n\tlet value = 0;\n\tlet previousMessage = '';\n\n\tconst max = Math.max(1, userMax);\n\tconst size = Math.max(1, userSize);\n\n\tconst activeStyle = (state: State) => {\n\t\tswitch (state) {\n\t\t\tcase 'initial':\n\t\t\tcase 'active':\n\t\t\t\treturn color.magenta;\n\t\t\tcase 'error':\n\t\t\tcase 'cancel':\n\t\t\t\treturn color.red;\n\t\t\tcase 'submit':\n\t\t\t\treturn color.green;\n\t\t\tdefault:\n\t\t\t\treturn color.magenta;\n\t\t}\n\t};\n\tconst drawProgress = (state: State, msg: string) => {\n\t\tconst active = Math.floor((value / max) * size);\n\t\treturn `${activeStyle(state)(S_PROGRESS_CHAR[style].repeat(active))}${color.dim(S_PROGRESS_CHAR[style].repeat(size - active))} ${msg}`;\n\t};\n\n\tconst start = (msg = '') => {\n\t\tpreviousMessage = msg;\n\t\tspin.start(drawProgress('initial', msg));\n\t};\n\tconst advance = (step = 1, msg?: string): void => {\n\t\tvalue = Math.min(max, step + value);\n\t\tspin.message(drawProgress('active', msg ?? previousMessage));\n\t\tpreviousMessage = msg ?? previousMessage;\n\t};\n\treturn {\n\t\tstart,\n\t\tstop: spin.stop,\n\t\tcancel: spin.cancel,\n\t\terror: spin.error,\n\t\tclear: spin.clear,\n\t\tadvance,\n\t\tisCancelled: spin.isCancelled,\n\t\tmessage: (msg: string) => advance(0, msg),\n\t};\n}\n","import { SelectPrompt, settings, wrapTextWithPrefix } from '@clack/core';\nimport color from 'picocolors';\nimport {\n\ttype CommonOptions,\n\tS_BAR,\n\tS_BAR_END,\n\tS_RADIO_ACTIVE,\n\tS_RADIO_INACTIVE,\n\tsymbol,\n\tsymbolBar,\n} from './common.js';\nimport { limitOptions } from './limit-options.js';\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\t/**\n\t\t\t * Whether this option is disabled.\n\t\t\t * Disabled options are visible but cannot be selected.\n\t\t\t *\n\t\t\t * By default, options are not disabled.\n\t\t\t */\n\t\t\tdisabled?: boolean;\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\t/**\n\t\t\t * Whether this option is disabled.\n\t\t\t * Disabled options are visible but cannot be selected.\n\t\t\t *\n\t\t\t * By default, options are not disabled.\n\t\t\t */\n\t\t\tdisabled?: boolean;\n\t\t};\n\nexport interface SelectOptions<Value> extends CommonOptions {\n\tmessage: string;\n\toptions: Option<Value>[];\n\tinitialValue?: Value;\n\tmaxItems?: number;\n}\n\nconst computeLabel = (label: string, format: (text: string) => string) => {\n\tif (!label.includes('\\n')) {\n\t\treturn format(label);\n\t}\n\treturn label\n\t\t.split('\\n')\n\t\t.map((line) => format(line))\n\t\t.join('\\n');\n};\n\nexport const select = <Value>(opts: SelectOptions<Value>) => {\n\tconst opt = (\n\t\toption: Option<Value>,\n\t\tstate: 'inactive' | 'active' | 'selected' | 'cancelled' | 'disabled'\n\t) => {\n\t\tconst label = option.label ?? String(option.value);\n\t\tswitch (state) {\n\t\t\tcase 'disabled':\n\t\t\t\treturn `${color.gray(S_RADIO_INACTIVE)} ${computeLabel(label, color.gray)}${\n\t\t\t\t\toption.hint ? ` ${color.dim(`(${option.hint ?? 'disabled'})`)}` : ''\n\t\t\t\t}`;\n\t\t\tcase 'selected':\n\t\t\t\treturn `${computeLabel(label, color.dim)}`;\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 `${computeLabel(label, (str) => color.strikethrough(color.dim(str)))}`;\n\t\t\tdefault:\n\t\t\t\treturn `${color.dim(S_RADIO_INACTIVE)} ${computeLabel(label, color.dim)}`;\n\t\t}\n\t};\n\n\treturn new SelectPrompt({\n\t\toptions: opts.options,\n\t\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\toutput: opts.output,\n\t\tinitialValue: opts.initialValue,\n\t\trender() {\n\t\t\tconst hasGuide = opts.withGuide ?? settings.withGuide;\n\t\t\tconst titlePrefix = `${symbol(this.state)} `;\n\t\t\tconst titlePrefixBar = `${symbolBar(this.state)} `;\n\t\t\tconst messageLines = wrapTextWithPrefix(\n\t\t\t\topts.output,\n\t\t\t\topts.message,\n\t\t\t\ttitlePrefixBar,\n\t\t\t\ttitlePrefix\n\t\t\t);\n\t\t\tconst title = `${hasGuide ? `${color.gray(S_BAR)}\\n` : ''}${messageLines}\\n`;\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\tconst submitPrefix = hasGuide ? `${color.gray(S_BAR)} ` : '';\n\t\t\t\t\tconst wrappedLines = wrapTextWithPrefix(\n\t\t\t\t\t\topts.output,\n\t\t\t\t\t\topt(this.options[this.cursor], 'selected'),\n\t\t\t\t\t\tsubmitPrefix\n\t\t\t\t\t);\n\t\t\t\t\treturn `${title}${wrappedLines}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst cancelPrefix = hasGuide ? `${color.gray(S_BAR)} ` : '';\n\t\t\t\t\tconst wrappedLines = wrapTextWithPrefix(\n\t\t\t\t\t\topts.output,\n\t\t\t\t\t\topt(this.options[this.cursor], 'cancelled'),\n\t\t\t\t\t\tcancelPrefix\n\t\t\t\t\t);\n\t\t\t\t\treturn `${title}${wrappedLines}${hasGuide ? `\\n${color.gray(S_BAR)}` : ''}`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tconst prefix = hasGuide ? `${color.cyan(S_BAR)} ` : '';\n\t\t\t\t\tconst prefixEnd = hasGuide ? color.cyan(S_BAR_END) : '';\n\t\t\t\t\t// Calculate rowPadding: title lines + footer lines (S_BAR_END + trailing newline)\n\t\t\t\t\tconst titleLineCount = title.split('\\n').length;\n\t\t\t\t\tconst footerLineCount = hasGuide ? 2 : 1; // S_BAR_END + trailing newline (or just trailing newline)\n\t\t\t\t\treturn `${title}${prefix}${limitOptions({\n\t\t\t\t\t\toutput: opts.output,\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\tcolumnPadding: prefix.length,\n\t\t\t\t\t\trowPadding: titleLineCount + footerLineCount,\n\t\t\t\t\t\tstyle: (item, active) =>\n\t\t\t\t\t\t\topt(item, item.disabled ? 'disabled' : active ? 'active' : 'inactive'),\n\t\t\t\t\t}).join(`\\n${prefix}`)}\\n${prefixEnd}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value | symbol>;\n};\n","import { SelectKeyPrompt, settings, wrapTextWithPrefix } from '@clack/core';\nimport color from 'picocolors';\nimport { type CommonOptions, S_BAR, S_BAR_END, symbol } from './common.js';\nimport type { Option } from './select.js';\n\nexport interface SelectKeyOptions<Value extends string> extends CommonOptions {\n\tmessage: string;\n\toptions: Option<Value>[];\n\tinitialValue?: Value;\n\tcaseSensitive?: boolean;\n}\n\nexport const selectKey = <Value extends string>(opts: SelectKeyOptions<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\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\toutput: opts.output,\n\t\tinitialValue: opts.initialValue,\n\t\tcaseSensitive: opts.caseSensitive,\n\t\trender() {\n\t\t\tconst hasGuide = opts.withGuide ?? settings.withGuide;\n\t\t\tconst title = `${hasGuide ? `${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\tconst submitPrefix = hasGuide ? `${color.gray(S_BAR)} ` : '';\n\t\t\t\t\tconst selectedOption =\n\t\t\t\t\t\tthis.options.find((opt) => opt.value === this.value) ?? opts.options[0];\n\t\t\t\t\tconst wrapped = wrapTextWithPrefix(\n\t\t\t\t\t\topts.output,\n\t\t\t\t\t\topt(selectedOption, 'selected'),\n\t\t\t\t\t\tsubmitPrefix\n\t\t\t\t\t);\n\t\t\t\t\treturn `${title}${wrapped}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst cancelPrefix = hasGuide ? `${color.gray(S_BAR)} ` : '';\n\t\t\t\t\tconst wrapped = wrapTextWithPrefix(\n\t\t\t\t\t\topts.output,\n\t\t\t\t\t\topt(this.options[0], 'cancelled'),\n\t\t\t\t\t\tcancelPrefix\n\t\t\t\t\t);\n\t\t\t\t\treturn `${title}${wrapped}${hasGuide ? `\\n${color.gray(S_BAR)}` : ''}`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tconst defaultPrefix = hasGuide ? `${color.cyan(S_BAR)} ` : '';\n\t\t\t\t\tconst defaultPrefixEnd = hasGuide ? color.cyan(S_BAR_END) : '';\n\t\t\t\t\tconst wrapped = this.options\n\t\t\t\t\t\t.map((option, i) =>\n\t\t\t\t\t\t\twrapTextWithPrefix(\n\t\t\t\t\t\t\t\topts.output,\n\t\t\t\t\t\t\t\topt(option, i === this.cursor ? 'active' : 'inactive'),\n\t\t\t\t\t\t\t\tdefaultPrefix\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join('\\n');\n\t\t\t\t\treturn `${title}${wrapped}\\n${defaultPrefixEnd}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<Value | symbol>;\n};\n","import { stripVTControlCharacters as strip } from 'node:util';\nimport color from 'picocolors';\nimport { S_BAR, S_ERROR, S_INFO, S_STEP_SUBMIT, S_SUCCESS, S_WARN } from './common.js';\nimport type { LogMessageOptions } from './log.js';\n\nconst prefix = `${color.gray(S_BAR)} `;\n\n// TODO (43081j): this currently doesn't support custom `output` writables\n// because we rely on `columns` existing (i.e. `process.stdout.columns).\n//\n// If we want to support `output` being passed in, we will need to use\n// a condition like `if (output insance Writable)` to check if it has columns\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","import type { CommonOptions } from './common.js';\nimport { spinner } from './spinner.js';\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[], opts?: CommonOptions) => {\n\tfor (const task of tasks) {\n\t\tif (task.enabled === false) continue;\n\n\t\tconst s = spinner(opts);\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 type { Writable } from 'node:stream';\nimport { getColumns } from '@clack/core';\nimport color from 'picocolors';\nimport { erase } from 'sisteransi';\nimport {\n\ttype CommonOptions,\n\tisCI as isCIFn,\n\tisTTY as isTTYFn,\n\tS_BAR,\n\tS_STEP_SUBMIT,\n} from './common.js';\nimport { log } from './log.js';\n\nexport interface TaskLogOptions extends CommonOptions {\n\ttitle: string;\n\tlimit?: number;\n\tspacing?: number;\n\tretainLog?: boolean;\n}\n\nexport interface TaskLogMessageOptions {\n\traw?: boolean;\n}\n\nexport interface TaskLogCompletionOptions {\n\tshowLog?: boolean;\n}\n\ninterface BufferEntry {\n\theader?: string;\n\tvalue: string;\n\tfull: string;\n\tresult?: {\n\t\tstatus: 'success' | 'error';\n\t\tmessage: string;\n\t};\n}\n\nconst stripDestructiveANSI = (input: string): string => {\n\t// biome-ignore lint/suspicious/noControlCharactersInRegex: intentional\n\treturn input.replace(/\\x1b\\[(?:\\d+;)*\\d*[ABCDEFGHfJKSTsu]|\\x1b\\[(s|u)/g, '');\n};\n\n/**\n * Renders a log which clears on success and remains on failure\n */\nexport const taskLog = (opts: TaskLogOptions) => {\n\tconst output: Writable = opts.output ?? process.stdout;\n\tconst columns = getColumns(output);\n\tconst secondarySymbol = color.gray(S_BAR);\n\tconst spacing = opts.spacing ?? 1;\n\tconst barSize = 3;\n\tconst retainLog = opts.retainLog === true;\n\tconst isTTY = !isCIFn() && isTTYFn(output);\n\n\toutput.write(`${secondarySymbol}\\n`);\n\toutput.write(`${color.green(S_STEP_SUBMIT)} ${opts.title}\\n`);\n\tfor (let i = 0; i < spacing; i++) {\n\t\toutput.write(`${secondarySymbol}\\n`);\n\t}\n\n\tconst buffers: BufferEntry[] = [\n\t\t{\n\t\t\tvalue: '',\n\t\t\tfull: '',\n\t\t},\n\t];\n\tlet lastMessageWasRaw = false;\n\n\tconst clear = (clearTitle: boolean): void => {\n\t\tif (buffers.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet lines = 0;\n\n\t\tif (clearTitle) {\n\t\t\tlines += spacing + 2;\n\t\t}\n\n\t\tfor (const buffer of buffers) {\n\t\t\tconst { value, result } = buffer;\n\t\t\tlet text = result?.message ?? value;\n\n\t\t\tif (text.length === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (result === undefined && buffer.header !== undefined && buffer.header !== '') {\n\t\t\t\ttext += `\\n${buffer.header}`;\n\t\t\t}\n\n\t\t\tconst bufferHeight = text.split('\\n').reduce((count, line) => {\n\t\t\t\tif (line === '') {\n\t\t\t\t\treturn count + 1;\n\t\t\t\t}\n\t\t\t\treturn count + Math.ceil((line.length + barSize) / columns);\n\t\t\t}, 0);\n\n\t\t\tlines += bufferHeight;\n\t\t}\n\n\t\tif (lines > 0) {\n\t\t\tlines += 1;\n\t\t\toutput.write(erase.lines(lines));\n\t\t}\n\t};\n\tconst printBuffer = (buffer: BufferEntry, messageSpacing?: number, full?: boolean): void => {\n\t\tconst messages = full ? `${buffer.full}\\n${buffer.value}` : buffer.value;\n\t\tif (buffer.header !== undefined && buffer.header !== '') {\n\t\t\tlog.message(buffer.header.split('\\n').map(color.bold), {\n\t\t\t\toutput,\n\t\t\t\tsecondarySymbol,\n\t\t\t\tsymbol: secondarySymbol,\n\t\t\t\tspacing: 0,\n\t\t\t});\n\t\t}\n\t\tlog.message(messages.split('\\n').map(color.dim), {\n\t\t\toutput,\n\t\t\tsecondarySymbol,\n\t\t\tsymbol: secondarySymbol,\n\t\t\tspacing: messageSpacing ?? spacing,\n\t\t});\n\t};\n\tconst renderBuffer = (): void => {\n\t\tfor (const buffer of buffers) {\n\t\t\tconst { header, value, full } = buffer;\n\t\t\tif ((header === undefined || header.length === 0) && value.length === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprintBuffer(buffer, undefined, retainLog === true && full.length > 0);\n\t\t}\n\t};\n\tconst message = (buffer: BufferEntry, msg: string, mopts?: TaskLogMessageOptions) => {\n\t\tclear(false);\n\t\tif ((mopts?.raw !== true || !lastMessageWasRaw) && buffer.value !== '') {\n\t\t\tbuffer.value += '\\n';\n\t\t}\n\t\tbuffer.value += stripDestructiveANSI(msg);\n\t\tlastMessageWasRaw = mopts?.raw === true;\n\t\tif (opts.limit !== undefined) {\n\t\t\tconst lines = buffer.value.split('\\n');\n\t\t\tconst linesToRemove = lines.length - opts.limit;\n\t\t\tif (linesToRemove > 0) {\n\t\t\t\tconst removedLines = lines.splice(0, linesToRemove);\n\t\t\t\tif (retainLog) {\n\t\t\t\t\tbuffer.full += (buffer.full === '' ? '' : '\\n') + removedLines.join('\\n');\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuffer.value = lines.join('\\n');\n\t\t}\n\t\tif (isTTY) {\n\t\t\tprintBuffers();\n\t\t}\n\t};\n\tconst printBuffers = (): void => {\n\t\tfor (const buffer of buffers) {\n\t\t\tif (buffer.result) {\n\t\t\t\tif (buffer.result.status === 'error') {\n\t\t\t\t\tlog.error(buffer.result.message, { output, secondarySymbol, spacing: 0 });\n\t\t\t\t} else {\n\t\t\t\t\tlog.success(buffer.result.message, { output, secondarySymbol, spacing: 0 });\n\t\t\t\t}\n\t\t\t} else if (buffer.value !== '') {\n\t\t\t\tprintBuffer(buffer, 0);\n\t\t\t}\n\t\t}\n\t};\n\tconst completeBuffer = (buffer: BufferEntry, result: BufferEntry['result']): void => {\n\t\tclear(false);\n\n\t\tbuffer.result = result;\n\n\t\tif (isTTY) {\n\t\t\tprintBuffers();\n\t\t}\n\t};\n\n\treturn {\n\t\tmessage(msg: string, mopts?: TaskLogMessageOptions) {\n\t\t\tmessage(buffers[0], msg, mopts);\n\t\t},\n\t\tgroup(name: string) {\n\t\t\tconst buffer: BufferEntry = {\n\t\t\t\theader: name,\n\t\t\t\tvalue: '',\n\t\t\t\tfull: '',\n\t\t\t};\n\t\t\tbuffers.push(buffer);\n\t\t\treturn {\n\t\t\t\tmessage(msg: string, mopts?: TaskLogMessageOptions) {\n\t\t\t\t\tmessage(buffer, msg, mopts);\n\t\t\t\t},\n\t\t\t\terror(message: string) {\n\t\t\t\t\tcompleteBuffer(buffer, {\n\t\t\t\t\t\tstatus: 'error',\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tsuccess(message: string) {\n\t\t\t\t\tcompleteBuffer(buffer, {\n\t\t\t\t\t\tstatus: 'success',\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t\terror(message: string, opts?: TaskLogCompletionOptions): void {\n\t\t\tclear(true);\n\t\t\tlog.error(message, { output, secondarySymbol, spacing: 1 });\n\t\t\tif (opts?.showLog !== false) {\n\t\t\t\trenderBuffer();\n\t\t\t}\n\t\t\t// clear buffer since error is an end state\n\t\t\tbuffers.splice(1, buffers.length - 1);\n\t\t\tbuffers[0].value = '';\n\t\t\tbuffers[0].full = '';\n\t\t},\n\t\tsuccess(message: string, opts?: TaskLogCompletionOptions): void {\n\t\t\tclear(true);\n\t\t\tlog.success(message, { output, secondarySymbol, spacing: 1 });\n\t\t\tif (opts?.showLog === true) {\n\t\t\t\trenderBuffer();\n\t\t\t}\n\t\t\t// clear buffer since success is an end state\n\t\t\tbuffers.splice(1, buffers.length - 1);\n\t\t\tbuffers[0].value = '';\n\t\t\tbuffers[0].full = '';\n\t\t},\n\t};\n};\n","import { settings, TextPrompt } from '@clack/core';\nimport color from 'picocolors';\nimport { type CommonOptions, S_BAR, S_BAR_END, symbol } from './common.js';\n\nexport interface TextOptions extends CommonOptions {\n\tmessage: string;\n\tplaceholder?: string;\n\tdefaultValue?: string;\n\tinitialValue?: string;\n\tvalidate?: (value: string | undefined) => string | Error | undefined;\n}\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\toutput: opts.output,\n\t\tsignal: opts.signal,\n\t\tinput: opts.input,\n\t\trender() {\n\t\t\tconst hasGuide = opts?.withGuide ?? settings.withGuide;\n\t\t\tconst titlePrefix = `${hasGuide ? `${color.gray(S_BAR)}\\n` : ''}${symbol(this.state)} `;\n\t\t\tconst title = `${titlePrefix}${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 userInput = !this.userInput ? placeholder : this.userInputWithCursor;\n\t\t\tconst value = this.value ?? '';\n\n\t\t\tswitch (this.state) {\n\t\t\t\tcase 'error': {\n\t\t\t\t\tconst errorText = this.error ? ` ${color.yellow(this.error)}` : '';\n\t\t\t\t\tconst errorPrefix = hasGuide ? `${color.yellow(S_BAR)} ` : '';\n\t\t\t\t\tconst errorPrefixEnd = hasGuide ? color.yellow(S_BAR_END) : '';\n\t\t\t\t\treturn `${title.trim()}\\n${errorPrefix}${userInput}\\n${errorPrefixEnd}${errorText}\\n`;\n\t\t\t\t}\n\t\t\t\tcase 'submit': {\n\t\t\t\t\tconst valueText = value ? ` ${color.dim(value)}` : '';\n\t\t\t\t\tconst submitPrefix = hasGuide ? color.gray(S_BAR) : '';\n\t\t\t\t\treturn `${title}${submitPrefix}${valueText}`;\n\t\t\t\t}\n\t\t\t\tcase 'cancel': {\n\t\t\t\t\tconst valueText = value ? ` ${color.strikethrough(color.dim(value))}` : '';\n\t\t\t\t\tconst cancelPrefix = hasGuide ? color.gray(S_BAR) : '';\n\t\t\t\t\treturn `${title}${cancelPrefix}${valueText}${value.trim() ? `\\n${cancelPrefix}` : ''}`;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tconst defaultPrefix = hasGuide ? `${color.cyan(S_BAR)} ` : '';\n\t\t\t\t\tconst defaultPrefixEnd = hasGuide ? color.cyan(S_BAR_END) : '';\n\t\t\t\t\treturn `${title}${defaultPrefix}${userInput}\\n${defaultPrefixEnd}\\n`;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t}).prompt() as Promise<string | symbol>;\n};\n","export interface Meta {\n name: string;\n slug: string;\n agent: string;\n description?: string;\n created_at?: string;\n}\n\nexport interface ToolDefinition {\n /** Path to the agent's global config dir, relative to os.homedir() */\n globalConfigDir: string;\n description: string;\n /** Optional: env var that can also redirect this agent (for reference/compat) */\n envVar?: string;\n}\n\nexport interface Config {\n tools: Record<string, ToolDefinition>;\n}\n\nexport interface CliConfig {\n contentDir?: string; // Path to content directory (relative to configDir or absolute)\n}\n\nexport interface SharedDirectory {\n /** Name of the shared directory (e.g., 'agents') */\n name: string;\n /** Path relative to os.homedir() (e.g., '.agents') */\n globalPath: string;\n /** Name in content dir with underscore prefix (e.g., '_agents') */\n contentDirName: string;\n description: string;\n}\n\nexport const SHARED_DIRECTORIES: Record<string, SharedDirectory> = {\n agents: {\n name: 'agents',\n globalPath: '.agents',\n contentDirName: '_agents',\n description: 'Cross-agent shared resources (skills, etc.)',\n },\n};\n\nexport const BASE_PROFILE_SLUG = '_base';\nexport const SHARED_PROFILE_SLUG = '_shared';\nexport const RESERVED_PROFILE_SLUGS = [BASE_PROFILE_SLUG, SHARED_PROFILE_SLUG] as const;\n\nexport const SUPPORTED_TOOLS: Record<string, ToolDefinition> = {\n claude: {\n globalConfigDir: '.claude',\n description: 'Claude Code',\n envVar: 'CLAUDE_CONFIG_DIR',\n },\n amp: {\n globalConfigDir: '.config/amp',\n description: 'Amp',\n envVar: 'AMP_CONFIG_DIR',\n },\n opencode: {\n globalConfigDir: '.config/opencode',\n description: 'OpenCode',\n envVar: 'OPENCODE_CONFIG_DIR',\n },\n codex: {\n globalConfigDir: '.codex',\n description: 'Codex',\n envVar: 'CODEX_CONFIG_DIR',\n },\n gemini: {\n globalConfigDir: '.gemini',\n description: 'Gemini',\n envVar: 'GEMINI_CONFIG_DIR',\n },\n augment: {\n globalConfigDir: '.augment',\n description: 'Augment',\n envVar: 'AUGMENT_CONFIG_DIR',\n },\n};\n","import { RESERVED_PROFILE_SLUGS } from '../types/index.js';\n\nconst SLUG_REGEX = /^[a-z0-9][a-z0-9._-]*$/;\nconst RESERVED_SLUGS = new Set<string>(RESERVED_PROFILE_SLUGS);\n\nexport function slugify(name: string): string {\n return name\n .trim()\n .toLowerCase()\n .replace(/\\s+/g, '-')\n .replace(/[^a-z0-9._-]/g, '')\n .replace(/-+/g, '-')\n .replace(/^-+|-+$/g, '');\n}\n\nexport function validateProfileName(name: string): string | null {\n const trimmed = name.trim();\n if (trimmed.length === 0) return 'Profile name is required.';\n if (trimmed !== name) return 'Profile name must not include surrounding whitespace.';\n const slug = slugify(name);\n if (slug.length === 0) return 'Profile name must contain at least one letter or number.';\n if (slug.includes('..')) return 'Profile name must not include \"..\".';\n return null;\n}\n\nexport function validateNewProfileName(name: string): string | null {\n const validationError = validateProfileName(name);\n if (validationError) return validationError;\n\n const slug = slugify(name);\n if (RESERVED_SLUGS.has(slug)) {\n return `Profile name '${slug}' is reserved and cannot be used.`;\n }\n\n return null;\n}\n\nexport function validateSlug(slug: string): string | null {\n if (slug.length === 0) return 'Slug is required.';\n if (!SLUG_REGEX.test(slug)) {\n return 'Slug must be lowercase letters, numbers, \".\", \"-\", \"_\".';\n }\n if (slug.includes('..')) return 'Slug must not include \"..\".';\n return null;\n}\n","/**\n * .profileinclude — allow-list format for include-based agents.\n *\n * Format:\n * - Newline-separated paths\n * - Lines starting with `#` (optionally preceded by whitespace) are comments\n * - Trailing `/` denotes a directory entry\n * - Blank lines are ignored\n *\n * Strategy:\n * Agents that have a .profileinclude use the \"inverted per-file symlink\" strategy:\n * the global config dir is left as a real directory, and only allow-listed paths\n * inside it are symlinked to the active profile.\n *\n * Agents without a .profileinclude use the \"directory\" strategy:\n * the entire global config dir is a symlink to the active profile dir (legacy behavior).\n *\n * TODO: getDefaultProfileInclude() currently only consults inline defaults.\n * Once content-dir override support is added, it must check\n * contentDir/{agent}/.profileinclude first, and fall back to defaults second.\n * Until then, user edits to the content-dir copy are not read at runtime.\n */\n\nexport interface ProfileInclude {\n /** Directory names to include (without trailing slash) */\n dirs: string[];\n /** File names/paths to include */\n files: string[];\n}\n\n/**\n * Parse a .profileinclude file's content.\n * - Ignores blank lines\n * - Strips lines where the first non-whitespace character is `#`\n * - Trailing `/` = directory entry; otherwise file entry\n * - Normalizes entries: trims whitespace, skips empty results\n */\nexport function parseProfileInclude(content: string): ProfileInclude {\n const dirs: string[] = [];\n const files: string[] = [];\n\n for (const rawLine of content.split('\\n')) {\n const line = rawLine.trim();\n\n // Skip blank lines and comment lines (# must be first non-whitespace char)\n if (!line || line.startsWith('#')) continue;\n\n if (line.endsWith('/')) {\n const entry = line.slice(0, -1).trim();\n if (entry) dirs.push(entry);\n } else {\n if (line) files.push(line);\n }\n }\n\n return { dirs, files };\n}\n\n/**\n * Generate a deny-all / allow-list .gitignore from a ProfileInclude.\n *\n * The .gitignore lives at the agent content dir level. Profile dirs are one\n * level deeper, so all per-profile patterns use a star-slash prefix.\n * Directory entries get both a dir pattern and a double-star glob so that\n * directory contents are tracked recursively.\n */\nexport function generateGitignore(include: ProfileInclude): string {\n const lines: string[] = [\n '# Generated by agentprofiles from .profileinclude',\n '# Deny-all, then allow only tracked config files',\n '',\n '# Ignore everything at this level, allow profile dirs',\n '*',\n '!*/',\n '',\n '# Ignore everything inside profile dirs',\n '*/*',\n '',\n '# Allow tracked config entries (matches .profileinclude)',\n ];\n\n for (const file of include.files) {\n lines.push(`!*/${file}`);\n }\n\n for (const dir of include.dirs) {\n lines.push(`!*/${dir}/`);\n lines.push(`!*/${dir}/**`);\n }\n\n // Always allow agentprofiles management files\n lines.push('');\n lines.push('# Allow agentprofiles management files');\n lines.push('!*/meta.json');\n lines.push('!.profileinclude');\n lines.push('!.gitignore');\n\n return lines.join('\\n') + '\\n';\n}\n\n// ---------------------------------------------------------------------------\n// Inline default .profileinclude content per agent\n//\n// These are the CLI-shipped defaults. setup copies them to\n// contentDir/{agent}/.profileinclude where the user can edit them.\n//\n// Keys must match keys in SUPPORTED_TOOLS.\n// ---------------------------------------------------------------------------\n\nconst CLAUDE_PROFILEINCLUDE = `# claude .profileinclude\n# Tracked config files for Claude Code profiles.\n# Trailing / = directory. Lines starting with # are comments.\nagents/\nskills/\ncommands/\nhooks/\nCLAUDE.md\nsettings.json\nsettings.local.json\n`;\n\nconst CODEX_PROFILEINCLUDE = `# codex .profileinclude\n# Tracked config files for Codex profiles.\n# Trailing / = directory. Lines starting with # are comments.\nprompts/\nskills/\nAGENTS.md\n`;\n\n/**\n * Map of agent name → default .profileinclude content.\n * Only agents listed here use the \"include\" strategy.\n * Agents absent from this map use the \"directory\" strategy.\n */\nexport const DEFAULT_PROFILE_INCLUDES: Record<string, string> = {\n claude: CLAUDE_PROFILEINCLUDE,\n codex: CODEX_PROFILEINCLUDE,\n};\n\n/**\n * Get the default .profileinclude content for an agent.\n * Returns null if the agent uses the whole-directory strategy.\n */\nexport function getDefaultProfileInclude(agent: string): string | null {\n return DEFAULT_PROFILE_INCLUDES[agent] ?? null;\n}\n\n/**\n * Resolve the ProfileInclude for an agent from its default.\n * Returns null if the agent uses the whole-directory strategy.\n */\nexport function resolveProfileInclude(agent: string): ProfileInclude | null {\n const content = getDefaultProfileInclude(agent);\n if (!content) return null;\n return parseProfileInclude(content);\n}\n\n/**\n * Get the agent's symlink strategy.\n * - 'include': inverted per-file symlinks into a real global dir (claude, codex)\n * - 'directory': whole-directory symlink to the profile dir (amp, opencode, augment, etc.)\n */\nexport function getAgentStrategy(agent: string): 'include' | 'directory' {\n return getDefaultProfileInclude(agent) !== null ? 'include' : 'directory';\n}\n","import { generateGitignore, resolveProfileInclude } from './profileinclude.js';\n\n// ---------------------------------------------------------------------------\n// Gitignore templates for whole-directory (non-include) agents\n// ---------------------------------------------------------------------------\n\nconst OPENCODE_GITIGNORE = `# Generated by agentprofiles\n# Regeneratable from package.json\n*/node_modules/\n`;\n\nconst AMP_GITIGNORE = `# Generated by agentprofiles\n# Keep: settings.json, AGENTS.md, themes/\n# Ignore: oauth tokens, caches, logs, temporary files\n\n# Authentication and sensitive data\noauth/\n\n# Caches and logs\ncache/\nlogs/\n\n# Temporary files\ntmp/\n\n# System files\n.DS_Store\n`;\n\nconst GEMINI_GITIGNORE = `# Generated by agentprofiles\n# Runtime/session state per profile\n*/antigravity\n*/antigravity-browser-profile\n*/history\n*/installation_id\n*/projects.json\n*/settings.json.orig\n*/state.json\n*/tmp\n*/trustedFolders.json\n*/user_id\n`;\n\nconst AUGMENT_GITIGNORE = `# Generated by agentprofiles\n# Keep: settings.json, agents/, commands/\n# Ignore: session tokens, caches, binaries, internal state, logs\n\n# Session and authentication\n.auggie.json\nsession.json\nsessions/\n\n# Caches and temporary files\ncheckpoint-documents/\ntask-storage/\ntmp/\n\n# Binaries and internal state\nbinaries/\nelectron-node/\nauggie-path\n\n# Logs and debugging\nmcp-debug.log\nmcp-server/\nobservability/\n\n# System files\n.DS_Store\n`;\n\n/**\n * Get the .gitignore content for an agent's content directory.\n *\n * For include-based agents (claude, codex): generates a deny-all / allow-list\n * gitignore derived from the agent's .profileinclude defaults.\n *\n * For directory-based agents: returns the static template.\n */\nexport function getAgentGitignore(agent: string): string {\n // Include-based agents: generate from .profileinclude\n const include = resolveProfileInclude(agent);\n if (include) {\n return generateGitignore(include);\n }\n\n // Directory-based agents: static templates\n switch (agent) {\n case 'opencode':\n return OPENCODE_GITIGNORE;\n case 'amp':\n return AMP_GITIGNORE;\n case 'gemini':\n return GEMINI_GITIGNORE;\n case 'augment':\n return AUGMENT_GITIGNORE;\n default:\n return '';\n }\n}\n","import fs from 'node:fs/promises';\nimport path from 'node:path';\n\n/**\n * Read the target of a symlink.\n * Returns null if the path is not a symlink.\n */\nexport async function readSymlinkTarget(linkPath: string): Promise<string | null> {\n try {\n const stat = await fs.lstat(linkPath);\n if (!stat.isSymbolicLink()) {\n return null;\n }\n return await fs.readlink(linkPath);\n } catch {\n return null;\n }\n}\n\n/**\n * Check if a path is a symlink.\n */\nexport async function isSymlink(linkPath: string): Promise<boolean> {\n try {\n const stat = await fs.lstat(linkPath);\n return stat.isSymbolicLink();\n } catch {\n return false;\n }\n}\n\n/**\n * Create a symlink atomically using the temp + rename pattern.\n * This ensures atomic replacement of an existing symlink.\n *\n * Pattern:\n * 1. Create temp symlink in parent dir\n * 2. Rename temp over target (atomic on POSIX)\n */\nexport async function atomicSymlink(target: string, linkPath: string): Promise<void> {\n const parentDir = path.dirname(linkPath);\n const linkName = path.basename(linkPath);\n const tempLinkName = `.${linkName}-tmp-${Date.now()}`;\n const tempLinkPath = path.join(parentDir, tempLinkName);\n\n try {\n // Create temp symlink\n await fs.symlink(target, tempLinkPath);\n\n // Atomically rename over target\n await fs.rename(tempLinkPath, linkPath);\n } catch (err) {\n // Clean up temp symlink if rename failed\n try {\n await fs.unlink(tempLinkPath);\n } catch {\n // Ignore cleanup errors\n }\n throw err;\n }\n}\n\n/**\n * Move a directory from src to dst.\n * Tries rename() first (fast, same filesystem).\n * Falls back to recursive copy + delete for cross-device moves.\n */\nexport async function moveDirectory(src: string, dst: string): Promise<void> {\n try {\n // Try fast rename first\n await fs.rename(src, dst);\n } catch (err) {\n // Check if it's a cross-device error\n if (err instanceof Error && 'code' in err && err.code === 'EXDEV') {\n // Fall back to copy + delete\n await copyDirectory(src, dst);\n await fs.rm(src, { recursive: true, force: true });\n } else {\n throw err;\n }\n }\n}\n\n/**\n * Recursively copy a directory, preserving symlinks as-is.\n */\nexport async function copyDirectory(src: string, dst: string): Promise<void> {\n await fs.mkdir(dst, { recursive: true });\n\n const entries = await fs.readdir(src, { withFileTypes: true });\n\n for (const entry of entries) {\n const srcPath = path.join(src, entry.name);\n const dstPath = path.join(dst, entry.name);\n\n if (entry.isDirectory()) {\n await copyDirectory(srcPath, dstPath);\n } else if (entry.isSymbolicLink()) {\n // Preserve symlinks as-is\n const target = await fs.readlink(srcPath);\n await fs.symlink(target, dstPath);\n } else {\n await fs.copyFile(srcPath, dstPath);\n }\n }\n}\n","import fs from 'node:fs/promises';\nimport type { Dirent } from 'node:fs';\nimport path from 'node:path';\nimport os from 'node:os';\nimport {\n CliConfig,\n Meta,\n SUPPORTED_TOOLS,\n SHARED_DIRECTORIES,\n BASE_PROFILE_SLUG,\n SHARED_PROFILE_SLUG,\n} from '../types/index.js';\nimport { validateNewProfileName, slugify, validateSlug } from './validation.js';\nimport { getAgentGitignore } from './gitignore.js';\nimport {\n getAgentStrategy as _getAgentStrategy,\n getDefaultProfileInclude,\n resolveProfileInclude,\n type ProfileInclude,\n} from './profileinclude.js';\nimport {\n readSymlinkTarget,\n isSymlink,\n atomicSymlink,\n moveDirectory,\n copyDirectory,\n} from './symlink.js';\n\n// Resolution order for contentDir:\n// 1. AGENTPROFILES_CONTENT_DIR environment variable\n// 2. config.json contentDir setting\n// 3. Default: same as configDir\n\nexport type SymlinkStatus = 'active' | 'unmanaged' | 'missing' | 'broken' | 'external';\n\nexport interface BrokenSymlink {\n linkPath: string;\n target: string;\n}\n\nasync function pathExists(targetPath: string): Promise<boolean> {\n try {\n await fs.access(targetPath);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isSubpath(parent: string, child: string): boolean {\n const relative = path.relative(parent, child);\n return relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));\n}\n\nasync function copyPathDereferenced(sourcePath: string, destinationPath: string): Promise<void> {\n const linkStat = await fs.lstat(sourcePath);\n if (linkStat.isSymbolicLink()) {\n const linkTarget = await fs.readlink(sourcePath);\n const resolvedTarget = path.isAbsolute(linkTarget)\n ? linkTarget\n : path.resolve(path.dirname(sourcePath), linkTarget);\n await copyPathDereferenced(resolvedTarget, destinationPath);\n return;\n }\n\n if (linkStat.isDirectory()) {\n await fs.mkdir(destinationPath, { recursive: true });\n const entries = await fs.readdir(sourcePath, { withFileTypes: true });\n for (const entry of entries) {\n const childSource = path.join(sourcePath, entry.name);\n const childDestination = path.join(destinationPath, entry.name);\n await copyPathDereferenced(childSource, childDestination);\n }\n return;\n }\n\n await fs.mkdir(path.dirname(destinationPath), { recursive: true });\n await fs.copyFile(sourcePath, destinationPath);\n}\n\nasync function movePath(sourcePath: string, destinationPath: string): Promise<void> {\n try {\n await fs.rename(sourcePath, destinationPath);\n } catch (error) {\n if (error instanceof Error && 'code' in error && error.code === 'EXDEV') {\n const stat = await fs.lstat(sourcePath);\n if (stat.isDirectory()) {\n await copyDirectory(sourcePath, destinationPath);\n } else {\n await copyPathDereferenced(sourcePath, destinationPath);\n }\n await fs.rm(sourcePath, { recursive: true, force: true });\n return;\n }\n throw error;\n }\n}\n\nfunction getDefaultConfigDir(): string {\n // AGENTPROFILES_CONFIG_DIR overrides everything\n if (process.env.AGENTPROFILES_CONFIG_DIR) {\n return process.env.AGENTPROFILES_CONFIG_DIR;\n }\n return path.join(os.homedir(), '.config', 'agentprofiles');\n}\n\nexport class ConfigManager {\n private configDir: string;\n private contentDir: string;\n private tools: typeof SUPPORTED_TOOLS;\n private cliConfig: CliConfig | null = null;\n\n constructor() {\n this.configDir = getDefaultConfigDir();\n this.tools = SUPPORTED_TOOLS;\n // contentDir will be resolved lazily or after loading config\n this.contentDir = this.resolveContentDir();\n }\n\n private resolveContentDir(): string {\n // 1. Environment variable takes precedence\n if (process.env.AGENTPROFILES_CONTENT_DIR) {\n return process.env.AGENTPROFILES_CONTENT_DIR;\n }\n // 2. Config file setting (if loaded)\n if (this.cliConfig?.contentDir) {\n const configuredDir = this.cliConfig.contentDir;\n // If relative path, resolve relative to configDir\n if (!path.isAbsolute(configuredDir)) {\n return path.join(this.configDir, configuredDir);\n }\n return configuredDir;\n }\n // 3. Default: same as configDir\n return this.configDir;\n }\n\n private async loadCliConfig(): Promise<CliConfig> {\n const configPath = path.join(this.configDir, 'config.json');\n try {\n const content = await fs.readFile(configPath, 'utf-8');\n return JSON.parse(content) as CliConfig;\n } catch {\n return {};\n }\n }\n\n async init(): Promise<void> {\n this.cliConfig = await this.loadCliConfig();\n this.contentDir = this.resolveContentDir();\n }\n\n private async saveConfig(): Promise<void> {\n const configPath = path.join(this.configDir, 'config.json');\n await fs.writeFile(configPath, JSON.stringify(this.cliConfig || {}, null, 2));\n }\n\n getConfigDir(): string {\n return this.configDir;\n }\n\n getContentDir(): string {\n return this.contentDir;\n }\n\n async setContentDir(contentDir: string): Promise<void> {\n if (!this.cliConfig) {\n this.cliConfig = {};\n }\n this.cliConfig.contentDir = contentDir;\n this.contentDir = contentDir;\n await this.saveConfig();\n }\n\n async ensureConfigDir(): Promise<void> {\n // Create base config directory\n await fs.mkdir(this.configDir, { recursive: true });\n\n // Create config.json if not exists\n const configPath = path.join(this.configDir, 'config.json');\n try {\n await fs.access(configPath);\n // If config already exists, load it so contentDir reflects config.json.\n this.cliConfig = await this.loadCliConfig();\n } catch {\n const defaultConfig: CliConfig = {};\n await fs.writeFile(configPath, JSON.stringify(defaultConfig, null, 2));\n this.cliConfig = defaultConfig;\n }\n\n // Re-resolve content dir after loading/creating config.json.\n this.contentDir = this.resolveContentDir();\n\n // Create content directory (may be same as configDir)\n await fs.mkdir(this.contentDir, { recursive: true });\n\n // Create tool directories inside content dir\n for (const tool of Object.keys(this.tools)) {\n const toolDir = path.join(this.contentDir, tool);\n await fs.mkdir(toolDir, { recursive: true });\n await this.ensureAgentGitignore(toolDir, tool);\n }\n }\n\n private async ensureAgentGitignore(agentDir: string, agent: string) {\n const gitignorePath = path.join(agentDir, '.gitignore');\n try {\n await fs.access(gitignorePath);\n return;\n } catch {\n // continue\n }\n const content = getAgentGitignore(agent);\n if (!content) return;\n await fs.writeFile(gitignorePath, content);\n }\n\n async getProfiles(agent: string): Promise<Meta[]> {\n const agentDir = path.join(this.contentDir, agent);\n try {\n const entries = await fs.readdir(agentDir, { withFileTypes: true });\n const profiles: Meta[] = [];\n\n for (const entry of entries) {\n if (!entry.isDirectory()) continue;\n const dirName = entry.name;\n if (dirName === SHARED_PROFILE_SLUG) continue;\n if (validateSlug(dirName) !== null) continue;\n\n const metaPath = path.join(agentDir, dirName, 'meta.json');\n let meta: Partial<Meta> = {};\n try {\n const content = await fs.readFile(metaPath, 'utf-8');\n meta = JSON.parse(content);\n } catch {\n // No meta.json or invalid JSON - use defaults\n }\n\n profiles.push({\n name: meta.name || dirName,\n slug: dirName,\n agent,\n description: meta.description,\n created_at: meta.created_at,\n });\n }\n return profiles;\n } catch {\n return [];\n }\n }\n\n async createProfile(agent: string, name: string, description?: string): Promise<string> {\n if (!this.tools[agent]) {\n throw new Error(`Unsupported agent: ${agent}`);\n }\n const validationError = validateNewProfileName(name);\n if (validationError) {\n throw new Error(validationError);\n }\n\n const slug = slugify(name);\n const profileDir = path.join(this.contentDir, agent, slug);\n\n try {\n await fs.access(profileDir);\n throw new Error(`Profile '${slug}' already exists for agent '${agent}'`);\n } catch (err) {\n if (err instanceof Error && 'code' in err && err.code !== 'ENOENT') {\n throw err;\n }\n if (err instanceof Error && !('code' in err)) {\n throw err;\n }\n }\n\n await fs.mkdir(profileDir, { recursive: true });\n\n const meta: Meta = {\n name,\n slug,\n agent,\n description,\n created_at: new Date().toISOString(),\n };\n\n await fs.writeFile(path.join(profileDir, 'meta.json'), JSON.stringify(meta, null, 2));\n\n return profileDir;\n }\n\n private async ensureReservedProfile(\n agent: string,\n slug: string,\n description: string\n ): Promise<string> {\n const profileDir = path.join(this.contentDir, agent, slug);\n await fs.mkdir(profileDir, { recursive: true });\n\n const metaPath = path.join(profileDir, 'meta.json');\n if (!(await pathExists(metaPath))) {\n const meta: Meta = {\n name: slug,\n slug,\n agent,\n description,\n created_at: new Date().toISOString(),\n };\n await fs.writeFile(metaPath, JSON.stringify(meta, null, 2));\n }\n\n return profileDir;\n }\n\n async ensureBaseProfile(agent: string): Promise<string> {\n if (!this.tools[agent]) {\n throw new Error(`Unsupported agent: ${agent}`);\n }\n return this.ensureReservedProfile(agent, BASE_PROFILE_SLUG, 'Base profile (created by setup)');\n }\n\n async ensureBaseProfileLayout(agent: string): Promise<void> {\n await this.ensureBaseProfile(agent);\n if (this.getAgentStrategy(agent) === 'include') {\n await this.ensureIncludeAgentFiles(agent);\n await this.ensureIncludeProfileLayout(agent, BASE_PROFILE_SLUG);\n }\n // Directory-strategy agents don't need additional layout scaffolding\n }\n\n // ============================================================================\n // Include-strategy methods (inverted per-file symlinks for messy agents)\n // ============================================================================\n\n /**\n * Write .profileinclude and .gitignore to the agent content directory if missing.\n * Never overwrites user-edited copies.\n */\n private async ensureIncludeAgentFiles(agent: string): Promise<void> {\n const agentDir = path.join(this.contentDir, agent);\n await fs.mkdir(agentDir, { recursive: true });\n\n const includeContent = this.getDefaultProfileIncludeContent(agent);\n if (includeContent) {\n const includePath = path.join(agentDir, '.profileinclude');\n if (!(await pathExists(includePath))) {\n await fs.writeFile(includePath, includeContent);\n }\n }\n\n // .gitignore: reuse the existing per-agent helper (already idempotent)\n await this.ensureAgentGitignore(agentDir, agent);\n }\n\n /**\n * Ensure all allow-listed dir entries exist in a profile directory.\n * - Dir entries: create empty dir + .gitkeep if missing\n * - File entries: skip (user/agent creates them)\n * - Creates parent directories for nested entries\n */\n async ensureIncludeProfileLayout(agent: string, profileSlug: string): Promise<void> {\n const include = this.getProfileInclude(agent);\n if (!include) return;\n\n const profileDir = path.join(this.contentDir, agent, profileSlug);\n if (!(await pathExists(profileDir))) return;\n\n for (const dir of include.dirs) {\n const dirPath = path.join(profileDir, dir);\n await fs.mkdir(dirPath, { recursive: true });\n const gitkeepPath = path.join(dirPath, '.gitkeep');\n if (!(await pathExists(gitkeepPath))) {\n const entries = await fs.readdir(dirPath);\n if (entries.length === 0) {\n await fs.writeFile(gitkeepPath, '');\n }\n }\n }\n // File entries: no action — created by user or agent\n }\n\n /**\n * Adopt an existing real directory for an include-based agent.\n * Leaves the global dir in place. Moves allow-listed real entries to _base\n * and creates per-entry symlinks pointing from globalPath back to _base.\n */\n private async adoptExistingInclude(\n agent: string,\n profileName: string,\n options: { replaceExisting?: boolean } = {}\n ): Promise<void> {\n const globalPath = this.getGlobalConfigPath(agent);\n\n // Ensure global dir is a real directory\n let globalStat: Awaited<ReturnType<typeof fs.lstat>> | null = null;\n try {\n globalStat = await fs.lstat(globalPath);\n } catch {\n // Doesn't exist — create it\n await fs.mkdir(globalPath, { recursive: true });\n globalStat = await fs.lstat(globalPath);\n }\n if (globalStat.isSymbolicLink()) {\n throw new Error(\n `Cannot adopt include-based agent '${agent}': global path is a symlink. Run 'release' first.`\n );\n }\n\n const profileDir = path.join(this.contentDir, agent, profileName);\n\n // Handle existing profile\n let profileDirExists = false;\n try {\n await fs.access(profileDir);\n profileDirExists = true;\n if (options.replaceExisting) {\n await fs.rm(profileDir, { recursive: true, force: true });\n profileDirExists = false;\n }\n } catch (err) {\n if (err instanceof Error && 'code' in err && err.code === 'ENOENT') {\n // Good — profile doesn't exist yet\n } else {\n throw err;\n }\n }\n\n if (!profileDirExists) {\n await fs.mkdir(profileDir, { recursive: true });\n }\n\n const include = this.getProfileInclude(agent);\n if (!include) {\n throw new Error(`Agent '${agent}' has no .profileinclude — cannot use include strategy`);\n }\n\n // Process allow-listed entries\n const backupBase = `${globalPath}.bak-${Date.now()}`;\n let backupCreated = false;\n\n for (const entry of [...include.files, ...include.dirs]) {\n const isDir = include.dirs.includes(entry);\n const globalEntryPath = path.join(globalPath, entry);\n const profileEntryPath = path.join(profileDir, entry);\n\n // Ensure parent dir exists in profile\n await fs.mkdir(path.dirname(profileEntryPath), { recursive: true });\n\n let entryStat: Awaited<ReturnType<typeof fs.lstat>> | null = null;\n try {\n entryStat = await fs.lstat(globalEntryPath);\n } catch {\n // Entry doesn't exist in global dir\n }\n\n if (entryStat?.isSymbolicLink()) {\n // Existing symlink — skip, don't double-link\n continue;\n }\n\n if (entryStat) {\n // Real file or dir exists in global dir\n const profileEntryExists = await pathExists(profileEntryPath);\n if (profileDirExists && profileEntryExists) {\n // Profile already has this entry — back up the global copy instead of overwriting\n if (!backupCreated) {\n await fs.mkdir(backupBase, { recursive: true });\n backupCreated = true;\n }\n const backupEntryPath = path.join(backupBase, entry);\n await fs.mkdir(path.dirname(backupEntryPath), { recursive: true });\n await movePath(globalEntryPath, backupEntryPath);\n } else {\n // Profile doesn't have this entry — move global copy into profile\n await movePath(globalEntryPath, profileEntryPath);\n }\n } else if (!profileDirExists || !(await pathExists(profileEntryPath))) {\n if (isDir) {\n // Dir entry that doesn't exist yet in either place: scaffold with .gitkeep\n await fs.mkdir(profileEntryPath, { recursive: true });\n await fs.writeFile(path.join(profileEntryPath, '.gitkeep'), '');\n } else {\n // File entry missing from both global and profile: skip (no dangling symlink)\n continue;\n }\n }\n // If profileDirExists && profileEntryExists && !entryStat: profile already has it, nothing to move\n\n // Only create symlink if target now exists in the profile\n if (!(await pathExists(profileEntryPath))) continue;\n\n // Create symlink: globalPath/{entry} -> relative path to profile/{entry}\n await fs.mkdir(path.dirname(globalEntryPath), { recursive: true });\n const relTarget = path.relative(path.dirname(globalEntryPath), profileEntryPath);\n await fs.symlink(relTarget, globalEntryPath);\n }\n\n // Write meta.json if not already present\n const metaPath = path.join(profileDir, 'meta.json');\n if (!(await pathExists(metaPath))) {\n const meta: Meta = {\n name: profileName,\n slug: profileName,\n agent,\n description: 'Base profile (adopted from original config)',\n created_at: new Date().toISOString(),\n };\n await fs.writeFile(metaPath, JSON.stringify(meta, null, 2));\n }\n\n // Write .profileinclude and .gitignore to agent content dir if missing\n await this.ensureIncludeAgentFiles(agent);\n }\n\n /**\n * Get the active profile slug for an include-based agent.\n * Reads the target of the first managed per-entry symlink inside globalPath.\n * Returns null if not managed or no symlinks found.\n */\n async getActiveProfileInclude(agent: string): Promise<string | null> {\n const include = this.getProfileInclude(agent);\n if (!include) return null;\n\n const globalPath = this.getGlobalConfigPath(agent);\n const contentDirAbs = path.resolve(this.contentDir);\n const allEntries = [...include.files, ...include.dirs];\n\n for (const entry of allEntries) {\n const entryPath = path.join(globalPath, entry);\n let entryStat: Awaited<ReturnType<typeof fs.lstat>> | null = null;\n try {\n entryStat = await fs.lstat(entryPath);\n } catch {\n continue;\n }\n if (!entryStat?.isSymbolicLink()) continue;\n\n const target = await fs.readlink(entryPath);\n const absTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(entryPath), target);\n\n if (!isSubpath(contentDirAbs, absTarget)) continue;\n\n // Target is contentDir/{agent}/{slug}/{entry...}\n // Walk up entry depth to find the slug directory\n const entryDepth = entry.split(path.sep).length;\n let slugPath = absTarget;\n for (let i = 0; i < entryDepth; i++) {\n slugPath = path.dirname(slugPath);\n }\n return path.basename(slugPath);\n }\n\n return null;\n }\n\n /**\n * Get the symlink status for an include-based agent.\n * The global dir is a real directory; management is detected via _base + per-entry symlinks.\n */\n async getIncludeSymlinkStatus(agent: string): Promise<SymlinkStatus> {\n const globalPath = this.getGlobalConfigPath(agent);\n\n let globalStat: Awaited<ReturnType<typeof fs.lstat>> | null = null;\n try {\n globalStat = await fs.lstat(globalPath);\n } catch {\n return 'missing';\n }\n\n // If it's a symlink (leftover from old directory-strategy setup)\n if (globalStat.isSymbolicLink()) {\n const target = await readSymlinkTarget(globalPath);\n if (!target) return 'broken';\n try {\n await fs.access(globalPath);\n } catch {\n return 'broken';\n }\n const absTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(globalPath), target);\n const contentDirAbs = path.resolve(this.contentDir);\n return absTarget.startsWith(contentDirAbs + path.sep) ? 'active' : 'external';\n }\n\n // Real directory — check if _base exists (indicates management)\n const basePath = path.join(this.contentDir, agent, BASE_PROFILE_SLUG);\n if (!(await pathExists(basePath))) {\n return 'unmanaged';\n }\n\n // Require at least one per-entry symlink pointing into contentDir\n const include = this.getProfileInclude(agent);\n const contentDirAbs = path.resolve(this.contentDir);\n let managedSymlinkCount = 0;\n\n if (include) {\n for (const entry of [...include.files, ...include.dirs]) {\n const entryPath = path.join(globalPath, entry);\n let entryStat: Awaited<ReturnType<typeof fs.lstat>> | null = null;\n try {\n entryStat = await fs.lstat(entryPath);\n } catch {\n continue; // Missing entry\n }\n if (!entryStat.isSymbolicLink()) continue;\n\n // Check if this symlink points into our contentDir\n const target = await fs.readlink(entryPath);\n const absTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(entryPath), target);\n if (!absTarget.startsWith(contentDirAbs + path.sep)) continue;\n\n // It's a managed symlink — check if it's broken\n try {\n await fs.access(entryPath); // follows symlink\n } catch {\n return 'broken';\n }\n managedSymlinkCount++;\n }\n }\n\n if (managedSymlinkCount === 0) {\n return 'unmanaged';\n }\n\n return 'active';\n }\n\n /**\n * Switch the active profile for an include-based agent.\n * Repoints managed per-entry symlinks inside globalPath to the target profile.\n * Leaves real files/dirs and non-managed symlinks untouched.\n */\n async switchProfileInclude(agent: string, profileSlug: string): Promise<void> {\n const include = this.getProfileInclude(agent);\n if (!include) {\n throw new Error(`Agent '${agent}' has no .profileinclude`);\n }\n\n const globalPath = this.getGlobalConfigPath(agent);\n const profileDir = path.join(this.contentDir, agent, profileSlug);\n\n if (!(await pathExists(profileDir))) {\n throw new Error(`Profile '${profileSlug}' does not exist for agent '${agent}'`);\n }\n\n // Scaffold any missing entries in the target profile\n await this.ensureIncludeProfileLayout(agent, profileSlug);\n\n const contentDirAbs = path.resolve(this.contentDir);\n\n for (const entry of [...include.files, ...include.dirs]) {\n const globalEntryPath = path.join(globalPath, entry);\n const profileEntryPath = path.join(profileDir, entry);\n\n // Only create symlink if target exists in the profile\n if (!(await pathExists(profileEntryPath))) continue;\n\n let existingStat: Awaited<ReturnType<typeof fs.lstat>> | null = null;\n try {\n existingStat = await fs.lstat(globalEntryPath);\n } catch {\n // Entry missing — will create symlink below\n }\n\n if (existingStat) {\n if (existingStat.isSymbolicLink()) {\n const target = await fs.readlink(globalEntryPath);\n const absTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(globalEntryPath), target);\n if (!isSubpath(contentDirAbs, absTarget)) {\n continue; // External symlink — leave it\n }\n await fs.unlink(globalEntryPath); // Remove old managed symlink\n } else {\n continue; // Real file/dir — don't clobber\n }\n }\n\n // Create symlink: globalPath/{entry} -> relative path to profile/{entry}\n await fs.mkdir(path.dirname(globalEntryPath), { recursive: true });\n const relTarget = path.relative(path.dirname(globalEntryPath), profileEntryPath);\n await fs.symlink(relTarget, globalEntryPath);\n }\n }\n\n /**\n * Release an include-based agent from management.\n * For each managed per-entry symlink inside globalPath: removes the symlink\n * and copies the real content from the active profile back into globalPath.\n * Does NOT delete the profile directory.\n */\n async unlinkProfileInclude(agent: string): Promise<void> {\n const include = this.getProfileInclude(agent);\n if (!include) {\n throw new Error(`Agent '${agent}' has no .profileinclude`);\n }\n\n const globalPath = this.getGlobalConfigPath(agent);\n const contentDirAbs = path.resolve(this.contentDir);\n\n // Determine the active profile before removing any symlinks\n const activeProfile = await this.getActiveProfileInclude(agent);\n\n for (const entry of [...include.files, ...include.dirs]) {\n const globalEntryPath = path.join(globalPath, entry);\n\n let entryStat: Awaited<ReturnType<typeof fs.lstat>> | null = null;\n try {\n entryStat = await fs.lstat(globalEntryPath);\n } catch {\n continue;\n }\n\n if (!entryStat.isSymbolicLink()) continue; // Real file — leave it\n\n const target = await fs.readlink(globalEntryPath);\n const absTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(globalEntryPath), target);\n\n if (!isSubpath(contentDirAbs, absTarget)) continue; // External symlink — leave it\n\n // Remove the managed symlink\n await fs.unlink(globalEntryPath);\n\n // Copy content from profile back into globalPath\n if (await pathExists(absTarget)) {\n await fs.mkdir(path.dirname(globalEntryPath), { recursive: true });\n const targetStat = await fs.lstat(absTarget);\n if (targetStat.isDirectory()) {\n await copyDirectory(absTarget, globalEntryPath);\n } else {\n await fs.copyFile(absTarget, globalEntryPath);\n }\n }\n }\n\n // Remove the active profile directory so status returns to 'unmanaged'.\n // This mirrors the directory-strategy unlinkProfile behavior and is safe\n // here because unlinkProfile is only called from the release command.\n if (activeProfile) {\n const profileDir = path.join(this.contentDir, agent, activeProfile);\n await fs.rm(profileDir, { recursive: true, force: true });\n }\n }\n\n async findBrokenSymlinks(rootPath: string): Promise<BrokenSymlink[]> {\n const broken: BrokenSymlink[] = [];\n\n const walk = async (currentPath: string): Promise<void> => {\n let entries: Dirent[];\n try {\n entries = await fs.readdir(currentPath, { withFileTypes: true });\n } catch {\n return;\n }\n\n for (const entry of entries) {\n const absolutePath = path.join(currentPath, entry.name);\n\n if (entry.isSymbolicLink()) {\n const target = await readSymlinkTarget(absolutePath);\n if (!target) {\n broken.push({ linkPath: absolutePath, target: '(unreadable target)' });\n continue;\n }\n\n try {\n // Access through the symlink path to detect broken links.\n await fs.access(absolutePath);\n } catch {\n broken.push({ linkPath: absolutePath, target });\n }\n continue;\n }\n\n if (entry.isDirectory()) {\n await walk(absolutePath);\n }\n }\n };\n\n await walk(rootPath);\n return broken;\n }\n\n // ============================================================================\n // Symlink-based profile management\n // ============================================================================\n\n /**\n * Get the symlink strategy for an agent.\n * - 'include': inverted per-file symlinks (messy agents: claude, codex)\n * - 'directory': whole-directory symlink (clean agents: amp, opencode, etc.)\n *\n * TODO: check contentDir/{agent}/.profileinclude first (content-dir override).\n */\n getAgentStrategy(agent: string): 'include' | 'directory' {\n return _getAgentStrategy(agent);\n }\n\n /**\n * Resolve the ProfileInclude for an include-based agent.\n * Returns null for directory-based agents.\n *\n * TODO: read from contentDir/{agent}/.profileinclude when content-dir override\n * is implemented.\n */\n getProfileInclude(agent: string): ProfileInclude | null {\n return resolveProfileInclude(agent);\n }\n\n /**\n * Get the default .profileinclude content string for an agent (for writing to disk).\n * Returns null for directory-based agents.\n */\n getDefaultProfileIncludeContent(agent: string): string | null {\n return getDefaultProfileInclude(agent);\n }\n\n /**\n * Get the absolute path to an agent's global config directory.\n * Resolves relative paths from os.homedir().\n */\n getGlobalConfigPath(agent: string): string {\n const tool = this.tools[agent];\n if (!tool) {\n throw new Error(`Unsupported agent: ${agent}`);\n }\n return path.join(os.homedir(), tool.globalConfigDir);\n }\n\n /**\n * Check the state of an agent's global config directory.\n * Returns one of: 'active', 'unmanaged', 'missing', 'broken', 'external'\n */\n async getSymlinkStatus(agent: string): Promise<SymlinkStatus> {\n if (this.getAgentStrategy(agent) === 'include') {\n return this.getIncludeSymlinkStatus(agent);\n }\n\n const globalPath = this.getGlobalConfigPath(agent);\n\n // Use lstat to check the path itself (doesn't follow symlinks)\n let stat;\n try {\n stat = await fs.lstat(globalPath);\n } catch {\n return 'missing';\n }\n\n // Not a symlink = real directory\n if (!stat.isSymbolicLink()) {\n return 'unmanaged';\n }\n\n // It's a symlink — check if target exists\n const target = await readSymlinkTarget(globalPath);\n if (!target) {\n return 'broken';\n }\n\n // Check if target actually exists (follow the symlink)\n try {\n await fs.access(globalPath);\n } catch {\n return 'broken';\n }\n\n // Resolve target to absolute path\n const absoluteTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(globalPath), target);\n\n // Check if target is in our content dir\n const contentDirAbs = path.resolve(this.contentDir);\n if (!absoluteTarget.startsWith(contentDirAbs + path.sep)) {\n return 'external';\n }\n\n return 'active';\n }\n\n /**\n * Get the active profile slug for an agent.\n * Returns null if the agent is not managed by us.\n */\n async getActiveProfile(agent: string): Promise<string | null> {\n if (this.getAgentStrategy(agent) === 'include') {\n return this.getActiveProfileInclude(agent);\n }\n\n const status = await this.getSymlinkStatus(agent);\n if (status !== 'active') {\n return null;\n }\n\n const globalPath = this.getGlobalConfigPath(agent);\n const target = await readSymlinkTarget(globalPath);\n if (!target) {\n return null;\n }\n\n // Extract profile slug from target path\n // Target is like: /path/to/contentDir/agent/slug\n const absoluteTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(globalPath), target);\n\n const slug = path.basename(absoluteTarget);\n return slug;\n }\n\n /**\n * Adopt an existing real directory as a managed profile.\n * Moves the directory to contentDir/<agent>/_base and creates a symlink back.\n * Throws if _base already exists.\n * If symlink creation fails after move, rolls back by moving the directory back.\n */\n async adoptExisting(\n agent: string,\n profileName: string = BASE_PROFILE_SLUG,\n options: { replaceExisting?: boolean } = {}\n ): Promise<void> {\n if (this.getAgentStrategy(agent) === 'include') {\n return this.adoptExistingInclude(agent, profileName, options);\n }\n\n const globalPath = this.getGlobalConfigPath(agent);\n const status = await this.getSymlinkStatus(agent);\n\n if (status !== 'unmanaged') {\n throw new Error(\n `Cannot adopt: agent '${agent}' status is '${status}' (expected 'unmanaged')`\n );\n }\n\n const profileDir = path.join(this.contentDir, agent, profileName);\n\n // Check if profile already exists\n let profileDirExists = false;\n try {\n await fs.access(profileDir);\n profileDirExists = true;\n if (options.replaceExisting) {\n await fs.rm(profileDir, { recursive: true, force: true });\n profileDirExists = false;\n }\n } catch (err) {\n if (err instanceof Error && 'code' in err && err.code === 'ENOENT') {\n // Good, profile doesn't exist\n } else {\n throw err;\n }\n }\n\n if (!profileDirExists) {\n // Move the real directory to profile location\n await moveDirectory(globalPath, profileDir);\n\n // Create meta.json for the adopted profile\n const meta: Meta = {\n name: profileName,\n slug: profileName,\n agent,\n description: 'Base profile (adopted from original config)',\n created_at: new Date().toISOString(),\n };\n await fs.writeFile(path.join(profileDir, 'meta.json'), JSON.stringify(meta, null, 2));\n\n // Create symlink back to the profile with rollback on failure\n try {\n await atomicSymlink(profileDir, globalPath);\n } catch (err) {\n // Rollback: move the directory back to its original location\n try {\n await moveDirectory(profileDir, globalPath);\n } catch (rollbackErr) {\n // If rollback fails, throw both errors\n throw new Error(\n `Failed to create symlink and rollback failed: ${err instanceof Error ? err.message : String(err)}. ` +\n `Rollback error: ${rollbackErr instanceof Error ? rollbackErr.message : String(rollbackErr)}`\n );\n }\n throw err;\n }\n } else {\n // Profile already exists (e.g. content repo cloned) — back up globalPath and symlink to existing profile\n const backupPath = `${globalPath}.bak-${Date.now()}`;\n await moveDirectory(globalPath, backupPath);\n await atomicSymlink(profileDir, globalPath);\n }\n }\n\n /**\n * Verify that an adoption was successful.\n * Checks that the symlink exists and points to the expected profile directory.\n * Returns true if verification passes, false otherwise.\n */\n async verifyAdoption(agent: string, profileName: string = BASE_PROFILE_SLUG): Promise<boolean> {\n const expectedProfileDir = path.join(this.contentDir, agent, profileName);\n\n if (this.getAgentStrategy(agent) === 'include') {\n // For include-based agents: verify that _base exists and at least one\n // managed per-entry symlink points to the expected profile directory.\n if (!(await pathExists(expectedProfileDir))) return false;\n\n const include = this.getProfileInclude(agent);\n if (!include) return false;\n\n const globalPath = this.getGlobalConfigPath(agent);\n const contentDirAbs = path.resolve(this.contentDir);\n const allEntries = [...include.files, ...include.dirs];\n\n // If include list is empty, treat as verified if profile dir exists\n if (allEntries.length === 0) return true;\n\n for (const entry of allEntries) {\n const entryPath = path.join(globalPath, entry);\n let entryStat: Awaited<ReturnType<typeof fs.lstat>> | null = null;\n try {\n entryStat = await fs.lstat(entryPath);\n } catch {\n continue;\n }\n if (!entryStat?.isSymbolicLink()) continue;\n\n const target = await fs.readlink(entryPath);\n const absTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(entryPath), target);\n\n if (!isSubpath(contentDirAbs, absTarget)) continue;\n\n // Check target points to the expected profile\n const expectedEntryPath = path.resolve(expectedProfileDir, entry);\n if (path.resolve(absTarget) === expectedEntryPath) return true;\n }\n\n return false;\n }\n\n const globalPath = this.getGlobalConfigPath(agent);\n\n // Check if global path is a symlink\n const status = await this.getSymlinkStatus(agent);\n if (status !== 'active') {\n return false;\n }\n\n // Check if symlink points to the expected profile directory\n const target = await readSymlinkTarget(globalPath);\n if (!target) {\n return false;\n }\n\n // Resolve target to absolute path for comparison\n const absoluteTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(globalPath), target);\n\n const absoluteExpected = path.resolve(expectedProfileDir);\n\n return absoluteTarget === absoluteExpected;\n }\n\n /**\n * Atomically switch the symlink to point to a different profile.\n * Uses atomic pattern: create temp symlink, then rename over target.\n */\n async switchProfile(agent: string, profileSlug: string): Promise<void> {\n if (profileSlug === SHARED_PROFILE_SLUG) {\n throw new Error(`Profile '${SHARED_PROFILE_SLUG}' is reserved and cannot be activated.`);\n }\n\n if (this.getAgentStrategy(agent) === 'include') {\n return this.switchProfileInclude(agent, profileSlug);\n }\n\n const globalPath = this.getGlobalConfigPath(agent);\n const profileDir = path.join(this.contentDir, agent, profileSlug);\n\n // Verify profile exists\n try {\n await fs.access(profileDir);\n } catch {\n throw new Error(`Profile '${profileSlug}' does not exist for agent '${agent}'`);\n }\n\n // Verify global path is a symlink\n const isLink = await isSymlink(globalPath);\n if (!isLink) {\n throw new Error(`Agent '${agent}' global config is not a symlink (status: unmanaged)`);\n }\n\n // Atomically swap the symlink\n await atomicSymlink(profileDir, globalPath);\n }\n\n /**\n * Unlink a managed profile - move contents back to global config dir.\n * This \"releases\" the agent from management.\n */\n async unlinkProfile(agent: string): Promise<void> {\n if (this.getAgentStrategy(agent) === 'include') {\n return this.unlinkProfileInclude(agent);\n }\n\n const globalPath = this.getGlobalConfigPath(agent);\n const status = await this.getSymlinkStatus(agent);\n\n if (status !== 'active') {\n throw new Error(`Cannot unlink: agent '${agent}' status is '${status}' (expected 'active')`);\n }\n\n const activeProfile = await this.getActiveProfile(agent);\n if (!activeProfile) {\n throw new Error(`Cannot determine active profile for agent '${agent}'`);\n }\n\n const profileDir = path.join(this.contentDir, agent, activeProfile);\n const globalParent = path.dirname(globalPath);\n const globalBaseName = path.basename(globalPath);\n const tempGlobalPath = path.join(globalParent, `.${globalBaseName}-release-${Date.now()}`);\n\n // Copy the profile directory to a temp location (preserving symlinks as copies)\n await copyDirectory(profileDir, tempGlobalPath);\n\n // Remove the managed symlink so the global path can become a real directory.\n await fs.unlink(globalPath);\n\n try {\n await fs.rename(tempGlobalPath, globalPath);\n } catch (error) {\n await fs.rm(tempGlobalPath, { recursive: true, force: true });\n try {\n await atomicSymlink(profileDir, globalPath);\n } catch (restoreError) {\n throw new Error(\n `Failed to restore original symlink after release error: ${restoreError instanceof Error ? restoreError.message : String(restoreError)}`\n );\n }\n throw error;\n }\n\n // Remove profile from managed content after successful release.\n await fs.rm(profileDir, { recursive: true, force: true });\n }\n\n // ============================================================================\n // Shared directory management\n // ============================================================================\n\n /**\n * Get the absolute path to a shared directory.\n */\n getSharedDirGlobalPath(name: string): string {\n const sharedDir = SHARED_DIRECTORIES[name];\n if (!sharedDir) {\n throw new Error(`Unknown shared directory: ${name}`);\n }\n return path.join(os.homedir(), sharedDir.globalPath);\n }\n\n /**\n * Get the content dir path for a shared directory.\n */\n getSharedDirContentPath(name: string): string {\n const sharedDir = SHARED_DIRECTORIES[name];\n if (!sharedDir) {\n throw new Error(`Unknown shared directory: ${name}`);\n }\n return path.join(this.contentDir, sharedDir.contentDirName);\n }\n\n /**\n * Check the state of a shared directory (same as getSymlinkStatus).\n */\n async getSharedDirStatus(name: string): Promise<SymlinkStatus> {\n const globalPath = this.getSharedDirGlobalPath(name);\n\n // Use lstat to check the path itself (doesn't follow symlinks)\n let stat;\n try {\n stat = await fs.lstat(globalPath);\n } catch {\n return 'missing';\n }\n\n // Not a symlink = real directory\n if (!stat.isSymbolicLink()) {\n return 'unmanaged';\n }\n\n // It's a symlink — check if target exists\n const target = await readSymlinkTarget(globalPath);\n if (!target) {\n return 'broken';\n }\n\n // Check if target actually exists (follow the symlink)\n try {\n await fs.access(globalPath);\n } catch {\n return 'broken';\n }\n\n // Resolve target to absolute path\n const absoluteTarget = path.isAbsolute(target)\n ? target\n : path.resolve(path.dirname(globalPath), target);\n\n // Check if target is in our content dir\n const contentDirAbs = path.resolve(this.contentDir);\n if (!absoluteTarget.startsWith(contentDirAbs + path.sep)) {\n return 'external';\n }\n\n return 'active';\n }\n\n /**\n * Adopt an existing shared directory.\n * Moves it to contentDir/<contentDirName> and creates a symlink back.\n */\n async adoptSharedDir(name: string): Promise<void> {\n const globalPath = this.getSharedDirGlobalPath(name);\n const contentPath = this.getSharedDirContentPath(name);\n const status = await this.getSharedDirStatus(name);\n\n if (status !== 'unmanaged') {\n throw new Error(\n `Cannot adopt shared dir '${name}': status is '${status}' (expected 'unmanaged')`\n );\n }\n\n // Check if content path already exists\n let contentPathExists = false;\n try {\n await fs.access(contentPath);\n contentPathExists = true;\n } catch (err) {\n if (err instanceof Error && 'code' in err && err.code === 'ENOENT') {\n // Good, doesn't exist\n } else {\n throw err;\n }\n }\n\n if (!contentPathExists) {\n // Move the real directory to content location\n await moveDirectory(globalPath, contentPath);\n } else {\n // Content already exists (e.g. content repo cloned) — back up globalPath and symlink to existing content\n const backupPath = `${globalPath}.bak-${Date.now()}`;\n await moveDirectory(globalPath, backupPath);\n }\n\n // Create symlink back\n await atomicSymlink(contentPath, globalPath);\n }\n\n /**\n * Unlink a managed shared directory.\n * Moves contents back to global location.\n */\n async unlinkSharedDir(name: string): Promise<void> {\n const globalPath = this.getSharedDirGlobalPath(name);\n const contentPath = this.getSharedDirContentPath(name);\n const status = await this.getSharedDirStatus(name);\n\n if (status !== 'active') {\n throw new Error(\n `Cannot unlink shared dir '${name}': status is '${status}' (expected 'active')`\n );\n }\n\n // Remove the symlink\n await fs.unlink(globalPath);\n\n // Move content back to global location\n await moveDirectory(contentPath, globalPath);\n }\n}\n","import fs from 'node:fs/promises';\nimport path from 'node:path';\nimport os from 'node:os';\nimport * as p from '@clack/prompts';\nimport color from 'picocolors';\nimport { ConfigManager } from './config.js';\nimport { SUPPORTED_TOOLS, SHARED_DIRECTORIES, BASE_PROFILE_SLUG } from '../types/index.js';\n\nfunction getDefaultConfigDir(): string {\n if (process.env.AGENTPROFILES_CONFIG_DIR) {\n return process.env.AGENTPROFILES_CONFIG_DIR;\n }\n return path.join(os.homedir(), '.config', 'agentprofiles');\n}\n\nfunction getConfigPath(): string {\n return path.join(getDefaultConfigDir(), 'config.json');\n}\n\nexport function expandTildePath(input: string): string {\n if (input === '~') {\n return os.homedir();\n }\n if (input.startsWith('~/')) {\n return path.join(os.homedir(), input.slice(2));\n }\n if (input.startsWith('~')) {\n return path.join(os.homedir(), input.slice(1));\n }\n return input;\n}\n\nexport async function isInitialized(): Promise<boolean> {\n try {\n await fs.access(getConfigPath());\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function runOnboarding(options: { isRerun?: boolean } = {}): Promise<boolean> {\n const config = new ConfigManager();\n\n if (options.isRerun) {\n p.intro(color.cyan('Re-running agentprofiles setup'));\n } else {\n p.intro(color.cyan('Welcome to agentprofiles!'));\n p.note(\n `This tool manages configuration profiles for LLM agent tools.\\n` +\n `Profiles are stored as symlinks to centralized directories.`,\n 'About'\n );\n }\n\n // Load existing config so getContentDir() reflects what's already configured.\n await config.init();\n\n const configDir = config.getConfigDir();\n p.log.info(`Config directory: ${color.dim(configDir)}`);\n\n const currentContentDir = config.getContentDir();\n\n const contentDirChoice = await p.text({\n message: 'Where should profile contents be stored?',\n placeholder: currentContentDir,\n defaultValue: currentContentDir,\n validate: (value) => {\n if (!value) return 'Please enter a directory path';\n if (!path.isAbsolute(value) && !value.startsWith('~')) {\n return 'Please enter an absolute path';\n }\n return undefined;\n },\n });\n\n if (p.isCancel(contentDirChoice)) {\n p.cancel('Setup cancelled.');\n return false;\n }\n\n let contentDir = contentDirChoice as string;\n contentDir = expandTildePath(contentDir);\n\n const spinner = p.spinner();\n spinner.start('Creating directories...');\n\n try {\n await config.ensureConfigDir();\n\n if (contentDir !== configDir) {\n await config.setContentDir(contentDir);\n await config.ensureConfigDir();\n }\n\n spinner.stop('Directories created');\n } catch (error) {\n spinner.stop('Failed to create directories');\n p.log.error(`Error: ${error instanceof Error ? error.message : String(error)}`);\n return false;\n }\n\n // Scan agents for adoption\n const adoptedAgents: string[] = [];\n for (const [agent, toolDef] of Object.entries(SUPPORTED_TOOLS)) {\n const status = await config.getSymlinkStatus(agent);\n\n if (status === 'unmanaged') {\n const globalPath = config.getGlobalConfigPath(agent);\n const shouldAdopt = await p.confirm({\n message: `Found existing ${toolDef.description} config at ${color.dim(globalPath)}. Adopt as _base profile?`,\n initialValue: true,\n });\n\n if (p.isCancel(shouldAdopt)) {\n p.cancel('Setup cancelled.');\n return false;\n }\n\n if (shouldAdopt === true) {\n try {\n await config.adoptExisting(agent, BASE_PROFILE_SLUG);\n\n // Verify adoption was successful\n const verified = await config.verifyAdoption(agent, BASE_PROFILE_SLUG);\n if (!verified) {\n p.log.warn(\n `Adoption of ${agent} may have failed verification. ` +\n `Please check that ${config.getGlobalConfigPath(agent)} is a symlink pointing to the correct profile.`\n );\n } else {\n adoptedAgents.push(agent);\n p.log.success(`Adopted ${toolDef.description} as _base profile`);\n }\n } catch (error) {\n const errorMsg = error instanceof Error ? error.message : String(error);\n\n if (errorMsg.includes('already exists')) {\n const replaceExisting = await p.confirm({\n message: `A _base profile already exists for ${toolDef.description}. Replace it with the current config?`,\n initialValue: false,\n });\n\n if (p.isCancel(replaceExisting)) {\n p.cancel('Setup cancelled.');\n return false;\n }\n\n if (replaceExisting === true) {\n try {\n await config.adoptExisting(agent, BASE_PROFILE_SLUG, { replaceExisting: true });\n const verified = await config.verifyAdoption(agent, BASE_PROFILE_SLUG);\n if (!verified) {\n p.log.warn(\n `Adoption of ${agent} may have failed verification. ` +\n `Please check that ${config.getGlobalConfigPath(agent)} is a symlink pointing to the correct profile.`\n );\n } else {\n adoptedAgents.push(agent);\n p.log.success(`Replaced and adopted ${toolDef.description} as _base profile`);\n }\n } catch (retryError) {\n p.log.error(\n `Failed to adopt ${agent}: ${retryError instanceof Error ? retryError.message : String(retryError)}`\n );\n }\n } else {\n p.log.info(`Skipped ${toolDef.description}`);\n }\n } else {\n p.log.error(`Failed to adopt ${agent}: ${errorMsg}`);\n }\n }\n }\n } else if (status === 'active') {\n p.log.info(`${toolDef.description} is already managed`);\n } else if (status === 'missing') {\n p.log.info(`${toolDef.description} not installed — skipping`);\n } else if (status === 'broken') {\n p.log.warn(\n `${toolDef.description} has a broken symlink at ${color.dim(config.getGlobalConfigPath(agent))}. Run ${color.cyan('agentprofiles doctor')} to repair.`\n );\n } else if (status === 'external') {\n p.log.warn(\n `${toolDef.description} symlink at ${color.dim(config.getGlobalConfigPath(agent))} points outside this content directory — skipping adoption.`\n );\n }\n }\n\n // Scan shared directories for adoption\n const adoptedSharedDirs: string[] = [];\n for (const [name, sharedDir] of Object.entries(SHARED_DIRECTORIES)) {\n const status = await config.getSharedDirStatus(name);\n\n if (status === 'unmanaged') {\n const globalPath = config.getSharedDirGlobalPath(name);\n const shouldAdopt = await p.confirm({\n message: `Found existing ${sharedDir.description} at ${color.dim(globalPath)}. Adopt?`,\n initialValue: true,\n });\n\n if (p.isCancel(shouldAdopt)) {\n p.cancel('Setup cancelled.');\n return false;\n }\n\n if (shouldAdopt === true) {\n try {\n await config.adoptSharedDir(name);\n\n // Verify adoption was successful\n const verified = (await config.getSharedDirStatus(name)) === 'active';\n if (!verified) {\n p.log.warn(\n `Adoption of ${name} may have failed verification. ` +\n `Please check that ${config.getSharedDirGlobalPath(name)} is a symlink pointing to the correct location.`\n );\n } else {\n adoptedSharedDirs.push(name);\n p.log.success(`Adopted ${sharedDir.description}`);\n }\n } catch (error) {\n p.log.error(\n `Failed to adopt ${name}: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n }\n } else if (status === 'active') {\n p.log.info(`${sharedDir.description} is already managed`);\n }\n }\n\n // Ensure every agent has a _base profile scaffold and apply known layout conventions.\n for (const agent of Object.keys(SUPPORTED_TOOLS)) {\n try {\n await config.ensureBaseProfileLayout(agent);\n } catch (error) {\n p.log.warn(\n `Could not finalize base profile layout for ${agent}: ${\n error instanceof Error ? error.message : String(error)\n }`\n );\n }\n }\n\n // Show summary\n let summary = color.green('Setup complete!');\n if (adoptedAgents.length > 0 || adoptedSharedDirs.length > 0) {\n summary += '\\n\\nAdopted:';\n for (const agent of adoptedAgents) {\n const toolDef = SUPPORTED_TOOLS[agent];\n if (toolDef) {\n summary += `\\n • ${toolDef.description} (_base profile)`;\n }\n }\n for (const name of adoptedSharedDirs) {\n const sharedDir = SHARED_DIRECTORIES[name];\n if (sharedDir) {\n summary += `\\n • ${sharedDir.description}`;\n }\n }\n }\n summary += `\\n\\nRun ${color.cyan('agentprofiles add <agent>')} to create additional profiles.`;\n\n p.outro(summary);\n return true;\n}\n\nexport async function ensureInitialized(): Promise<boolean> {\n if (await isInitialized()) {\n return true;\n }\n\n if (!process.stdout.isTTY) {\n console.error(color.red('agentprofiles is not initialized.'));\n console.error(`Run ${color.cyan('agentprofiles setup')} to set up.`);\n process.exit(1);\n }\n\n return runOnboarding();\n}\n","import { defineCommand } from 'citty';\nimport { ConfigManager } from '../lib/config.js';\nimport { SUPPORTED_TOOLS, SHARED_DIRECTORIES } from '../types/index.js';\nimport color from 'picocolors';\n\nexport async function statusCommand() {\n const config = new ConfigManager();\n await config.init();\n\n console.log(color.bold('\\n📊 Agent Profiles Status\\n'));\n\n // Show agent statuses\n console.log(color.bold('Agents:'));\n for (const [agentKey, agentDef] of Object.entries(SUPPORTED_TOOLS)) {\n const status = await config.getSymlinkStatus(agentKey);\n const activeProfile = await config.getActiveProfile(agentKey);\n\n let statusLine = ` ${color.bold(agentDef.description)} (${agentKey})`;\n\n if (status === 'active') {\n const displayName = activeProfile === '_base' ? 'Base profile' : activeProfile;\n statusLine += ` → ${color.cyan(displayName)}`;\n } else if (status === 'unmanaged') {\n statusLine += ` → ${color.dim('Not managed (run setup to adopt)')}`;\n } else if (status === 'missing') {\n statusLine += ` → ${color.dim('Not installed')}`;\n } else if (status === 'broken') {\n statusLine += ` → ${color.red('Broken symlink')}`;\n } else if (status === 'external') {\n statusLine += ` → ${color.yellow('Symlink points outside managed profiles')}`;\n }\n\n console.log(statusLine);\n }\n\n // Show shared directory statuses\n console.log(color.bold('\\nShared Directories:'));\n for (const [, sharedDir] of Object.entries(SHARED_DIRECTORIES)) {\n const status = await config.getSharedDirStatus(sharedDir.name);\n\n let statusLine = ` ${color.bold(sharedDir.description)} (${sharedDir.globalPath})`;\n\n if (status === 'active') {\n statusLine += ` → ${color.cyan('Managed')}`;\n } else if (status === 'unmanaged') {\n statusLine += ` → ${color.dim('Not managed')}`;\n } else if (status === 'missing') {\n statusLine += ` → ${color.dim('Not present')}`;\n } else if (status === 'broken') {\n statusLine += ` → ${color.red('Broken symlink')}`;\n } else if (status === 'external') {\n statusLine += ` → ${color.yellow('Symlink points outside managed location')}`;\n }\n\n console.log(statusLine);\n }\n\n console.log();\n}\n\nexport default defineCommand({\n meta: {\n name: 'status',\n description: 'Show agent profile status',\n },\n async run() {\n await statusCommand();\n },\n});\n","import { defineCommand } from 'citty';\nimport { log, note } from '@clack/prompts';\nimport { ConfigManager } from '../lib/config.js';\nimport { SUPPORTED_TOOLS, BASE_PROFILE_SLUG } from '../types/index.js';\nimport color from 'picocolors';\n\nexport async function listCommand(agent?: string) {\n const config = new ConfigManager();\n await config.init();\n\n if (agent && !SUPPORTED_TOOLS[agent]) {\n console.error(color.red(`Unsupported agent: ${agent}`));\n process.exit(1);\n }\n\n const configDir = config.getConfigDir();\n const contentDir = config.getContentDir();\n\n const configLines = [`Config: ${color.dim(configDir)}`];\n if (contentDir !== configDir) {\n configLines.push(`Content: ${color.dim(contentDir)}`);\n }\n log.info(configLines.join('\\n'));\n\n const agents = agent ? [agent] : Object.keys(SUPPORTED_TOOLS);\n\n for (const a of agents) {\n const profiles = await config.getProfiles(a);\n const activeProfile = await config.getActiveProfile(a);\n const tool = SUPPORTED_TOOLS[a];\n if (!tool) continue;\n\n // Filter out _base from the display list\n const displayProfiles = profiles.filter((p) => p.slug !== BASE_PROFILE_SLUG);\n\n if (displayProfiles.length === 0) {\n note(color.dim('No profiles found'), `${tool.description} Profiles`);\n } else {\n const lines = displayProfiles.map((p) => {\n let label = p.name !== p.slug ? `${p.name} (${p.slug})` : p.name;\n\n if (p.slug === activeProfile) {\n label = `● ${label}`;\n }\n\n if (p.description) {\n return `${color.cyan(label)} ${color.dim('-')} ${p.description}`;\n }\n return color.cyan(label);\n });\n\n // If active profile is _base, show an indicator at the end\n if (activeProfile === BASE_PROFILE_SLUG) {\n lines.push(`● ${color.dim('Base profile')}`);\n }\n\n note(lines.join('\\n'), `${tool.description} Profiles`);\n }\n }\n}\n\nexport default defineCommand({\n meta: {\n name: 'list',\n description: 'List available profiles',\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Filter by agent name',\n required: false,\n },\n },\n async run({ args }) {\n await listCommand(args.agent);\n },\n});\n","var p=[\"accommodating\",\"admirable\",\"adored\",\"adventurous\",\"affable\",\"affectionate\",\"agreeable\",\"alluring\",\"amiable\",\"amicable\",\"amusing\",\"appreciable\",\"appreciated\",\"appreciative\",\"attentive\",\"authentic\",\"balanced\",\"beautiful\",\"benevolent\",\"blessed\",\"blissful\",\"bounteous\",\"bountiful\",\"bright\",\"brilliant\",\"bubbly\",\"calm\",\"caring\",\"charitable\",\"charming\",\"cheerful\",\"cheery\",\"cherished\",\"comforting\",\"committed\",\"compassionate\",\"complimentary\",\"confident\",\"considerate\",\"content\",\"contented\",\"cordial\",\"courageous\",\"creative\",\"credible\",\"dedicated\",\"delighted\",\"delightful\",\"dependable\",\"determined\",\"devoted\",\"diligent\",\"dreamy\",\"eager\",\"earnest\",\"easygoing\",\"ebullient\",\"elated\",\"empowering\",\"encouraging\",\"endearing\",\"energetic\",\"engaging\",\"enthusiastic\",\"exciting\",\"exquisite\",\"extraordinary\",\"exuberant\",\"fabulous\",\"faithful\",\"fervent\",\"festive\",\"forgiving\",\"friendly\",\"funny\",\"generous\",\"gentle\",\"genuine\",\"giggling\",\"giving\",\"gleeful\",\"glowing\",\"good\",\"graceful\",\"gracious\",\"grateful\",\"gratified\",\"gratifying\",\"happy\",\"harmonious\",\"heartening\",\"heartfelt\",\"heartwarming\",\"helpful\",\"honest\",\"honorable\",\"hopeful\",\"hospitable\",\"humorous\",\"illuminating\",\"imaginative\",\"impartial\",\"inclusive\",\"innocent\",\"innovative\",\"inspiring\",\"invigorating\",\"inviting\",\"jolly\",\"jovial\",\"joyful\",\"joyfully\",\"joyous\",\"jubilant\",\"keen\",\"kind\",\"kindhearted\",\"kindly\",\"laughing\",\"liberating\",\"lighthearted\",\"likeable\",\"liked\",\"lively\",\"lovable\",\"lovely\",\"loving\",\"loyal\",\"lucid\",\"luminous\",\"magnanimous\",\"mellow\",\"merry\",\"mindful\",\"mirthful\",\"modest\",\"nice\",\"noble\",\"nourishing\",\"nurturing\",\"obliging\",\"open\",\"openhearted\",\"openminded\",\"optimistic\",\"outgoing\",\"passionate\",\"patient\",\"peaceful\",\"personable\",\"playful\",\"pleasant\",\"pleasing\",\"polite\",\"positive\",\"productive\",\"prosperous\",\"radiant\",\"reassuring\",\"refreshing\",\"rejoicing\",\"relaxed\",\"reliable\",\"resilient\",\"respectable\",\"respectful\",\"responsive\",\"revered\",\"reverent\",\"satisfied\",\"secure\",\"sensational\",\"sensitive\",\"serene\",\"sincere\",\"smiling\",\"sociable\",\"soft\",\"sparkling\",\"spirited\",\"stable\",\"sunny\",\"supportive\",\"sweet\",\"sympathetic\",\"tactful\",\"tenacious\",\"thankful\",\"thoughtful\",\"tolerant\",\"tranquil\",\"true\",\"trusting\",\"trustworthy\",\"truthful\",\"understanding\",\"unique\",\"unselfish\",\"untroubled\",\"upbeat\",\"uplifting\",\"valuable\",\"valued\",\"versatile\",\"vibrant\",\"vigorous\",\"virtuous\",\"vital\",\"vivacious\",\"warm\",\"warmhearted\",\"welcoming\",\"wholehearted\",\"wholesome\",\"willing\",\"winsome\",\"wise\",\"witty\",\"wonderful\",\"xenial\",\"yearning\",\"youthful\",\"yummy\",\"zealous\",\"zestful\",\"zesty\",\"zippy\"];var u=[\"aardvark\",\"albatross\",\"ant\",\"antelope\",\"ape\",\"armadillo\",\"badger\",\"bat\",\"bear\",\"bison\",\"bumblebee\",\"butterfly\",\"camel\",\"capybara\",\"caribou\",\"cassowary\",\"cat\",\"caterpillar\",\"cheetah\",\"chicken\",\"chimpanzee\",\"chinchilla\",\"chipmunk\",\"cougar\",\"cow\",\"coyote\",\"crab\",\"cricket\",\"crow\",\"deer\",\"dingo\",\"dog\",\"dolphin\",\"donkey\",\"dove\",\"duck\",\"eagle\",\"echidna\",\"elephant\",\"falcon\",\"ferret\",\"finch\",\"fish\",\"flamingo\",\"fly\",\"fox\",\"frog\",\"gazelle\",\"gerbil\",\"giraffe\",\"goat\",\"goldfish\",\"goose\",\"gorilla\",\"grasshopper\",\"hamster\",\"hare\",\"hedgehog\",\"heron\",\"hippopotamus\",\"horse\",\"hummingbird\",\"hyena\",\"iguana\",\"impala\",\"jackal\",\"jaguar\",\"jellyfish\",\"kangaroo\",\"kitten\",\"koala\",\"kudu\",\"ladybug\",\"leopard\",\"lion\",\"llama\",\"lobster\",\"locust\",\"lynx\",\"magpie\",\"marten\",\"meerkat\",\"mink\",\"mockingbird\",\"mole\",\"mongoose\",\"monkey\",\"moose\",\"mouse\",\"mynah\",\"narwhal\",\"newt\",\"nuthatch\",\"ocelot\",\"octopus\",\"opossum\",\"orangutan\",\"osprey\",\"ostrich\",\"otter\",\"owl\",\"ox\",\"oyster\",\"panda\",\"pangolin\",\"panther\",\"parakeet\",\"parrot\",\"peacock\",\"pelican\",\"penguin\",\"pheasant\",\"pig\",\"pigeon\",\"pika\",\"platypus\",\"plover\",\"polecat\",\"porcupine\",\"puffin\",\"quail\",\"quokka\",\"rabbit\",\"raccoon\",\"ragdoll\",\"ram\",\"rat\",\"raven\",\"reindeer\",\"rhea\",\"rhinoceros\",\"roo\",\"rooster\",\"saiga\",\"salamander\",\"sambar\",\"sandpiper\",\"sardine\",\"scorpion\",\"seahorse\",\"seal\",\"serval\",\"sheep\",\"shelduck\",\"shrew\",\"shrimp\",\"siskin\",\"skunk\",\"sloth\",\"snail\",\"snapper\",\"sora\",\"sparrow\",\"spoonbill\",\"squirrel\",\"starling\",\"stingray\",\"stork\",\"swan\",\"tadpole\",\"tamarin\",\"tanager\",\"tapir\",\"tarpon\",\"tarsier\",\"tetra\",\"thrush\",\"tiger\",\"toad\",\"toucan\",\"toucanet\",\"towhee\",\"trogon\",\"turaco\",\"turtle\",\"uakari\",\"umbrellabird\",\"urchin\",\"vaquita\",\"vicuna\",\"vireo\",\"vole\",\"vulture\",\"wagtail\",\"wallaby\",\"wallaroo\",\"walrus\",\"warthog\",\"waxwing\",\"whale\",\"whippet\",\"wilddog\",\"wildebeest\",\"wolf\",\"wolverine\",\"wombat\",\"woodpecker\",\"wrasse\",\"xerus\",\"yaffle\",\"yak\",\"zebra\",\"zebu\"];var m=[\"abacus\",\"acroterion\",\"aedicule\",\"aisle\",\"alcove\",\"ambulatory\",\"annex\",\"antechamber\",\"apse\",\"arcade\",\"arch\",\"architrave\",\"archivolt\",\"archway\",\"astragal\",\"atrium\",\"attic\",\"balcony\",\"baldachin\",\"baluster\",\"balustrade\",\"bargeboard\",\"baseboard\",\"basilica\",\"bay\",\"bead\",\"beam\",\"belfry\",\"belvedere\",\"billet\",\"blueprint\",\"bracket\",\"breezeway\",\"brise\",\"buttress\",\"campanile\",\"canopy\",\"cantilever\",\"capital\",\"cartouche\",\"caryatid\",\"casement\",\"casing\",\"castellated\",\"chamfer\",\"chevron\",\"chimney\",\"cladding\",\"clerestory\",\"cloister\",\"colonnade\",\"column\",\"console\",\"coping\",\"corbel\",\"cornice\",\"courtyard\",\"crenellation\",\"cresting\",\"crown\",\"cupola\",\"curtain\",\"cyma\",\"dado\",\"dais\",\"dentil\",\"dome\",\"domed\",\"doric\",\"dormer\",\"dripstone\",\"eaves\",\"echinus\",\"elevation\",\"ell\",\"engaged\",\"entablature\",\"entresol\",\"entryway\",\"facade\",\"fanlight\",\"fascia\",\"fenestration\",\"finial\",\"fluting\",\"foundation\",\"foyer\",\"fresco\",\"frieze\",\"gable\",\"gallery\",\"gargoyle\",\"grille\",\"hall\",\"hammerbeam\",\"hearth\",\"hip\",\"hyphen\",\"impost\",\"inglenook\",\"interior\",\"ionic\",\"jamb\",\"joist\",\"keystone\",\"lancet\",\"lantern\",\"lintel\",\"lobby\",\"loggia\",\"louver\",\"lunette\",\"mansard\",\"metope\",\"mezzanine\",\"minaret\",\"modillion\",\"molding\",\"mullion\",\"muntins\",\"narthex\",\"nave\",\"newel\",\"niche\",\"obelisk\",\"oculus\",\"ogee\",\"oriel\",\"parapet\",\"pavilion\",\"pedestal\",\"pediment\",\"pendentive\",\"pilaster\",\"pillar\",\"pinnacle\",\"plinth\",\"porte\",\"portico\",\"quatrefoil\",\"quoin\",\"rafter\",\"raking\",\"reredos\",\"reveal\",\"ridge\",\"riser\",\"roof\",\"rosette\",\"rotunda\",\"roundel\",\"sash\",\"sconce\",\"sill\",\"skylight\",\"soffit\",\"spandrel\",\"spire\",\"stanchion\",\"steeple\",\"stoa\",\"stucco\",\"stylobate\",\"terrace\",\"tracery\",\"transept\",\"transom\",\"tread\",\"trellis\",\"triforium\",\"triglyph\",\"truss\",\"turret\",\"tympanum\",\"undercroft\",\"vault\",\"veranda\",\"vestibule\",\"volute\",\"voussoir\",\"wainscot\",\"wall\",\"window\",\"ziggurat\"];var d=[\"abstract\",\"acanthus\",\"acrylic\",\"adornment\",\"aesthetic\",\"airbrush\",\"amphora\",\"animation\",\"antiquity\",\"applique\",\"aquarelle\",\"arabesque\",\"armature\",\"artifact\",\"artisan\",\"artistry\",\"artwork\",\"assemblage\",\"atelier\",\"balance\",\"baroque\",\"batik\",\"biennale\",\"blending\",\"bricolage\",\"brushstroke\",\"bust\",\"calligraphy\",\"cameo\",\"canvas\",\"carving\",\"casting\",\"ceramics\",\"charcoal\",\"chasing\",\"chiaroscuro\",\"chisel\",\"chromatic\",\"classical\",\"cloisonne\",\"collage\",\"composition\",\"connoisseur\",\"contour\",\"contrast\",\"craftsmanship\",\"crayon\",\"creativity\",\"critique\",\"cubism\",\"curator\",\"dada\",\"decorative\",\"decoupage\",\"design\",\"diorama\",\"diptych\",\"drapery\",\"drawing\",\"easel\",\"embellishment\",\"embossing\",\"enamel\",\"encaustic\",\"engraving\",\"ensemble\",\"etching\",\"expressionism\",\"fauvism\",\"filigree\",\"fine\",\"finesse\",\"firing\",\"folio\",\"foreshortening\",\"form\",\"gauche\",\"gesso\",\"gilding\",\"glyptic\",\"gouache\",\"graffiti\",\"harmony\",\"hatching\",\"hue\",\"iconography\",\"illustration\",\"impasto\",\"impressionism\",\"ink\",\"installation\",\"intaglio\",\"interpretation\",\"kiln\",\"kilnwork\",\"kinetic\",\"lacquer\",\"landscape\",\"linocut\",\"lithography\",\"luminism\",\"lyrical\",\"mannequin\",\"marbling\",\"masterpiece\",\"medallion\",\"medium\",\"memento\",\"miniature\",\"miniaturist\",\"mobile\",\"modernism\",\"mosaic\",\"mural\",\"museum\",\"naturalism\",\"neoclassicism\",\"neon\",\"nuance\",\"oil\",\"origami\",\"ornament\",\"painting\",\"palette\",\"pastel\",\"patina\",\"pencil\",\"pentimento\",\"perspective\",\"photography\",\"pictorial\",\"pigment\",\"plaster\",\"pointillism\",\"polychrome\",\"portfolio\",\"portrait\",\"print\",\"proportion\",\"provenance\",\"relief\",\"renaissance\",\"rendering\",\"replica\",\"representation\",\"restoration\",\"retrospective\",\"rococo\",\"romanticism\",\"salon\",\"sanguine\",\"saturation\",\"sculpture\",\"sepia\",\"serif\",\"sfumato\",\"sgraffito\",\"shade\",\"shadow\",\"silhouette\",\"simulacrum\",\"sketch\",\"stencil\",\"stippling\",\"stoneware\",\"studio\",\"study\",\"surrealism\",\"symmetry\",\"tableau\",\"technique\",\"tempera\",\"tessellation\",\"texture\",\"tint\",\"triptych\",\"typography\",\"underpainting\",\"varnish\",\"vernissage\",\"virtuoso\",\"visionary\",\"visual\",\"watercolor\",\"weaving\",\"woodcut\"];var h=[\"alabaster\",\"amber\",\"aqua\",\"auburn\",\"azure\",\"beige\",\"bisque\",\"black\",\"blonde\",\"blue\",\"blush\",\"bone\",\"bordeaux\",\"brick\",\"brown\",\"buff\",\"burgundy\",\"cadet\",\"canary\",\"cappuccino\",\"cardinal\",\"carmine\",\"carnelian\",\"celadon\",\"cerulean\",\"champagne\",\"chartreuse\",\"claret\",\"cobalt\",\"cognac\",\"copper\",\"cornflower\",\"crimson\",\"cyan\",\"daffodil\",\"ebony\",\"ecru\",\"eggshell\",\"electric\",\"espresso\",\"fawn\",\"flax\",\"fuchsia\",\"glaucous\",\"gold\",\"goldenrod\",\"graphite\",\"gray\",\"green\",\"gunmetal\",\"heliotrope\",\"hunter\",\"indigo\",\"ivory\",\"jade\",\"jasper\",\"khaki\",\"lapis\",\"lava\",\"magenta\",\"mahogany\",\"maize\",\"malachite\",\"mandarin\",\"maroon\",\"mauve\",\"midnight\",\"mocha\",\"mulberry\",\"navy\",\"obsidian\",\"ochre\",\"onyx\",\"paprika\",\"pearl\",\"periwinkle\",\"pewter\",\"pink\",\"platinum\",\"powder\",\"puce\",\"purple\",\"red\",\"rosewood\",\"ruby\",\"russet\",\"rust\",\"sable\",\"saffron\",\"sangria\",\"scarlet\",\"seafoam\",\"sienna\",\"silver\",\"slate\",\"smoke\",\"snow\",\"steel\",\"tan\",\"taupe\",\"tawny\",\"teal\",\"terracotta\",\"titanium\",\"turquoise\",\"ultramarine\",\"umber\",\"verdigris\",\"vermilion\",\"viridian\",\"white\",\"yellow\",\"zinc\",\"zircon\"];var g=[\"acceptance\",\"admiration\",\"adoration\",\"affection\",\"agitation\",\"agony\",\"alarm\",\"amazement\",\"amusement\",\"anger\",\"anguish\",\"anticipation\",\"anxiety\",\"apathy\",\"apprehension\",\"astonishment\",\"awe\",\"bashfulness\",\"belonging\",\"bewilderment\",\"bitterness\",\"bliss\",\"boredom\",\"caution\",\"cheerfulness\",\"compassion\",\"concern\",\"confidence\",\"confusion\",\"contempt\",\"contentment\",\"courage\",\"craving\",\"curiosity\",\"cynicism\",\"defensiveness\",\"defiance\",\"delight\",\"denial\",\"depression\",\"despair\",\"desperation\",\"determination\",\"devastation\",\"disappointment\",\"disbelief\",\"discomfort\",\"discontent\",\"discouragement\",\"disdain\",\"disgust\",\"disillusionment\",\"dismay\",\"displeasure\",\"distraction\",\"distress\",\"distrust\",\"doom\",\"doubt\",\"dread\",\"eagerness\",\"elation\",\"embarrassment\",\"empathy\",\"emptiness\",\"enchantment\",\"enjoyment\",\"enlightenment\",\"enthusiasm\",\"envy\",\"euphoria\",\"exasperation\",\"excitement\",\"exhaustion\",\"exhilaration\",\"expectation\",\"fascination\",\"fatigue\",\"fear\",\"ferocity\",\"fondness\",\"fright\",\"frustration\",\"fulfillment\",\"fury\",\"gladness\",\"glee\",\"gloom\",\"glumness\",\"gratification\",\"gratitude\",\"greed\",\"grief\",\"grouchiness\",\"grumpiness\",\"guilt\",\"happiness\",\"hatred\",\"heartache\",\"helplessness\",\"hesitation\",\"homesickness\",\"hope\",\"hopelessness\",\"horror\",\"hostility\",\"humiliation\",\"hurt\",\"hysteria\",\"impatience\",\"indifference\",\"indignation\",\"infatuation\",\"insecurity\",\"inspiration\",\"interest\",\"intimidation\",\"intoxication\",\"irritability\",\"irritation\",\"isolation\",\"jealousy\",\"joy\",\"jubilation\",\"kindness\",\"loneliness\",\"longing\",\"loathing\",\"love\",\"melancholy\",\"misery\",\"mortification\",\"negativity\",\"nervousness\",\"numbness\",\"obsession\",\"optimism\",\"outrage\",\"overwhelm\",\"panic\",\"paranoia\",\"patience\",\"peace\",\"pensiveness\",\"perplexity\",\"pessimism\",\"pity\",\"positivity\",\"powerlessness\",\"pride\",\"puzzlement\",\"rage\",\"rapture\",\"reassurance\",\"regret\",\"rejection\",\"relaxation\",\"reluctance\",\"remorse\",\"resentment\",\"resignation\",\"restlessness\",\"reverence\",\"revulsion\",\"sadness\",\"satisfaction\",\"scorn\",\"security\",\"selfpity\",\"serenity\",\"shame\",\"shock\",\"shyness\",\"skepticism\",\"solidarity\",\"sorrow\",\"spite\",\"stubbornness\",\"suffering\",\"sullenness\",\"surprise\",\"suspicion\",\"sympathy\",\"tenderness\",\"tension\",\"terror\",\"thankfulness\",\"thrill\",\"torment\",\"tranquility\",\"triumph\",\"uncertainty\",\"unease\",\"unhappiness\",\"valor\",\"vengeance\",\"vexation\",\"vigilance\",\"vulnerability\",\"warmth\",\"wariness\",\"weariness\",\"wonder\",\"worry\",\"worthlessness\",\"wrath\",\"zeal\",\"zest\"];var b=[\"accessory\",\"apparel\",\"asymmetrical\",\"attire\",\"ballet\",\"bandana\",\"beaded\",\"belt\",\"bespoke\",\"blazer\",\"blouse\",\"bodysuit\",\"boho\",\"bolero\",\"boots\",\"boutique\",\"bracelet\",\"brocade\",\"brooch\",\"button\",\"cape\",\"capri\",\"cardigan\",\"cashmere\",\"casual\",\"chic\",\"chiffon\",\"classic\",\"cloche\",\"clutch\",\"cocktail\",\"collar\",\"collection\",\"corduroy\",\"cotton\",\"couture\",\"cravat\",\"cuff\",\"culottes\",\"dapper\",\"denim\",\"drape\",\"dress\",\"earrings\",\"edgy\",\"elegant\",\"embroidery\",\"empire\",\"epaulette\",\"eyelet\",\"fabric\",\"fashion\",\"faux\",\"fedora\",\"fitted\",\"flair\",\"flannel\",\"flapper\",\"floral\",\"formal\",\"fringe\",\"fur\",\"garment\",\"garter\",\"glamorous\",\"gloves\",\"gown\",\"halter\",\"handbag\",\"haute\",\"headband\",\"heel\",\"hemline\",\"iridescent\",\"jacket\",\"jewelry\",\"jumpsuit\",\"kaftan\",\"kimono\",\"knit\",\"lace\",\"lapel\",\"leather\",\"linen\",\"loafers\",\"luxurious\",\"material\",\"merino\",\"moccasin\",\"modern\",\"mule\",\"necklace\",\"outfit\",\"oxford\",\"palazzo\",\"pants\",\"pashmina\",\"patent\",\"pattern\",\"pearls\",\"peplum\",\"plaid\",\"platform\",\"pleat\",\"pleated\",\"pocket\",\"poncho\",\"preppy\",\"puff\",\"pumps\",\"purse\",\"quilted\",\"retro\",\"robe\",\"ruched\",\"ruffle\",\"sandals\",\"sartorial\",\"satin\",\"scarf\",\"seamstress\",\"sequin\",\"shawl\",\"sheath\",\"shift\",\"shirt\",\"shoes\",\"shorts\",\"silk\",\"skirt\",\"sleek\",\"sleeve\",\"slippers\",\"sneakers\",\"socks\",\"sophisticated\",\"stiletto\",\"stole\",\"strappy\",\"striped\",\"stylish\",\"suede\",\"suit\",\"sundress\",\"sunglasses\",\"sweater\",\"taffeta\",\"textile\",\"tiara\",\"tie\",\"tote\",\"trend\",\"trim\",\"trousers\",\"tulle\",\"tunic\",\"turtleneck\",\"tweed\",\"uniform\",\"velvet\",\"vest\",\"vintage\",\"vogue\",\"wardrobe\",\"watch\",\"wedge\",\"wool\",\"woven\",\"wrap\"];var y=[\"almond\",\"apple\",\"apricot\",\"artichoke\",\"asparagus\",\"avocado\",\"bacon\",\"bagel\",\"barley\",\"basil\",\"bean\",\"beef\",\"beet\",\"berry\",\"biscuit\",\"blueberry\",\"bread\",\"broccoli\",\"brusselsprout\",\"bun\",\"butter\",\"cabbage\",\"cake\",\"candy\",\"cantaloupe\",\"caramel\",\"carrot\",\"cashew\",\"cauliflower\",\"caviar\",\"celery\",\"cheese\",\"chickpea\",\"chili\",\"chocolate\",\"chutney\",\"cider\",\"cinnamon\",\"citrus\",\"clam\",\"cocoa\",\"coconut\",\"coffee\",\"cookie\",\"corn\",\"cranberry\",\"cupcake\",\"currant\",\"curry\",\"date\",\"dill\",\"doughnut\",\"egg\",\"eggplant\",\"endive\",\"fennel\",\"fig\",\"flour\",\"garlic\",\"gelatin\",\"ginger\",\"grape\",\"grapefruit\",\"gravy\",\"greenbean\",\"guava\",\"halibut\",\"ham\",\"hamburger\",\"hazelnut\",\"honey\",\"honeydew\",\"horseradish\",\"iceberg\",\"jalapeno\",\"jam\",\"jelly\",\"kale\",\"ketchup\",\"kiwi\",\"lamb\",\"leek\",\"lemon\",\"lentil\",\"lettuce\",\"lime\",\"lychee\",\"macadamia\",\"macaroni\",\"mango\",\"maple\",\"margarine\",\"mayonnaise\",\"milk\",\"mint\",\"molasses\",\"muffin\",\"mushroom\",\"mustard\",\"nectarine\",\"noodle\",\"nutmeg\",\"oat\",\"olive\",\"onion\",\"orange\",\"oregano\",\"pancake\",\"papaya\",\"parsley\",\"parsnip\",\"pasta\",\"peach\",\"peanut\",\"pear\",\"pecan\",\"pepper\",\"persimmon\",\"pickle\",\"pie\",\"pineapple\",\"pistachio\",\"plum\",\"pomegranate\",\"popcorn\",\"pork\",\"potato\",\"pretzel\",\"prune\",\"pudding\",\"pumpkin\",\"quince\",\"radicchio\",\"radish\",\"raisin\",\"raspberry\",\"ravioli\",\"relish\",\"rhubarb\",\"rice\",\"rosemary\",\"rye\",\"sage\",\"salad\",\"salami\",\"salmon\",\"salsa\",\"salt\",\"sandwich\",\"scallop\",\"seaweed\",\"slaw\",\"sorbet\",\"soy\",\"spaghetti\",\"spinach\",\"squash\",\"steak\",\"strawberry\",\"sundae\",\"sushi\",\"taco\",\"tangerine\",\"tart\",\"tea\",\"thyme\",\"toast\",\"tomato\",\"trout\",\"tuna\",\"turkey\",\"turnip\",\"vanilla\",\"veal\",\"venison\",\"vinegar\",\"waffle\",\"walnut\",\"watercress\",\"watermelon\",\"wheat\",\"whipped\",\"wine\",\"yam\",\"yogurt\",\"zucchini\"];var f=[\"academia\",\"accomplishment\",\"achievement\",\"advancement\",\"ancestor\",\"ancient\",\"anthropology\",\"antiquarian\",\"antique\",\"archaeology\",\"archive\",\"aristocracy\",\"bronze\",\"bygone\",\"calendar\",\"cartography\",\"castle\",\"cathedral\",\"century\",\"ceremony\",\"chronicle\",\"chronographer\",\"citadel\",\"civilization\",\"coins\",\"commemoration\",\"compilation\",\"conquest\",\"conservation\",\"coronation\",\"culture\",\"cuneiform\",\"customs\",\"decade\",\"decree\",\"deeds\",\"diplomacy\",\"discovery\",\"document\",\"dynasty\",\"edict\",\"encyclopedia\",\"eon\",\"epoch\",\"era\",\"events\",\"excavation\",\"exhibit\",\"expedition\",\"exploration\",\"feudal\",\"fossil\",\"founder\",\"genealogy\",\"generation\",\"golden\",\"governance\",\"heraldry\",\"heritage\",\"hieratic\",\"hieroglyphs\",\"history\",\"imperial\",\"inscription\",\"institute\",\"invention\",\"journal\",\"kingdom\",\"knowledge\",\"landmark\",\"legacy\",\"lineage\",\"lore\",\"medieval\",\"memorabilia\",\"memorial\",\"memories\",\"methodology\",\"migration\",\"millennium\",\"monarchy\",\"monastery\",\"monument\",\"mummy\",\"mythology\",\"nation\",\"nobility\",\"nostalgia\",\"origin\",\"palace\",\"paleography\",\"paleontology\",\"papyrus\",\"parchment\",\"past\",\"patriarch\",\"periodization\",\"pharaoh\",\"pilgrimage\",\"prehistoric\",\"preservation\",\"primary\",\"progeny\",\"progress\",\"pyramid\",\"realm\",\"reconstruction\",\"record\",\"reign\",\"relic\",\"remembrance\",\"repository\",\"research\",\"revolution\",\"royal\",\"ruins\",\"scholar\",\"scroll\",\"secondary\",\"settlement\",\"society\",\"stone\",\"storytelling\",\"tapestry\",\"temple\",\"throne\",\"timeline\",\"tradition\",\"treaty\",\"university\",\"vellum\"];var v=[\"allegory\",\"alliteration\",\"allusion\",\"almanac\",\"analogy\",\"anecdote\",\"annotation\",\"antagonist\",\"anthology\",\"antihero\",\"aphorism\",\"appendix\",\"archetype\",\"assonance\",\"autobiography\",\"ballad\",\"bibliography\",\"bildungsroman\",\"biography\",\"blurb\",\"bookmark\",\"canon\",\"canto\",\"caricature\",\"catharsis\",\"chapter\",\"characterization\",\"chronology\",\"cliche\",\"codex\",\"comedy\",\"commentary\",\"conflict\",\"connotation\",\"consonance\",\"couplet\",\"dedication\",\"denouement\",\"deus\",\"dialect\",\"dialogue\",\"diary\",\"diction\",\"didactic\",\"drama\",\"dramatis\",\"dystopia\",\"editorial\",\"elegy\",\"ellipsis\",\"enigma\",\"enjambment\",\"epilogue\",\"epiphany\",\"epistolary\",\"epitaph\",\"epithet\",\"essay\",\"euphemism\",\"excerpt\",\"exposition\",\"fable\",\"fairytale\",\"fantasy\",\"farce\",\"fiction\",\"figurative\",\"flashback\",\"flashforward\",\"foil\",\"folklore\",\"footnote\",\"foreshadowing\",\"foreword\",\"frame\",\"genre\",\"glossary\",\"haiku\",\"hardcover\",\"heroine\",\"hubris\",\"hyperbole\",\"idiom\",\"imagery\",\"index\",\"intertextuality\",\"introduction\",\"invective\",\"irony\",\"jargon\",\"juxtaposition\",\"legend\",\"leitmotif\",\"libretto\",\"limerick\",\"literary\",\"literature\",\"litotes\",\"lyric\",\"manuscript\",\"memoir\",\"metaphor\",\"meter\",\"metonymy\",\"monograph\",\"monologue\",\"mood\",\"motif\",\"mystery\",\"narration\",\"narrative\",\"narrator\",\"nonfiction\",\"novella\",\"ode\",\"omniscient\",\"onomatopoeia\",\"opus\",\"oxymoron\",\"parable\",\"paradox\",\"paragraph\",\"parody\",\"passage\",\"pastiche\",\"pastoral\",\"pathetic\",\"pentameter\",\"persona\",\"personification\",\"plot\",\"poem\",\"poetics\",\"poetry\",\"point\",\"postscript\",\"preface\",\"premise\",\"prologue\",\"propaganda\",\"prose\",\"protagonist\",\"pseudonym\",\"publisher\",\"quatrain\",\"quest\",\"quotation\",\"reader\",\"realism\",\"refrain\",\"resolution\",\"rhetoric\",\"rhyme\",\"rhythm\",\"romance\",\"saga\",\"sarcasm\",\"satire\",\"scene\",\"scribe\",\"sequel\",\"serial\",\"setting\",\"simile\",\"soliloquy\",\"sonnet\",\"stanza\",\"storyline\",\"stream\",\"structure\",\"style\",\"subplot\",\"subtext\",\"summary\",\"suspense\",\"symbol\",\"symbolism\",\"synopsis\",\"syntax\",\"tale\",\"tanka\",\"text\",\"theme\",\"thesis\",\"thriller\",\"title\",\"tome\",\"tone\",\"tragedy\",\"trope\",\"understatement\",\"utopia\",\"verse\",\"vignette\",\"villain\",\"voice\",\"wordplay\"];var k=[\"accordion\",\"acoustic\",\"adagio\",\"allegro\",\"alto\",\"amplifier\",\"andante\",\"anthem\",\"aria\",\"arpeggio\",\"arrangement\",\"band\",\"banjo\",\"baritone\",\"bass\",\"bassoon\",\"baton\",\"beat\",\"bell\",\"blues\",\"bongo\",\"brass\",\"cadence\",\"cantata\",\"capriccio\",\"cello\",\"chimes\",\"chorale\",\"chord\",\"chorus\",\"clarinet\",\"clef\",\"coda\",\"composer\",\"concert\",\"concerto\",\"conductor\",\"counterpoint\",\"crescendo\",\"cymbal\",\"decrescendo\",\"ditty\",\"drum\",\"duet\",\"dynamics\",\"etude\",\"euphonium\",\"falsetto\",\"fanfare\",\"fermata\",\"fiddler\",\"flute\",\"folk\",\"forte\",\"fortissimo\",\"fretboard\",\"fugue\",\"glissando\",\"glockenspiel\",\"gospel\",\"groove\",\"guitar\",\"harmonica\",\"harmonics\",\"harp\",\"harpsichord\",\"horn\",\"hymn\",\"improvisation\",\"instrument\",\"interlude\",\"interval\",\"jazz\",\"jingle\",\"key\",\"keyboard\",\"legato\",\"lullaby\",\"lute\",\"madrigal\",\"maestro\",\"major\",\"mandolin\",\"march\",\"measure\",\"melody\",\"metronome\",\"microphone\",\"minuet\",\"musical\",\"musicianship\",\"nocturne\",\"oboe\",\"octave\",\"opera\",\"oratorio\",\"orchestra\",\"orchestration\",\"organ\",\"ostinato\",\"overture\",\"panpipes\",\"percussion\",\"piano\",\"piccolo\",\"pitch\",\"pizzicato\",\"polka\",\"prelude\",\"quartet\",\"quintet\",\"recital\",\"recorder\",\"requiem\",\"rhapsody\",\"riff\",\"rondo\",\"samba\",\"scale\",\"score\",\"serenade\",\"sharp\",\"singer\",\"solfege\",\"solo\",\"sonata\",\"song\",\"sonorous\",\"soprano\",\"staccato\",\"staff\",\"strings\",\"suite\",\"symphony\",\"syncopation\",\"tambourine\",\"tango\",\"tempo\",\"tenor\",\"timbre\",\"tonality\",\"treble\",\"triad\",\"trill\",\"trio\",\"trombone\",\"trumpet\",\"tune\",\"tuner\",\"ukulele\",\"unison\",\"variation\",\"vibrato\",\"viola\",\"violin\",\"vivace\",\"vocalise\",\"waltz\",\"woodwind\",\"xylophone\",\"yodel\",\"zither\"];var w=[\"achilles\",\"aeolus\",\"aesculapius\",\"aether\",\"agamemnon\",\"ajax\",\"amalthea\",\"ambrosia\",\"amphitrite\",\"andromeda\",\"antaeus\",\"antigone\",\"apollo\",\"aquilo\",\"ares\",\"argo\",\"argus\",\"ariadne\",\"artemis\",\"asclepius\",\"athena\",\"atlas\",\"atropos\",\"aurora\",\"bacchus\",\"bellerophon\",\"bellona\",\"boreas\",\"briseis\",\"cadmus\",\"calliope\",\"calypso\",\"cassandra\",\"cassiopeia\",\"castor\",\"centaurs\",\"cerberus\",\"ceres\",\"chaos\",\"charon\",\"charybdis\",\"chimera\",\"clio\",\"clotho\",\"cupid\",\"cybele\",\"cynthia\",\"daedalus\",\"daphne\",\"diana\",\"dido\",\"diomedes\",\"dionysus\",\"dryads\",\"egeria\",\"electra\",\"elysium\",\"endymion\",\"eos\",\"eris\",\"europa\",\"eurydice\",\"euterpe\",\"fates\",\"faunus\",\"flora\",\"fortuna\",\"gaea\",\"galatea\",\"ganymede\",\"gorgons\",\"graces\",\"griffin\",\"hector\",\"helios\",\"hephaestus\",\"hera\",\"hercules\",\"hermes\",\"hero\",\"hestia\",\"hydra\",\"hyperion\",\"icarus\",\"io\",\"iris\",\"janus\",\"jason\",\"juno\",\"jupiter\",\"lachesis\",\"leda\",\"leto\",\"liber\",\"maenads\",\"mars\",\"medea\",\"medusa\",\"melampus\",\"memnon\",\"mercury\",\"midas\",\"minerva\",\"minos\",\"minotaur\",\"moirae\",\"momus\",\"morpheus\",\"muses\",\"nemesis\",\"neptune\",\"nereus\",\"nike\",\"nymphs\",\"odysseus\",\"olympus\",\"orion\",\"orpheus\",\"pallas\",\"pan\",\"pandora\",\"paris\",\"pegasus\",\"penelope\",\"persephone\",\"perseus\",\"phaedra\",\"phaeton\",\"phoebe\",\"phoenix\",\"pluto\",\"pollux\",\"polyphemus\",\"poseidon\",\"priam\",\"prometheus\",\"proserpina\",\"proteus\",\"psyche\",\"pygmalion\",\"python\",\"romulus\",\"saturn\",\"scylla\",\"selene\",\"sibyl\",\"silenus\",\"sol\",\"sphinx\",\"styx\",\"tartarus\",\"terpsichore\",\"theseus\",\"thetis\",\"thisbe\",\"tiresias\",\"titan\",\"triton\",\"troy\",\"venus\",\"vesta\",\"vulcan\",\"zephyr\",\"zeus\"];var x=[\"acacia\",\"acorn\",\"alder\",\"alpine\",\"amaryllis\",\"amethyst\",\"anemone\",\"aquamarine\",\"arboretum\",\"aspen\",\"autumn\",\"avalanche\",\"azalea\",\"bamboo\",\"banyan\",\"baobab\",\"bark\",\"basalt\",\"beach\",\"beech\",\"birch\",\"blossom\",\"bluff\",\"bog\",\"boulder\",\"bracken\",\"branch\",\"breeze\",\"briar\",\"brook\",\"buckeye\",\"bud\",\"butte\",\"cactus\",\"camellia\",\"canyon\",\"carnation\",\"cascade\",\"cave\",\"cedar\",\"chamomile\",\"chestnut\",\"chrysanthemum\",\"citrine\",\"cliff\",\"cloud\",\"clover\",\"coast\",\"conifer\",\"coral\",\"cove\",\"creek\",\"crystal\",\"cypress\",\"dahlia\",\"dandelion\",\"dawn\",\"delta\",\"desert\",\"dew\",\"driftwood\",\"dune\",\"earth\",\"eclipse\",\"ecosystem\",\"elm\",\"emerald\",\"eucalyptus\",\"everglades\",\"evergreen\",\"fern\",\"firefly\",\"fjord\",\"flint\",\"flower\",\"fog\",\"foothill\",\"forest\",\"galaxy\",\"garden\",\"geyser\",\"ginkgo\",\"glacier\",\"glade\",\"gorge\",\"granite\",\"grass\",\"grotto\",\"grove\",\"harbor\",\"harvest\",\"haze\",\"hazel\",\"heath\",\"heather\",\"hemlock\",\"hibiscus\",\"hill\",\"holly\",\"honeysuckle\",\"horizon\",\"hyacinth\",\"island\",\"ivy\",\"jasmine\",\"jungle\",\"juniper\",\"kelp\",\"lagoon\",\"lake\",\"lavender\",\"leaf\",\"lichen\",\"lighthouse\",\"lilac\",\"lily\",\"lotus\",\"magnolia\",\"mangrove\",\"marigold\",\"marsh\",\"meadow\",\"meteor\",\"mimosa\",\"mist\",\"monsoon\",\"moon\",\"moonstone\",\"moss\",\"mountain\",\"nest\",\"oak\",\"oasis\",\"ocean\",\"opal\",\"orchard\",\"orchid\",\"palm\",\"pampas\",\"pebble\",\"peony\",\"petal\",\"phlox\",\"pine\",\"planet\",\"plateau\",\"pond\",\"poppy\",\"prairie\",\"primrose\",\"quartz\",\"rainbow\",\"raindrop\",\"rainforest\",\"redwood\",\"reef\",\"rhododendron\",\"river\",\"rock\",\"rose\",\"sand\",\"sapphire\",\"savanna\",\"sea\",\"seashell\",\"seed\",\"sequoia\",\"shore\",\"sky\",\"snapdragon\",\"snowdrop\",\"snowflake\",\"spring\",\"sprout\",\"spruce\",\"star\",\"steppe\",\"summit\",\"sun\",\"sunbeam\",\"sunflower\",\"sunrise\",\"sunset\",\"sycamore\",\"taiga\",\"thistle\",\"tide\",\"topaz\",\"tree\",\"tulip\",\"tundra\",\"valley\",\"violet\",\"volcano\",\"waterfall\",\"wave\",\"willow\",\"wind\",\"wisteria\",\"woodland\",\"yucca\",\"zinnia\"];var j=[\"accountant\",\"acrobat\",\"actuary\",\"administrator\",\"advisor\",\"advocate\",\"agronomist\",\"analyst\",\"animator\",\"anthropologist\",\"appraiser\",\"apprentice\",\"arbitrator\",\"archaeologist\",\"architect\",\"archivist\",\"astronomer\",\"attorney\",\"auctioneer\",\"auditor\",\"author\",\"baker\",\"banker\",\"barber\",\"barista\",\"bartender\",\"biologist\",\"blacksmith\",\"blogger\",\"bookkeeper\",\"botanist\",\"brewer\",\"broadcaster\",\"broker\",\"builder\",\"butcher\",\"buyer\",\"cabinetmaker\",\"calligrapher\",\"caregiver\",\"carpenter\",\"cartographer\",\"cashier\",\"caterer\",\"chemist\",\"chiropractor\",\"cinematographer\",\"clerk\",\"cobbler\",\"columnist\",\"comedian\",\"commissioner\",\"consultant\",\"contractor\",\"copywriter\",\"coroner\",\"correspondent\",\"counselor\",\"courier\",\"craftsman\",\"critic\",\"cryptographer\",\"custodian\",\"dancer\",\"dealer\",\"dentist\",\"dermatologist\",\"designer\",\"detective\",\"developer\",\"dietitian\",\"diplomat\",\"director\",\"dispatcher\",\"diver\",\"doctor\",\"doorman\",\"drafter\",\"dramatist\",\"driver\",\"ecologist\",\"economist\",\"editor\",\"educator\",\"electrician\",\"embalmer\",\"engineer\",\"engraver\",\"entrepreneur\",\"epidemiologist\",\"essayist\",\"estimator\",\"ethnographer\",\"evangelist\",\"examiner\",\"executive\",\"explorer\",\"exporter\",\"fabricator\",\"facilitator\",\"farmer\",\"financier\",\"firefighter\",\"fisherman\",\"florist\",\"foreman\",\"forester\",\"fundraiser\",\"gamekeeper\",\"gardener\",\"gemologist\",\"geneticist\",\"geographer\",\"geologist\",\"glazier\",\"goldsmith\",\"governor\",\"grocer\",\"groundskeeper\",\"guide\",\"hairdresser\",\"handyman\",\"herbalist\",\"historian\",\"host\",\"housekeeper\",\"illustrator\",\"importer\",\"inspector\",\"instructor\",\"interpreter\",\"interviewer\",\"inventor\",\"investigator\",\"ironworker\",\"jeweler\",\"journalist\",\"judge\",\"laborer\",\"landscaper\",\"lawyer\",\"lecturer\",\"librarian\",\"lifeguard\",\"linguist\",\"lithographer\",\"lobbyist\",\"locksmith\",\"machinist\",\"magician\",\"magistrate\",\"manager\",\"manufacturer\",\"marketer\",\"mason\",\"mathematician\",\"mechanic\",\"mediator\",\"meteorologist\",\"midwife\",\"milliner\",\"miner\",\"minister\",\"model\",\"mortician\",\"musician\",\"nanny\",\"navigator\",\"negotiator\",\"neurologist\",\"notary\",\"novelist\",\"nurse\",\"nutritionist\",\"obstetrician\",\"oceanographer\",\"oncologist\",\"operator\",\"ophthalmologist\",\"optician\",\"optometrist\",\"orator\",\"ornithologist\",\"orthodontist\",\"painter\",\"paleontologist\",\"paralegal\",\"paramedic\",\"pathologist\",\"pediatrician\",\"perfumer\",\"pharmacist\",\"philosopher\",\"photographer\",\"physician\",\"physicist\",\"physiotherapist\",\"pilot\",\"plasterer\",\"playwright\",\"plumber\",\"podiatrist\",\"poet\",\"politician\",\"porter\",\"potter\",\"preacher\",\"principal\",\"printer\",\"producer\",\"professor\",\"programmer\",\"promoter\",\"proofreader\",\"prosecutor\",\"prosthetist\",\"psychiatrist\",\"psychologist\",\"publicist\",\"puppeteer\",\"rabbi\",\"radiologist\",\"rancher\",\"realtor\",\"receptionist\",\"recruiter\",\"registrar\",\"reporter\",\"researcher\",\"retailer\",\"roofer\",\"sailor\",\"salesperson\",\"sanitarian\",\"scientist\",\"screenwriter\",\"sculptor\",\"secretary\",\"senator\",\"server\",\"shepherd\",\"sheriff\",\"sociologist\",\"soldier\",\"sommelier\",\"speechwriter\",\"spokesperson\",\"statistician\",\"stockbroker\",\"stonemason\",\"strategist\",\"stylist\",\"superintendent\",\"supervisor\",\"supplier\",\"surgeon\",\"surveyor\",\"tailor\",\"taxidermist\",\"teacher\",\"technician\",\"therapist\",\"tiler\",\"toxicologist\",\"trader\",\"translator\",\"treasurer\",\"tutor\",\"typist\",\"underwriter\",\"upholsterer\",\"urologist\",\"usher\",\"valet\",\"vendor\",\"veterinarian\",\"videographer\",\"vintner\",\"virologist\",\"volunteer\",\"waiter\",\"warden\",\"weaver\",\"welder\",\"wholesaler\",\"woodworker\",\"writer\",\"zoologist\"];var z=[\"acceleration\",\"acid\",\"alkaline\",\"allele\",\"alloy\",\"amoeba\",\"amplitude\",\"anatomy\",\"antibiotic\",\"antibody\",\"antigen\",\"antioxidant\",\"aqueous\",\"assay\",\"atom\",\"atomic\",\"bacteria\",\"barometer\",\"base\",\"beaker\",\"biome\",\"biopsy\",\"biosynthesis\",\"bond\",\"botany\",\"calibration\",\"capillary\",\"carbohydrate\",\"carbon\",\"catalyst\",\"cathode\",\"cell\",\"cellular\",\"centrifuge\",\"chlorophyll\",\"chromosome\",\"circuit\",\"coagulation\",\"coefficient\",\"colloid\",\"combustion\",\"compound\",\"condensation\",\"conductivity\",\"covalent\",\"cytoplasm\",\"data\",\"decay\",\"decomposition\",\"density\",\"diffusion\",\"dilution\",\"dipole\",\"dissection\",\"dissolution\",\"distillation\",\"dna\",\"electrode\",\"electrolyte\",\"electron\",\"element\",\"embryo\",\"emission\",\"endothermic\",\"enzyme\",\"equation\",\"equilibrium\",\"evaporation\",\"evolution\",\"exothermic\",\"experiment\",\"exponential\",\"fermentation\",\"filament\",\"filtration\",\"fission\",\"flask\",\"formula\",\"frequency\",\"friction\",\"fungus\",\"fusion\",\"gamete\",\"gas\",\"gene\",\"genome\",\"geology\",\"geothermal\",\"germ\",\"glucose\",\"gradient\",\"gravitational\",\"halogen\",\"heredity\",\"hormone\",\"hybrid\",\"hydrogen\",\"hydrolysis\",\"hypothesis\",\"immunity\",\"induction\",\"inertia\",\"inoculation\",\"insulation\",\"ion\",\"isomer\",\"laboratory\",\"laser\",\"latent\",\"lattice\",\"lens\",\"lipid\",\"liquid\",\"locus\",\"magnet\",\"magnetic\",\"magnetism\",\"mass\",\"membrane\",\"metabolism\",\"metallurgy\",\"microscope\",\"mitochondria\",\"mitosis\",\"molecular\",\"molecule\",\"momentum\",\"monomer\",\"morphology\",\"mutation\",\"neuron\",\"neutralization\",\"nitrogen\",\"nutrient\",\"observation\",\"optics\",\"orbital\",\"organic\",\"oscillation\",\"osmosis\",\"oxidation\",\"oxygen\",\"ozone\",\"parasite\",\"particle\",\"pathogen\",\"peptide\",\"periodic\",\"permeability\",\"petri\",\"phenotype\",\"phosphate\",\"photosynthesis\",\"physics\",\"pipette\",\"plankton\",\"polymer\",\"potential\",\"precipitate\",\"pressure\",\"prism\",\"prokaryote\",\"protein\",\"quantum\",\"radioactive\",\"reactant\",\"reaction\",\"reagent\",\"receptor\",\"recessive\",\"reduction\",\"reflection\",\"refraction\",\"replication\",\"resistance\",\"resonance\",\"respiration\",\"ribosome\",\"rna\",\"salinity\",\"saturated\",\"sediment\",\"semiconductor\",\"serum\",\"solid\",\"solubility\",\"solute\",\"solution\",\"solvent\",\"speciation\",\"specimen\",\"spectrometer\",\"spore\",\"stimulus\",\"stoichiometry\",\"substrate\",\"suspension\",\"symbiosis\",\"synthesis\",\"taxonomy\",\"temperature\",\"theorem\",\"theory\",\"thermal\",\"thermodynamics\",\"titration\",\"tissue\",\"toxin\",\"transcription\",\"translation\",\"transmitter\",\"ultraviolet\",\"valence\",\"vapor\",\"variable\",\"vector\",\"velocity\",\"virus\",\"viscosity\",\"voltage\",\"volume\",\"wavelength\",\"zoology\"];var q=[\"aperture\",\"apogee\",\"asterism\",\"asteroid\",\"astrology\",\"astronaut\",\"astronomy\",\"atmosphere\",\"axis\",\"betelgeuse\",\"bigbang\",\"binary\",\"bolide\",\"canopus\",\"capsule\",\"celestial\",\"centauri\",\"centaurus\",\"cepheid\",\"cetus\",\"chiron\",\"cluster\",\"comet\",\"constellation\",\"copernicus\",\"corona\",\"cosmic\",\"cosmonaut\",\"crater\",\"cygnus\",\"draco\",\"dwarf\",\"einstein\",\"equinox\",\"eridanus\",\"exoplanet\",\"fermi\",\"galactic\",\"galileo\",\"gemini\",\"gravity\",\"hades\",\"halley\",\"heliocentric\",\"hubble\",\"hypernova\",\"infrared\",\"interstellar\",\"isotope\",\"jansky\",\"kbo\",\"kepler\",\"kuiper\",\"laplace\",\"larissa\",\"libration\",\"lightyear\",\"lunar\",\"lyra\",\"magnetar\",\"messier\",\"meteorite\",\"meteoroid\",\"milkyway\",\"mimas\",\"nadir\",\"naiad\",\"nebula\",\"nereid\",\"neutron\",\"nix\",\"nova\",\"nucleus\",\"oberon\",\"occultation\",\"oort\",\"orbit\",\"parsec\",\"perigee\",\"perihelion\",\"perseid\",\"phobos\",\"photon\",\"pioneer\",\"plasma\",\"polar\",\"polaris\",\"proton\",\"puck\",\"pulsar\",\"quasar\",\"radar\",\"radiation\",\"radioscope\",\"retrograde\",\"rocket\",\"sagittarius\",\"satellite\",\"satyr\",\"sideral\",\"sirius\",\"skylab\",\"solar\",\"solstice\",\"space\",\"spaceship\",\"spectrum\",\"starlight\",\"starship\",\"stellar\",\"supernova\",\"taurid\",\"telescope\",\"tethys\",\"thule\",\"titania\",\"ufo\",\"ulysses\",\"umbra\",\"universe\",\"uranus\",\"ursa\",\"vacuum\",\"vega\",\"vernal\",\"voyager\",\"wormhole\",\"xenon\",\"yttrium\",\"zenith\",\"zodiac\"];var E=[\"aerobics\",\"archery\",\"athlete\",\"backstroke\",\"badminton\",\"baseball\",\"basketball\",\"bench\",\"biathlon\",\"billiards\",\"birdie\",\"bobsled\",\"bocce\",\"bogey\",\"bowling\",\"boxing\",\"captain\",\"champion\",\"cheerleading\",\"cleats\",\"climbing\",\"competition\",\"court\",\"crawl\",\"croquet\",\"curling\",\"cycling\",\"darts\",\"decathlon\",\"defense\",\"diving\",\"dodgeball\",\"dribble\",\"dugout\",\"dunk\",\"equestrian\",\"fairway\",\"fencing\",\"field\",\"fitness\",\"football\",\"freestyle\",\"futsal\",\"goal\",\"goalie\",\"goalkeeper\",\"golf\",\"gymnastics\",\"halftime\",\"handball\",\"heptathlon\",\"hiking\",\"hockey\",\"hurdles\",\"javelin\",\"jersey\",\"jogging\",\"judo\",\"karate\",\"kickball\",\"kickboxing\",\"lacrosse\",\"league\",\"luge\",\"marathon\",\"medal\",\"medalist\",\"medley\",\"midfielder\",\"netball\",\"offense\",\"olympics\",\"overtime\",\"paddleboarding\",\"paintball\",\"par\",\"parkour\",\"passing\",\"penalty\",\"pentathlon\",\"pickleball\",\"pilates\",\"pingpong\",\"playoff\",\"podium\",\"polo\",\"qualifier\",\"racket\",\"racquetball\",\"rally\",\"rebounding\",\"referee\",\"relay\",\"rink\",\"rowing\",\"rugby\",\"running\",\"sailing\",\"scoreboard\",\"scoring\",\"scrimmage\",\"serve\",\"shot\",\"sideline\",\"skating\",\"skeleton\",\"skiing\",\"slalom\",\"sled\",\"snooker\",\"snowboarding\",\"soccer\",\"softball\",\"sparring\",\"speedskating\",\"spike\",\"sprint\",\"stadium\",\"steeplechase\",\"striker\",\"surfing\",\"swimming\",\"table\",\"tackling\",\"taekwondo\",\"teammate\",\"tennis\",\"throwing\",\"timeout\",\"tournament\",\"track\",\"trainer\",\"trampolining\",\"triathlete\",\"triathlon\",\"trophy\",\"tryout\",\"tumbling\",\"umpire\",\"varsity\",\"victory\",\"volleyball\",\"wakeboarding\",\"walking\",\"warmup\",\"waterpolo\",\"weightlifting\",\"wicket\",\"windsurfing\",\"workout\",\"wrestling\",\"yoga\",\"zone\",\"zumba\"];var N=[\"aircraft\",\"airliner\",\"airplane\",\"airport\",\"ambulance\",\"amphibious\",\"armored\",\"autobus\",\"automobile\",\"aviation\",\"balloon\",\"barge\",\"biplane\",\"boat\",\"boxcar\",\"buggy\",\"bullet\",\"bus\",\"cab\",\"cable\",\"caboose\",\"camper\",\"canoe\",\"caravan\",\"cargo\",\"carriage\",\"carrier\",\"cart\",\"catamaran\",\"chairlift\",\"chariot\",\"chopper\",\"clipper\",\"coach\",\"cockpit\",\"commuter\",\"convertible\",\"coupe\",\"cruiser\",\"deckboat\",\"delivery\",\"diesel\",\"dinghy\",\"dirigible\",\"dolly\",\"draisine\",\"dray\",\"drifter\",\"engine\",\"express\",\"ferry\",\"flatbed\",\"fleet\",\"floatplane\",\"flyover\",\"freighter\",\"fuselage\",\"galleon\",\"galley\",\"glider\",\"gondola\",\"gunboat\",\"gyrocopter\",\"hangar\",\"hatchback\",\"hauler\",\"hearse\",\"helicopter\",\"highway\",\"hopper\",\"houseboat\",\"hovercraft\",\"hydrofoil\",\"hydroplane\",\"icebreaker\",\"inflatable\",\"interstate\",\"jet\",\"jetliner\",\"jetpack\",\"jetski\",\"jitney\",\"junction\",\"kayak\",\"ketch\",\"landau\",\"landing\",\"launch\",\"lifeboat\",\"limousine\",\"liner\",\"locomotive\",\"maglev\",\"metro\",\"minibus\",\"minivan\",\"moped\",\"monorail\",\"mooring\",\"motorbike\",\"motorboat\",\"motorcycle\",\"motorhome\",\"narrowboat\",\"outboard\",\"outrigger\",\"paddleboat\",\"parachute\",\"parasail\",\"passenger\",\"patrol\",\"pedalo\",\"pickup\",\"pier\",\"pontoon\",\"propeller\",\"pullman\",\"quadcopter\",\"raft\",\"railcar\",\"railroad\",\"railway\",\"rickshaw\",\"roadster\",\"ropeway\",\"rotorcraft\",\"rowboat\",\"runway\",\"sailboat\",\"schooner\",\"scooter\",\"seaplane\",\"sedan\",\"semitrailer\",\"ship\",\"shuttle\",\"skateboard\",\"skiff\",\"sleigh\",\"snowmobile\",\"speedboat\",\"station\",\"steamboat\",\"steamer\",\"steamship\",\"streetcar\",\"submarine\",\"subwaycar\",\"tandem\",\"tanker\",\"taxi\",\"taxicab\",\"tender\",\"terminal\",\"tiller\",\"toboggan\",\"tractor\",\"trailer\",\"train\",\"tram\",\"tramcar\",\"tramway\",\"transport\",\"trawler\",\"tricycle\",\"trolley\",\"trolleybus\",\"truck\",\"tugboat\",\"turboprop\",\"ultralight\",\"unicycle\",\"van\",\"vehicle\",\"vessel\",\"wagon\",\"watercraft\",\"wharf\",\"wheelbarrow\",\"windjammer\",\"yacht\",\"yawl\",\"zeppelin\"];var T=2,B=[...p,...h],O=[u,m,d,g,b,y,f,v,k,w,x,j,z,q,E,N],n=a=>a[Math.floor(Math.random()*a.length)],L=(a,e,r)=>{if(a<2)throw new Error(\"Need at least 2 words\");if(!e)throw new Error(\"Need a separator\");if(r!==void 0&&(!Number.isInteger(r)||r<=0))throw new Error(\"maxLength must be a positive integer\")},s=(a,e)=>{let r=n(O),i=e===void 0?r:r.filter(t=>t.length<=e);if(i.length===0)return s(a,e);let o=n(i);return a.includes(o)?s(a,e):o},Q=(a,e)=>{let r=[n(B)];for(let i=1;i<a;i+=1)r.push(s(r));return r.join(e)},I=(a,e,r)=>new Error(`maxLength ${a} is too short to generate ${e} segments with separator \"${r}\"`),X=(a,e)=>{let r=a-(e-1)*T,i=B.filter(o=>o.length<=r);return i.length===0?void 0:n(i)},Z=(a,e,r)=>{let i=e-r*T;return O.flat().some(t=>t.length<=i)?s(a,i):void 0},ee=(a,e,r,i,o)=>{let t=r;for(let l=1;l<e;l+=1){let c=Z(a,t,e-l-1);if(!c)throw I(i,e,o);a.push(c),t-=c.length}return t},ae=(a,e,r)=>{let i=r-(a-1)*e.length,o=X(i,a);if(!o)throw I(r,a,e);let t=[o];return ee(t,a,i-o.length,r,e),t.join(e)},Pe=(a={})=>{let{maxLength:e,segments:r=2,separator:i=\"-\"}=a;return L(r,i,e),e===void 0?Q(r,i):ae(r,i,e)};export{Pe as joyful};\n","import { select, isCancel, cancel } from '@clack/prompts';\nimport { SUPPORTED_TOOLS, BASE_PROFILE_SLUG } from '../types/index.js';\nimport { ConfigManager } from './config.js';\n\nexport async function promptForAgent(message = 'Select an agent:'): Promise<string> {\n const options = Object.entries(SUPPORTED_TOOLS).map(([key, tool]) => ({\n value: key,\n label: tool.description,\n hint: key,\n }));\n\n const response = await select({\n message,\n options,\n });\n\n if (isCancel(response)) {\n cancel('Operation cancelled.');\n process.exit(0);\n }\n\n return response as string;\n}\n\nexport async function promptForProfile(\n config: ConfigManager,\n agent: string,\n message = 'Select a profile:'\n): Promise<string | null> {\n const profiles = await config.getProfiles(agent);\n\n if (profiles.length === 0) {\n return null;\n }\n\n const activeProfile = await config.getActiveProfile(agent);\n\n const response = await select({\n message,\n options: profiles.map((p) => {\n let label = p.name;\n let hint = p.description;\n\n // Mark active profile\n if (p.slug === activeProfile) {\n label = `● ${label}`;\n }\n\n // Label _base profile\n if (p.slug === BASE_PROFILE_SLUG) {\n hint = 'Base profile';\n }\n\n return {\n value: p.slug,\n label,\n hint,\n };\n }),\n });\n\n if (isCancel(response)) {\n cancel('Operation cancelled.');\n process.exit(0);\n }\n\n return response as string;\n}\n","import { defineCommand } from 'citty';\nimport { outro, text, isCancel, cancel, confirm } from '@clack/prompts';\nimport { ConfigManager } from '../lib/config.js';\nimport { SUPPORTED_TOOLS, BASE_PROFILE_SLUG } from '../types/index.js';\nimport color from 'picocolors';\nimport { validateNewProfileName, slugify } from '../lib/validation.js';\nimport { joyful } from 'joyful';\nimport { promptForAgent } from '../lib/prompts.js';\nimport { copyDirectory } from '../lib/symlink.js';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\n\nexport async function addCommand(agent?: string, name?: string, from?: string) {\n let resolvedAgent = agent;\n\n if (!resolvedAgent) {\n resolvedAgent = await promptForAgent('Select agent to create profile for:');\n }\n\n if (!SUPPORTED_TOOLS[resolvedAgent]) {\n console.error(color.red(`Unsupported agent: ${resolvedAgent}`));\n process.exit(1);\n }\n\n if (!name) {\n const suggestedName = joyful();\n const response = await text({\n message: 'Enter profile name:',\n placeholder: suggestedName,\n initialValue: suggestedName,\n validate(value) {\n if (!value) return 'Profile name is required.';\n return validateNewProfileName(value) || undefined;\n },\n });\n\n if (isCancel(response)) {\n cancel('Operation cancelled.');\n process.exit(0);\n }\n name = response;\n }\n const validationError = validateNewProfileName(name);\n if (validationError) {\n console.error(color.red(validationError));\n process.exit(1);\n }\n\n const config = new ConfigManager();\n await config.init();\n try {\n const profileDir = await config.createProfile(resolvedAgent, name);\n const slug = slugify(name);\n\n // Determine source profile directory\n let sourceDir: string;\n if (from) {\n // Use the specified source profile\n const sourceSlug = slugify(from);\n sourceDir = path.join(config.getContentDir(), resolvedAgent, sourceSlug);\n try {\n await fs.access(sourceDir);\n } catch {\n console.error(\n color.red(`Source profile '${from}' does not exist for agent '${resolvedAgent}'`)\n );\n process.exit(1);\n }\n } else {\n // Default to _base\n sourceDir = path.join(config.getContentDir(), resolvedAgent, BASE_PROFILE_SLUG);\n }\n\n // Copy from source profile if it exists\n try {\n await fs.access(sourceDir);\n // Source exists, copy its contents to the new profile (preserving symlinks)\n await copyDirectory(sourceDir, profileDir);\n // Overwrite meta.json with the new profile's metadata\n const metaPath = path.join(profileDir, 'meta.json');\n const meta = {\n name,\n slug,\n agent: resolvedAgent,\n created_at: new Date().toISOString(),\n };\n await fs.writeFile(metaPath, JSON.stringify(meta, null, 2));\n } catch {\n // Source doesn't exist, that's fine (only happens if --from not specified and _base doesn't exist)\n }\n\n // Scaffold include-list dir entries for include-based agents.\n await config.ensureIncludeProfileLayout(resolvedAgent, slug);\n\n outro(`Profile created at ${color.cyan(profileDir)}`);\n\n // Offer to switch to the new profile\n const shouldSwitch = await confirm({\n message: 'Switch to this profile now?',\n initialValue: true,\n });\n\n if (isCancel(shouldSwitch)) {\n process.exit(0);\n }\n\n if (shouldSwitch) {\n await config.switchProfile(resolvedAgent, slug);\n outro(`Switched to profile ${color.cyan(name)}`);\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n console.error(color.red(message));\n process.exit(1);\n }\n}\n\nexport default defineCommand({\n meta: {\n name: 'add',\n description: 'Create a new profile (alias: create)',\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Agent name',\n required: false,\n },\n name: {\n type: 'positional',\n description: 'Profile name',\n required: false,\n },\n from: {\n type: 'string',\n description: 'Source profile to clone from (defaults to _base)',\n required: false,\n },\n },\n async run({ args }) {\n await addCommand(args.agent, args.name, args.from);\n },\n});\n","import { defineCommand } from 'citty';\nimport { outro, select, text, isCancel, cancel, note } from '@clack/prompts';\nimport { ConfigManager } from '../lib/config.js';\nimport { SUPPORTED_TOOLS, BASE_PROFILE_SLUG } from '../types/index.js';\nimport color from 'picocolors';\nimport { validateNewProfileName, validateProfileName, slugify } from '../lib/validation.js';\nimport { joyful } from 'joyful';\nimport { promptForAgent } from '../lib/prompts.js';\n\nasync function batchSwitchAll(profileName: string): Promise<void> {\n const config = new ConfigManager();\n await config.init();\n const resolvedProfileName =\n profileName === 'base' || profileName === 'unset' ? BASE_PROFILE_SLUG : profileName;\n\n const results = {\n switched: [] as string[],\n skipped: [] as string[],\n errors: [] as { agent: string; error: string }[],\n };\n\n for (const agent of Object.keys(SUPPORTED_TOOLS)) {\n try {\n // Check if agent is managed\n const status = await config.getSymlinkStatus(agent);\n if (status !== 'active' && status !== 'broken') {\n results.skipped.push(`${agent} (not managed)`);\n continue;\n }\n\n // Check if profile exists for this agent\n const profiles = await config.getProfiles(agent);\n const profileExists = profiles.some((p) => p.slug === resolvedProfileName);\n\n if (!profileExists) {\n results.skipped.push(`${agent} (profile '${resolvedProfileName}' not found)`);\n continue;\n }\n\n // Switch the profile\n await config.switchProfile(agent, resolvedProfileName);\n results.switched.push(agent);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n results.errors.push({ agent, error: message });\n }\n }\n\n // Print summary\n if (results.switched.length > 0) {\n console.log(color.green(`✓ Switched ${results.switched.length} agent(s):`));\n results.switched.forEach((agent) => console.log(` - ${agent}`));\n }\n\n if (results.skipped.length > 0) {\n console.log(color.dim(`⊘ Skipped ${results.skipped.length} agent(s):`));\n results.skipped.forEach((msg) => console.log(` - ${msg}`));\n }\n\n if (results.errors.length > 0) {\n console.log(color.red(`✗ Errors (${results.errors.length}):`));\n results.errors.forEach(({ agent, error }) => console.log(` - ${agent}: ${error}`));\n process.exit(1);\n }\n\n outro(\n `Activated ${color.cyan(resolvedProfileName)} profile for ${results.switched.length} agent(s).`\n );\n}\n\nexport async function setCommand(agent?: string, name?: string) {\n const resolvedAgent: string = agent ?? (await promptForAgent('Select agent to set profile for:'));\n\n if (!SUPPORTED_TOOLS[resolvedAgent]) {\n console.error(color.red(`Unsupported agent: ${resolvedAgent}`));\n process.exit(1);\n }\n\n const config = new ConfigManager();\n await config.init();\n\n // Check that agent is managed\n const status = await config.getSymlinkStatus(resolvedAgent);\n if (status === 'unmanaged') {\n console.error(\n color.red(`Agent '${resolvedAgent}' is not managed. Run 'agentprofiles setup' first.`)\n );\n process.exit(1);\n }\n if (status === 'missing') {\n console.error(color.red(`Agent '${resolvedAgent}' is not installed.`));\n process.exit(1);\n }\n\n let resolvedName: string | undefined = name;\n\n if (!resolvedName) {\n const profiles = await config.getProfiles(resolvedAgent);\n const activeProfile = await config.getActiveProfile(resolvedAgent);\n\n if (profiles.length === 0) {\n note(`No profiles found for ${resolvedAgent}. Let's create one.`, 'New Profile');\n\n const suggestedName = joyful();\n const nameResponse = await text({\n message: 'Enter a name for this profile:',\n placeholder: suggestedName,\n initialValue: suggestedName,\n validate(value) {\n if (!value) return 'Profile name is required.';\n return validateNewProfileName(value) || undefined;\n },\n });\n\n if (isCancel(nameResponse)) {\n cancel('Operation cancelled.');\n process.exit(0);\n }\n\n const newName = nameResponse as string;\n await config.createProfile(resolvedAgent, newName);\n note(`Created profile ${color.cyan(newName)}`, 'Profile Created');\n resolvedName = slugify(newName);\n } else {\n const selectableProfiles = profiles.filter((p) => p.slug !== BASE_PROFILE_SLUG);\n const response = await select({\n message: 'Select a profile to activate:',\n options: [\n {\n value: BASE_PROFILE_SLUG,\n label: 'Unset (reset to base profile)',\n hint: activeProfile === BASE_PROFILE_SLUG ? '(active)' : 'switch to _base',\n },\n ...selectableProfiles.map((p) => ({\n value: p.slug,\n label: p.name,\n hint: p.slug === activeProfile ? '(active)' : p.description,\n })),\n ],\n });\n\n if (isCancel(response)) {\n cancel('Operation cancelled.');\n process.exit(0);\n }\n resolvedName = response as string;\n }\n } else {\n // Handle 'base' alias for BASE_PROFILE_SLUG\n if (resolvedName === 'base' || resolvedName === 'unset') {\n resolvedName = BASE_PROFILE_SLUG;\n } else {\n const validationError = validateProfileName(resolvedName);\n if (validationError) {\n console.error(color.red(validationError));\n process.exit(1);\n }\n resolvedName = slugify(resolvedName);\n }\n }\n\n if (!resolvedName) {\n console.error(color.red('Profile name is required.'));\n process.exit(1);\n }\n\n try {\n if (resolvedName === BASE_PROFILE_SLUG) {\n await config.ensureBaseProfileLayout(resolvedAgent);\n }\n await config.switchProfile(resolvedAgent, resolvedName);\n outro(`Activated ${color.cyan(resolvedName)} profile for ${resolvedAgent}.`);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n console.error(color.red(message));\n process.exit(1);\n }\n}\n\nexport default defineCommand({\n meta: {\n name: 'set',\n description: 'Set the active profile for an agent',\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Agent name',\n required: false,\n },\n name: {\n type: 'positional',\n description: 'Profile name (or \"base\"/\"unset\" for base profile)',\n required: false,\n },\n all: {\n type: 'boolean',\n description: 'Switch all managed agents to the same profile',\n required: false,\n },\n },\n async run({ args }) {\n // Handle --all flag: agentprofiles set --all <profile>\n if (args.all) {\n const profileName = args.agent; // When --all is used, first positional is the profile name\n if (!profileName) {\n console.error(color.red('Profile name is required when using --all flag'));\n process.exit(1);\n }\n await batchSwitchAll(profileName);\n return;\n }\n\n // Handle shorthand: agentprofiles set <profile> (no agent arg, treated as --all)\n if (args.agent && !args.name) {\n // Check if this looks like a profile name (not an agent name)\n // If agent is not in SUPPORTED_TOOLS, treat it as a profile name for --all\n if (!SUPPORTED_TOOLS[args.agent]) {\n await batchSwitchAll(args.agent);\n return;\n }\n }\n\n // Normal flow: agentprofiles set <agent> [name]\n await setCommand(args.agent, args.name);\n },\n});\n","import { defineCommand } from 'citty';\nimport { outro } from '@clack/prompts';\nimport { SUPPORTED_TOOLS, BASE_PROFILE_SLUG } from '../types/index.js';\nimport color from 'picocolors';\nimport { promptForAgent } from '../lib/prompts.js';\nimport { ConfigManager } from '../lib/config.js';\n\nexport async function unsetCommand(agent?: string) {\n const resolvedAgent: string = agent ?? (await promptForAgent('Select agent to unset:'));\n\n if (!SUPPORTED_TOOLS[resolvedAgent]) {\n console.error(color.red(`Unsupported agent: ${resolvedAgent}`));\n process.exit(1);\n }\n\n const config = new ConfigManager();\n await config.init();\n\n // Check that agent is managed\n const status = await config.getSymlinkStatus(resolvedAgent);\n if (status === 'unmanaged') {\n console.error(color.red(`Agent '${resolvedAgent}' is not managed.`));\n process.exit(1);\n }\n if (status === 'missing') {\n console.error(color.red(`Agent '${resolvedAgent}' is not installed.`));\n process.exit(1);\n }\n\n try {\n await config.switchProfile(resolvedAgent, BASE_PROFILE_SLUG);\n outro(`Switched ${resolvedAgent} to base profile.`);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n console.error(color.red(message));\n process.exit(1);\n }\n}\n\nexport default defineCommand({\n meta: {\n name: 'unset',\n description: 'Switch an agent back to its base profile',\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Agent name',\n required: false,\n },\n },\n async run({ args }) {\n await unsetCommand(args.agent);\n },\n});\n","import { defineCommand } from 'citty';\nimport { outro, note } from '@clack/prompts';\nimport { ConfigManager } from '../lib/config.js';\nimport { SUPPORTED_TOOLS } from '../types/index.js';\nimport color from 'picocolors';\nimport { spawn } from 'node:child_process';\nimport path from 'node:path';\nimport { promptForAgent, promptForProfile } from '../lib/prompts.js';\n\nexport function parseEditorValue(editor: string): { command: string; args: string[] } {\n const trimmed = editor.trim();\n if (!trimmed) {\n return { command: '', args: [] };\n }\n\n const tokens = trimmed.match(/(\".*?\"|'.*?'|\\S+)/g) ?? [];\n\n if (tokens.length === 0) {\n return { command: '', args: [] };\n }\n\n const stripQuotes = (value: string) => {\n if (\n (value.startsWith('\"') && value.endsWith('\"')) ||\n (value.startsWith(\"'\") && value.endsWith(\"'\"))\n ) {\n return value.slice(1, -1);\n }\n return value;\n };\n\n const [commandToken, ...argTokens] = tokens;\n\n if (!commandToken) {\n return { command: '', args: [] };\n }\n\n return {\n command: stripQuotes(commandToken),\n args: argTokens.map(stripQuotes),\n };\n}\n\nexport async function editCommand(agent?: string, name?: string) {\n const resolvedAgent: string = agent ?? (await promptForAgent('Select agent:'));\n\n if (!SUPPORTED_TOOLS[resolvedAgent]) {\n console.error(color.red(`Unsupported agent: ${resolvedAgent}`));\n process.exit(1);\n }\n\n const config = new ConfigManager();\n await config.init();\n\n let resolvedName: string;\n if (name) {\n resolvedName = name;\n } else {\n const selected = await promptForProfile(config, resolvedAgent, 'Select profile to edit:');\n if (!selected) {\n note(\n `No profiles found for ${resolvedAgent}. Create one first with: agentprofiles add ${resolvedAgent}`,\n 'No Profiles'\n );\n process.exit(0);\n }\n resolvedName = selected;\n }\n\n const profileDir = path.join(config.getContentDir(), resolvedAgent, resolvedName);\n\n const editorEnv = process.env.EDITOR?.trim();\n if (editorEnv) {\n const { command, args } = parseEditorValue(editorEnv);\n if (command) {\n const child = spawn(command, [...args, profileDir], { stdio: 'inherit' });\n child.on('exit', () => {\n outro('Editor closed');\n });\n return;\n }\n }\n\n const platform = process.platform;\n const openCommand = platform === 'darwin' ? 'open' : platform === 'linux' ? 'xdg-open' : null;\n\n if (!openCommand) {\n console.log(profileDir);\n return;\n }\n\n const child = spawn(openCommand, [profileDir], { stdio: 'inherit' });\n child.on('error', () => {\n console.log(profileDir);\n });\n}\n\nexport default defineCommand({\n meta: {\n name: 'edit',\n description: 'Edit a profile configuration',\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Agent name',\n required: false,\n },\n name: {\n type: 'positional',\n description: 'Profile name',\n required: false,\n },\n },\n async run({ args }) {\n await editCommand(args.agent, args.name);\n },\n});\n","import { defineCommand } from 'citty';\nimport { outro, confirm, isCancel, cancel, note } from '@clack/prompts';\nimport { ConfigManager } from '../lib/config.js';\nimport { SUPPORTED_TOOLS, BASE_PROFILE_SLUG, SHARED_PROFILE_SLUG } from '../types/index.js';\nimport color from 'picocolors';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport { promptForAgent, promptForProfile } from '../lib/prompts.js';\n\nexport async function removeCommand(agent?: string, name?: string) {\n const resolvedAgent: string = agent ?? (await promptForAgent('Select agent:'));\n\n if (!SUPPORTED_TOOLS[resolvedAgent]) {\n console.error(color.red(`Unsupported agent: ${resolvedAgent}`));\n process.exit(1);\n }\n\n const config = new ConfigManager();\n await config.init();\n const profiles = await config.getProfiles(resolvedAgent);\n\n if (profiles.length === 0) {\n note(`No profiles found for ${resolvedAgent}. Nothing to remove.`, 'No Profiles');\n process.exit(0);\n }\n\n let resolvedName: string;\n if (name) {\n resolvedName = name;\n } else {\n const selected = await promptForProfile(config, resolvedAgent, 'Select a profile to remove:');\n if (!selected) {\n note(`No profiles found for ${resolvedAgent}.`, 'No Profiles');\n process.exit(0);\n }\n resolvedName = selected;\n }\n\n // Block removal of _base\n if (resolvedName === BASE_PROFILE_SLUG) {\n console.error(color.red(`Cannot remove the base profile (${BASE_PROFILE_SLUG}).`));\n process.exit(1);\n }\n\n // Block removal of reserved non-profile directories\n if (resolvedName === SHARED_PROFILE_SLUG) {\n console.error(color.red(`Cannot remove reserved profile name (${SHARED_PROFILE_SLUG}).`));\n process.exit(1);\n }\n\n // Block removal of active profile\n const activeProfile = await config.getActiveProfile(resolvedAgent);\n if (activeProfile === resolvedName) {\n console.error(\n color.red(\n `Cannot remove the active profile. Switch to a different profile first.\\nUse: agentprofiles set ${resolvedAgent} <profile-name>`\n )\n );\n process.exit(1);\n }\n\n const profileDir = path.join(config.getContentDir(), resolvedAgent, resolvedName);\n try {\n await fs.access(profileDir);\n } catch {\n console.error(color.red(`Profile '${resolvedName}' not found for agent '${resolvedAgent}'`));\n process.exit(1);\n }\n\n const shouldDelete = await confirm({\n message: `Are you sure you want to delete the profile ${color.cyan(resolvedName)}? This cannot be undone.`,\n initialValue: false,\n });\n\n if (isCancel(shouldDelete) || !shouldDelete) {\n cancel('Operation cancelled.');\n process.exit(0);\n }\n\n await fs.rm(profileDir, { recursive: true, force: true });\n\n outro(`Deleted profile ${color.cyan(resolvedName)} for ${resolvedAgent}.`);\n}\n\nexport default defineCommand({\n meta: {\n name: 'remove',\n description: 'Remove a profile (alias: rm)',\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Agent name',\n required: false,\n },\n name: {\n type: 'positional',\n description: 'Profile name',\n required: false,\n },\n },\n async run({ args }) {\n await removeCommand(args.agent, args.name);\n },\n});\n","import { defineCommand } from 'citty';\nimport { confirm, outro, cancel } from '@clack/prompts';\nimport { SUPPORTED_TOOLS } from '../types/index.js';\nimport color from 'picocolors';\nimport { promptForAgent } from '../lib/prompts.js';\nimport { ConfigManager } from '../lib/config.js';\n\nexport async function releaseCommand(agent?: string) {\n const resolvedAgent: string = agent ?? (await promptForAgent('Select agent to release:'));\n\n if (!SUPPORTED_TOOLS[resolvedAgent]) {\n console.error(color.red(`Unsupported agent: ${resolvedAgent}`));\n process.exit(1);\n }\n\n const config = new ConfigManager();\n await config.init();\n\n // Check that agent is managed\n const status = await config.getSymlinkStatus(resolvedAgent);\n if (status === 'unmanaged') {\n console.error(color.red(`Agent '${resolvedAgent}' is not managed.`));\n process.exit(1);\n }\n if (status === 'missing') {\n console.error(color.red(`Agent '${resolvedAgent}' is not installed.`));\n process.exit(1);\n }\n\n // Get the active profile to show what will happen\n const activeProfile = await config.getActiveProfile(resolvedAgent);\n const globalPath = config.getGlobalConfigPath(resolvedAgent);\n\n const shouldRelease = await confirm({\n message: `Release ${color.cyan(resolvedAgent)} from management? This will move the active profile (${color.cyan(activeProfile || 'unknown')}) back to ${color.cyan(globalPath)} and remove the symlink.`,\n initialValue: false,\n });\n\n if (!shouldRelease) {\n cancel('Operation cancelled.');\n process.exit(0);\n }\n\n try {\n await config.unlinkProfile(resolvedAgent);\n outro(\n `Released ${color.cyan(resolvedAgent)} from management. Profile restored to ${color.cyan(globalPath)}.`\n );\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n console.error(color.red(message));\n process.exit(1);\n }\n}\n\nexport default defineCommand({\n meta: {\n name: 'release',\n description: 'Release an agent from management (stop managing profiles)',\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Agent name',\n required: false,\n },\n },\n async run({ args }) {\n await releaseCommand(args.agent);\n },\n});\n","import { defineCommand } from 'citty';\nimport { confirm, select } from '@clack/prompts';\nimport { ConfigManager } from '../lib/config.js';\nimport { SUPPORTED_TOOLS, SHARED_DIRECTORIES, BASE_PROFILE_SLUG } from '../types/index.js';\nimport color from 'picocolors';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\n\nexport async function doctorCommand() {\n const config = new ConfigManager();\n await config.init();\n\n console.log(color.bold('\\n🔧 Agent Profiles Doctor\\n'));\n\n const issues: string[] = [];\n const fixes: string[] = [];\n\n // Check each agent\n for (const [agentKey, agentDef] of Object.entries(SUPPORTED_TOOLS)) {\n const status = await config.getSymlinkStatus(agentKey);\n const strategy = config.getAgentStrategy(agentKey);\n\n if (status === 'broken') {\n const globalPath = config.getGlobalConfigPath(agentKey);\n\n if (strategy === 'include') {\n // Include agents: 'broken' means one or more per-entry symlinks inside globalPath\n // are broken. The fix is to switch to _base which re-creates all managed entries.\n issues.push(\n `${agentDef.description} (${agentKey}): broken per-entry symlink(s) in ${globalPath}`\n );\n\n const choice = await select({\n message: `Fix broken include symlinks for ${color.cyan(agentKey)}?`,\n options: [\n { value: 'switch_base', label: 'Switch to _base profile (re-creates managed entries)' },\n { value: 'skip', label: 'Skip' },\n ],\n });\n\n if (choice === 'switch_base') {\n try {\n const baseDir = path.join(config.getContentDir(), agentKey, BASE_PROFILE_SLUG);\n await fs.access(baseDir);\n await config.switchProfile(agentKey, BASE_PROFILE_SLUG);\n fixes.push(`Switched ${agentKey} to _base profile (repaired broken entries)`);\n } catch {\n console.error(color.red(` Error: _base profile not found for ${agentKey}`));\n }\n }\n } else {\n // Directory agents: 'broken' means the directory-level symlink is broken.\n issues.push(`${agentDef.description} (${agentKey}): broken symlink`);\n\n const choice = await select({\n message: `Fix broken symlink for ${color.cyan(agentKey)}?`,\n options: [\n { value: 'switch_base', label: 'Switch to _base profile' },\n { value: 'remove', label: 'Remove the symlink' },\n { value: 'skip', label: 'Skip' },\n ],\n });\n\n if (choice === 'switch_base') {\n try {\n const baseDir = path.join(config.getContentDir(), agentKey, BASE_PROFILE_SLUG);\n await fs.access(baseDir);\n await config.switchProfile(agentKey, BASE_PROFILE_SLUG);\n fixes.push(`Switched ${agentKey} to _base profile`);\n } catch {\n console.error(color.red(` Error: _base profile not found for ${agentKey}`));\n }\n } else if (choice === 'remove') {\n try {\n await fs.unlink(globalPath);\n fixes.push(`Removed broken symlink for ${agentKey}`);\n } catch (error) {\n const msg = error instanceof Error ? error.message : String(error);\n console.error(color.red(` Error removing symlink: ${msg}`));\n }\n }\n }\n }\n }\n\n // Check for missing _base profiles\n for (const [agentKey, agentDef] of Object.entries(SUPPORTED_TOOLS)) {\n const status = await config.getSymlinkStatus(agentKey);\n if (status === 'active') {\n const baseDir = path.join(config.getContentDir(), agentKey, BASE_PROFILE_SLUG);\n try {\n await fs.access(baseDir);\n } catch {\n issues.push(`${agentDef.description} (${agentKey}): missing _base profile`);\n const shouldCreate = await confirm({\n message: `Create empty _base profile for ${color.cyan(agentKey)}?`,\n initialValue: false,\n });\n if (shouldCreate) {\n try {\n await fs.mkdir(baseDir, { recursive: true });\n const meta = {\n name: BASE_PROFILE_SLUG,\n slug: BASE_PROFILE_SLUG,\n agent: agentKey,\n description: 'Base profile (created by doctor)',\n created_at: new Date().toISOString(),\n };\n await fs.writeFile(path.join(baseDir, 'meta.json'), JSON.stringify(meta, null, 2));\n fixes.push(`Created _base profile for ${agentKey}`);\n } catch (error) {\n const msg = error instanceof Error ? error.message : String(error);\n console.error(color.red(` Error creating _base: ${msg}`));\n }\n }\n }\n }\n }\n\n // Check for missing meta.json in active profiles\n for (const [agentKey] of Object.entries(SUPPORTED_TOOLS)) {\n const status = await config.getSymlinkStatus(agentKey);\n if (status === 'active') {\n const activeProfile = await config.getActiveProfile(agentKey);\n if (activeProfile) {\n const profileDir = path.join(config.getContentDir(), agentKey, activeProfile);\n const metaPath = path.join(profileDir, 'meta.json');\n try {\n await fs.access(metaPath);\n } catch {\n issues.push(`${agentKey}: missing meta.json in ${activeProfile} profile`);\n const shouldCreate = await confirm({\n message: `Create meta.json for ${color.cyan(agentKey)}/${color.cyan(activeProfile)}?`,\n initialValue: false,\n });\n if (shouldCreate) {\n try {\n const meta = {\n name: activeProfile,\n slug: activeProfile,\n agent: agentKey,\n description: 'Profile metadata (created by doctor)',\n created_at: new Date().toISOString(),\n };\n await fs.writeFile(metaPath, JSON.stringify(meta, null, 2));\n fixes.push(`Created meta.json for ${agentKey}/${activeProfile}`);\n } catch (error) {\n const msg = error instanceof Error ? error.message : String(error);\n console.error(color.red(` Error creating meta.json: ${msg}`));\n }\n }\n }\n }\n }\n }\n\n // Check shared directories\n for (const [, sharedDir] of Object.entries(SHARED_DIRECTORIES)) {\n const status = await config.getSharedDirStatus(sharedDir.name);\n if (status === 'broken') {\n issues.push(`Shared directory ${sharedDir.description}: broken symlink`);\n const shouldRemove = await confirm({\n message: `Remove broken symlink for ${color.cyan(sharedDir.globalPath)}?`,\n initialValue: false,\n });\n if (shouldRemove) {\n try {\n const globalPath = config.getSharedDirGlobalPath(sharedDir.name);\n await fs.unlink(globalPath);\n fixes.push(`Removed broken symlink for ${sharedDir.description}`);\n } catch (error) {\n const msg = error instanceof Error ? error.message : String(error);\n console.error(color.red(` Error: ${msg}`));\n }\n }\n }\n }\n\n // Recursively scan all managed profile content for broken symlinks.\n const contentDir = config.getContentDir();\n const brokenSymlinks = await config.findBrokenSymlinks(contentDir);\n if (brokenSymlinks.length > 0) {\n issues.push(`Managed content: ${brokenSymlinks.length} broken symlink(s) found`);\n\n for (const link of brokenSymlinks) {\n const relativePath = path.relative(contentDir, link.linkPath);\n issues.push(`Broken symlink: ${relativePath} -> ${link.target}`);\n }\n\n const shouldRemove = await confirm({\n message: `Remove ${brokenSymlinks.length} broken symlink(s) found under managed content?`,\n initialValue: false,\n });\n\n if (shouldRemove) {\n for (const link of brokenSymlinks) {\n try {\n await fs.unlink(link.linkPath);\n const relativePath = path.relative(contentDir, link.linkPath);\n fixes.push(`Removed broken symlink ${relativePath}`);\n } catch (error) {\n const msg = error instanceof Error ? error.message : String(error);\n console.error(color.red(` Error removing broken symlink ${link.linkPath}: ${msg}`));\n }\n }\n }\n }\n\n // Summary\n console.log(color.bold('\\n📋 Summary\\n'));\n if (issues.length === 0) {\n console.log(color.green('✓ No issues found!'));\n } else {\n console.log(color.yellow(`Found ${issues.length} issue(s):`));\n issues.forEach((issue) => console.log(` • ${issue}`));\n }\n\n if (fixes.length > 0) {\n console.log(color.green(`\\nFixed ${fixes.length} issue(s):`));\n fixes.forEach((fix) => console.log(` ✓ ${fix}`));\n }\n\n console.log();\n}\n\nexport default defineCommand({\n meta: {\n name: 'doctor',\n description: 'Scan for and repair issues with profiles and symlinks',\n },\n async run() {\n await doctorCommand();\n },\n});\n","import { select, isCancel, cancel } from '@clack/prompts';\n\ntype MenuAction =\n | 'status'\n | 'list'\n | 'add'\n | 'set'\n | 'unset'\n | 'edit'\n | 'remove'\n | 'release'\n | 'doctor';\n\nconst menuOptions: Array<{ value: MenuAction; label: string; hint: string }> = [\n { value: 'status', label: 'Status', hint: 'Show agent profile status' },\n { value: 'list', label: 'List profiles', hint: 'Show all profiles' },\n { value: 'add', label: 'Add profile', hint: 'Create a new profile' },\n { value: 'set', label: 'Set profile', hint: 'Activate a profile for an agent' },\n { value: 'unset', label: 'Unset profile', hint: 'Switch an agent to base profile' },\n { value: 'edit', label: 'Edit profile', hint: 'Open a profile in your editor' },\n { value: 'remove', label: 'Remove profile', hint: 'Delete a profile' },\n { value: 'release', label: 'Release agent', hint: 'Stop managing an agent' },\n { value: 'doctor', label: 'Doctor / Repair', hint: 'Scan for and repair issues' },\n];\n\nexport async function showMainMenu(): Promise<void> {\n const response = await select({\n message: 'What would you like to do?',\n options: menuOptions,\n });\n\n if (isCancel(response)) {\n cancel('Goodbye!');\n process.exit(0);\n }\n\n const action = response as MenuAction;\n\n switch (action) {\n case 'status': {\n const { statusCommand } = await import('../commands/status.js');\n await statusCommand();\n break;\n }\n case 'list': {\n const { listCommand } = await import('../commands/list.js');\n await listCommand();\n break;\n }\n case 'add': {\n const { addCommand } = await import('../commands/add.js');\n await addCommand();\n break;\n }\n case 'set': {\n const { setCommand } = await import('../commands/set.js');\n await setCommand();\n break;\n }\n case 'unset': {\n const { unsetCommand } = await import('../commands/unset.js');\n await unsetCommand();\n break;\n }\n case 'edit': {\n const { editCommand } = await import('../commands/edit.js');\n await editCommand();\n break;\n }\n case 'remove': {\n const { removeCommand } = await import('../commands/remove.js');\n await removeCommand();\n break;\n }\n case 'release': {\n const { releaseCommand } = await import('../commands/release.js');\n await releaseCommand();\n break;\n }\n case 'doctor': {\n const { doctorCommand } = await import('../commands/doctor.js');\n await doctorCommand();\n break;\n }\n }\n}\n","import { defineCommand } from 'citty';\nimport { runOnboarding } from '../lib/onboarding.js';\n\nexport async function setupCommand(): Promise<void> {\n const success = await runOnboarding({ isRerun: true });\n if (!success) {\n process.exit(1);\n }\n}\n\nexport default defineCommand({\n meta: {\n name: 'setup',\n description: 'Initialize the agentprofiles system (alias: init)',\n },\n async run() {\n await setupCommand();\n },\n});\n","import { defineCommand } from 'citty';\nimport { setupCommand } from './setup.js';\n\nexport default defineCommand({\n meta: {\n name: 'init',\n hidden: true,\n },\n async run() {\n await setupCommand();\n },\n});\n","import { defineCommand } from 'citty';\nimport { addCommand } from './add.js';\n\nexport default defineCommand({\n meta: {\n name: 'create',\n description: 'Create a new profile (alias for add)',\n hidden: true,\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Agent name (claude/opencode)',\n required: false,\n },\n name: {\n type: 'positional',\n description: 'Profile name',\n required: false,\n },\n },\n async run({ args }) {\n await addCommand(args.agent, args.name);\n },\n});\n","import { defineCommand } from 'citty';\nimport { removeCommand } from './remove.js';\n\nexport default defineCommand({\n meta: {\n name: 'rm',\n hidden: true,\n },\n args: {\n agent: {\n type: 'positional',\n description: 'Agent name (claude/opencode)',\n required: true,\n },\n name: {\n type: 'positional',\n description: 'Profile name',\n required: false,\n },\n },\n async run({ args }) {\n await removeCommand(args.agent, args.name);\n },\n});\n","import { defineCommand, runMain } from 'citty';\nimport { createRequire } from 'node:module';\nimport { renderBanner, renderInfo } from './lib/banner.js';\nimport { checkForUpdates } from './lib/update.js';\n\nconst require = createRequire(import.meta.url);\nconst pkg = require('../package.json');\n\nconst isQuiet = process.argv.includes('--quiet') || process.argv.includes('-q');\n\nif (!isQuiet) {\n renderBanner();\n renderInfo(pkg);\n}\n\ncheckForUpdates(pkg).catch(() => {});\n\nconst knownSubcommands = [\n 'setup',\n 'init',\n 'list',\n 'add',\n 'create',\n 'edit',\n 'remove',\n 'rm',\n 'set',\n 'unset',\n 'status',\n 'release',\n 'doctor',\n];\n\nconst args = process.argv.slice(2);\nconst hasSubcommand = args.some(\n (arg) => knownSubcommands.includes(arg) || arg === '--help' || arg === '-h'\n);\nconst isHelpOrVersion = args.some(\n (arg) => arg === '--help' || arg === '-h' || arg === '--version' || arg === '-V'\n);\nconst isInitCommand = args.some((arg) => arg === 'init' || arg === 'setup');\n\nif (!isInitCommand && !isHelpOrVersion) {\n const { ensureInitialized } = await import('./lib/onboarding.js');\n await ensureInitialized();\n}\n\nif (!hasSubcommand && !isHelpOrVersion) {\n const { showMainMenu } = await import('./lib/main-menu.js');\n await showMainMenu();\n} else {\n const main = defineCommand({\n meta: {\n name: 'agentprofiles',\n version: pkg.version,\n description: pkg.description,\n },\n subCommands: {\n setup: () => import('./commands/setup.js').then((m) => m.default),\n init: () => import('./commands/init.js').then((m) => m.default),\n list: () => import('./commands/list.js').then((m) => m.default),\n add: () => import('./commands/add.js').then((m) => m.default),\n create: () => import('./commands/create.js').then((m) => m.default),\n edit: () => import('./commands/edit.js').then((m) => m.default),\n remove: () => import('./commands/remove.js').then((m) => m.default),\n rm: () => import('./commands/rm.js').then((m) => m.default),\n set: () => import('./commands/set.js').then((m) => m.default),\n unset: () => import('./commands/unset.js').then((m) => m.default),\n status: () => import('./commands/status.js').then((m) => m.default),\n release: () => import('./commands/release.js').then((m) => m.default),\n doctor: () => import('./commands/doctor.js').then((m) => m.default),\n },\n });\n\n runMain(main);\n}\n","import color from 'picocolors';\n\ndeclare const __DEV__: boolean;\ndeclare const __BUILD_TIME__: string;\ndeclare const __GIT_SHA__: string;\nconst isDev = typeof __DEV__ !== 'undefined' ? __DEV__ : true;\nconst buildTime = typeof __BUILD_TIME__ !== 'undefined' ? __BUILD_TIME__ : '';\nconst gitSha = typeof __GIT_SHA__ !== 'undefined' ? __GIT_SHA__ : '';\n\n// Pre-generated banner (cfonts tiny/candy)\n// Regenerate with: cfonts \"agentprofiles\" -f tiny -c candy\nconst BANNER =\n '\\n\\u001b[93m \\u001b[39m\\u001b[94m▄▀█\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[35m█▀▀\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[92m█▀▀\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[36m█▄ █\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[92m▀█▀\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[91m█▀█\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[36m█▀█\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[92m█▀█\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[92m█▀▀\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[32m█\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[92m█ \\u001b[39m\\u001b[93m \\u001b[39m\\u001b[92m█▀▀\\u001b[39m\\u001b[93m \\u001b[39m\\u001b[31m█▀▀\\u001b[39m\\n\\u001b[31m \\u001b[39m\\u001b[95m█▀█\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[35m█▄█\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[32m██▄\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[33m█ ▀█\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[36m █ \\u001b[39m\\u001b[31m \\u001b[39m\\u001b[36m█▀▀\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[35m█▀▄\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[91m█▄█\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[95m█▀ \\u001b[39m\\u001b[31m \\u001b[39m\\u001b[31m█\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[92m█▄▄\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[32m██▄\\u001b[39m\\u001b[31m \\u001b[39m\\u001b[95m▄▄█\\u001b[39m\\n';\n\nexport function renderBanner(): void {\n console.log(BANNER);\n}\n\nexport function renderInfo(pkg: { name: string; version: string; description?: string }): void {\n const devMetaParts: string[] = [];\n if (gitSha) devMetaParts.push(gitSha);\n if (buildTime) devMetaParts.push(`@ ${buildTime}`);\n const devLabel = devMetaParts.length > 0 ? `dev ${devMetaParts.join(' ')}` : 'dev';\n const devTag = isDev ? color.yellow(` (${devLabel})`) : '';\n const info = `${color.dim(pkg.name)} ${color.cyan(`v${pkg.version}`)}${devTag}`;\n // Use a clean description\n const desc = pkg.description\n ? color.dim(` — Manage configuration profiles for LLM agent tools`)\n : '';\n console.log(`${info}${desc}\\n`);\n}\n","import { execSync } from 'node:child_process';\nimport fs from 'node:fs';\n\ntype PackageManager = 'npm' | 'pnpm' | 'yarn' | 'volta' | 'unknown';\n\ninterface DetectionResult {\n manager: PackageManager;\n updateCommand: string;\n}\n\nfunction getInstallLocation(binName: string): string | null {\n try {\n const whichResult = execSync(`which ${binName}`, { encoding: 'utf-8' }).trim();\n return fs.realpathSync(whichResult);\n } catch {\n return null;\n }\n}\n\nfunction detectPackageManager(installPath: string | null, pkgName: string): DetectionResult {\n if (!installPath) {\n return { manager: 'unknown', updateCommand: `npm i -g ${pkgName}` };\n }\n\n const path = installPath.toLowerCase();\n\n if (path.includes('pnpm/global') || path.includes('.local/share/pnpm')) {\n return { manager: 'pnpm', updateCommand: `pnpm add -g ${pkgName}` };\n }\n\n if (path.includes('yarn/global') || path.includes('.yarn')) {\n return { manager: 'yarn', updateCommand: `yarn global add ${pkgName}` };\n }\n\n if (path.includes('.volta/')) {\n return { manager: 'volta', updateCommand: `volta install ${pkgName}` };\n }\n\n return { manager: 'npm', updateCommand: `npm i -g ${pkgName}` };\n}\n\nexport async function checkForUpdates(pkg: { name: string; version: string }): Promise<void> {\n const { default: updateNotifier } = await import('update-notifier');\n\n const installPath = getInstallLocation('agentprofiles');\n const { updateCommand } = detectPackageManager(installPath, pkg.name);\n\n const notifier = updateNotifier({\n pkg,\n updateCheckInterval: 1000 * 60 * 60 * 24,\n });\n\n notifier.notify({\n message: `Update available {currentVersion} → {latestVersion}\\nRun ${updateCommand} to update`,\n defer: true,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAF9B;AAAA;AAAA;AAAA;AAAA;;;ACOA,SAAS,YAAY,OAAO,IAAI;AAC/B,MAAI,eAAe,KAAK,IAAI,EAAG;AAC/B,SAAO,SAAS,KAAK,YAAY;AAClC;AACA,SAAS,YAAY,KAAK,YAAY;AACrC,QAAM,YAAY,cAAc;AAChC,QAAM,QAAQ,CAAC;AACf,MAAI,CAAC,OAAO,OAAO,QAAQ,SAAU,QAAO;AAC5C,MAAI,OAAO;AACX,MAAI;AACJ,MAAI;AACJ,aAAW,QAAQ,KAAK;AACvB,UAAM,aAAa,UAAU,SAAS,IAAI;AAC1C,QAAI,eAAe,MAAM;AACxB,YAAM,KAAK,IAAI;AACf,aAAO;AACP,sBAAgB;AAChB;AAAA,IACD;AACA,UAAM,UAAU,YAAY,IAAI;AAChC,QAAI,qBAAqB,OAAO;AAC/B,UAAI,kBAAkB,SAAS,YAAY,MAAM;AAChD,cAAM,KAAK,IAAI;AACf,eAAO;AACP,wBAAgB;AAChB;AAAA,MACD;AACA,UAAI,kBAAkB,QAAQ,YAAY,SAAS,KAAK,SAAS,GAAG;AACnE,cAAM,WAAW,KAAK,GAAG,EAAE;AAC3B,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AMA,GAAE,OAAO;AAAA,MAC9D,MAAM,MAAM,0DAA6B,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,MAC9D,KAAK,MAAM,wDAA4B,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,MAC5D,QAAQ,MAAM,8DAA+B,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,MAClE,MAAM,MAAM,0DAA6B,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,MAC9D,QAAQ,MAAM,8DAA+B,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,MAClE,IAAI,MAAM,sDAA2B,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,MAC1D,KAAK,MAAM,wDAA4B,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,MAC5D,OAAO,MAAM,4DAA8B,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,MAChE,QAAQ,MAAM,8DAA+B,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,MAClE,SAAS,MAAM,gEAAgC,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,MACpE,QAAQ,MAAM,8DAA+B,KAAK,CAACA,OAAMA,GAAE,OAAO;AAAA,IACpE;AAAA,EACF,CAAC;AAED,UAAQ,IAAI;AACd;","names":["p","args","p","f","x","y","findCursor","cursor","delta","options","opt","newCursor","maxCursor","clampedCursor","wrapAnsi","string","columns","line","exec","isActionKey","key","action","settings","value","diffLines","a","b","aLines","bLines","numLines","diff","i","isCancel","CANCEL_SYMBOL","setRawMode","input","block","stdin","output","stdout","overwrite","hideCursor","rl","readline","ReadStream","clear","data","name","sequence","str","dx","dy","isWindows","wrapTextWithPrefix","text","prefix","startPrefix","getColumns","index","isAmbiguous","isFullWidth","isWide","ANSI_RE","CONTROL_RE","TAB_RE","EMOJI_RE","LATIN_RE","MODIFIER_RE","NO_TRUNCATION","getStringTruncatedWidth","fastStringWidth","ESC","CSI","END_CODE","ANSI_ESCAPE_BELL","ANSI_CSI","ANSI_OSC","ANSI_SGR_TERMINATOR","ANSI_ESCAPE_LINK","GROUP_REGEX","getClosingCode","wrapAnsiCode","wrapAnsiHyperlink","wordLengths","wrapWord","stringVisibleTrimSpacesRight","actions","getRows","Prompt","ConfirmPrompt","SelectPrompt","TextPrompt","x","truncationOptions","widthOptions","LIMIT","ELLIPSIS","ELLIPSIS_WIDTH","ANSI_WIDTH","CONTROL_WIDTH","TAB_WIDTH","AMBIGUOUS_WIDTH","EMOJI_WIDTH","FULL_WIDTH_WIDTH","REGULAR_WIDTH","WIDE_WIDTH","indexPrev","length","lengthExtra","truncationEnabled","truncationIndex","truncationLimit","unmatchedStart","unmatchedEnd","width","widthExtra","outer","unmatched","char","codePoint","fastStringTruncatedWidth","openingCode","code","url","words","character","stringWidth","rows","word","characters","isInsideEscape","isInsideLinkEscape","lastRow","visible","currentCharacter","nextCharacter","rawCharacterIndex","characterLength","last","returnValue","escapeCode","escapeUrl","lengths","rowLength","remainingColumns","breaksStartingThisLine","row","preString","pre","currentPre","nextPre","preStringIndex","groups","closingCode","trackValue","render","signal","opts","event","params","cb","cbs","cleanup","subscriber","resolve","_key","write","problem","lines","frame","diffOffsetAfter","diffOffsetBefore","diffLine","erase","adjustedDiffLine","newLines","confirm","initialCursor","userInput","s1","s2","s3","color","isUnicodeSupported","process","wrapAnsi","string","columns","options","line","exec","unicode","isCI","unicodeOr","S_STEP_ACTIVE","S_STEP_CANCEL","S_STEP_ERROR","S_STEP_SUBMIT","S_BAR_START","S_BAR","S_BAR_END","S_BAR_START_RIGHT","S_BAR_END_RIGHT","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_CORNER_BOTTOM_LEFT","S_CORNER_TOP_LEFT","S_INFO","S_SUCCESS","S_WARN","S_ERROR","symbol","symbolBar","isAmbiguous","isFullWidth","isWide","ANSI_RE","CONTROL_RE","TAB_RE","EMOJI_RE","LATIN_RE","MODIFIER_RE","NO_TRUNCATION","getStringTruncatedWidth","fastStringWidth","ESC","CSI","END_CODE","ANSI_ESCAPE_BELL","ANSI_CSI","ANSI_OSC","ANSI_SGR_TERMINATOR","ANSI_ESCAPE_LINK","GROUP_REGEX","getClosingCode","wrapAnsiCode","wrapAnsiHyperlink","wordLengths","wrapWord","stringVisibleTrimSpacesRight","trimLines","limitOptions","confirm","log","cancel","intro","outro","defaultNoteFormatter","wrapWithFormat","note","defaultStyleFn","spinner","S_PROGRESS_CHAR","computeLabel","select","prefix","text","c","fallback","state","color","x","input","truncationOptions","widthOptions","LIMIT","ELLIPSIS","ELLIPSIS_WIDTH","ANSI_WIDTH","CONTROL_WIDTH","TAB_WIDTH","AMBIGUOUS_WIDTH","EMOJI_WIDTH","FULL_WIDTH_WIDTH","REGULAR_WIDTH","WIDE_WIDTH","indexPrev","index","length","lengthExtra","truncationEnabled","truncationIndex","truncationLimit","unmatchedStart","unmatchedEnd","width","widthExtra","outer","unmatched","char","codePoint","fastStringTruncatedWidth","openingCode","code","url","words","character","stringWidth","rows","word","characters","isInsideEscape","isInsideLinkEscape","lastRow","visible","currentCharacter","nextCharacter","rawCharacterIndex","characterLength","last","returnValue","escapeCode","escapeUrl","lengths","rowLength","remainingColumns","breaksStartingThisLine","row","preString","pre","currentPre","nextPre","preStringIndex","groups","closingCode","initialLineCount","startIndex","endIndex","maxLines","lineCount","removals","i","group","params","cursor","style","output","getColumns","columnPadding","rowPadding","maxWidth","getRows","overflowFormat","paramMaxItems","outputMaxItems","maxItems","slidingWindowLocation","shouldRenderTopEllipsis","shouldRenderBottomEllipsis","slidingWindowLocationEnd","lineGroups","slidingWindowLocationWithEllipsis","slidingWindowLocationEndWithEllipsis","wrappedLines","precedingRemovals","followingRemovals","newLineCount","cursorGroupIndex","trimLinesLocal","result","lineGroup","opts","active","inactive","ConfirmPrompt","hasGuide","settings","title","value","submitPrefix","cancelPrefix","defaultPrefix","defaultPrefixEnd","message","secondarySymbol","spacing","withGuide","parts","spacingString","secondaryPrefix","messageParts","firstLine","lines","ln","format","wrapMsg","maxWidthNormal","sum","maxWidthFormat","wrapWidth","titleLen","len","msg","leadingBorder","bottomLeft","indicator","onCancel","cancelMessage","errorMessage","frames","delay","signal","isCIFn","unblock","loop","isSpinnerActive","isCancelled","_message","_prevMessage","_origin","styleFn","handleExit","_stop","errorEventHandler","signalEventHandler","registerHooks","clearHooks","clearPrevMessage","prevLines","erase","removeTrailingDots","formatTimer","origin","duration","min","secs","start","block","frameIndex","indicatorTimer","frame","outputMessage","loadingDots","wrapped","silent","step","label","opt","option","str","SelectPrompt","titlePrefix","titlePrefixBar","messageLines","wrapTextWithPrefix","prefixEnd","titleLineCount","footerLineCount","item","TextPrompt","placeholder","userInput","errorText","errorPrefix","errorPrefixEnd","valueText","fs","path","fs","path","contentDirAbs","globalPath","target","fs","path","os","getDefaultConfigDir","color","R","bt","import_picocolors","init_dist","color","import_picocolors","color","R","p","import_picocolors","init_dist","args","d","y","k","x","j","z","q","N","T","B","O","L","Q","I","X","Z","init_dist","e","p","init_dist","fs","path","color","import_picocolors","init_dist","args","p","color","import_picocolors","init_dist","args","color","import_picocolors","init_dist","args","path","color","args","child","import_picocolors","init_dist","fs","path","color","import_picocolors","init_dist","args","color","import_picocolors","init_dist","args","fs","path","color","import_picocolors","init_dist","statusCommand","listCommand","addCommand","setCommand","unsetCommand","editCommand","removeCommand","releaseCommand","doctorCommand","init_dist","args","args","pkg","color","path","pkg","require","ensureInitialized","showMainMenu","m"]}
|