@rockcarver/frodo-cli 5.0.0-6 → 5.0.0-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/AuthoringPrintState-vyWOD1Wt.cjs +124 -0
- package/dist/AuthoringPrintState-vyWOD1Wt.cjs.map +1 -0
- package/dist/Console-1LBCP_JZ.cjs +177069 -0
- package/dist/Console-1LBCP_JZ.cjs.map +1 -0
- package/dist/DefaultsStore-RlEkAWqT.cjs +155 -0
- package/dist/DefaultsStore-RlEkAWqT.cjs.map +1 -0
- package/dist/EntityPickers-BGrRn1Yq.cjs +145 -0
- package/dist/EntityPickers-BGrRn1Yq.cjs.map +1 -0
- package/dist/EscapableSelectPrompt-BljVxNDm.cjs +2356 -0
- package/dist/EscapableSelectPrompt-BljVxNDm.cjs.map +1 -0
- package/dist/FrodoCommand-DueD-n-I.cjs +15474 -0
- package/dist/FrodoCommand-DueD-n-I.cjs.map +1 -0
- package/dist/RealmOps-Buhw-nZ1.cjs +340 -0
- package/dist/RealmOps-Buhw-nZ1.cjs.map +1 -0
- package/dist/RealmPickers-IjVJiRB5.cjs +137 -0
- package/dist/RealmPickers-IjVJiRB5.cjs.map +1 -0
- package/dist/ResolveInteractiveInputs-D_-5704M.cjs +1856 -0
- package/dist/ResolveInteractiveInputs-D_-5704M.cjs.map +1 -0
- package/dist/app.cjs +1147 -1148
- package/dist/app.cjs.map +1 -1
- package/package.json +3 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EscapableSelectPrompt-BljVxNDm.cjs","names":["createRequire","AsyncLocalStorage","AsyncResource","AsyncResource","process","styleText","NO_TRUNCATION","fastStringTruncatedWidth","ESC","stringWidth","cliWidth","process","stripVTControlCharacters","MuteStream","readline","AsyncResource","onSignalExit","path","c","c"],"sources":["../src/utils/interactive/EscapeSequenceTimeout.ts","../src/utils/interactive/ExitAll.ts","../src/utils/interactive/PromptGateState.ts","../src/utils/interactive/EditableOptions.ts","../node_modules/@inquirer/core/dist/lib/key.js","../node_modules/@inquirer/core/dist/lib/errors.js","../node_modules/@inquirer/core/dist/lib/hook-engine.js","../node_modules/@inquirer/core/dist/lib/use-state.js","../node_modules/@inquirer/core/dist/lib/use-effect.js","../node_modules/@inquirer/figures/dist/index.js","../node_modules/@inquirer/core/dist/lib/theme.js","../node_modules/@inquirer/core/dist/lib/make-theme.js","../node_modules/@inquirer/core/dist/lib/use-prefix.js","../node_modules/@inquirer/core/dist/lib/use-memo.js","../node_modules/@inquirer/core/dist/lib/use-ref.js","../node_modules/@inquirer/core/dist/lib/use-keypress.js","../node_modules/cli-width/index.js","../node_modules/fast-string-truncated-width/dist/utils.js","../node_modules/fast-string-truncated-width/dist/index.js","../node_modules/fast-string-width/dist/index.js","../node_modules/fast-wrap-ansi/lib/main.js","../node_modules/@inquirer/core/dist/lib/utils.js","../node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js","../node_modules/@inquirer/type/dist/utils.js","../node_modules/mute-stream/lib/index.js","../node_modules/@inquirer/core/node_modules/signal-exit/dist/mjs/signals.js","../node_modules/@inquirer/core/node_modules/signal-exit/dist/mjs/index.js","../node_modules/@inquirer/ansi/dist/index.js","../node_modules/@inquirer/core/dist/lib/screen-manager.js","../node_modules/@inquirer/core/dist/lib/create-prompt.js","../src/utils/interactive/NavigationMenu.ts","../src/utils/interactive/EscapableSelectPrompt.ts"],"sourcesContent":["/**\n * Readline's escapeCodeTimeout decides how long a lone ESC byte is held\n * as a potential escape-SEQUENCE prefix before it is delivered as an\n * 'escape' keypress. Node's default (500ms) makes the double-ESC\n * \"exit all\" gesture impossible: within that horizon the second ESC\n * byte merely RESTARTS the pending sequence instead of delivering a\n * second keypress, so a fast double-press yields ONE keypress ~500ms\n * later -- long after any in-prompt grace window closed (verified live\n * and in isolated probes; setting the interface's property after\n * creation does NOT take effect -- only the constructor option does).\n *\n * 50ms is an order of magnitude below a human double-tap (~80-150ms)\n * while comfortably above real escape sequences (arrow/function keys\n * arrive as contiguous multi-byte bursts, well under 50ms apart), so\n * sequence parsing stays correct.\n *\n * @inquirer/core constructs its readline interfaces WITHOUT the option,\n * and the interface isn't reachable before the first keypress, so the\n * value cannot be passed through the prompt wrappers. This shim replaces\n * node:readline's createInterface once, injecting the default into every\n * interface the CLI creates (all of them are prompt/readline consumers;\n * nothing else in frodo depends on a 500ms escape horizon).\n *\n * The patch mutates the CJS exports object of the builtin: builtin CJS\n * exports are mutable ordinary objects, and node's ESM named exports for\n * builtins delegate to that same object, so @inquirer's\n * require('node:readline') sees the replacement.\n */\nimport { createRequire } from 'node:module';\nimport type { Interface as ReadLine, ReadLineOptions } from 'node:readline';\n\nexport const ESCAPE_CODE_TIMEOUT_MS = 50;\n\nlet patched = false;\n\nexport function applyEscapeSequenceTimeout(): void {\n if (patched) return;\n patched = true;\n // require() (not a static import): the patch must go through the CJS\n // exports OBJECT of the builtin -- a static ESM import's named\n // bindings are immutable and cannot be re-pointed. createRequire\n // works in both module systems; its base differs (CJS has __filename,\n // the ESM Jest suites only have import.meta.url -- which the bundler\n // polyfills for the CJS output).\n const requireRef = (() => {\n try {\n return createRequire(__filename);\n } catch {\n return createRequire(import.meta.url);\n }\n })();\n const rl = requireRef('node:readline') as {\n createInterface: (options?: ReadLineOptions) => ReadLine;\n };\n const original = rl.createInterface;\n rl.createInterface = function patchedCreateInterface(\n options?: ReadLineOptions\n ): ReadLine {\n return original({\n escapeCodeTimeout: ESCAPE_CODE_TIMEOUT_MS,\n ...options,\n });\n };\n}\n","import { applyEscapeSequenceTimeout } from './EscapeSequenceTimeout';\n\n// The double-ESC gesture needs a short escape-sequence horizon (see\n// EscapeSequenceTimeout.ts) -- applied once, before any prompt mounts\n// (no createInterface call happens while merely importing; the patch\n// only needs to beat the first CALL). app.ts also calls this before\n// parseAsync; this module-load call is idempotent defense in depth for\n// entry points that never see app.ts.\napplyEscapeSequenceTimeout();\n\n/**\n * The \"exit all the way out\" affordance (user feedback 2026-10-12:\n * backing out of a nested position one ESC per level costs too many\n * presses; a fast double-ESC -- the mouse double-click gesture -- should\n * unwind everything at once). Single ESC keeps its per-surface meaning\n * (back one level, or exit at the top); two ESCs within the window\n * resolve the prompt with the EXIT_ALL sentinel, which callers unwind\n * to the very top with.\n *\n * Zero-import (one sibling module: EscapeSequenceTimeout, itself\n * dependency-free): every prompt module and the resolver use this, so\n * it must not drag any graph in.\n *\n * MECHANISM (user design 2026-10-13, replacing the cross-prompt wall-\n * clock tried first): the first ESC does NOT resolve the prompt -- it\n * opens a GRACE WINDOW (setTimeout). A second ESC inside the window\n * resolves EXIT_ALL immediately; when the timer fires with no second\n * press, the single-ESC action resolves (back one level). Both presses\n * are therefore processed by the SAME prompt instance -- the gesture\n * can never fall into the gap between a closing prompt and whatever\n * re-opens next. That gap is exactly what broke the previous design:\n * every ESC resolves and closes its prompt, so the second press always\n * landed in a fresh instance (picker boot + human reaction measured\n * 1.3s in the field -- far outside any sane pairing window), and no\n * cross-prompt clock could bridge it reliably without also pairing\n * deliberate level-by-level back-outs.\n *\n * The cost is 400ms of added latency on every single-ESC action --\n * imperceptible next to the picker it closes. A status hint renders\n * during the grace so the gesture is discoverable (\"esc again to exit\n * all\").\n */\n\n/** Milliseconds the first ESC waits before acting on its own. */\nexport const EXIT_ALL_WINDOW_MS = 400;\n\n/**\n * The sentinel every escapable prompt resolves with when the user\n * double-pressed ESC. Distinct from the per-surface escape symbols\n * (ESCAPE / MULTISEL_ESCAPE / PAGE_ESCAPE / the value box's reject):\n * those mean \"back one level\", this means \"leave everything\".\n */\nexport const EXIT_ALL = Symbol('interactive:exitAll');\n\n/**\n * The unwind signal consumers of EXIT_ALL THROW (never return): exit-all\n * means \"leave the session entirely -- straight back to the shell\" (docs/\n * INTERACTIVE-COMMANDS.md), from any nesting depth. A thrown symbol\n * traverses commander's async action/hooks and every intermediate loop\n * untouched -- the per-surface STEP_BACK catches already let\n * non-STEP_BACK errors propagate -- until app.ts's top-level handler\n * converts it into a clean exit. Throwing (rather than threading a\n * return value through every loop) is what makes the unwind work from\n * pickers called INSIDE nested loops (realm/entity pickers inside the\n * action body, editors inside routing loops): each of those would\n * otherwise need its own EXIT_ALL branch.\n */\nexport const EXIT_ALL_SIGNAL = Symbol('interactive:exitAllSignal');\n\n/**\n * Starts the grace window for the first ESC of a possible double-press\n * and arms the second-press handler. `onSecondEscape` runs immediately\n * when a second ESC arrives inside the window (the prompt then resolves\n * EXIT_ALL); `onGraceExpire` runs when the window closes with no second\n * press (the prompt then resolves its per-surface single-ESC action).\n * `onOtherKey` cancels the grace and resolves the single-ESC action\n * immediately -- the presses must be CONSECUTIVE (the double-click\n * analogy); any other key ends the gesture.\n *\n * Returns a disposer that clears the timer without resolving anything\n * (for prompt teardown).\n */\nexport function armEscapeGrace({\n windowMs = EXIT_ALL_WINDOW_MS,\n onSecondEscape,\n onGraceExpire,\n}: {\n windowMs?: number;\n onSecondEscape: () => void;\n onGraceExpire: () => void;\n}): { secondEscape: () => void; otherKey: () => void; dispose: () => void } {\n let concluded = false;\n const timer = setTimeout(() => {\n if (concluded) return;\n concluded = true;\n onGraceExpire();\n }, windowMs);\n // Never hold the process open for the grace window: the prompt is\n // about to resolve one way or the other, and an unref'd timer that\n // fires after teardown is a no-op (concluded stays false only while\n // the prompt lives).\n timer.unref?.();\n return {\n secondEscape() {\n if (concluded) return;\n concluded = true;\n clearTimeout(timer);\n onSecondEscape();\n },\n otherKey() {\n if (concluded) return;\n concluded = true;\n clearTimeout(timer);\n onGraceExpire();\n },\n dispose() {\n clearTimeout(timer);\n concluded = true;\n },\n };\n}\n","/**\n * The prompt gate's pure state, split from PromptGate.ts so it stays\n * importable from unit tests: PromptGate pulls in @inquirer/core and the\n * frodo-lib-importing ColorTheme, and this CLI's Jest setup cannot load\n * frodo-lib (see src/app.commandWiring.test.ts's header comment).\n *\n * Prompts fire only when EVERY one of these holds --\n *\n * - `FRODO_NO_PROMPT` is unset (the explicit user opt-out, honored no\n * matter how interactive the session looks; also settable per command\n * via --no-prompt, see FrodoCommand);\n * - `FRODO_TEST !== '1'` (the e2e harness tools/with-frodo-bin.mjs spawns\n * with stdio: 'inherit', so local test runs DO have a TTY -- an\n * isTTY-only gate would hang them);\n * - both stdin and stdout are TTYs (piped/redirected sessions, the MCP\n * server's stdio protocol channel, and CI all fail this naturally);\n * - and setNeverPrompt() has not been called for this process (belt and\n * braces for surfaces whose stdio is a protocol channel by\n * construction, e.g. `frodo mcp server start --transport stdio`).\n *\n * Outside the gate, behavior is byte-identical to before the interactive\n * layer existed: same errors, same exit codes.\n */\n\n/** Module-scoped hard kill switch for protocol-channel surfaces. */\nlet neverPrompt = false;\n\n/**\n * Prompts actually rendered this process (incremented by the prompt\n * modules as they open). The resolution pass consults this to tell an\n * interactive-assisted run (at least one prompt concluded) from a fully\n * specified TTY run where the pass found nothing to do -- the command\n * preview's final print belongs to the former (its payoff is the\n * prompts' concluding <enter>), not the latter. Counter, not flag: a\n * connection page + picker session must not lose the fact because the\n * FIRST prompt of the session renders before the print gate could read a\n * boolean.\n */\nlet promptSessionCount = 0;\n\n/**\n * Records that an interactive prompt is being shown. Called by the\n * prompt modules (textPrompt, escapableSelect, escapableMultiSelect,\n * connectionPage) at open time.\n */\nexport function notePromptRendered(): void {\n promptSessionCount += 1;\n}\n\n/** How many prompts have rendered this process. */\nexport function promptsRendered(): number {\n return promptSessionCount;\n}\n\n/**\n * Permanently disables prompting for the remainder of this process. Used\n * by surfaces whose stdin/stdout are a protocol channel by construction\n * (e.g. the MCP server's stdio transport) as belt-and-braces alongside\n * the natural isTTY check.\n */\nexport function setNeverPrompt(): void {\n neverPrompt = true;\n}\n\n/**\n * Test-only escape hatch: clears the kill switch so a test can exercise\n * the other gate conditions in any order. Not part of the product\n * surface.\n */\nexport function resetNeverPromptForTests(): void {\n neverPrompt = false;\n}\n\n/**\n * Whether prompts may fire in this process right now. Pure (no I/O) and\n * cheap, so it can be consulted per prompt.\n */\nexport function canPrompt(): boolean {\n if (neverPrompt) return false;\n if (process.env.FRODO_NO_PROMPT) return false;\n if (process.env.FRODO_TEST === '1') return false;\n return !!process.stdin.isTTY && !!process.stdout.isTTY;\n}\n","/**\n * The invocation editor's candidate list and the discoverability\n * hint derived from it (docs/INTERACTIVE-COMMANDS.md), split into a\n * zero-import module the same way PromptGateState/ActiveActionCommandState\n * are: pickers in this directory (EntityPickers, RealmPickers) attach the\n * hint to their prompts, and the editor in cli/ResolveInteractiveInputs\n * consumes the same list -- one shared source of truth, so the\n * \"(→ N options)\" count is always the truthful promise the\n * editor delivers on.\n *\n * Pure commander logic, no frodo-lib: importable from anywhere without\n * dragging heavy graphs into tests that mock frodo-lib wholesale.\n */\n\nimport type { Command, Option } from 'commander';\n\n/**\n * The command's editable options for this invocation -- the exact\n * candidate list the invocation editor offers: options not yet valued,\n * PLUS already-valued ones (editing what was given\n * is the point of an editor; the value step pre-fills the current\n * value). Non-editable machinery (help/version/prompting) never counts.\n */\nexport function editableOptionalOptions(command: Command): Option[] {\n return command.options.filter((option) => {\n // Help/version/prompt machinery is not an editable option. The\n // prompting switch is a dual option pair (--prompt + --no-prompt)\n // sharing the `prompt` attribute -- BOTH name() spellings excluded.\n if (\n option.name() === 'help' ||\n option.name() === 'help-more' ||\n option.name() === 'help-all' ||\n option.name() === 'version' ||\n option.name() === 'prompt' ||\n option.name() === 'no-prompt' ||\n option.name() === 'edit' ||\n option.name() === 'save-defaults'\n ) {\n return false;\n }\n return true;\n });\n}\n\n/**\n * The discoverability hint for `command`'s pickers: a counted\n * promise of what pressing → opens. Undefined when there is nothing to\n * configure -- silence means done, so pickers without a hint keep the\n * → key unclaimed.\n */\nexport function editableOptionsHint(command: Command): string | undefined {\n const count = editableOptionalOptions(command).length;\n return count > 0 ? `→ ${count} options` : undefined;\n}\n\n/**\n * One collapsible section in the grouped editor: the help-group id\n * (commander's heading string) and the human label the header renders\n * (`Authentication Options:` -> `Authentication options`).\n */\nexport type EditableOptionGroup = {\n /** The help-group heading this section folds (the grouping key). */\n id: string;\n /** The header label, e.g. 'Connection options'. */\n label: string;\n};\n\n/**\n * Zero-import: `helpGroupHeading` is commander's own Option property;\n * no frodo-lib. Headings 'Options:' and '' mean the command's OWN\n * options -- the group every leaf option lands in unless FrodoCommand\n * assigned a shared heading (the same data the -h/-hh layout uses, so\n * help and the editor can never disagree about where an option\n * belongs).\n */\nconst COMMAND_SPECIFIC_HEADINGS = new Set(['Options:', '']);\n\n/**\n * The option's editable-group id in the invocation editor:\n * `undefined` = the command's own options (rendered flat, always\n * visible), a heading string = a collapsible shared section.\n */\nexport function editableOptionGroupOf(option: Option): string | undefined {\n const heading = option.helpGroupHeading ?? '';\n return COMMAND_SPECIFIC_HEADINGS.has(heading) ? undefined : heading;\n}\n\n/**\n * The collapsible sections `options` actually populate, ordered\n * alphabetically by heading -- the same order `-hh` help prints the\n * groups in, so the editor and expanded help read alike. Empty groups\n * never render (silence = this command carries no such options).\n */\nexport function editableOptionGroups(options: Option[]): EditableOptionGroup[] {\n const present = new Set<string>();\n for (const option of options) {\n const group = editableOptionGroupOf(option);\n if (group !== undefined) present.add(group);\n }\n return [...present]\n .sort((a, b) => a.localeCompare(b))\n .map((heading) => ({\n id: heading,\n label: groupLabel(heading),\n }));\n}\n\n/** 'Authentication Options:' -> 'Authentication options'. */\nfunction groupLabel(heading: string): string {\n const words = heading.replace(/:$/, '').trim();\n if (words.length === 0) return 'Options';\n // Lowercase the trailing group word only ('options'), never the\n // distinguishing first word ('authentication').\n const parts = words.split(' ');\n parts[parts.length - 1] = parts[parts.length - 1].toLowerCase();\n return parts.join(' ');\n}\n\n/**\n * The editor's candidate ORDER: the command's own options first, then\n * the shared groups alphabetically by heading (the -hh order), the\n * dash-insensitive word sort INSIDE each (user feedback 2026-10-12: a\n * flat alphabetical list buries the command's own options among global/\n * connection machinery). Derived from the same grouping helpers the\n * grouped editor renders, so order and sections can never drift apart.\n */\nexport function sortEditableOptions(options: Option[]): Option[] {\n const groups = editableOptionGroups(options);\n const rankOf = (option: Option): number => {\n const group = editableOptionGroupOf(option);\n return group === undefined ? -1 : groups.findIndex((g) => g.id === group);\n };\n const label = (option: Option): string => {\n const words = option.flags\n .split(/[, ]+/)\n .filter((token) => token.startsWith('-'))\n .map((token) => token.replace(/^-+/, ''))\n .filter((word) => !/^[<[]/.test(word));\n return words.join(' ').toLowerCase();\n };\n return [...options].sort((a, b) => {\n const rankA = rankOf(a);\n const rankB = rankOf(b);\n if (rankA !== rankB) return rankA - rankB;\n return label(a).localeCompare(label(b));\n });\n}\n","const keybindings = ['emacs', 'vim'];\nconst keybindingLookup = new Set(keybindings);\nfunction isKeybinding(value) {\n return keybindingLookup.has(value);\n}\nexport function getDefaultKeybindings() {\n const env = process.env['INQUIRER_KEYBINDINGS'];\n if (!env)\n return [];\n return Array.from(new Set(env\n .toLowerCase()\n .split(/[\\s,]+/)\n .filter(isKeybinding)));\n}\nexport const isUpKey = (key, keybindings = []) => \n// The up key\nkey.name === 'up' ||\n // Vim keybinding: hjkl keys map to left/down/up/right\n (keybindings.includes('vim') && key.name === 'k') ||\n // Emacs keybinding: Ctrl+P means \"previous\" in Emacs navigation conventions\n (keybindings.includes('emacs') && key.ctrl && key.name === 'p');\nexport const isDownKey = (key, keybindings = []) => \n// The down key\nkey.name === 'down' ||\n // Vim keybinding: hjkl keys map to left/down/up/right\n (keybindings.includes('vim') && key.name === 'j') ||\n // Emacs keybinding: Ctrl+N means \"next\" in Emacs navigation conventions\n (keybindings.includes('emacs') && key.ctrl && key.name === 'n');\nexport const isSpaceKey = (key) => key.name === 'space';\nexport const isBackspaceKey = (key) => key.name === 'backspace';\nexport const isTabKey = (key) => key.name === 'tab';\nexport const isNumberKey = (key) => '1234567890'.includes(key.name);\nexport const isEnterKey = (key) => key.name === 'enter' || key.name === 'return';\nexport const isShiftKey = (key) => key.shift;\n","export class AbortPromptError extends Error {\n name = 'AbortPromptError';\n message = 'Prompt was aborted';\n constructor(options) {\n super();\n this.cause = options?.cause;\n }\n}\nexport class CancelPromptError extends Error {\n name = 'CancelPromptError';\n message = 'Prompt was canceled';\n}\nexport class ExitPromptError extends Error {\n name = 'ExitPromptError';\n}\nexport class HookError extends Error {\n name = 'HookError';\n}\nexport class ValidationError extends Error {\n name = 'ValidationError';\n}\n","/* eslint @typescript-eslint/no-explicit-any: [\"off\"] */\nimport { AsyncLocalStorage, AsyncResource } from 'node:async_hooks';\nimport { HookError, ValidationError } from \"./errors.js\";\nconst hookStorage = new AsyncLocalStorage();\nfunction createStore(rl) {\n const store = {\n rl,\n hooks: [],\n hooksCleanup: [],\n hooksEffect: [],\n index: 0,\n handleChange() { },\n };\n return store;\n}\n// Run callback in with the hook engine setup.\nexport function withHooks(rl, cb) {\n const store = createStore(rl);\n function cycle(render) {\n store.handleChange = () => {\n store.index = 0;\n render();\n };\n store.handleChange();\n }\n return hookStorage.run(store, () => cb(cycle));\n}\n// Safe getStore utility that'll return the store or throw if undefined.\nfunction getStore() {\n const store = hookStorage.getStore();\n if (!store) {\n throw new HookError('[Inquirer] Hook functions can only be called from within a prompt');\n }\n return store;\n}\nexport function readline() {\n return getStore().rl;\n}\n// Merge state updates happening within the callback function to avoid multiple renders.\nexport function withUpdates(fn) {\n const wrapped = (...args) => {\n const store = getStore();\n let shouldUpdate = false;\n const oldHandleChange = store.handleChange;\n store.handleChange = () => {\n shouldUpdate = true;\n };\n const returnValue = fn(...args);\n if (shouldUpdate) {\n oldHandleChange();\n }\n store.handleChange = oldHandleChange;\n return returnValue;\n };\n return AsyncResource.bind(wrapped);\n}\nexport function withPointer(cb) {\n const store = getStore();\n const { index } = store;\n const pointer = {\n get() {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n return store.hooks[index];\n },\n set(value) {\n store.hooks[index] = value;\n },\n initialized: index in store.hooks,\n };\n const returnValue = cb(pointer);\n store.index++;\n return returnValue;\n}\nexport function handleChange() {\n getStore().handleChange();\n}\nexport const effectScheduler = {\n queue(cb) {\n const store = getStore();\n const { index } = store;\n store.hooksEffect.push(() => {\n store.hooksCleanup[index]?.();\n const cleanFn = cb(readline());\n if (cleanFn != null && typeof cleanFn !== 'function') {\n throw new ValidationError('useEffect return value must be a cleanup function or nothing.');\n }\n store.hooksCleanup[index] = cleanFn;\n });\n },\n run() {\n const store = getStore();\n withUpdates(() => {\n store.hooksEffect.forEach((effect) => {\n effect();\n });\n // Warning: Clean the hooks before exiting the `withUpdates` block.\n // Failure to do so means an updates would hit the same effects again.\n store.hooksEffect.length = 0;\n })();\n },\n clearAll() {\n const store = getStore();\n store.hooksCleanup.forEach((cleanFn) => {\n cleanFn?.();\n });\n store.hooksEffect.length = 0;\n store.hooksCleanup.length = 0;\n },\n};\n","import { AsyncResource } from 'node:async_hooks';\nimport { withPointer, handleChange } from \"./hook-engine.js\";\nfunction isFactory(value) {\n return typeof value === 'function';\n}\nfunction isReducer(value) {\n return typeof value === 'function';\n}\nexport function useState(defaultValue) {\n return withPointer((pointer) => {\n const setState = AsyncResource.bind(function setState(newValue) {\n const currentValue = pointer.get();\n const nextValue = isReducer(newValue) ? newValue(currentValue) : newValue;\n // Noop if the value is still the same.\n if (!Object.is(currentValue, nextValue)) {\n pointer.set(nextValue);\n // Trigger re-render\n handleChange();\n }\n });\n if (pointer.initialized) {\n return [pointer.get(), setState];\n }\n const value = isFactory(defaultValue) ? defaultValue() : defaultValue;\n pointer.set(value);\n return [value, setState];\n });\n}\n","import { withPointer, effectScheduler } from \"./hook-engine.js\";\nexport function useEffect(cb, depArray) {\n withPointer((pointer) => {\n const oldDeps = pointer.get();\n const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i]));\n if (hasChanged) {\n effectScheduler.queue(cb);\n }\n pointer.set(depArray);\n });\n}\n","// process.env dot-notation access prints:\n// Property 'TERM' comes from an index signature, so it must be accessed with ['TERM'].ts(4111)\n/* eslint dot-notation: [\"off\"] */\nimport process from 'node:process';\n// Ported from is-unicode-supported\nfunction isUnicodeSupported() {\n if (!process.platform.startsWith('win')) {\n return process.env['TERM'] !== 'linux'; // Linux console (kernel)\n }\n return (Boolean(process.env['CI']) || // CI environments generally support unicode\n Boolean(process.env['WT_SESSION']) || // Windows Terminal\n Boolean(process.env['TERMINUS_SUBLIME']) || // Terminus (<0.2.27)\n process.env['ConEmuTask'] === '{cmd::Cmder}' || // ConEmu and cmder\n process.env['TERM_PROGRAM'] === 'Terminus-Sublime' ||\n process.env['TERM_PROGRAM'] === 'vscode' ||\n process.env['TERM'] === 'xterm-256color' ||\n process.env['TERM'] === 'alacritty' ||\n process.env['TERMINAL_EMULATOR'] === 'JetBrains-JediTerm');\n}\n// Ported from figures\nconst common = {\n circleQuestionMark: '(?)',\n questionMarkPrefix: '(?)',\n square: '█',\n squareDarkShade: '▓',\n squareMediumShade: '▒',\n squareLightShade: '░',\n squareTop: '▀',\n squareBottom: '▄',\n squareLeft: '▌',\n squareRight: '▐',\n squareCenter: '■',\n bullet: '●',\n dot: '․',\n ellipsis: '…',\n pointerSmall: '›',\n triangleUp: '▲',\n triangleUpSmall: '▴',\n triangleDown: '▼',\n triangleDownSmall: '▾',\n triangleLeftSmall: '◂',\n triangleRightSmall: '▸',\n home: '⌂',\n heart: '♥',\n musicNote: '♪',\n musicNoteBeamed: '♫',\n arrowUp: '↑',\n arrowDown: '↓',\n arrowLeft: '←',\n arrowRight: '→',\n arrowLeftRight: '↔',\n arrowUpDown: '↕',\n almostEqual: '≈',\n notEqual: '≠',\n lessOrEqual: '≤',\n greaterOrEqual: '≥',\n identical: '≡',\n infinity: '∞',\n subscriptZero: '₀',\n subscriptOne: '₁',\n subscriptTwo: '₂',\n subscriptThree: '₃',\n subscriptFour: '₄',\n subscriptFive: '₅',\n subscriptSix: '₆',\n subscriptSeven: '₇',\n subscriptEight: '₈',\n subscriptNine: '₉',\n oneHalf: '½',\n oneThird: '⅓',\n oneQuarter: '¼',\n oneFifth: '⅕',\n oneSixth: '⅙',\n oneEighth: '⅛',\n twoThirds: '⅔',\n twoFifths: '⅖',\n threeQuarters: '¾',\n threeFifths: '⅗',\n threeEighths: '⅜',\n fourFifths: '⅘',\n fiveSixths: '⅚',\n fiveEighths: '⅝',\n sevenEighths: '⅞',\n line: '─',\n lineBold: '━',\n lineDouble: '═',\n lineDashed0: '┄',\n lineDashed1: '┅',\n lineDashed2: '┈',\n lineDashed3: '┉',\n lineDashed4: '╌',\n lineDashed5: '╍',\n lineDashed6: '╴',\n lineDashed7: '╶',\n lineDashed8: '╸',\n lineDashed9: '╺',\n lineDashed10: '╼',\n lineDashed11: '╾',\n lineDashed12: '−',\n lineDashed13: '–',\n lineDashed14: '‐',\n lineDashed15: '⁃',\n lineVertical: '│',\n lineVerticalBold: '┃',\n lineVerticalDouble: '║',\n lineVerticalDashed0: '┆',\n lineVerticalDashed1: '┇',\n lineVerticalDashed2: '┊',\n lineVerticalDashed3: '┋',\n lineVerticalDashed4: '╎',\n lineVerticalDashed5: '╏',\n lineVerticalDashed6: '╵',\n lineVerticalDashed7: '╷',\n lineVerticalDashed8: '╹',\n lineVerticalDashed9: '╻',\n lineVerticalDashed10: '╽',\n lineVerticalDashed11: '╿',\n lineDownLeft: '┐',\n lineDownLeftArc: '╮',\n lineDownBoldLeftBold: '┓',\n lineDownBoldLeft: '┒',\n lineDownLeftBold: '┑',\n lineDownDoubleLeftDouble: '╗',\n lineDownDoubleLeft: '╖',\n lineDownLeftDouble: '╕',\n lineDownRight: '┌',\n lineDownRightArc: '╭',\n lineDownBoldRightBold: '┏',\n lineDownBoldRight: '┎',\n lineDownRightBold: '┍',\n lineDownDoubleRightDouble: '╔',\n lineDownDoubleRight: '╓',\n lineDownRightDouble: '╒',\n lineUpLeft: '┘',\n lineUpLeftArc: '╯',\n lineUpBoldLeftBold: '┛',\n lineUpBoldLeft: '┚',\n lineUpLeftBold: '┙',\n lineUpDoubleLeftDouble: '╝',\n lineUpDoubleLeft: '╜',\n lineUpLeftDouble: '╛',\n lineUpRight: '└',\n lineUpRightArc: '╰',\n lineUpBoldRightBold: '┗',\n lineUpBoldRight: '┖',\n lineUpRightBold: '┕',\n lineUpDoubleRightDouble: '╚',\n lineUpDoubleRight: '╙',\n lineUpRightDouble: '╘',\n lineUpDownLeft: '┤',\n lineUpBoldDownBoldLeftBold: '┫',\n lineUpBoldDownBoldLeft: '┨',\n lineUpDownLeftBold: '┥',\n lineUpBoldDownLeftBold: '┩',\n lineUpDownBoldLeftBold: '┪',\n lineUpDownBoldLeft: '┧',\n lineUpBoldDownLeft: '┦',\n lineUpDoubleDownDoubleLeftDouble: '╣',\n lineUpDoubleDownDoubleLeft: '╢',\n lineUpDownLeftDouble: '╡',\n lineUpDownRight: '├',\n lineUpBoldDownBoldRightBold: '┣',\n lineUpBoldDownBoldRight: '┠',\n lineUpDownRightBold: '┝',\n lineUpBoldDownRightBold: '┡',\n lineUpDownBoldRightBold: '┢',\n lineUpDownBoldRight: '┟',\n lineUpBoldDownRight: '┞',\n lineUpDoubleDownDoubleRightDouble: '╠',\n lineUpDoubleDownDoubleRight: '╟',\n lineUpDownRightDouble: '╞',\n lineDownLeftRight: '┬',\n lineDownBoldLeftBoldRightBold: '┳',\n lineDownLeftBoldRightBold: '┯',\n lineDownBoldLeftRight: '┰',\n lineDownBoldLeftBoldRight: '┱',\n lineDownBoldLeftRightBold: '┲',\n lineDownLeftRightBold: '┮',\n lineDownLeftBoldRight: '┭',\n lineDownDoubleLeftDoubleRightDouble: '╦',\n lineDownDoubleLeftRight: '╥',\n lineDownLeftDoubleRightDouble: '╤',\n lineUpLeftRight: '┴',\n lineUpBoldLeftBoldRightBold: '┻',\n lineUpLeftBoldRightBold: '┷',\n lineUpBoldLeftRight: '┸',\n lineUpBoldLeftBoldRight: '┹',\n lineUpBoldLeftRightBold: '┺',\n lineUpLeftRightBold: '┶',\n lineUpLeftBoldRight: '┵',\n lineUpDoubleLeftDoubleRightDouble: '╩',\n lineUpDoubleLeftRight: '╨',\n lineUpLeftDoubleRightDouble: '╧',\n lineUpDownLeftRight: '┼',\n lineUpBoldDownBoldLeftBoldRightBold: '╋',\n lineUpDownBoldLeftBoldRightBold: '╈',\n lineUpBoldDownLeftBoldRightBold: '╇',\n lineUpBoldDownBoldLeftRightBold: '╊',\n lineUpBoldDownBoldLeftBoldRight: '╉',\n lineUpBoldDownLeftRight: '╀',\n lineUpDownBoldLeftRight: '╁',\n lineUpDownLeftBoldRight: '┽',\n lineUpDownLeftRightBold: '┾',\n lineUpBoldDownBoldLeftRight: '╂',\n lineUpDownLeftBoldRightBold: '┿',\n lineUpBoldDownLeftBoldRight: '╃',\n lineUpBoldDownLeftRightBold: '╄',\n lineUpDownBoldLeftBoldRight: '╅',\n lineUpDownBoldLeftRightBold: '╆',\n lineUpDoubleDownDoubleLeftDoubleRightDouble: '╬',\n lineUpDoubleDownDoubleLeftRight: '╫',\n lineUpDownLeftDoubleRightDouble: '╪',\n lineCross: '╳',\n lineBackslash: '╲',\n lineSlash: '╱',\n};\nconst specialMainSymbols = {\n tick: '✔',\n info: 'ℹ',\n warning: '⚠',\n cross: '✘',\n squareSmall: '◻',\n squareSmallFilled: '◼',\n circle: '◯',\n circleFilled: '◉',\n circleDotted: '◌',\n circleDouble: '◎',\n circleCircle: 'ⓞ',\n circleCross: 'ⓧ',\n circlePipe: 'Ⓘ',\n radioOn: '◉',\n radioOff: '◯',\n checkboxOn: '☒',\n checkboxOff: '☐',\n checkboxCircleOn: 'ⓧ',\n checkboxCircleOff: 'Ⓘ',\n pointer: '❯',\n triangleUpOutline: '△',\n triangleLeft: '◀',\n triangleRight: '▶',\n lozenge: '◆',\n lozengeOutline: '◇',\n hamburger: '☰',\n smiley: '㋡',\n mustache: '෴',\n star: '★',\n play: '▶',\n nodejs: '⬢',\n oneSeventh: '⅐',\n oneNinth: '⅑',\n oneTenth: '⅒',\n};\nconst specialFallbackSymbols = {\n tick: '√',\n info: 'i',\n warning: '‼',\n cross: '×',\n squareSmall: '□',\n squareSmallFilled: '■',\n circle: '( )',\n circleFilled: '(*)',\n circleDotted: '( )',\n circleDouble: '( )',\n circleCircle: '(○)',\n circleCross: '(×)',\n circlePipe: '(│)',\n radioOn: '(*)',\n radioOff: '( )',\n checkboxOn: '[×]',\n checkboxOff: '[ ]',\n checkboxCircleOn: '(×)',\n checkboxCircleOff: '( )',\n pointer: '>',\n triangleUpOutline: '∆',\n triangleLeft: '◄',\n triangleRight: '►',\n lozenge: '♦',\n lozengeOutline: '◊',\n hamburger: '≡',\n smiley: '☺',\n mustache: '┌─┐',\n star: '✶',\n play: '►',\n nodejs: '♦',\n oneSeventh: '1/7',\n oneNinth: '1/9',\n oneTenth: '1/10',\n};\nexport const mainSymbols = {\n ...common,\n ...specialMainSymbols,\n};\nexport const fallbackSymbols = {\n ...common,\n ...specialFallbackSymbols,\n};\nconst shouldUseMain = isUnicodeSupported();\nconst figures = shouldUseMain\n ? mainSymbols\n : fallbackSymbols;\nexport default figures;\nconst replacements = Object.entries(specialMainSymbols);\n// On terminals which do not support Unicode symbols, substitute them to other symbols\nexport const replaceSymbols = (string, { useFallback = !shouldUseMain } = {}) => {\n if (useFallback) {\n for (const [key, mainSymbol] of replacements) {\n const fallbackSymbol = fallbackSymbols[key];\n if (!fallbackSymbol) {\n throw new Error(`Unable to find fallback for ${key}`);\n }\n string = string.replaceAll(mainSymbol, fallbackSymbol);\n }\n }\n return string;\n};\n","import { styleText } from 'node:util';\nimport figures from '@inquirer/figures';\nimport { getDefaultKeybindings } from \"./key.js\";\nexport const defaultTheme = {\n prefix: {\n idle: styleText('blue', '?'),\n done: styleText('green', figures.tick),\n },\n spinner: {\n interval: 80,\n frames: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'].map((frame) => styleText('yellow', frame)),\n },\n keybindings: [],\n style: {\n answer: (text) => styleText('cyan', text),\n message: (text) => styleText('bold', text),\n error: (text) => styleText('red', `> ${text}`),\n defaultAnswer: (text) => styleText('dim', `(${text})`),\n help: (text) => styleText('dim', text),\n highlight: (text) => styleText('cyan', text),\n key: (text) => styleText('cyan', styleText('bold', `<${text}>`)),\n },\n};\nexport function getDefaultTheme() {\n return {\n ...defaultTheme,\n keybindings: getDefaultKeybindings(),\n };\n}\n","import { getDefaultTheme } from \"./theme.js\";\nfunction isPlainObject(value) {\n if (typeof value !== 'object' || value === null)\n return false;\n let proto = value;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(value) === proto;\n}\nfunction deepMerge(...objects) {\n const output = {};\n for (const obj of objects) {\n for (const [key, value] of Object.entries(obj)) {\n const prevValue = output[key];\n output[key] =\n isPlainObject(prevValue) && isPlainObject(value)\n ? deepMerge(prevValue, value)\n : value;\n }\n }\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n return output;\n}\nexport function makeTheme(...themes) {\n /* oxlint-disable typescript/no-unsafe-type-assertion */\n const themesToMerge = [\n getDefaultTheme(),\n ...themes.filter((theme) => theme != null),\n ];\n return deepMerge(...themesToMerge);\n /* oxlint-enable typescript/no-unsafe-type-assertion */\n}\n","import { useState } from \"./use-state.js\";\nimport { useEffect } from \"./use-effect.js\";\nimport { makeTheme } from \"./make-theme.js\";\nexport function usePrefix({ status = 'idle', theme, }) {\n const [showLoader, setShowLoader] = useState(false);\n const [tick, setTick] = useState(0);\n const { prefix, spinner } = makeTheme(theme);\n useEffect(() => {\n if (status === 'loading') {\n let tickInterval;\n let inc = -1;\n // Delay displaying spinner by 300ms, to avoid flickering\n const delayTimeout = setTimeout(() => {\n setShowLoader(true);\n tickInterval = setInterval(() => {\n inc = inc + 1;\n setTick(inc % spinner.frames.length);\n }, spinner.interval);\n }, 300);\n return () => {\n clearTimeout(delayTimeout);\n clearInterval(tickInterval);\n };\n }\n else {\n setShowLoader(false);\n }\n }, [status]);\n if (showLoader) {\n return spinner.frames[tick];\n }\n // There's a delay before we show the loader. So we want to ignore `loading` here, and pass idle instead.\n const iconName = status === 'loading' ? 'idle' : status;\n return typeof prefix === 'string' ? prefix : (prefix[iconName] ?? prefix['idle']);\n}\n","import { withPointer } from \"./hook-engine.js\";\nexport function useMemo(fn, dependencies) {\n return withPointer((pointer) => {\n const prev = pointer.get();\n if (!pointer.initialized ||\n prev.dependencies.length !== dependencies.length ||\n prev.dependencies.some((dep, i) => dep !== dependencies[i])) {\n const value = fn();\n pointer.set({ value, dependencies });\n return value;\n }\n return prev.value;\n });\n}\n","import { useState } from \"./use-state.js\";\nexport function useRef(val) {\n return useState({ current: val })[0];\n}\n","import { useRef } from \"./use-ref.js\";\nimport { useEffect } from \"./use-effect.js\";\nimport { withUpdates } from \"./hook-engine.js\";\nexport function useKeypress(userHandler) {\n const signal = useRef(userHandler);\n signal.current = userHandler;\n useEffect((rl) => {\n let ignore = false;\n const handler = withUpdates((_input, event) => {\n if (ignore)\n return;\n void signal.current(event, rl);\n });\n rl.input.on('keypress', handler);\n return () => {\n ignore = true;\n rl.input.removeListener('keypress', handler);\n };\n }, []);\n}\n","'use strict';\n\nmodule.exports = cliWidth;\n\nfunction normalizeOpts(options) {\n const defaultOpts = {\n defaultWidth: 0,\n output: process.stdout,\n tty: require('tty'),\n };\n\n if (!options) {\n return defaultOpts;\n }\n\n Object.keys(defaultOpts).forEach(function (key) {\n if (!options[key]) {\n options[key] = defaultOpts[key];\n }\n });\n\n return options;\n}\n\nfunction cliWidth(options) {\n const opts = normalizeOpts(options);\n\n if (opts.output.getWindowSize) {\n return opts.output.getWindowSize()[0] || opts.defaultWidth;\n }\n\n if (opts.tty.getWindowSize) {\n return opts.tty.getWindowSize()[1] || opts.defaultWidth;\n }\n\n if (opts.output.columns) {\n return opts.output.columns;\n }\n\n if (process.env.CLI_WIDTH) {\n const width = parseInt(process.env.CLI_WIDTH, 10);\n\n if (!isNaN(width) && width !== 0) {\n return width;\n }\n }\n\n return opts.defaultWidth;\n}\n","/* MAIN */\nconst getCodePointsLength = (() => {\n const SURROGATE_PAIR_RE = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n return (input) => {\n let surrogatePairsNr = 0;\n SURROGATE_PAIR_RE.lastIndex = 0;\n while (SURROGATE_PAIR_RE.test(input)) {\n surrogatePairsNr += 1;\n }\n return input.length - surrogatePairsNr;\n };\n})();\nconst isFullWidth = (x) => {\n return x === 0x3000 || x >= 0xFF01 && x <= 0xFF60 || x >= 0xFFE0 && x <= 0xFFE6;\n};\nconst isWideNotCJKTNotEmoji = (x) => {\n return x === 0x231B || x === 0x2329 || x >= 0x2FF0 && x <= 0x2FFF || x >= 0x3001 && x <= 0x303E || 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 >= 0xFE10 && x <= 0xFE19 || x >= 0xFE30 && x <= 0xFE52 || x >= 0xFE54 && x <= 0xFE66 || x >= 0xFE68 && x <= 0xFE6B || x >= 0x1F200 && x <= 0x1F202 || x >= 0x1F210 && x <= 0x1F23B || x >= 0x1F240 && x <= 0x1F248 || x >= 0x20000 && x <= 0x2FFFD || x >= 0x30000 && x <= 0x3FFFD;\n};\n/* EXPORT */\nexport { getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji };\n","/* IMPORT */\nimport { getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji } from './utils.js';\n/* HELPERS */\nconst ANSI_RE = /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\\u001b\\]8;[^;]*;.*?(?:\\u0007|\\u001b\\u005c)/y;\nconst CONTROL_RE = /[\\x00-\\x08\\x0A-\\x1F\\x7F-\\x9F]{1,1000}/y;\nconst CJKT_WIDE_RE = /(?:(?![\\uFF61-\\uFF9F\\uFF00-\\uFFEF])[\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Hangul}\\p{Script=Tangut}]){1,1000}/yu;\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 */\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 = 0;\n const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;\n const TAB_WIDTH = widthOptions.tabWidth ?? 8;\n const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;\n const FULL_WIDTH_WIDTH = 2;\n const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;\n const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;\n const PARSE_BLOCKS = [\n [LATIN_RE, REGULAR_WIDTH],\n [ANSI_RE, ANSI_WIDTH],\n [CONTROL_RE, CONTROL_WIDTH],\n [TAB_RE, TAB_WIDTH],\n [EMOJI_RE, EMOJI_WIDTH],\n [CJKT_WIDE_RE, WIDE_WIDTH],\n ];\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 (isWideNotCJKTNotEmoji(codePoint)) {\n widthExtra = WIDE_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 outer;\n }\n /* PARSE BLOCKS */\n for (let i = 0, l = PARSE_BLOCKS.length; i < l; i++) {\n const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];\n BLOCK_RE.lastIndex = index;\n if (BLOCK_RE.test(input)) {\n lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;\n widthExtra = lengthExtra * BLOCK_WIDTH;\n if ((width + widthExtra) > truncationLimit) {\n truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));\n }\n if ((width + widthExtra) > LIMIT) {\n truncationEnabled = true;\n break outer;\n }\n width += widthExtra;\n unmatchedStart = indexPrev;\n unmatchedEnd = index;\n index = indexPrev = BLOCK_RE.lastIndex;\n continue outer;\n }\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 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 && lastRow !== undefined && lastRow.length && 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) {\n if (stringWidth(words[last - 1])) {\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 let rows = [''];\n let rowLength = 0;\n for (let index = 0; index < words.length; index++) {\n const word = words[index];\n if (options.trim !== false) {\n const row = rows.at(-1) ?? '';\n const trimmed = row.trimStart();\n if (row.length !== trimmed.length) {\n rows[rows.length - 1] = trimmed;\n rowLength = stringWidth(trimmed);\n }\n }\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 || options.trim === false) {\n rows[rows.length - 1] += ' ';\n rowLength++;\n }\n }\n const wordLength = stringWidth(word);\n if (options.hard && wordLength > columns) {\n const remainingColumns = columns - rowLength;\n const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);\n const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);\n if (breaksStartingNextLine < breaksStartingThisLine) {\n rows.push('');\n }\n wrapWord(rows, word, columns);\n rowLength = stringWidth(rows.at(-1) ?? '');\n continue;\n }\n if (rowLength + wordLength > columns && rowLength && wordLength) {\n if (options.wordWrap === false && rowLength < columns) {\n wrapWord(rows, word, columns);\n rowLength = stringWidth(rows.at(-1) ?? '');\n continue;\n }\n rows.push('');\n rowLength = 0;\n }\n if (rowLength + wordLength > columns && options.wordWrap === false) {\n wrapWord(rows, word, columns);\n rowLength = stringWidth(rows.at(-1) ?? '');\n continue;\n }\n rows[rows.length - 1] += word;\n rowLength += wordLength;\n }\n if (options.trim !== false) {\n rows = rows.map((row) => stringVisibleTrimSpacesRight(row));\n }\n const preString = rows.join('\\n');\n let inSurrogate = false;\n for (let i = 0; i < preString.length; i++) {\n const character = preString[i];\n returnValue += character;\n if (!inSurrogate) {\n inSurrogate = character >= '\\ud800' && character <= '\\udbff';\n if (inSurrogate) {\n continue;\n }\n }\n else {\n inSurrogate = false;\n }\n if (character === ESC || character === CSI) {\n GROUP_REGEX.lastIndex = i + 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 if (preString[i + 1] === '\\n') {\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink('');\n }\n const closingCode = escapeCode ? getClosingCode(escapeCode) : undefined;\n if (escapeCode && closingCode) {\n returnValue += wrapAnsiCode(closingCode);\n }\n }\n else if (character === '\\n') {\n if (escapeCode && getClosingCode(escapeCode)) {\n returnValue += wrapAnsiCode(escapeCode);\n }\n if (escapeUrl) {\n returnValue += wrapAnsiHyperlink(escapeUrl);\n }\n }\n }\n return returnValue;\n};\nconst CRLF_OR_LF = /\\r?\\n/;\nexport function wrapAnsi(string, columns, options) {\n return String(string)\n .normalize()\n .split(CRLF_OR_LF)\n .map((line) => exec(line, columns, options))\n .join('\\n');\n}\n","import cliWidth from 'cli-width';\nimport { wrapAnsi } from 'fast-wrap-ansi';\nimport { readline } from \"./hook-engine.js\";\n/**\n * Force line returns at specific width. This function is ANSI code friendly and it'll\n * ignore invisible codes during width calculation.\n * @param {string} content\n * @param {number} width\n * @return {string}\n */\nexport function breakLines(content, width) {\n return content\n .split('\\n')\n .flatMap((line) => wrapAnsi(line, width, { trim: false, wordWrap: false })\n .split('\\n')\n .map((str) => str.trimEnd()))\n .join('\\n');\n}\n/**\n * Returns the width of the active readline, or 80 as default value.\n * @returns {number}\n */\nexport function readlineWidth() {\n return cliWidth({ defaultWidth: 80, output: readline().output });\n}\n","import { useRef } from \"../use-ref.js\";\nimport { readlineWidth, breakLines } from \"../utils.js\";\nfunction usePointerPosition({ active, renderedItems, pageSize, loop, }) {\n const state = useRef({\n lastPointer: active,\n lastActive: undefined,\n });\n const { lastPointer, lastActive } = state.current;\n const middle = Math.floor(pageSize / 2);\n const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);\n const defaultPointerPosition = renderedItems\n .slice(0, active)\n .reduce((acc, item) => acc + item.length, 0);\n let pointer = defaultPointerPosition;\n if (renderedLength > pageSize) {\n if (loop) {\n /**\n * Creates the next position for the pointer considering an infinitely\n * looping list of items to be rendered on the page.\n *\n * The goal is to progressively move the cursor to the middle position as the user move down, and then keep\n * the cursor there. When the user move up, maintain the cursor position.\n */\n // By default, keep the cursor position as-is.\n pointer = lastPointer;\n if (\n // First render, skip this logic.\n lastActive != null &&\n // Only move the pointer down when the user moves down.\n lastActive < active &&\n // Check user didn't move up across page boundary.\n active - lastActive < pageSize) {\n pointer = Math.min(\n // Furthest allowed position for the pointer is the middle of the list\n middle, Math.abs(active - lastActive) === 1\n ? Math.min(\n // Move the pointer at most the height of the last active item.\n lastPointer + (renderedItems[lastActive]?.length ?? 0), \n // If the user moved by one item, move the pointer to the natural position of the active item as\n // long as it doesn't move the cursor up.\n Math.max(defaultPointerPosition, lastPointer))\n : // Otherwise, move the pointer down by the difference between the active and last active item.\n lastPointer + active - lastActive);\n }\n }\n else {\n /**\n * Creates the next position for the pointer considering a finite list of\n * items to be rendered on a page.\n *\n * The goal is to keep the pointer in the middle of the page whenever possible, until\n * we reach the bounds of the list (top or bottom). In which case, the cursor moves progressively\n * to the bottom or top of the list.\n */\n const spaceUnderActive = renderedItems\n .slice(active)\n .reduce((acc, item) => acc + item.length, 0);\n pointer =\n spaceUnderActive < pageSize - middle\n ? // If the active item is near the end of the list, progressively move the cursor towards the end.\n pageSize - spaceUnderActive\n : // Otherwise, progressively move the pointer to the middle of the list.\n Math.min(defaultPointerPosition, middle);\n }\n }\n // Save state for the next render\n state.current.lastPointer = pointer;\n state.current.lastActive = active;\n return pointer;\n}\nexport function usePagination({ items, active, renderItem, pageSize, loop = true, }) {\n const width = readlineWidth();\n const bound = (num) => ((num % items.length) + items.length) % items.length;\n const renderedItems = items.map((item, index) => {\n if (item == null)\n return [];\n return breakLines(renderItem({ item, index, isActive: index === active }), width).split('\\n');\n });\n const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);\n const renderItemAtIndex = (index) => renderedItems[index] ?? [];\n const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });\n // Render the active item to decide the position.\n // If the active item fits under the pointer, we render it there.\n // Otherwise, we need to render it to fit at the bottom of the page; moving the pointer up.\n const activeItem = renderItemAtIndex(active).slice(0, pageSize);\n const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;\n // Create an array of lines for the page, and add the lines of the active item into the page\n const pageBuffer = Array.from({ length: pageSize });\n pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);\n // Store to prevent rendering the same item twice\n const itemVisited = new Set([active]);\n // Fill the page under the active item\n let bufferPointer = activeItemPosition + activeItem.length;\n let itemPointer = bound(active + 1);\n while (bufferPointer < pageSize &&\n !itemVisited.has(itemPointer) &&\n (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {\n const lines = renderItemAtIndex(itemPointer);\n const linesToAdd = lines.slice(0, pageSize - bufferPointer);\n pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);\n // Move pointers for next iteration\n itemVisited.add(itemPointer);\n bufferPointer += linesToAdd.length;\n itemPointer = bound(itemPointer + 1);\n }\n // Fill the page over the active item\n bufferPointer = activeItemPosition - 1;\n itemPointer = bound(active - 1);\n while (bufferPointer >= 0 &&\n !itemVisited.has(itemPointer) &&\n (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {\n const lines = renderItemAtIndex(itemPointer);\n const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));\n pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);\n // Move pointers for next iteration\n itemVisited.add(itemPointer);\n bufferPointer -= linesToAdd.length;\n itemPointer = bound(itemPointer - 1);\n }\n return pageBuffer.filter((line) => typeof line === 'string').join('\\n');\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Create a promise and get access to its `resolve` and `reject` functions.\n *\n * Mirrors `Promise.withResolvers()`, available starting from Node 22.\n * TODO: Remove once Node 22 becomes the minimum supported version.\n */\nexport function withResolver() {\n let resolve;\n let reject;\n const promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { promise, resolve: resolve, reject: reject };\n}\n","const Stream = require('stream')\n\nclass MuteStream extends Stream {\n #isTTY = null\n\n constructor (opts = {}) {\n super(opts)\n this.writable = this.readable = true\n this.muted = false\n this.on('pipe', this._onpipe)\n this.replace = opts.replace\n\n // For readline-type situations\n // This much at the start of a line being redrawn after a ctrl char\n // is seen (such as backspace) won't be redrawn as the replacement\n this._prompt = opts.prompt || null\n this._hadControl = false\n }\n\n #destSrc (key, def) {\n if (this._dest) {\n return this._dest[key]\n }\n if (this._src) {\n return this._src[key]\n }\n return def\n }\n\n #proxy (method, ...args) {\n if (typeof this._dest?.[method] === 'function') {\n this._dest[method](...args)\n }\n if (typeof this._src?.[method] === 'function') {\n this._src[method](...args)\n }\n }\n\n get isTTY () {\n if (this.#isTTY !== null) {\n return this.#isTTY\n }\n return this.#destSrc('isTTY', false)\n }\n\n // basically just get replace the getter/setter with a regular value\n set isTTY (val) {\n this.#isTTY = val\n }\n\n get rows () {\n return this.#destSrc('rows')\n }\n\n get columns () {\n return this.#destSrc('columns')\n }\n\n mute () {\n this.muted = true\n }\n\n unmute () {\n this.muted = false\n }\n\n _onpipe (src) {\n this._src = src\n }\n\n pipe (dest, options) {\n this._dest = dest\n return super.pipe(dest, options)\n }\n\n pause () {\n if (this._src) {\n return this._src.pause()\n }\n }\n\n resume () {\n if (this._src) {\n return this._src.resume()\n }\n }\n\n write (c) {\n if (this.muted) {\n if (!this.replace) {\n return true\n }\n // eslint-disable-next-line no-control-regex\n if (c.match(/^\\u001b/)) {\n if (c.indexOf(this._prompt) === 0) {\n c = c.slice(this._prompt.length)\n c = c.replace(/./g, this.replace)\n c = this._prompt + c\n }\n this._hadControl = true\n return this.emit('data', c)\n } else {\n if (this._prompt && this._hadControl &&\n c.indexOf(this._prompt) === 0) {\n this._hadControl = false\n this.emit('data', this._prompt)\n c = c.slice(this._prompt.length)\n }\n c = c.toString().replace(/./g, this.replace)\n }\n }\n this.emit('data', c)\n }\n\n end (c) {\n if (this.muted) {\n if (c && this.replace) {\n c = c.toString().replace(/./g, this.replace)\n } else {\n c = null\n }\n }\n if (c) {\n this.emit('data', c)\n }\n this.emit('end')\n }\n\n destroy (...args) {\n return this.#proxy('destroy', ...args)\n }\n\n destroySoon (...args) {\n return this.#proxy('destroySoon', ...args)\n }\n\n close (...args) {\n return this.#proxy('close', ...args)\n }\n}\n\nmodule.exports = MuteStream\n","/**\n * This is not the set of all possible signals.\n *\n * It IS, however, the set of all signals that trigger\n * an exit on either Linux or BSD systems. Linux is a\n * superset of the signal names supported on BSD, and\n * the unknown signals just fail to register, so we can\n * catch that easily enough.\n *\n * Windows signals are a different set, since there are\n * signals that terminate Windows processes, but don't\n * terminate (or don't even exist) on Posix systems.\n *\n * Don't bother with SIGKILL. It's uncatchable, which\n * means that we can't fire any callbacks anyway.\n *\n * If a user does happen to register a handler on a non-\n * fatal signal like SIGWINCH or something, and then\n * exit, it'll end up firing `process.emit('exit')`, so\n * the handler will be fired anyway.\n *\n * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n * artificially, inherently leave the process in a\n * state from which it is not safe to try and enter JS\n * listeners.\n */\nexport const signals = [];\nsignals.push('SIGHUP', 'SIGINT', 'SIGTERM');\nif (process.platform !== 'win32') {\n signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n );\n}\nif (process.platform === 'linux') {\n signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT');\n}\n//# sourceMappingURL=signals.js.map","// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\n// grab a reference to node's real process object right away\nimport { signals } from './signals.js';\nexport { signals };\nconst processOk = (process) => !!process &&\n typeof process === 'object' &&\n typeof process.removeListener === 'function' &&\n typeof process.emit === 'function' &&\n typeof process.reallyExit === 'function' &&\n typeof process.listeners === 'function' &&\n typeof process.kill === 'function' &&\n typeof process.pid === 'number' &&\n typeof process.on === 'function';\nconst kExitEmitter = Symbol.for('signal-exit emitter');\nconst global = globalThis;\nconst ObjectDefineProperty = Object.defineProperty.bind(Object);\n// teeny special purpose ee\nclass Emitter {\n emitted = {\n afterExit: false,\n exit: false,\n };\n listeners = {\n afterExit: [],\n exit: [],\n };\n count = 0;\n id = Math.random();\n constructor() {\n if (global[kExitEmitter]) {\n return global[kExitEmitter];\n }\n ObjectDefineProperty(global, kExitEmitter, {\n value: this,\n writable: false,\n enumerable: false,\n configurable: false,\n });\n }\n on(ev, fn) {\n this.listeners[ev].push(fn);\n }\n removeListener(ev, fn) {\n const list = this.listeners[ev];\n const i = list.indexOf(fn);\n /* c8 ignore start */\n if (i === -1) {\n return;\n }\n /* c8 ignore stop */\n if (i === 0 && list.length === 1) {\n list.length = 0;\n }\n else {\n list.splice(i, 1);\n }\n }\n emit(ev, code, signal) {\n if (this.emitted[ev]) {\n return false;\n }\n this.emitted[ev] = true;\n let ret = false;\n for (const fn of this.listeners[ev]) {\n ret = fn(code, signal) === true || ret;\n }\n if (ev === 'exit') {\n ret = this.emit('afterExit', code, signal) || ret;\n }\n return ret;\n }\n}\nclass SignalExitBase {\n}\nconst signalExitWrap = (handler) => {\n return {\n onExit(cb, opts) {\n return handler.onExit(cb, opts);\n },\n load() {\n return handler.load();\n },\n unload() {\n return handler.unload();\n },\n };\n};\nclass SignalExitFallback extends SignalExitBase {\n onExit() {\n return () => { };\n }\n load() { }\n unload() { }\n}\nclass SignalExit extends SignalExitBase {\n // \"SIGHUP\" throws an `ENOSYS` error on Windows,\n // so use a supported signal instead\n /* c8 ignore start */\n #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP';\n /* c8 ignore stop */\n #emitter = new Emitter();\n #process;\n #originalProcessEmit;\n #originalProcessReallyExit;\n #sigListeners = {};\n #loaded = false;\n constructor(process) {\n super();\n this.#process = process;\n // { <signal>: <listener fn>, ... }\n this.#sigListeners = {};\n for (const sig of signals) {\n this.#sigListeners[sig] = () => {\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n const listeners = this.#process.listeners(sig);\n let { count } = this.#emitter;\n // This is a workaround for the fact that signal-exit v3 and signal\n // exit v4 are not aware of each other, and each will attempt to let\n // the other handle it, so neither of them do. To correct this, we\n // detect if we're the only handler *except* for previous versions\n // of signal-exit, and increment by the count of listeners it has\n // created.\n /* c8 ignore start */\n const p = process;\n if (typeof p.__signal_exit_emitter__ === 'object' &&\n typeof p.__signal_exit_emitter__.count === 'number') {\n count += p.__signal_exit_emitter__.count;\n }\n /* c8 ignore stop */\n if (listeners.length === count) {\n this.unload();\n const ret = this.#emitter.emit('exit', null, sig);\n /* c8 ignore start */\n const s = sig === 'SIGHUP' ? this.#hupSig : sig;\n if (!ret)\n process.kill(process.pid, s);\n /* c8 ignore stop */\n }\n };\n }\n this.#originalProcessReallyExit = process.reallyExit;\n this.#originalProcessEmit = process.emit;\n }\n onExit(cb, opts) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return () => { };\n }\n /* c8 ignore stop */\n if (this.#loaded === false) {\n this.load();\n }\n const ev = opts?.alwaysLast ? 'afterExit' : 'exit';\n this.#emitter.on(ev, cb);\n return () => {\n this.#emitter.removeListener(ev, cb);\n if (this.#emitter.listeners['exit'].length === 0 &&\n this.#emitter.listeners['afterExit'].length === 0) {\n this.unload();\n }\n };\n }\n load() {\n if (this.#loaded) {\n return;\n }\n this.#loaded = true;\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n this.#emitter.count += 1;\n for (const sig of signals) {\n try {\n const fn = this.#sigListeners[sig];\n if (fn)\n this.#process.on(sig, fn);\n }\n catch (_) { }\n }\n this.#process.emit = (ev, ...a) => {\n return this.#processEmit(ev, ...a);\n };\n this.#process.reallyExit = (code) => {\n return this.#processReallyExit(code);\n };\n }\n unload() {\n if (!this.#loaded) {\n return;\n }\n this.#loaded = false;\n signals.forEach(sig => {\n const listener = this.#sigListeners[sig];\n /* c8 ignore start */\n if (!listener) {\n throw new Error('Listener not defined for signal: ' + sig);\n }\n /* c8 ignore stop */\n try {\n this.#process.removeListener(sig, listener);\n /* c8 ignore start */\n }\n catch (_) { }\n /* c8 ignore stop */\n });\n this.#process.emit = this.#originalProcessEmit;\n this.#process.reallyExit = this.#originalProcessReallyExit;\n this.#emitter.count -= 1;\n }\n #processReallyExit(code) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return 0;\n }\n this.#process.exitCode = code || 0;\n /* c8 ignore stop */\n this.#emitter.emit('exit', this.#process.exitCode, null);\n return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);\n }\n #processEmit(ev, ...args) {\n const og = this.#originalProcessEmit;\n if (ev === 'exit' && processOk(this.#process)) {\n if (typeof args[0] === 'number') {\n this.#process.exitCode = args[0];\n /* c8 ignore start */\n }\n /* c8 ignore start */\n const ret = og.call(this.#process, ev, ...args);\n /* c8 ignore start */\n this.#emitter.emit('exit', this.#process.exitCode, null);\n /* c8 ignore stop */\n return ret;\n }\n else {\n return og.call(this.#process, ev, ...args);\n }\n }\n}\nconst process = globalThis.process;\n// wrap so that we call the method on the actual handler, without\n// exporting it directly.\nexport const { \n/**\n * Called when the process is exiting, whether via signal, explicit\n * exit, or running out of stuff to do.\n *\n * If the global process object is not suitable for instrumentation,\n * then this will be a no-op.\n *\n * Returns a function that may be used to unload signal-exit.\n */\nonExit, \n/**\n * Load the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\nload, \n/**\n * Unload the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\nunload, } = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback());\n//# sourceMappingURL=index.js.map","const ESC = '\\u001B[';\n/** Move cursor to first column */\nexport const cursorLeft = ESC + 'G';\n/** Hide the cursor */\nexport const cursorHide = ESC + '?25l';\n/** Show the cursor */\nexport const cursorShow = ESC + '?25h';\n/** Move cursor up by count rows */\nexport const cursorUp = (rows = 1) => (rows > 0 ? `${ESC}${rows}A` : '');\n/** Move cursor down by count rows */\nexport const cursorDown = (rows = 1) => rows > 0 ? `${ESC}${rows}B` : '';\n/** Move cursor to position (x, y) */\nexport const cursorTo = (x, y) => {\n if (typeof y === 'number' && !Number.isNaN(y)) {\n return `${ESC}${y + 1};${x + 1}H`;\n }\n return `${ESC}${x + 1}G`;\n};\nconst eraseLine = ESC + '2K';\n/** Erase the specified number of lines above the cursor */\nexport const eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : '';\n","import { stripVTControlCharacters } from 'node:util';\nimport { breakLines, readlineWidth } from \"./utils.js\";\nimport { cursorDown, cursorLeft, cursorUp, cursorTo, cursorShow, eraseLines, } from '@inquirer/ansi';\nconst height = (content) => content.split('\\n').length;\nconst lastLine = (content) => content.split('\\n').pop() ?? '';\nexport default class ScreenManager {\n // These variables are keeping information to allow correct prompt re-rendering\n height = 0;\n extraLinesUnderPrompt = 0;\n cursorPos;\n rl;\n constructor(rl) {\n this.rl = rl;\n this.cursorPos = rl.getCursorPos();\n }\n write(content) {\n this.rl.output.unmute();\n this.rl.output.write(content);\n this.rl.output.mute();\n }\n render(content, bottomContent = '') {\n // Write message to screen and setPrompt to control backspace\n const promptLine = lastLine(content);\n const rawPromptLine = stripVTControlCharacters(promptLine);\n // Remove the rl.line from our prompt. We can't rely on the content of\n // rl.line (mainly because of the password prompt), so just rely on it's\n // length.\n let prompt = rawPromptLine;\n if (this.rl.line.length > 0) {\n prompt = prompt.slice(0, -this.rl.line.length);\n }\n this.rl.setPrompt(prompt);\n // SetPrompt will change cursor position, now we can get correct value\n this.cursorPos = this.rl.getCursorPos();\n const width = readlineWidth();\n content = breakLines(content, width);\n bottomContent = breakLines(bottomContent, width);\n // Manually insert an extra line if we're at the end of the line.\n // This prevent the cursor from appearing at the beginning of the\n // current line.\n if (rawPromptLine.length % width === 0) {\n content += '\\n';\n }\n let output = content + (bottomContent ? '\\n' + bottomContent : '');\n /**\n * Re-adjust the cursor at the correct position.\n */\n // We need to consider parts of the prompt under the cursor as part of the bottom\n // content in order to correctly cleanup and re-render.\n const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;\n const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);\n // Return cursor to the input position (on top of the bottomContent)\n if (bottomContentHeight > 0)\n output += cursorUp(bottomContentHeight);\n // Return cursor to the initial left offset.\n output += cursorTo(this.cursorPos.cols);\n /**\n * Render and store state for future re-rendering\n */\n this.write(cursorDown(this.extraLinesUnderPrompt) + eraseLines(this.height) + output);\n this.extraLinesUnderPrompt = bottomContentHeight;\n this.height = height(output);\n }\n checkCursorPos() {\n const cursorPos = this.rl.getCursorPos();\n if (cursorPos.cols !== this.cursorPos.cols) {\n this.write(cursorTo(cursorPos.cols));\n this.cursorPos = cursorPos;\n }\n }\n done({ clearContent }) {\n this.rl.setPrompt('');\n let output = cursorDown(this.extraLinesUnderPrompt);\n output += clearContent ? eraseLines(this.height) : '\\n';\n // Reset cursor to column 0. On Windows terminals, \\n moves the cursor\n // down without resetting the column when the rendered prompt+answer\n // wraps past the terminal width. Without this, all subsequent output\n // starts at the wrong horizontal offset.\n output += cursorLeft;\n output += cursorShow;\n this.write(output);\n this.rl.close();\n }\n}\n","import * as readline from 'node:readline';\nimport { AsyncResource } from 'node:async_hooks';\nimport { withResolver } from '@inquirer/type';\nimport MuteStream from 'mute-stream';\nimport { onExit as onSignalExit } from 'signal-exit';\nimport ScreenManager from \"./screen-manager.js\";\nimport { withHooks, effectScheduler } from \"./hook-engine.js\";\nimport { AbortPromptError, CancelPromptError, ExitPromptError } from \"./errors.js\";\nimport path from 'node:path';\n// Capture the real setImmediate at module load time so it works even when test\n// frameworks mock timers with vi.useFakeTimers() or similar.\nconst nativeSetImmediate = globalThis.setImmediate;\n/**\n * Register an event listener and return its disposer, so registrations collapse\n * into a single statement: `cleanups.add(listenTo(rl, 'close', handler))`.\n */\nfunction listenTo(target, event, listener) {\n if ('on' in target) {\n target.on(event, listener);\n return () => target.removeListener(event, listener);\n }\n target.addEventListener(event, listener);\n return () => target.removeEventListener(event, listener);\n}\nfunction getCallSites() {\n // oxlint-disable-next-line typescript/unbound-method\n const savedPrepareStackTrace = Error.prepareStackTrace;\n let result = [];\n try {\n Error.prepareStackTrace = (_, callSites) => {\n const callSitesWithoutCurrent = callSites.slice(1);\n result = callSitesWithoutCurrent;\n return callSitesWithoutCurrent;\n };\n // oxlint-disable-next-line no-unused-expressions\n new Error().stack;\n }\n catch {\n // An error will occur if the Node flag --frozen-intrinsics is used.\n // https://nodejs.org/api/cli.html#--frozen-intrinsics\n return result;\n }\n Error.prepareStackTrace = savedPrepareStackTrace;\n return result;\n}\nexport function createPrompt(view) {\n const callSites = getCallSites();\n const prompt = (config, context = {}) => {\n // Default `input` to stdin\n const { input = process.stdin, signal } = context;\n const cleanups = new Set();\n // Add mute capabilities to the output\n const output = new MuteStream();\n output.pipe(context.output ?? process.stdout);\n /* oxlint-disable typescript/no-unsafe-type-assertion */\n const rl = readline.createInterface({\n terminal: true,\n input,\n output,\n });\n /* oxlint-enable typescript/no-unsafe-type-assertion */\n // Mute the output after readline has initialized so readline can perform\n // any terminal setup writes (e.g. Windows Console API initialization)\n // before suppressing output. ScreenManager will unmute/mute around each\n // render call as needed.\n output.mute();\n const screen = new ScreenManager(rl);\n const { promise, resolve, reject } = withResolver();\n return withHooks(rl, (cycle) => {\n // Clear hook effects synchronously before the prompt settles: readline\n // emits keypresses synchronously within a single data event, so a\n // microtask-deferred cleanup would let same-tick input keep driving a\n // settled prompt.\n const clearEffects = AsyncResource.bind(() => effectScheduler.clearAll());\n // The promise resolvers and effectScheduler.clearAll() are both idempotent,\n // so repeated settlement attempts are harmless no-ops. If a hook cleanup\n // throws, the cleanup error supersedes the settlement: the answer (or\n // settlement error, e.g. AbortPromptError) is dropped in favor of\n // rejecting with the cleanup error.\n const settlePrompt = (settle) => {\n try {\n clearEffects();\n settle();\n }\n catch (error) {\n reject(error);\n }\n };\n const resolvePrompt = (value) => settlePrompt(() => resolve(value));\n const rejectPrompt = (error) => settlePrompt(() => reject(error));\n const promptPromise = Object.assign(promise\n .finally(() => {\n cleanups.forEach((cleanup) => cleanup());\n screen.done({ clearContent: Boolean(context.clearPromptOnDone) });\n output.end();\n })\n .then(() => promise), { cancel: () => rejectPrompt(new CancelPromptError()) });\n if (signal) {\n const abort = () => rejectPrompt(new AbortPromptError({ cause: signal.reason }));\n if (signal.aborted) {\n abort();\n return promptPromise;\n }\n cleanups.add(listenTo(signal, 'abort', abort));\n }\n cleanups.add(onSignalExit((code, signal) => {\n rejectPrompt(new ExitPromptError(`User force closed the prompt with ${code} ${signal}`));\n }));\n // SIGINT must be explicitly handled by the prompt so the ExitPromptError can be handled.\n // Otherwise, the prompt will stop and in some scenarios never resolve.\n // Ref issue #1741\n cleanups.add(listenTo(rl, 'SIGINT', () => rejectPrompt(new ExitPromptError(`User force closed the prompt with SIGINT`))));\n // Fallback for readline closing without the prompt settling (e.g. stdin\n // EOF), so active effect timeouts still get cleared. Every settlement\n // path already clears effects through settlePrompt; this event triggers\n // immediately when the user presses ctrl+c, while signal-exit only\n // triggers after the process is done (after timeouts finish triggering).\n cleanups.add(listenTo(rl, 'close', clearEffects));\n const startCycle = () => {\n // Re-renders only happen when the state change; but the readline cursor could\n // change position and that also requires a re-render (and a manual one because\n // we mute the streams). We set the listener after the initial workLoop to avoid\n // a double render if render triggered by a state change sets the cursor to the\n // right position.\n cleanups.add(listenTo(rl.input, 'keypress', () => screen.checkCursorPos()));\n let pendingDone = null;\n cycle(() => {\n let effectsSettled = false;\n try {\n const nextView = view(config, (value) => {\n if (effectsSettled) {\n // After the cycle completes (async validation path), the \"done\"\n // render already flushed via setStatus → handleChange, so resolve\n // immediately.\n resolvePrompt(value);\n }\n else {\n pendingDone = { value };\n }\n });\n // Typescript won't allow this, but not all users rely on typescript.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (nextView === undefined) {\n let callerFilename = callSites[1]?.getFileName();\n if (callerFilename && !callerFilename.startsWith('file://')) {\n callerFilename = path.resolve(callerFilename);\n }\n throw new Error(`Prompt functions must return a string.\\n at ${callerFilename}`);\n }\n const [content, bottomContent] = typeof nextView === 'string' ? [nextView] : nextView;\n screen.render(content, bottomContent);\n effectScheduler.run();\n }\n catch (error) {\n rejectPrompt(error);\n }\n effectsSettled = true;\n if (pendingDone !== null) {\n const { value } = pendingDone;\n pendingDone = null;\n resolvePrompt(value);\n }\n });\n };\n // Proper Readable streams (like process.stdin) may have OS-level buffered\n // data that arrives in the poll phase when readline resumes the stream.\n // Deferring the first render by one setImmediate tick (check phase, after\n // poll) lets that stale data flow through readline harmlessly—no keypress\n // handlers are registered yet and the output is muted, so the stale\n // keystrokes are silently discarded.\n // Old-style streams (like MuteStream) have no such buffering, so the\n // render cycle starts immediately.\n //\n // @see https://github.com/SBoudrias/Inquirer.js/issues/1303\n if ('readableFlowing' in input) {\n nativeSetImmediate(startCycle);\n }\n else {\n startCycle();\n }\n return promptPromise;\n });\n };\n return prompt;\n}\n","import c from '../ColorTheme';\n\n/**\n * The navigation menu (docs/INTERACTIVE-COMMANDS.md): a framed box at\n * the TOP of every prompt frame, so the user reads the available keys\n * BEFORE the question. Only keys that apply to the current prompt\n * appear, each rendered in its theme color -- the visual grammar:\n *\n * - movement (up/down, and space/enter in multi-selects) -- `muted`\n * (always available, so it reads as furniture, not news);\n * - the segment keys (-> where a hint arms it, <- in the editor) --\n * `command` (the navigation actions worth spotting);\n * - conclude (enter in single-selects, space+enter in multi-selects) --\n * `positive` (the committing action);\n * - exit (esc) -- `negative` (the backing-out action).\n *\n * Zero-import aside from the theme (same constraint as EditableOptions):\n * every prompt module renders this, so it must not drag frodo-lib\n * graphs into tests that mock frodo-lib wholesale.\n */\n\n/**\n * The direction keys as the bar draws them: Unicode medium triangles\n * (heavier than the slim arrows, no arrow shaft), shown in [] like every\n * key label.\n */\nconst DIRECTION_KEYS = { upDown: '⏶⏷', left: '⏴', right: '⏵' } as const;\n\nexport type NavigationMenuItem = {\n /** The key labels, in [] (key notation), e.g. '[⏶⏷]' or '[ENTER]'. */\n keys: string;\n /** What the keys do, e.g. 'move'. */\n action: string;\n /** The theme intent the item renders in. */\n intent: 'muted' | 'command' | 'positive' | 'negative';\n};\n\n/**\n * Builds the menu items for one prompt frame from the affordances it\n * actually has -- callers pass what applies; absent keys simply don't\n * render (silence = that key does nothing here, the same \"counted,\n * truthful\" discipline the -> hint follows).\n */\nexport function navigationMenuItems(options: {\n /** space toggles (multi-selects only). */\n space?: string;\n /** enter concludes (the label varies: 'conclude', 'commit'). */\n enter?: string;\n /** The -> hint, e.g. '3 options' (segments exist). */\n right?: string;\n /** A <- segment exists (the editor's back navigation). */\n left?: boolean;\n /** The prompt has a filterable list (type-to-search applies). */\n filter?: boolean;\n /** esc backs out (always true for our escapable prompts). */\n escape?: string;\n}): NavigationMenuItem[] {\n const items: NavigationMenuItem[] = [];\n items.push({\n keys: `[${DIRECTION_KEYS.upDown}]`,\n action: 'move',\n intent: 'muted',\n });\n if (options.filter) {\n items.push({ keys: 'type', action: 'to filter', intent: 'muted' });\n }\n if (options.space) {\n items.push({ keys: '[space]', action: options.space, intent: 'muted' });\n }\n if (options.enter) {\n items.push({\n keys: '[ENTER]',\n action: options.enter,\n intent: 'positive',\n });\n }\n if (options.right) {\n items.push({\n keys: `[${DIRECTION_KEYS.right}]`,\n action: options.right,\n intent: 'command',\n });\n }\n if (options.left) {\n items.push({\n keys: `[${DIRECTION_KEYS.left}]`,\n action: 'back',\n intent: 'command',\n });\n }\n items.push({\n keys: '[ESC]',\n action: options.escape ?? 'back out',\n intent: 'negative',\n });\n return items;\n}\n\nconst INTENT_COLOR: Record<\n NavigationMenuItem['intent'],\n (text: string) => string\n> = {\n muted: (text) => c.muted(text),\n command: (text) => c.command(text),\n positive: (text) => c.positive(text),\n negative: (text) => c.negative(text),\n};\n\n/**\n * The ANSI-stripped width input for the box math: every SGR sequence\n * (ESC [ ... m) carries no cells, everything the frames render is plain\n * UTF-8 or SGR -- the same assumption the wall alignment already makes.\n */\nexport function stripAnsi(text: string): string {\n // eslint-disable-next-line no-control-regex -- the control character IS the point\n return text.replace(/\\x1b\\[[0-9;]*m/g, '');\n}\n\n/** The columns every frame is drawn at unless the caller says otherwise. */\nconst DEFAULT_FRAME_WIDTH = 120;\nconst FRAME_BORDER = 2; // the │ ... │ walls\nconst FRAME_PADDING = 1; // one space inside each border\n\n/**\n * The text width available INSIDE a frame drawn at `width` columns --\n * the one place the wall + padding math lives, so box renderers and the\n * wrappers feeding them can never disagree about where the wall is.\n */\nexport function frameInnerWidth(width = DEFAULT_FRAME_WIDTH): number {\n return Math.max(10, width - FRAME_BORDER - FRAME_PADDING * 2);\n}\n\n/**\n * Word-wraps ONE logical line to `width` columns (ANSI stripped first, so\n * the measured text is the drawn text). Spacing between words is kept\n * (aligned \"key: text\" columns survive a wrap), leading indentation\n * repeats on continuation rows, and a word longer than a whole row is\n * hard-split rather than pushed through the right wall.\n */\nexport function wrapLine(line: string, width: number): string[] {\n const text = stripAnsi(line).trimEnd();\n if (text.length <= width) return [text];\n const indent = /^\\s*/.exec(text)?.[0] ?? '';\n const room = Math.max(1, width - indent.length);\n const rows: string[] = [];\n let current = '';\n for (const chunk of text.slice(indent.length).match(/\\S+\\s*/g) ?? []) {\n let piece = chunk;\n while (piece.trimEnd().length > room) {\n if (current) {\n rows.push(indent + current.trimEnd());\n current = '';\n }\n rows.push(indent + piece.slice(0, room));\n piece = piece.slice(room);\n }\n if (current && current.length + piece.trimEnd().length > room) {\n rows.push(indent + current.trimEnd());\n current = piece;\n } else {\n current += piece;\n }\n }\n if (current.trim()) rows.push(indent + current.trimEnd());\n return rows.length > 0 ? rows : [''];\n}\n\n/**\n * A highlighted entry's description as muted panel rows, wrapped to the\n * frame so a long description can never push past the right wall (a\n * multi-line description keeps its own line breaks; each line wraps on\n * its own).\n */\nexport function descriptionPanelLines(\n description: string,\n width = DEFAULT_FRAME_WIDTH\n): { text: string; plain: string }[] {\n const inner = frameInnerWidth(width);\n return description\n .split('\\n')\n .flatMap((row) => wrapLine(row, inner))\n .map((row) => ({ text: c.muted(row), plain: row }));\n}\n\n/**\n * One framed box renderer for all prompt-frame furniture (the Navigate\n * menu, every prompt's question+list panel, the inline value editor's\n * Value box): the title (a plain string, or a {text, plain} pair when it\n * carries colored content -- e.g. the question line with its prefix and\n * query echo), the body lines (pre-colored), and the width the frame is\n * drawn at -- so every box in a frame shares the same silhouette and the\n * same wrap/measure discipline (ANSI excluded from every measurement).\n *\n * The {text, plain} pair exists for ONE historical reason -- the query\n * echo used to be conditional on the caller's search configuration, so\n * the colored and measured forms could diverge (the bare-stub picker's\n * panel top wall came out short by the query's length: the renderer\n * drew to a text WITHOUT the echo, the walls measured a plain WITH it).\n * The renderer now measures the title on stripAnsi(title.text) itself,\n * so the pair is belt-and-braces: callers may still pass plain for\n * clarity, but a divergent plain can no longer skew the walls.\n */\nexport function renderFramedBox(options: {\n title: string | { text: string; plain: string };\n /** Body lines, already colored; measured on their plain text. */\n lines: { text: string; plain: string }[];\n width?: number;\n}): string {\n const { lines } = options;\n const title =\n typeof options.title === 'string' ? { text: options.title } : options.title;\n // One space between wall and title content on both sides -- the\n // Navigate menu's ' Navigate ' convention, applied to every box.\n // Measured on the STRIPPED TEXT: one source of truth, the walls can\n // never drift from what is drawn.\n const titleText = ` ${title.text} `;\n const titlePlain = ` ${stripAnsi(title.text)} `;\n const width = options.width ?? DEFAULT_FRAME_WIDTH;\n const PADDING = FRAME_PADDING;\n const innerWidth = frameInnerWidth(width);\n const top = `┌${titleText}${'─'.repeat(Math.max(0, innerWidth + PADDING * 2 - titlePlain.length))}┐`;\n const bottom = `└${'─'.repeat(innerWidth + PADDING * 2)}┘`;\n const body = lines\n .map((line) => {\n const pad = ' '.repeat(Math.max(0, innerWidth - line.plain.length));\n return `│ ${line.text}${pad} │`;\n })\n .join('\\n');\n return `${top}\\n${body}\\n${bottom}`;\n}\n\n/**\n * Renders the framed box, wrapped to `width` columns (the prompt frames\n * live in a real terminal -- the PTY pins 120; the box respects the\n * caller's width so narrow terminals wrap the ITEMS, not the border).\n * Returns '' when there are no items.\n */\nexport function renderNavigationMenu(\n items: NavigationMenuItem[],\n width = DEFAULT_FRAME_WIDTH\n): string {\n if (items.length === 0) return '';\n\n // Render item texts first (colored), then lay them out row by row --\n // rows break on DISPLAY width (ANSI excluded from the measurement).\n const rendered = items.map((item) => ({\n text: `${INTENT_COLOR[item.intent](item.keys)} ${c.muted(item.action)}`,\n plainWidth: item.keys.length + 1 + item.action.length,\n plain: `${item.keys} ${item.action}`,\n }));\n\n // Separator between items inside a row.\n const GAP = ' · ';\n const GAP_WIDTH = GAP.length;\n const innerWidth = frameInnerWidth(width);\n\n const rows: (typeof rendered)[] = [];\n let current: typeof rendered = [];\n let currentWidth = 0;\n for (const item of rendered) {\n const addition =\n current.length === 0 ? item.plainWidth : GAP_WIDTH + item.plainWidth;\n if (current.length > 0 && currentWidth + addition > innerWidth) {\n rows.push(current);\n current = [item];\n currentWidth = item.plainWidth;\n } else {\n current.push(item);\n currentWidth += addition;\n }\n }\n if (current.length > 0) rows.push(current);\n\n const title = 'Navigate';\n return renderFramedBox({\n title,\n lines: rows.map((row) => {\n const plainWidth = row.reduce(\n (sum, item, index) =>\n sum + item.plainWidth + (index > 0 ? GAP_WIDTH : 0),\n 0\n );\n const pad = ' '.repeat(Math.max(0, innerWidth - plainWidth));\n return {\n text: `${row.map((item) => item.text).join(GAP)}${pad}`,\n plain: `${row.map((item) => item.plain).join(GAP)}${pad}`,\n };\n }),\n width,\n });\n}\n","import {\n createPrompt,\n isDownKey,\n isEnterKey,\n isUpKey,\n useEffect,\n useKeypress,\n useMemo,\n usePagination,\n usePrefix,\n useRef,\n useState,\n} from '@inquirer/core';\nimport c from '../ColorTheme';\nimport { armEscapeGrace, EXIT_ALL } from './ExitAll';\nimport {\n descriptionPanelLines,\n navigationMenuItems,\n renderFramedBox,\n renderNavigationMenu,\n stripAnsi,\n} from './NavigationMenu';\nimport { notePromptRendered } from './PromptGateState';\n\n/**\n * Distinct return value `escapableSelect` resolves with when the user\n * presses Escape instead of choosing something -- callers branch on this\n * to go back a menu level (or exit cleanly at the top level) instead of\n * treating it as a real selection.\n */\nexport const ESCAPE = Symbol('escapableSelect:escape');\n\n/**\n * Distinct return value `escapableSelect` resolves with when the user\n * presses → (right arrow) instead of choosing something -- the\n * \"enter the next editor segment\" key of the segment navigation\n * described in docs/INTERACTIVE-COMMANDS.md.\n * Only fires when the prompt is configured with a `hint` (the caller's\n * promise that something more to configure exists); without a hint the\n * key is left to readline, so plain pickers keep today's behavior.\n * Callers branch on this to open the options editor / connection page\n * and then re-run the picker.\n */\nexport const RIGHT = Symbol('escapableSelect:right');\n\nexport type EscapableSelectChoice<Value> = {\n value: Value;\n name: string;\n description?: string;\n};\n\n/**\n * Matches a choice against the current search query. `query` is the raw\n * (not lowercased) buffer content -- the predicate decides on casing\n * itself, so e.g. the connection-profile pickers can do case-insensitive\n * substring matching across BOTH host and alias while an entity picker\n * can demand a prefix match on `name` only. When no predicate is\n * configured, filtering falls back to a case-insensitive substring match\n * on `name`.\n */\nexport type EscapableSelectMatch<Value> = (\n choice: EscapableSelectChoice<Value>,\n query: string\n) => boolean;\n\nexport type EscapableSelectConfig<Value> = {\n message: string;\n choices: EscapableSelectChoice<Value>[];\n default?: Value;\n pageSize?: number;\n /**\n * Custom match predicate for type-to-search (see the class doc for the\n * full interaction contract). Omitted, every list is still filterable --\n * the name-only fallback applies -- so callers only reach for this when\n * the match must span more than the visible label (host + alias) or use\n * different casing rules.\n */\n search?: EscapableSelectMatch<Value>;\n /**\n * Discoverability hint: when set, the prompt renders it as a\n * muted line under the list and arms the → key (resolving with the\n * `RIGHT` sentinel). Callers pass a counted, truthful promise --\n * e.g. \"→ 4 options\" -- derived from the same candidate\n * filter the offered segment uses; omit it when there is nothing more\n * to configure (silence = done).\n */\n hint?: string;\n /**\n * Command preview: the command being authored, rendered as a\n * footer line (red + cursive while mandatory input is missing, green/\n * white when ready). Callers pass the pre-rendered string from\n * CommandPreview.ts -- or, for LIVE preview (the\n * footer reflects what the user is INFLUENCING, not what they last\n * committed), a function of the currently HIGHLIGHTED choice's value,\n * re-invoked on every render: arrowing through a realm list updates\n * the footer before <enter> commits. When nothing is highlighted\n * (filtered to no matches) the function receives undefined and should\n * fall back to the committed state.\n */\n preview?: string | ((highlighted: unknown) => string);\n};\n\n/**\n * A small, deliberately reimplemented sibling of the packaged\n * `@inquirer/select` prompt, differing in one core way: Escape resolves\n * the prompt with the `ESCAPE` sentinel instead of doing nothing.\n *\n * The packaged `select` prompt has no Escape keybinding at all -- confirmed\n * by reading its installed source directly -- and no way to configure one;\n * only `@inquirer/core`'s lower-level `createPrompt`/`useKeypress` expose\n * the raw keypress needed to detect it (Node's `readline` keypress events\n * carry `key.name === 'escape'`, standard `emitKeypressEvents` behavior).\n *\n * Type-to-search is built in rather than adopting `@inquirer/search` for\n * the same reason: the packaged prompt throws on Escape, can't express\n * \"clear query first, back out second\", and offers no pluggable match\n * predicate -- all three are required by the connection-profile pickers\n * (host + alias, case-insensitive) and the escape-as-back menu loops this\n * CLI is built around. It is a universal capability, not an opt-in: every\n * list filters as you type (predicate or name fallback), short enums and\n * long pickers alike -- consistent muscle memory beats one more knob.\n */\n// `createPrompt`'s view function can't itself be generic (its `Value` type\n// parameter is inferred once, at the `createPrompt(view)` call site, from a\n// non-generic view) -- so the implementation below is written loosely\n// against `unknown`, matching the runtime, and the exported binding is\n// given a precise, hand-written generic type instead. This is the same\n// split `@inquirer/select` itself relies on (its compiled `.js` is\n// similarly untyped; a separate `.d.ts` declares the generic public type).\n// The promise resolves with the chosen value, `ESCAPE`, or -- only when\n// the config carried a `hint`, which the type system cannot see -- the\n// `RIGHT` sentinel. Hint-less callers therefore see RIGHT in the type\n// though it can never resolve for them; a `=== RIGHT` check compiles\n// everywhere and is simply dead at runtime there.\ntype EscapableSelectFn = <Value>(\n config: EscapableSelectConfig<Value>\n) => Promise<Value | typeof ESCAPE | typeof RIGHT | typeof EXIT_ALL>;\n\nconst escapableSelectImpl = createPrompt(\n (config: EscapableSelectConfig<unknown>, done: (value: unknown) => void) => {\n // Default well above what any menu in this CLI actually needs: once\n // `pageSize` covers every choice, `usePagination` renders a static\n // list and the cursor moves through it directly on each ↑/↓ -- below\n // that threshold it switches to a scrolling viewport that keeps the\n // cursor near a fixed row and scrolls the list underneath it instead,\n // which reads as \"the items move, not the selection.\"\n const { pageSize = 20, choices } = config;\n const [status, setStatus] = useState<'idle' | 'done' | 'escaped'>('idle');\n const prefix = usePrefix({\n status: status === 'escaped' ? 'done' : status,\n });\n\n // The search query mirrors the readline buffer (`rl.line`) on every\n // keystroke -- the same pattern `textPrompt` (PromptGate) uses, for\n // the same reason: readline does the editing (typing, backspace,\n // paste, ctrl+u), the prompt only mirrors and reads. Nothing here\n // reads `rl.line` on Enter/Escape, so the buffer-consumption\n // subtlety textPrompt works around doesn't apply.\n const [query, setQuery] = useState('');\n\n const filtered = useMemo(() => {\n if (!config.search) {\n if (query.length === 0) return choices;\n const needle = query.toLowerCase();\n return choices.filter((choice) =>\n choice.name.toLowerCase().includes(needle)\n );\n }\n return choices.filter((choice) => config.search!(choice, query));\n }, [choices, query, config.search]);\n\n // The cursor resets to the top of the FILTERED list whenever the\n // query changes -- predictable (\"my text takes me to the first\n // match\"). `useEffect` (not a render-time write) because the setter\n // must exist first and inquirer re-renders on every state change\n // anyway; a render-time `setActive` here would either run before\n // `useState` declared it (TDZ crash) or loop the render.\n // Reset to the first match whenever the query TEXT changes -- but\n // NOT on mount: the initial cursor belongs on the configured\n // default (e.g. the editor's pre-filled current value), and this\n // effect would otherwise clobber it immediately after the first\n // render. Text-compared, not reference-compared: a setQuery to the\n // SAME text (e.g. a programmatic reset) must not yank the cursor.\n const firstRender = useRef(true);\n const lastQueryRef = useRef(query);\n useEffect(() => {\n if (firstRender.current) {\n firstRender.current = false;\n lastQueryRef.current = query;\n return;\n }\n if (lastQueryRef.current === query) return;\n lastQueryRef.current = query;\n setActive(0);\n }, [query]);\n\n const defaultIndex = useMemo(() => {\n if (!('default' in config)) return 0;\n const index = choices.findIndex(\n (choice) => choice.value === config.default\n );\n return index === -1 ? 0 : index;\n }, [config.default, choices]);\n const [active, setActive] = useState(defaultIndex);\n const selected = filtered[active];\n // The double-ESC grace (see ExitAll.ts): the first ESC opens a short\n // window instead of resolving; a second ESC inside it exits all, and\n // an expired window resolves the single-ESC action. Ref (not state)\n // -- the handler reads/mutates it synchronously.\n const escapeGraceRef = useRef<\n ReturnType<typeof armEscapeGrace> | undefined\n >(undefined);\n // True while the grace window is open: the view renders the exit-all\n // hint so the gesture is discoverable.\n const [escapeGraceOpen, setEscapeGraceOpen] = useState(false);\n\n // Grace teardown on unmount: a timer firing after the prompt resolved\n // would call a stale handler (the prompt's hooks are gone).\n useEffect(() => () => escapeGraceRef.current?.dispose(), []);\n\n const resolveEscapeGrace = (kind: 'escape' | 'all') => {\n setEscapeGraceOpen(false);\n setStatus('escaped');\n done(kind === 'all' ? EXIT_ALL : ESCAPE);\n };\n\n useKeypress((key, rl) => {\n if (key.name === 'escape') {\n // Two-stage escape with an active query (see `search` docs).\n if (rl.line.length > 0) {\n rl.clearLine(0);\n setQuery('');\n escapeGraceRef.current?.otherKey();\n escapeGraceRef.current = undefined;\n return;\n }\n if (escapeGraceRef.current) {\n // Second ESC inside the grace window: exit all the way out\n // (user feedback 2026-10-12; mechanism per user design\n // 2026-10-13 -- both presses stay in THIS instance).\n const grace = escapeGraceRef.current;\n escapeGraceRef.current = undefined;\n grace.secondEscape();\n return;\n }\n // First ESC: open the grace window. When it expires, the\n // single-ESC action (\"back one level\") resolves.\n setEscapeGraceOpen(true);\n escapeGraceRef.current = armEscapeGrace({\n onSecondEscape: () => resolveEscapeGrace('all'),\n onGraceExpire: () => resolveEscapeGrace('escape'),\n });\n return;\n } else if (\n key.name === 'right' &&\n config.hint &&\n // Segment navigation only when the filter query is empty; with\n // text typed, ←/→ stay readline cursor movement (same pattern as\n // the two-stage escape above).\n rl.line.length === 0\n ) {\n escapeGraceRef.current?.otherKey();\n escapeGraceRef.current = undefined;\n setStatus('done');\n done(RIGHT);\n } else if (isEnterKey(key)) {\n escapeGraceRef.current?.otherKey();\n escapeGraceRef.current = undefined;\n if (!selected) {\n // Filtered to nothing: Enter does nothing rather than crashing\n // (the view shows an explicit \"no matches\" state).\n return;\n }\n setStatus('done');\n done(selected.value);\n } else if (isUpKey(key) || isDownKey(key)) {\n escapeGraceRef.current?.otherKey();\n escapeGraceRef.current = undefined;\n if (filtered.length === 0) return;\n const offset = isUpKey(key) ? -1 : 1;\n // Clamp at the ends -- a list with a beginning and an end, not\n // an endless loop (user feedback 2026-10-12; the cursor stops\n // at the first/last row and further keys in that direction do\n // nothing). FUNCTIONAL update: several keypresses can arrive\n // inside one render cycle (paste, fast typing around a\n // keystroke) -- a closure over `active` would compute every\n // step from the same stale value and eat the extra moves.\n setActive((previous) =>\n Math.min(filtered.length - 1, Math.max(0, previous + offset))\n );\n } else {\n // Everything else is readline's business (typing, paste, backspace,\n // ctrl+u, any unhandled key); the buffer holds the result -- there\n // is no reliable \"printable\" predicate to read off the keypress\n // event (a printable char's `name` IS the character). Mirroring it\n // into state drives the filter; the same pattern textPrompt\n // (PromptGate) uses. Any non-ESC key breaks the double-ESC\n // streak.\n escapeGraceRef.current?.otherKey();\n escapeGraceRef.current = undefined;\n setQuery(rl.line);\n }\n });\n\n if (status === 'escaped') {\n return `${prefix} ${config.message} ${c.muted('(cancelled)')}`;\n }\n if (status === 'done') {\n return `${prefix} ${config.message} ${c.positive(selected!.name)}`;\n }\n\n const page = usePagination({\n items: filtered,\n active,\n renderItem: ({ item, isActive }) => {\n const line = `${isActive ? '›' : ' '} ${item.name}`;\n return isActive ? c.command(line) : line;\n },\n pageSize,\n loop: false,\n });\n\n // The query echo renders whenever a query exists -- not only for\n // custom-search pickers. The bare-stub picker uses the name\n // fallback (no config.search), and its panel WAS the proof the\n // echo was lying by omission: the list visibly narrowed while the\n // title said nothing (and the conditional echo's divergence between\n // the colored and measured title forms skewed the top wall by the\n // query's length -- see renderFramedBox, which now measures the\n // drawn text itself).\n const queryEcho = query.length > 0 ? c.command(` query: ${query}`) : '';\n // PANEL PER SURFACE (user feedback 2026-10-12): every prompt frame\n // is built from the same three boxes -- the Navigate menu (top,\n // permanent), a framed panel for question + list + description, and\n // any transient editor box UNDER the panel. The panel is what makes\n // the pick selectors and the multi-select consistent: same\n // silhouette, same measure discipline (ANSI excluded), description\n // trailing INSIDE the panel right under its list.\n const menu = renderNavigationMenu(\n navigationMenuItems({\n filter: true,\n enter: 'select',\n right: config.hint ? config.hint.replace(/^→\\s*/, '') : undefined,\n escape: 'back · [ESC]×2 exit all',\n })\n );\n const panelLines: { text: string; plain: string }[] = [];\n if (escapeGraceOpen) {\n // The grace window is open (first ESC seen): make the gesture's\n // second half obvious -- this line lives until the grace resolves.\n panelLines.push({\n text: c.muted('esc again to exit all -- or wait to go back one level'),\n plain: 'esc again to exit all -- or wait to go back one level',\n });\n }\n if (filtered.length > 0) {\n for (const row of page.split('\\n')) {\n panelLines.push({ text: row, plain: stripAnsi(row) });\n }\n } else {\n panelLines.push({\n text: c.muted('(no matches -- backspace to edit)'),\n plain: '(no matches -- backspace to edit)',\n });\n }\n if (selected?.description) {\n panelLines.push({ text: '', plain: '' });\n panelLines.push(...descriptionPanelLines(selected.description));\n }\n const panel = renderFramedBox({\n title: {\n text: `${prefix} ${config.message}${queryEcho}`,\n plain: `? ${config.message}${queryEcho}`,\n },\n lines: panelLines,\n });\n\n // Live preview: a function form is re-invoked on EVERY render with\n // the currently highlighted choice's value (undefined when filtered\n // to no matches) -- arrowing through a list updates the footer\n // before <enter> commits. A string form stays static as before.\n const previewLine =\n typeof config.preview === 'function'\n ? config.preview(selected?.value)\n : config.preview;\n\n const lines = [menu, panel, previewLine].filter(Boolean);\n return lines.join('\\n');\n }\n);\n\nexport const escapableSelect = ((config) => {\n notePromptRendered();\n // Erase-on-conclude: the frame (question, list, footer, committed or\n // cancelled answer) disappears entirely when the prompt settles -- the\n // caller's own follow-up output (the eventual-command print, the action's\n // real output) is the only trace. Runs on every exit path: @inquirer/core\n // fires screen.done({ clearContent }) from the prompt promise's .finally()\n // (create-prompt.js), so enter, escape, ->, SIGINT and EOF all erase.\n return escapableSelectImpl(config, { clearPromptOnDone: true });\n}) as unknown as EscapableSelectFn;\n"],"ignoreList":[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29],"mappings":";;;;;;;;;;;AAiCA,IAAI,UAAU;AAEd,SAAgB,6BAAmC;CACjD,IAAI,SAAS;CACb,UAAU;CAcV,MAAM,YAPoB;EACxB,IAAI;GACF,QAAA,GAAOA,YAAAA,cAAAA,CAAc,UAAU;EACjC,QAAQ;GACN,QAAA,GAAOA,YAAAA,cAAAA,CAAAA,QAAAA,KAAAA,CAAAA,CAAAA,cAAAA,UAAAA,CAAAA,CAAAA,IAA6B;EACtC;CACF,EAAA,CACoB,CAAC,CAAC,eAAe;CAGrC,MAAM,WAAW,GAAG;CACpB,GAAG,kBAAkB,SAAS,uBAC5B,SACU;EACV,OAAO,SAAS;GACd,mBAAA;GACA,GAAG;EACL,CAAC;CACH;AACF;;;ACvDA,2BAA2B;;;;;;;AA4C3B,MAAa,WAAW,OAAO,qBAAqB;;;;;;;;;;;;;;AAepD,MAAa,kBAAkB,OAAO,2BAA2B;;;;;;;;;;;;;;AAejE,SAAgB,eAAe,EAC7B,WAAA,KACA,gBACA,iBAK0E;CAC1E,IAAI,YAAY;CAChB,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