@rockcarver/frodo-cli 5.0.0-21 → 5.0.0-22
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 +13 -0
- package/dist/{Console-CoAlCJ12.cjs → Console-gqjYb6W3.cjs} +558 -24
- package/dist/{Console-CoAlCJ12.cjs.map → Console-gqjYb6W3.cjs.map} +1 -1
- package/dist/{EntityPickers-DwBJs2ob.cjs → EntityPickers-CW8YUPps.cjs} +6 -6
- package/dist/{EntityPickers-DwBJs2ob.cjs.map → EntityPickers-CW8YUPps.cjs.map} +1 -1
- package/dist/{EscapableSelectPrompt-_LjMcD3D.cjs → EscapableSelectPrompt-BQvkZbap.cjs} +2 -2
- package/dist/{EscapableSelectPrompt-_LjMcD3D.cjs.map → EscapableSelectPrompt-BQvkZbap.cjs.map} +1 -1
- package/dist/{FrodoCommand-CNGnTfsM.cjs → FrodoCommand-C_WQ1qiY.cjs} +7 -7
- package/dist/{FrodoCommand-CNGnTfsM.cjs.map → FrodoCommand-C_WQ1qiY.cjs.map} +1 -1
- package/dist/{RealmOps-DL-uIcdz.cjs → RealmOps-rM69C80W.cjs} +2 -2
- package/dist/{RealmOps-DL-uIcdz.cjs.map → RealmOps-rM69C80W.cjs.map} +1 -1
- package/dist/{RealmPickers-Cu69kFhW.cjs → RealmPickers-CqVo_oru.cjs} +6 -6
- package/dist/{RealmPickers-Cu69kFhW.cjs.map → RealmPickers-CqVo_oru.cjs.map} +1 -1
- package/dist/{ResolveInteractiveInputs-Guw_NOYz.cjs → ResolveInteractiveInputs-yYRVsQmo.cjs} +6 -6
- package/dist/{ResolveInteractiveInputs-Guw_NOYz.cjs.map → ResolveInteractiveInputs-yYRVsQmo.cjs.map} +1 -1
- package/dist/app.cjs +9 -9
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-C-fzZZTt.cjs");
|
|
2
|
-
const require_Console = require("./Console-
|
|
3
|
-
const require_EscapableSelectPrompt = require("./EscapableSelectPrompt-
|
|
2
|
+
const require_Console = require("./Console-gqjYb6W3.cjs");
|
|
3
|
+
const require_EscapableSelectPrompt = require("./EscapableSelectPrompt-BQvkZbap.cjs");
|
|
4
4
|
/**
|
|
5
5
|
* Read a line of free-form text. Paste-safe and editable (the readline
|
|
6
6
|
* buffer does the editing; the prompt only reads it), unlike accumulating
|
|
@@ -167,7 +167,7 @@ async function resolveEntityPicks(command) {
|
|
|
167
167
|
}
|
|
168
168
|
let chosen;
|
|
169
169
|
for (;;) {
|
|
170
|
-
const { liveOptionPreviewFor } = await Promise.resolve().then(() => require("./ResolveInteractiveInputs-
|
|
170
|
+
const { liveOptionPreviewFor } = await Promise.resolve().then(() => require("./ResolveInteractiveInputs-yYRVsQmo.cjs")).then((n) => n.ResolveInteractiveInputs_exports);
|
|
171
171
|
chosen = await require_EscapableSelectPrompt.escapableSelect({
|
|
172
172
|
message: pick.message ?? `Select ${pick.kind} to act on:`,
|
|
173
173
|
hint: require_EscapableSelectPrompt.editableOptionsHint(command),
|
|
@@ -183,7 +183,7 @@ async function resolveEntityPicks(command) {
|
|
|
183
183
|
})
|
|
184
184
|
});
|
|
185
185
|
if (chosen !== require_EscapableSelectPrompt.RIGHT) break;
|
|
186
|
-
const { runInvocationEditorForCommand } = await Promise.resolve().then(() => require("./ResolveInteractiveInputs-
|
|
186
|
+
const { runInvocationEditorForCommand } = await Promise.resolve().then(() => require("./ResolveInteractiveInputs-yYRVsQmo.cjs")).then((n) => n.ResolveInteractiveInputs_exports);
|
|
187
187
|
await runInvocationEditorForCommand(command);
|
|
188
188
|
}
|
|
189
189
|
if (chosen === require_EscapableSelectPrompt.EXIT_ALL) {
|
|
@@ -216,7 +216,7 @@ function valueOf(pick, entity) {
|
|
|
216
216
|
*/
|
|
217
217
|
async function searchFirst(command, pick, spec) {
|
|
218
218
|
if (!await spec.when()) return void 0;
|
|
219
|
-
const { commandPreviewFor } = await Promise.resolve().then(() => require("./ResolveInteractiveInputs-
|
|
219
|
+
const { commandPreviewFor } = await Promise.resolve().then(() => require("./ResolveInteractiveInputs-yYRVsQmo.cjs")).then((n) => n.ResolveInteractiveInputs_exports);
|
|
220
220
|
let note = spec.hint;
|
|
221
221
|
for (;;) {
|
|
222
222
|
const text = await promptInput({
|
|
@@ -292,4 +292,4 @@ Object.defineProperty(exports, "resolveEntityPicks", {
|
|
|
292
292
|
}
|
|
293
293
|
});
|
|
294
294
|
|
|
295
|
-
//# sourceMappingURL=EntityPickers-
|
|
295
|
+
//# sourceMappingURL=EntityPickers-CW8YUPps.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityPickers-DwBJs2ob.cjs","names":["canPrompt","ExitPromptError","createPrompt","useState","usePrefix","useTerminalWidth","isEnterKey","c","renderNavigationMenu","navigationMenuItems","renderFramedBox","descriptionPanelLines","stripAnsi","canPrompt","blockersOf","ESCAPE","escapableSelect","editableOptionsHint","RIGHT","EXIT_ALL","EXIT_ALL_SIGNAL","commitOption"],"sources":["../src/utils/interactive/PromptGate.ts","../src/utils/interactive/EntityPickers.ts"],"sourcesContent":["/**\n * Central gate deciding whether frodo may prompt interactively, plus the\n * terminal prompts built on `@inquirer/core` for gap-filling missing\n * command input (docs/INTERACTIVE-COMMANDS.md).\n *\n * ## The gate\n *\n * Re-exported from `PromptGateState.ts` (which holds its full\n * documentation and stays importable from unit tests -- this file pulls\n * in the frodo-lib-importing ColorTheme, and this CLI's Jest setup cannot\n * load frodo-lib; see src/app.commandWiring.test.ts's header comment).\n *\n * ## The prompts\n *\n * Deliberately hand-built on `@inquirer/core` (same pattern as the\n * existing exemplars `EscapableSelectPrompt.ts`/`JourneyDebugPrompt.ts`)\n * rather than adding `@inquirer/input`/`@inquirer/password`: the packaged\n * prompts throw `ExitPromptError` on Escape and EOF, while the gap-fill\n * layer needs Escape to resolve to a sentinel so callers can fall through\n * to their pre-existing missing-input error paths -- which is exactly the\n * contract the existing hand-built prompts already established.\n *\n * ## The frame\n *\n * Like every picker, a text prompt is drawn as a frame (record 0018): the\n * Navigate menu on top, the question in a box, and underneath the footer\n * the caller passes as `preview` -- the command being authored, with the\n * text typed so far shadowed in (record 0019). A prompt without a footer\n * is still framed; a caller that has the command passes one.\n */\n\nimport {\n createPrompt,\n ExitPromptError,\n isEnterKey,\n useKeypress,\n usePrefix,\n useState,\n} from '@inquirer/core';\nimport c from '../ColorTheme';\nimport {\n descriptionPanelLines,\n navigationMenuItems,\n renderFramedBox,\n renderNavigationMenu,\n stripAnsi,\n} from './NavigationMenu';\nimport { canPrompt, notePromptRendered } from './PromptGateState';\nimport { useTerminalWidth } from './TerminalWidth';\n\nexport {\n canPrompt,\n notePromptRendered,\n promptsRendered,\n setNeverPrompt,\n} from './PromptGateState';\n\n/**\n * The empty-string result of `promptInput`/`promptPassword`. The prompts\n * resolve with `''` in two cases that callers must tell apart, so this\n * sentinel is what they branch on: the user pressed Enter on an empty\n * line (meaning \"I have nothing to type\", e.g. no password), versus\n * `undefined`, which means prompting was disallowed by the gate and the\n * caller should simply fall through to its pre-existing missing-input\n * error path without printing anything prompt-related.\n *\n * Escape ALSO resolves with `''` -- for gap-fills, \"never mind, I'll type\n * the flag myself\" and \"there is no password\" have the same practical\n * outcome (no value supplied, command proceeds to its existing error), so\n * a separate escape sentinel would only add API surface. `promptInput`\n * renders `(no input)` after resolving so the transcript shows what\n * happened.\n */\nexport const EMPTY_INPUT = '';\n\nexport type TextInputConfig = {\n message: string;\n /**\n * Value applied when the user presses Enter on an empty line (shown as\n * a muted hint). When omitted, Enter-on-empty resolves `''` and the\n * caller decides what that means.\n */\n default?: string;\n /**\n * A sentence or two inside the box under the question: what to type, or\n * why it is asked again. Wrapped to the frame, so the question itself can\n * stay short.\n */\n hint?: string;\n /**\n * The footer under the frame: the command being authored (see\n * CommandPreview.ts). A function is called on every render with the text\n * typed so far, so the footer can show the command gaining the value\n * before <enter> commits. A hidden prompt (`promptPassword`) always gets\n * `''`: a secret never reaches a footer.\n */\n preview?: string | ((typed: string) => string);\n};\n\n/** What the text prompt component renders: the caller's config and whether the input is hidden. */\ntype TextPromptConfig = TextInputConfig & { suppress: boolean };\n\n/**\n * A `promptInput`/`promptPassword` result: `undefined` (gate refused --\n * caller falls through silently to its existing missing-input path),\n * `''` (user aborted/declined -- caller treats as missing input with its\n * existing error), or a non-empty string.\n */\nexport type TextInputResult = string | undefined;\n\n/**\n * Read a line of free-form text. Paste-safe and editable (the readline\n * buffer does the editing; the prompt only reads it), unlike accumulating\n * individual keypresses by hand.\n */\nexport async function promptInput(\n config: TextInputConfig\n): Promise<TextInputResult> {\n if (!canPrompt()) return undefined;\n return runTextPrompt(config, { suppress: false });\n}\n\n/**\n * Read a line of text without echoing it (passwords, passphrases, and\n * similar secrets). Same result contract as `promptInput`.\n */\nexport async function promptPassword(\n config: TextInputConfig\n): Promise<TextInputResult> {\n if (!canPrompt()) return undefined;\n return runTextPrompt(config, { suppress: true });\n}\n\n/**\n * Terminal conditions outside the user's in-prompt choices: stdin EOF\n * (Ctrl-D, e.g. the driver's shutdown write) and Ctrl-C both reject the\n * prompt with @inquirer/core's ExitPromptError. For gap-fills both mean\n * \"no value supplied\" and must degrade to the declined result (`''`) so\n * the caller falls through to its pre-existing missing-input error --\n * never a raw stack trace. (Escape is handled in-prompt, so it never\n * reaches this wrapper.)\n */\nasync function runTextPrompt(\n config: TextInputConfig,\n opts: { suppress: boolean }\n): Promise<string> {\n notePromptRendered();\n try {\n // Erase-on-conclude, like every prompt (record 0018): the frame goes\n // away when the prompt settles, whatever way it settles.\n return await TextPrompt(\n { ...config, ...opts },\n { clearPromptOnDone: true }\n );\n } catch (error) {\n if (error instanceof ExitPromptError) return EMPTY_INPUT;\n throw error;\n }\n}\n\nconst TextPrompt = createPrompt(\n (cfg: TextPromptConfig, done: (value: string) => void) => {\n // The readline buffer (`rl.line`) is the source of truth for the\n // typed text -- editing (backspace, ctrl+u, paste) is readline's\n // job. It is mirrored into state on every keystroke because of an\n // ordering subtlety verified against the installed @inquirer/core:\n // when Enter arrives, readline has ALREADY consumed and cleared its\n // buffer, so reading `rl.line` inside the Enter branch sees `''`\n // (the typed text only ever visible on non-Enter keypresses). The\n // mirror is written by the keypress immediately before Enter in\n // stream order, so reading state there sees the completed line.\n const [value, setValue] = useState('');\n const [status, setStatus] = useState<'idle' | 'done' | 'declined'>('idle');\n const prefix = usePrefix({\n status: status === 'declined' ? 'done' : status,\n });\n // The frame follows the terminal (re-drawn on resize). Declared after\n // every other useState so their hook order is unchanged.\n const width = useTerminalWidth();\n\n useKeypress((key, rl) => {\n if (isEnterKey(key)) {\n // rl.line is already consumed at this point (see above); use the\n // mirror, falling back defensively for a bare first-keystroke\n // Enter.\n const line = value || rl.line || '';\n if (line.length === 0 && cfg.default !== undefined) {\n setValue(cfg.default);\n setStatus('done');\n done(cfg.default);\n } else if (line.length === 0) {\n // Enter on an empty line with no default: a deliberate \"no\n // value\". Same resolution as Escape (see EMPTY_INPUT), but\n // rendered distinctly so the transcript shows the user\n // actively declined rather than backed out.\n setStatus('declined');\n done('');\n } else {\n setValue(line);\n setStatus('done');\n done(line);\n }\n } else if (key.name === 'escape') {\n setStatus('declined');\n done('');\n } else {\n // Everything else (typing, backspace, ctrl+u, paste...) is\n // handled by the underlying readline instance itself. Mirroring\n // `rl.line` into state drives the redraw AND keeps the\n // completed line available to the Enter branch above.\n setValue(rl.line);\n }\n });\n\n // A suppressed prompt shows one asterisk per typed character instead\n // of the text.\n const shown = cfg.suppress ? '*'.repeat(value.length) : value;\n\n if (status === 'declined') {\n return `${prefix} ${cfg.message} ${c.muted('(no input)')}`;\n }\n if (status === 'done') {\n return `${prefix} ${cfg.message} ${c.positive(shown)}`;\n }\n\n // Idle view: readline's native echo of the buffer is muted (see\n // create-prompt's output.mute()), so the typed characters would not\n // appear at all unless the view renders them. The frame is the same\n // three parts as every picker (record 0018): the Navigate menu, the\n // question in a box with the entry row (the cursor carries a glyph),\n // and the caller's footer.\n const entry = shown\n ? c.command(shown)\n : cfg.default !== undefined && !cfg.suppress\n ? c.muted(`(${cfg.default})`)\n : '';\n const menu = renderNavigationMenu(\n navigationMenuItems({\n move: false,\n type: cfg.suppress ? 'the value (hidden)' : 'a value',\n enter: 'commit',\n escape: 'back out',\n }),\n width\n );\n const panel = renderFramedBox({\n title: { text: `${prefix} ${cfg.message}`, plain: `? ${cfg.message}` },\n lines: [\n ...(cfg.hint\n ? [...descriptionPanelLines(cfg.hint, width), { text: '', plain: '' }]\n : []),\n { text: `› ${entry}`, plain: `› ${stripAnsi(entry)}` },\n ],\n width,\n });\n // Live footer: a function form is re-invoked on EVERY render with the\n // typed text, so the footer shows the command gaining the value before\n // <enter> commits. Never the text of a hidden prompt.\n const footer =\n typeof cfg.preview === 'function'\n ? cfg.preview(cfg.suppress ? '' : value)\n : cfg.preview;\n return [menu, panel, footer].filter(Boolean).join('\\n');\n }\n);\n","/**\n * Entity pickers (docs/INTERACTIVE-COMMANDS.md, post-auth pickers).\n *\n * A command whose target-entity option (`-i/--secret-id`, `-i/--tree-id`\n * etc.) was left unspecified can offer a dropdown populated from the live\n * system -- a PingAM server, a PingIDM instance, or an Identity Cloud\n * tenant, whichever the command targets -- instead of failing or forcing\n * `-a`. The data source is per-command: the spec's `load` is whatever read\n * function the command family's ops layer provides (`frodo.authn.journey\n * .readJourneys` for PingAM, `frodo.cloud.secret.readSecrets` for cloud,\n * and so on), so each picker is deployment-type-correct by construction;\n * nothing here assumes a particular deployment type.\n *\n * The flow spans two stages:\n *\n * 1. SETUP: the command declares its specs with `deferEntityPicks(command,\n * [...])`. The resolver (ResolveInteractiveInputs) reads the registry to\n * learn which options are entity-pickable, and when such an option is\n * the missing half of a mandatory/one-of rule, it SKIPS the free-text\n * value step for it (asking the user to type an id by hand would defeat\n * the picker's purpose) and leaves the option unset.\n *\n * 2. ACTION BODY: after `getTokens()` succeeds (the loaders need tokens),\n * the command calls `resolveEntityPicks(command)`, which runs the\n * dropdown for every still-unspecified pickable option. A prompt only\n * happens when the gate allows prompting (canPrompt()), the option is\n * still unspecified, and the loader returned at least one entity. Every\n * other path is a no-op, so non-interactive behavior stays\n * byte-identical: no TTY, `--no-prompt`, FRODO_NO_PROMPT, FRODO_TEST,\n * or an empty system all leave `options.<name>` untouched and the\n * action proceeds exactly as before (usually to its existing \"required\"\n * error).\n *\n * Escape backs out of a picker without setting anything -- callers treat\n * that as \"declined to run\" and return (same shape as a failed\n * getTokens()). A returned `false` from `resolveEntityPicks` is the\n * caller's signal to stop -- that includes a failing loader, which must\n * never read as \"picks satisfied\" (the delete-family actions'\n * `(options.all || (await resolveEntityPicks(command)))` would otherwise\n * fall through to delete-all on a transient read error).\n */\n\nimport { Command } from 'commander';\nimport { printError, verboseMessage } from '../Console';\nimport { editableOptionsHint } from './EditableOptions';\nimport { escapableSelect, ESCAPE, RIGHT } from './EscapableSelectPrompt';\nimport { EXIT_ALL, EXIT_ALL_SIGNAL } from './ExitAll';\nimport { blockersOf, commitOption, failWithConflict } from './OptionConflicts';\nimport { promptInput } from './PromptGate';\nimport { canPrompt } from './PromptGateState';\n\n/**\n * Loads the candidate entities for a picker. Returns the raw skeletons;\n * `label`/`description` turn an entity into the picker row. A failing load\n * (host unreachable, permission denied) DECLINES the pick: resolveEntityPicks\n * returns false so the command stops instead of falling through to its\n * destructive --all branch.\n */\nexport type EntityPickLoader<T> = () => Promise<T[]>;\n\n/**\n * The registry-facing shape of an entity pick spec: the entity type is\n * erased (functions accept `any`) so heterogenous spec lists type-check.\n * `entityPick<T>` keeps the typed surface for call sites; the erasure only\n * widens what the registry stores.\n */\nexport type EntityPickSpec<T = any> = {\n /**\n * Attribute name of the option being filled (e.g. `secretId`). The value\n * written back is the entity's rendered label unless the spec has a\n * `value` -- for most command families the option wants the entity\n * id/name, so the label IS the value (loaders are expected to feed the\n * label with the id).\n */\n name: string;\n /** Loads the candidates from the live system. */\n load: EntityPickLoader<T>;\n /** Renders an entity as the picker row label (and the option value, see `value`). */\n label: (entity: T) => string;\n /**\n * The option value for an entity, when it is not the row label (a user\n * row shows the name and the id; the option wants the id). The live\n * command preview and the committed value both use it.\n */\n value?: (entity: T) => string;\n /**\n * Type-to-search predicate over the entity. Omitted, typing filters the\n * row labels by case-insensitive substring; give one when the match must\n * span more than the label (a user by username, name, email or id).\n */\n search?: (entity: T, query: string) => boolean;\n /**\n * For lists too long to show whole: when `when()` says so, the picker asks\n * for a search text first and offers only what `load(text)` returns. A\n * string returned by `load` is shown as a message and the text is asked\n * for again (for example \"1200 users match 'a': type more\"). Esc or an\n * empty text declines the pick. `when` and `load` read the system; they do\n * not prompt.\n */\n searchFirst?: {\n when: () => Promise<boolean>;\n message?: string;\n /** Shown in the prompt under the question: what to type. */\n hint?: string;\n load: (text: string) => Promise<T[] | string>;\n };\n /** Optional second line shown as the row's dimmed description. */\n description?: (entity: T) => string | undefined;\n /** Prompt message; defaults to \"Select <entity kind>:\". */\n message?: string;\n /** Noun for the default message, e.g. \"secret\". */\n kind: string;\n /**\n * Attribute names of options the loader reads to narrow the list (`-c`\n * narrows the mappings that are offered). They conflict with the picked\n * option on the command line, so the pick replaces them: once it is made\n * they are dropped from the command, and the command that runs (and its\n * preview) is the one you could type again.\n */\n scopedBy?: string[];\n};\n\nconst pendingEntityPicks = new WeakMap<Command, EntityPickSpec<unknown>[]>();\n\n/**\n * Registers entity pickers on a command. Called from the command's setup\n * (module scope of the command file) so the resolver can consult the\n * registry and the action body can run the picks with one bare call.\n * `T` defaults to unknown, so heterogenous spec lists type-check.\n */\nexport function deferEntityPicks(\n command: Command,\n picks: EntityPickSpec[]\n): void {\n pendingEntityPicks.set(command, [\n ...(pendingEntityPicks.get(command) ?? []),\n ...picks,\n ]);\n}\n\n/**\n * The entity pickers registered on a command (empty when none). Read by\n * ResolveInteractiveInputs to know which options it should NOT free-text\n * prompt for -- those belong to the post-auth dropdown.\n */\nexport function getEntityPicks(command: Command): EntityPickSpec<unknown>[] {\n return pendingEntityPicks.get(command) ?? [];\n}\n\n/**\n * Whether the named option has an entity picker registered on this\n * command. Convenience for the resolver's value steps.\n */\nexport function hasEntityPick(command: Command, name: string): boolean {\n return getEntityPicks(command).some((pick) => pick.name === name);\n}\n\n/**\n * Defines an entity picker for one option. The returned spec is registered\n * via `deferEntityPicks`.\n */\nexport function entityPick<T>(spec: EntityPickSpec<T>): EntityPickSpec<T> {\n return spec;\n}\n\n/**\n * Runs every entity pick registered for this command whose option is still\n * unspecified. No-op when prompting is disallowed. Returns false when the\n * user escaped the picker -- the caller should return without running the\n * action's body (same shape as a failed getTokens()).\n */\nexport async function resolveEntityPicks(command: Command): Promise<boolean> {\n if (!canPrompt()) return true;\n for (const pick of getEntityPicks(command)) {\n // Commands branch on the RAW option value (options.secretId); writing\n // through setOptionValueWithSource keeps both that object and the\n // resolver's own getOptionValue reads consistent.\n if (command.getOptionValue(pick.name)) continue;\n // An option the user gave cannot be combined with the one this pick\n // fills (`-a` with `-i`): picking would build a command the CLI rejects.\n const [blocker] = blockersOf(command, pick.name, pick.scopedBy);\n if (blocker) {\n verboseMessage(\n `Not offering a ${pick.kind} to pick: it cannot be used with ${blocker.flags}.`\n );\n continue;\n }\n let entities: unknown[];\n try {\n const searched = pick.searchFirst\n ? await searchFirst(command, pick, pick.searchFirst)\n : undefined;\n if (searched === ESCAPE) {\n const { revokeAuthoringPrint } = await import('./AuthoringPrintState');\n revokeAuthoringPrint();\n return false;\n }\n entities = searched ?? (await pick.load());\n } catch (error) {\n // Loader failure is a DECLINED pick, not a satisfied one: returning\n // true here lets `(options.all || (await resolveEntityPicks(...)))`\n // fall through to the destructive --all branch (real incident\n // 2026-10-14: a transient 400 on the secrets-list read made\n // `esv secret delete` run delete-all on a live tenant). False =\n // \"stop without running the action body\", same contract as escape.\n printError(error as Error, `Error reading ${pick.kind}s`);\n return false;\n }\n if (entities.length === 0) return true;\n if (entities.length === 1) {\n // Single-option paradigm (gap-fill prompts): one candidate is no\n // choice -- auto-select it, mirroring the single-profile host\n // picker and the single-child stub auto-descend.\n apply(command, pick, entities[0]);\n continue;\n }\n // The → key (armed by the hint) opens the invocation\n // editor, then re-prompts this picker -- discover-and-edit without\n // leaving the flow. Editorial loop, ESCAPE still declines the pick.\n let chosen: unknown | typeof ESCAPE | typeof RIGHT;\n for (;;) {\n const { liveOptionPreviewFor } =\n await import('../../cli/ResolveInteractiveInputs');\n chosen = await escapableSelect<unknown>({\n message: pick.message ?? `Select ${pick.kind} to act on:`,\n hint: editableOptionsHint(command),\n // LIVE footer: the highlighted entity's label (the exact value\n // the real apply writes) shadows the target option per render,\n // so the footer shows the command gaining that pick BEFORE\n // <enter> commits. `pick.label` maps entity -> option value --\n // the same mapping the committed apply uses. An empty filtered\n // list highlights nothing: the callback then renders the\n // committed state (undefined -> undefined) instead of crashing\n // on the spec's `entity._id`-style label.\n preview: liveOptionPreviewFor(command, pick.name, (entity) =>\n entity === undefined ? undefined : valueOf(pick, entity)\n ),\n ...(pick.search\n ? {\n search: ({ value }: { value: unknown }, query: string) =>\n pick.search!(value, query),\n }\n : {}),\n choices: entities.map((entity) => {\n const description = pick.description?.(entity);\n return {\n value: entity,\n name: pick.label(entity),\n ...(description !== undefined ? { description } : {}),\n };\n }),\n });\n if (chosen !== RIGHT) break;\n const { runInvocationEditorForCommand } =\n await import('../../cli/ResolveInteractiveInputs');\n await runInvocationEditorForCommand(command);\n }\n if (chosen === EXIT_ALL) {\n // Exit-all: revoke the deferred authoring print (nothing may be\n // left behind for an abandoned flow) and THROW the unwind signal\n // -- it propagates through the action body to app.ts's top-level\n // handler, ending the session from any nesting depth.\n const { revokeAuthoringPrint } = await import('./AuthoringPrintState');\n revokeAuthoringPrint();\n throw EXIT_ALL_SIGNAL;\n }\n if (chosen === ESCAPE) {\n // User declined to run (single ESC): revoke the deferred authoring\n // print so the postAction fallback (non-auth commands' flush site)\n // leaves nothing behind for an abandoned flow -- same contract as\n // the one-of error path skipping postAction entirely.\n const { revokeAuthoringPrint } = await import('./AuthoringPrintState');\n revokeAuthoringPrint();\n return false;\n }\n apply(command, pick, chosen);\n }\n // The deferred authoring print: this\n // function is the flush site for commands whose entity picks are the\n // last command-mutating interactive step. Two shapes exist: pick-first\n // (`(pick) && (await getTokens())` -- picks run BEFORE auth) and\n // pick-after-auth (esv variable set, secret store mapping delete --\n // picks run AFTER auth). In both, flushing HERE puts the eventual\n // command directly above the action's results. Gated on auth already\n // having succeeded: a pick-first flow whose auth then fails must not\n // print (the command never ran). When auth has NOT succeeded yet, the\n // getTokens wrapper flushes instead (no picks pending -> it doesn't\n // skip). Non-interactive sessions (canPrompt false, early return)\n // never reach this.\n {\n const { authSucceededForFlush, flushAuthoringPrint } =\n await import('./AuthoringPrintState');\n if (authSucceededForFlush()) {\n flushAuthoringPrint();\n }\n }\n return true;\n}\n\n/** The option value for an entity: its `value`, else its row label. */\nfunction valueOf(pick: EntityPickSpec<unknown>, entity: unknown): string {\n return (pick.value ?? pick.label)(entity);\n}\n\n/**\n * The search-first step of a long list: asks for a text and loads the\n * matches until there are some. Returns the matches to show, `undefined`\n * when the list is short enough to load whole, or ESCAPE when the user\n * declined.\n */\nasync function searchFirst(\n command: Command,\n pick: EntityPickSpec<unknown>,\n spec: NonNullable<EntityPickSpec<unknown>['searchFirst']>\n): Promise<unknown[] | undefined | typeof ESCAPE> {\n if (!(await spec.when())) return undefined;\n const { commandPreviewFor } =\n await import('../../cli/ResolveInteractiveInputs');\n // what the prompt says under the question: the hint, then why the last text was not enough\n let note = spec.hint;\n for (;;) {\n const text = await promptInput({\n message: spec.message ?? `Search ${pick.kind}s:`,\n hint: note,\n // the search text is not the option's value: the footer is the command as it stands\n preview: () => commandPreviewFor(command) ?? '',\n });\n // '' is Esc, Ctrl-C or an empty line: all of them decline\n if (!text) return ESCAPE;\n const found = await spec.load(text.trim());\n if (typeof found !== 'string') {\n if (found.length > 0) return found;\n note = `No ${pick.kind} matches '${text.trim()}'.`;\n continue;\n }\n note = found;\n }\n}\n\nfunction apply(\n command: Command,\n pick: EntityPickSpec<unknown>,\n entity: unknown\n): void {\n const result = commitOption(command, pick.name, valueOf(pick, entity), {\n consume: pick.scopedBy,\n });\n if (result.status === 'blocked') {\n const option = command.options.find(\n (candidate) => candidate.attributeName() === pick.name\n );\n if (option) failWithConflict(command, option, result.blockedBy);\n return;\n }\n for (const dropped of result.cleared) {\n verboseMessage(\n `Dropped ${dropped.flags}: it cannot be used with the ${pick.kind} that was picked.`\n );\n }\n}\n"],"mappings":";;;;;;;;AAmHA,eAAsB,YACpB,QAC0B;CAC1B,IAAI,CAACA,8BAAAA,UAAU,GAAG,OAAO,KAAA;CACzB,OAAO,cAAc,QAAQ,EAAE,UAAU,MAAM,CAAC;AAClD;;;;;AAMA,eAAsB,eACpB,QAC0B;CAC1B,IAAI,CAACA,8BAAAA,UAAU,GAAG,OAAO,KAAA;CACzB,OAAO,cAAc,QAAQ,EAAE,UAAU,KAAK,CAAC;AACjD;;;;;;;;;;AAWA,eAAe,cACb,QACA,MACiB;CACjB,8BAAA,mBAAmB;CACnB,IAAI;EAGF,OAAO,MAAM,WACX;GAAE,GAAG;GAAQ,GAAG;EAAK,GACrB,EAAE,mBAAmB,KAAK,CAC5B;CACF,SAAS,OAAO;EACd,IAAI,iBAAiBC,8BAAAA,iBAAiB,OAAA;EACtC,MAAM;CACR;AACF;AAEA,MAAM,aAAaC,8BAAAA,cAChB,KAAuB,SAAkC;CAUxD,MAAM,CAAC,OAAO,YAAYC,8BAAAA,SAAS,EAAE;CACrC,MAAM,CAAC,QAAQ,aAAaA,8BAAAA,SAAuC,MAAM;CACzE,MAAM,SAASC,8BAAAA,UAAU,EACvB,QAAQ,WAAW,aAAa,SAAS,OAC3C,CAAC;CAGD,MAAM,QAAQC,8BAAAA,iBAAiB;CAE/B,8BAAA,aAAa,KAAK,OAAO;EACvB,IAAIC,8BAAAA,WAAW,GAAG,GAAG;GAInB,MAAM,OAAO,SAAS,GAAG,QAAQ;GACjC,IAAI,KAAK,WAAW,KAAK,IAAI,YAAY,KAAA,GAAW;IAClD,SAAS,I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W,WAAW;EAC/B,MAAM,SAAS,QAAQ,QAAQ,MAC5B,cAAc,UAAU,cAAc,MAAM,KAAK,IACpD;EACA,IAAI,QAAQ,8BAAA,iBAAiB,SAAS,QAAQ,OAAO,SAAS;EAC9D;CACF;CACA,KAAK,MAAM,WAAW,OAAO,SAC3B,gBAAA,eACE,WAAW,QAAQ,MAAM,+BAA+B,KAAK,KAAK,kBACpE;AAEJ"}
|
|
1
|
+
{"version":3,"file":"EntityPickers-CW8YUPps.cjs","names":["canPrompt","ExitPromptError","createPrompt","useState","usePrefix","useTerminalWidth","isEnterKey","c","renderNavigationMenu","navigationMenuItems","renderFramedBox","descriptionPanelLines","stripAnsi","canPrompt","blockersOf","ESCAPE","escapableSelect","editableOptionsHint","RIGHT","EXIT_ALL","EXIT_ALL_SIGNAL","commitOption"],"sources":["../src/utils/interactive/PromptGate.ts","../src/utils/interactive/EntityPickers.ts"],"sourcesContent":["/**\n * Central gate deciding whether frodo may prompt interactively, plus the\n * terminal prompts built on `@inquirer/core` for gap-filling missing\n * command input (docs/INTERACTIVE-COMMANDS.md).\n *\n * ## The gate\n *\n * Re-exported from `PromptGateState.ts` (which holds its full\n * documentation and stays importable from unit tests -- this file pulls\n * in the frodo-lib-importing ColorTheme, and this CLI's Jest setup cannot\n * load frodo-lib; see src/app.commandWiring.test.ts's header comment).\n *\n * ## The prompts\n *\n * Deliberately hand-built on `@inquirer/core` (same pattern as the\n * existing exemplars `EscapableSelectPrompt.ts`/`JourneyDebugPrompt.ts`)\n * rather than adding `@inquirer/input`/`@inquirer/password`: the packaged\n * prompts throw `ExitPromptError` on Escape and EOF, while the gap-fill\n * layer needs Escape to resolve to a sentinel so callers can fall through\n * to their pre-existing missing-input error paths -- which is exactly the\n * contract the existing hand-built prompts already established.\n *\n * ## The frame\n *\n * Like every picker, a text prompt is drawn as a frame (record 0018): the\n * Navigate menu on top, the question in a box, and underneath the footer\n * the caller passes as `preview` -- the command being authored, with the\n * text typed so far shadowed in (record 0019). A prompt without a footer\n * is still framed; a caller that has the command passes one.\n */\n\nimport {\n createPrompt,\n ExitPromptError,\n isEnterKey,\n useKeypress,\n usePrefix,\n useState,\n} from '@inquirer/core';\nimport c from '../ColorTheme';\nimport {\n descriptionPanelLines,\n navigationMenuItems,\n renderFramedBox,\n renderNavigationMenu,\n stripAnsi,\n} from './NavigationMenu';\nimport { canPrompt, notePromptRendered } from './PromptGateState';\nimport { useTerminalWidth } from './TerminalWidth';\n\nexport {\n canPrompt,\n notePromptRendered,\n promptsRendered,\n setNeverPrompt,\n} from './PromptGateState';\n\n/**\n * The empty-string result of `promptInput`/`promptPassword`. The prompts\n * resolve with `''` in two cases that callers must tell apart, so this\n * sentinel is what they branch on: the user pressed Enter on an empty\n * line (meaning \"I have nothing to type\", e.g. no password), versus\n * `undefined`, which means prompting was disallowed by the gate and the\n * caller should simply fall through to its pre-existing missing-input\n * error path without printing anything prompt-related.\n *\n * Escape ALSO resolves with `''` -- for gap-fills, \"never mind, I'll type\n * the flag myself\" and \"there is no password\" have the same practical\n * outcome (no value supplied, command proceeds to its existing error), so\n * a separate escape sentinel would only add API surface. `promptInput`\n * renders `(no input)` after resolving so the transcript shows what\n * happened.\n */\nexport const EMPTY_INPUT = '';\n\nexport type TextInputConfig = {\n message: string;\n /**\n * Value applied when the user presses Enter on an empty line (shown as\n * a muted hint). When omitted, Enter-on-empty resolves `''` and the\n * caller decides what that means.\n */\n default?: string;\n /**\n * A sentence or two inside the box under the question: what to type, or\n * why it is asked again. Wrapped to the frame, so the question itself can\n * stay short.\n */\n hint?: string;\n /**\n * The footer under the frame: the command being authored (see\n * CommandPreview.ts). A function is called on every render with the text\n * typed so far, so the footer can show the command gaining the value\n * before <enter> commits. A hidden prompt (`promptPassword`) always gets\n * `''`: a secret never reaches a footer.\n */\n preview?: string | ((typed: string) => string);\n};\n\n/** What the text prompt component renders: the caller's config and whether the input is hidden. */\ntype TextPromptConfig = TextInputConfig & { suppress: boolean };\n\n/**\n * A `promptInput`/`promptPassword` result: `undefined` (gate refused --\n * caller falls through silently to its existing missing-input path),\n * `''` (user aborted/declined -- caller treats as missing input with its\n * existing error), or a non-empty string.\n */\nexport type TextInputResult = string | undefined;\n\n/**\n * Read a line of free-form text. Paste-safe and editable (the readline\n * buffer does the editing; the prompt only reads it), unlike accumulating\n * individual keypresses by hand.\n */\nexport async function promptInput(\n config: TextInputConfig\n): Promise<TextInputResult> {\n if (!canPrompt()) return undefined;\n return runTextPrompt(config, { suppress: false });\n}\n\n/**\n * Read a line of text without echoing it (passwords, passphrases, and\n * similar secrets). Same result contract as `promptInput`.\n */\nexport async function promptPassword(\n config: TextInputConfig\n): Promise<TextInputResult> {\n if (!canPrompt()) return undefined;\n return runTextPrompt(config, { suppress: true });\n}\n\n/**\n * Terminal conditions outside the user's in-prompt choices: stdin EOF\n * (Ctrl-D, e.g. the driver's shutdown write) and Ctrl-C both reject the\n * prompt with @inquirer/core's ExitPromptError. For gap-fills both mean\n * \"no value supplied\" and must degrade to the declined result (`''`) so\n * the caller falls through to its pre-existing missing-input error --\n * never a raw stack trace. (Escape is handled in-prompt, so it never\n * reaches this wrapper.)\n */\nasync function runTextPrompt(\n config: TextInputConfig,\n opts: { suppress: boolean }\n): Promise<string> {\n notePromptRendered();\n try {\n // Erase-on-conclude, like every prompt (record 0018): the frame goes\n // away when the prompt settles, whatever way it settles.\n return await TextPrompt(\n { ...config, ...opts },\n { clearPromptOnDone: true }\n );\n } catch (error) {\n if (error instanceof ExitPromptError) return EMPTY_INPUT;\n throw error;\n }\n}\n\nconst TextPrompt = createPrompt(\n (cfg: TextPromptConfig, done: (value: string) => void) => {\n // The readline buffer (`rl.line`) is the source of truth for the\n // typed text -- editing (backspace, ctrl+u, paste) is readline's\n // job. It is mirrored into state on every keystroke because of an\n // ordering subtlety verified against the installed @inquirer/core:\n // when Enter arrives, readline has ALREADY consumed and cleared its\n // buffer, so reading `rl.line` inside the Enter branch sees `''`\n // (the typed text only ever visible on non-Enter keypresses). The\n // mirror is written by the keypress immediately before Enter in\n // stream order, so reading state there sees the completed line.\n const [value, setValue] = useState('');\n const [status, setStatus] = useState<'idle' | 'done' | 'declined'>('idle');\n const prefix = usePrefix({\n status: status === 'declined' ? 'done' : status,\n });\n // The frame follows the terminal (re-drawn on resize). Declared after\n // every other useState so their hook order is unchanged.\n const width = useTerminalWidth();\n\n useKeypress((key, rl) => {\n if (isEnterKey(key)) {\n // rl.line is already consumed at this point (see above); use the\n // mirror, falling back defensively for a bare first-keystroke\n // Enter.\n const line = value || rl.line || '';\n if (line.length === 0 && cfg.default !== undefined) {\n setValue(cfg.default);\n setStatus('done');\n done(cfg.default);\n } else if (line.length === 0) {\n // Enter on an empty line with no default: a deliberate \"no\n // value\". Same resolution as Escape (see EMPTY_INPUT), but\n // rendered distinctly so the transcript shows the user\n // actively declined rather than backed out.\n setStatus('declined');\n done('');\n } else {\n setValue(line);\n setStatus('done');\n done(line);\n }\n } else if (key.name === 'escape') {\n setStatus('declined');\n done('');\n } else {\n // Everything else (typing, backspace, ctrl+u, paste...) is\n // handled by the underlying readline instance itself. Mirroring\n // `rl.line` into state drives the redraw AND keeps the\n // completed line available to the Enter branch above.\n setValue(rl.line);\n }\n });\n\n // A suppressed prompt shows one asterisk per typed character instead\n // of the text.\n const shown = cfg.suppress ? '*'.repeat(value.length) : value;\n\n if (status === 'declined') {\n return `${prefix} ${cfg.message} ${c.muted('(no input)')}`;\n }\n if (status === 'done') {\n return `${prefix} ${cfg.message} ${c.positive(shown)}`;\n }\n\n // Idle view: readline's native echo of the buffer is muted (see\n // create-prompt's output.mute()), so the typed characters would not\n // appear at all unless the view renders them. The frame is the same\n // three parts as every picker (record 0018): the Navigate menu, the\n // question in a box with the entry row (the cursor carries a glyph),\n // and the caller's footer.\n const entry = shown\n ? c.command(shown)\n : cfg.default !== undefined && !cfg.suppress\n ? c.muted(`(${cfg.default})`)\n : '';\n const menu = renderNavigationMenu(\n navigationMenuItems({\n move: false,\n type: cfg.suppress ? 'the value (hidden)' : 'a value',\n enter: 'commit',\n escape: 'back out',\n }),\n width\n );\n const panel = renderFramedBox({\n title: { text: `${prefix} ${cfg.message}`, plain: `? ${cfg.message}` },\n lines: [\n ...(cfg.hint\n ? [...descriptionPanelLines(cfg.hint, width), { text: '', plain: '' }]\n : []),\n { text: `› ${entry}`, plain: `› ${stripAnsi(entry)}` },\n ],\n width,\n });\n // Live footer: a function form is re-invoked on EVERY render with the\n // typed text, so the footer shows the command gaining the value before\n // <enter> commits. Never the text of a hidden prompt.\n const footer =\n typeof cfg.preview === 'function'\n ? cfg.preview(cfg.suppress ? '' : value)\n : cfg.preview;\n return [menu, panel, footer].filter(Boolean).join('\\n');\n }\n);\n","/**\n * Entity pickers (docs/INTERACTIVE-COMMANDS.md, post-auth pickers).\n *\n * A command whose target-entity option (`-i/--secret-id`, `-i/--tree-id`\n * etc.) was left unspecified can offer a dropdown populated from the live\n * system -- a PingAM server, a PingIDM instance, or an Identity Cloud\n * tenant, whichever the command targets -- instead of failing or forcing\n * `-a`. The data source is per-command: the spec's `load` is whatever read\n * function the command family's ops layer provides (`frodo.authn.journey\n * .readJourneys` for PingAM, `frodo.cloud.secret.readSecrets` for cloud,\n * and so on), so each picker is deployment-type-correct by construction;\n * nothing here assumes a particular deployment type.\n *\n * The flow spans two stages:\n *\n * 1. SETUP: the command declares its specs with `deferEntityPicks(command,\n * [...])`. The resolver (ResolveInteractiveInputs) reads the registry to\n * learn which options are entity-pickable, and when such an option is\n * the missing half of a mandatory/one-of rule, it SKIPS the free-text\n * value step for it (asking the user to type an id by hand would defeat\n * the picker's purpose) and leaves the option unset.\n *\n * 2. ACTION BODY: after `getTokens()` succeeds (the loaders need tokens),\n * the command calls `resolveEntityPicks(command)`, which runs the\n * dropdown for every still-unspecified pickable option. A prompt only\n * happens when the gate allows prompting (canPrompt()), the option is\n * still unspecified, and the loader returned at least one entity. Every\n * other path is a no-op, so non-interactive behavior stays\n * byte-identical: no TTY, `--no-prompt`, FRODO_NO_PROMPT, FRODO_TEST,\n * or an empty system all leave `options.<name>` untouched and the\n * action proceeds exactly as before (usually to its existing \"required\"\n * error).\n *\n * Escape backs out of a picker without setting anything -- callers treat\n * that as \"declined to run\" and return (same shape as a failed\n * getTokens()). A returned `false` from `resolveEntityPicks` is the\n * caller's signal to stop -- that includes a failing loader, which must\n * never read as \"picks satisfied\" (the delete-family actions'\n * `(options.all || (await resolveEntityPicks(command)))` would otherwise\n * fall through to delete-all on a transient read error).\n */\n\nimport { Command } from 'commander';\nimport { printError, verboseMessage } from '../Console';\nimport { editableOptionsHint } from './EditableOptions';\nimport { escapableSelect, ESCAPE, RIGHT } from './EscapableSelectPrompt';\nimport { EXIT_ALL, EXIT_ALL_SIGNAL } from './ExitAll';\nimport { blockersOf, commitOption, failWithConflict } from './OptionConflicts';\nimport { promptInput } from './PromptGate';\nimport { canPrompt } from './PromptGateState';\n\n/**\n * Loads the candidate entities for a picker. Returns the raw skeletons;\n * `label`/`description` turn an entity into the picker row. A failing load\n * (host unreachable, permission denied) DECLINES the pick: resolveEntityPicks\n * returns false so the command stops instead of falling through to its\n * destructive --all branch.\n */\nexport type EntityPickLoader<T> = () => Promise<T[]>;\n\n/**\n * The registry-facing shape of an entity pick spec: the entity type is\n * erased (functions accept `any`) so heterogenous spec lists type-check.\n * `entityPick<T>` keeps the typed surface for call sites; the erasure only\n * widens what the registry stores.\n */\nexport type EntityPickSpec<T = any> = {\n /**\n * Attribute name of the option being filled (e.g. `secretId`). The value\n * written back is the entity's rendered label unless the spec has a\n * `value` -- for most command families the option wants the entity\n * id/name, so the label IS the value (loaders are expected to feed the\n * label with the id).\n */\n name: string;\n /** Loads the candidates from the live system. */\n load: EntityPickLoader<T>;\n /** Renders an entity as the picker row label (and the option value, see `value`). */\n label: (entity: T) => string;\n /**\n * The option value for an entity, when it is not the row label (a user\n * row shows the name and the id; the option wants the id). The live\n * command preview and the committed value both use it.\n */\n value?: (entity: T) => string;\n /**\n * Type-to-search predicate over the entity. Omitted, typing filters the\n * row labels by case-insensitive substring; give one when the match must\n * span more than the label (a user by username, name, email or id).\n */\n search?: (entity: T, query: string) => boolean;\n /**\n * For lists too long to show whole: when `when()` says so, the picker asks\n * for a search text first and offers only what `load(text)` returns. A\n * string returned by `load` is shown as a message and the text is asked\n * for again (for example \"1200 users match 'a': type more\"). Esc or an\n * empty text declines the pick. `when` and `load` read the system; they do\n * not prompt.\n */\n searchFirst?: {\n when: () => Promise<boolean>;\n message?: string;\n /** Shown in the prompt under the question: what to type. */\n hint?: string;\n load: (text: string) => Promise<T[] | string>;\n };\n /** Optional second line shown as the row's dimmed description. */\n description?: (entity: T) => string | undefined;\n /** Prompt message; defaults to \"Select <entity kind>:\". */\n message?: string;\n /** Noun for the default message, e.g. \"secret\". */\n kind: string;\n /**\n * Attribute names of options the loader reads to narrow the list (`-c`\n * narrows the mappings that are offered). They conflict with the picked\n * option on the command line, so the pick replaces them: once it is made\n * they are dropped from the command, and the command that runs (and its\n * preview) is the one you could type again.\n */\n scopedBy?: string[];\n};\n\nconst pendingEntityPicks = new WeakMap<Command, EntityPickSpec<unknown>[]>();\n\n/**\n * Registers entity pickers on a command. Called from the command's setup\n * (module scope of the command file) so the resolver can consult the\n * registry and the action body can run the picks with one bare call.\n * `T` defaults to unknown, so heterogenous spec lists type-check.\n */\nexport function deferEntityPicks(\n command: Command,\n picks: EntityPickSpec[]\n): void {\n pendingEntityPicks.set(command, [\n ...(pendingEntityPicks.get(command) ?? []),\n ...picks,\n ]);\n}\n\n/**\n * The entity pickers registered on a command (empty when none). Read by\n * ResolveInteractiveInputs to know which options it should NOT free-text\n * prompt for -- those belong to the post-auth dropdown.\n */\nexport function getEntityPicks(command: Command): EntityPickSpec<unknown>[] {\n return pendingEntityPicks.get(command) ?? [];\n}\n\n/**\n * Whether the named option has an entity picker registered on this\n * command. Convenience for the resolver's value steps.\n */\nexport function hasEntityPick(command: Command, name: string): boolean {\n return getEntityPicks(command).some((pick) => pick.name === name);\n}\n\n/**\n * Defines an entity picker for one option. The returned spec is registered\n * via `deferEntityPicks`.\n */\nexport function entityPick<T>(spec: EntityPickSpec<T>): EntityPickSpec<T> {\n return spec;\n}\n\n/**\n * Runs every entity pick registered for this command whose option is still\n * unspecified. No-op when prompting is disallowed. Returns false when the\n * user escaped the picker -- the caller should return without running the\n * action's body (same shape as a failed getTokens()).\n */\nexport async function resolveEntityPicks(command: Command): Promise<boolean> {\n if (!canPrompt()) return true;\n for (const pick of getEntityPicks(command)) {\n // Commands branch on the RAW option value (options.secretId); writing\n // through setOptionValueWithSource keeps both that object and the\n // resolver's own getOptionValue reads consistent.\n if (command.getOptionValue(pick.name)) continue;\n // An option the user gave cannot be combined with the one this pick\n // fills (`-a` with `-i`): picking would build a command the CLI rejects.\n const [blocker] = blockersOf(command, pick.name, pick.scopedBy);\n if (blocker) {\n verboseMessage(\n `Not offering a ${pick.kind} to pick: it cannot be used with ${blocker.flags}.`\n );\n continue;\n }\n let entities: unknown[];\n try {\n const searched = pick.searchFirst\n ? await searchFirst(command, pick, pick.searchFirst)\n : undefined;\n if (searched === ESCAPE) {\n const { revokeAuthoringPrint } = await import('./AuthoringPrintState');\n revokeAuthoringPrint();\n return false;\n }\n entities = searched ?? (await pick.load());\n } catch (error) {\n // Loader failure is a DECLINED pick, not a satisfied one: returning\n // true here lets `(options.all || (await resolveEntityPicks(...)))`\n // fall through to the destructive --all branch (real incident\n // 2026-10-14: a transient 400 on the secrets-list read made\n // `esv secret delete` run delete-all on a live tenant). False =\n // \"stop without running the action body\", same contract as escape.\n printError(error as Error, `Error reading ${pick.kind}s`);\n return false;\n }\n if (entities.length === 0) return true;\n if (entities.length === 1) {\n // Single-option paradigm (gap-fill prompts): one candidate is no\n // choice -- auto-select it, mirroring the single-profile host\n // picker and the single-child stub auto-descend.\n apply(command, pick, entities[0]);\n continue;\n }\n // The → key (armed by the hint) opens the invocation\n // editor, then re-prompts this picker -- discover-and-edit without\n // leaving the flow. Editorial loop, ESCAPE still declines the pick.\n let chosen: unknown | typeof ESCAPE | typeof RIGHT;\n for (;;) {\n const { liveOptionPreviewFor } =\n await import('../../cli/ResolveInteractiveInputs');\n chosen = await escapableSelect<unknown>({\n message: pick.message ?? `Select ${pick.kind} to act on:`,\n hint: editableOptionsHint(command),\n // LIVE footer: the highlighted entity's label (the exact value\n // the real apply writes) shadows the target option per render,\n // so the footer shows the command gaining that pick BEFORE\n // <enter> commits. `pick.label` maps entity -> option value --\n // the same mapping the committed apply uses. An empty filtered\n // list highlights nothing: the callback then renders the\n // committed state (undefined -> undefined) instead of crashing\n // on the spec's `entity._id`-style label.\n preview: liveOptionPreviewFor(command, pick.name, (entity) =>\n entity === undefined ? undefined : valueOf(pick, entity)\n ),\n ...(pick.search\n ? {\n search: ({ value }: { value: unknown }, query: string) =>\n pick.search!(value, query),\n }\n : {}),\n choices: entities.map((entity) => {\n const description = pick.description?.(entity);\n return {\n value: entity,\n name: pick.label(entity),\n ...(description !== undefined ? { description } : {}),\n };\n }),\n });\n if (chosen !== RIGHT) break;\n const { runInvocationEditorForCommand } =\n await import('../../cli/ResolveInteractiveInputs');\n await runInvocationEditorForCommand(command);\n }\n if (chosen === EXIT_ALL) {\n // Exit-all: revoke the deferred authoring print (nothing may be\n // left behind for an abandoned flow) and THROW the unwind signal\n // -- it propagates through the action body to app.ts's top-level\n // handler, ending the session from any nesting depth.\n const { revokeAuthoringPrint } = await import('./AuthoringPrintState');\n revokeAuthoringPrint();\n throw EXIT_ALL_SIGNAL;\n }\n if (chosen === ESCAPE) {\n // User declined to run (single ESC): revoke the deferred authoring\n // print so the postAction fallback (non-auth commands' flush site)\n // leaves nothing behind for an abandoned flow -- same contract as\n // the one-of error path skipping postAction entirely.\n const { revokeAuthoringPrint } = await import('./AuthoringPrintState');\n revokeAuthoringPrint();\n return false;\n }\n apply(command, pick, chosen);\n }\n // The deferred authoring print: this\n // function is the flush site for commands whose entity picks are the\n // last command-mutating interactive step. Two shapes exist: pick-first\n // (`(pick) && (await getTokens())` -- picks run BEFORE auth) and\n // pick-after-auth (esv variable set, secret store mapping delete --\n // picks run AFTER auth). In both, flushing HERE puts the eventual\n // command directly above the action's results. Gated on auth already\n // having succeeded: a pick-first flow whose auth then fails must not\n // print (the command never ran). When auth has NOT succeeded yet, the\n // getTokens wrapper flushes instead (no picks pending -> it doesn't\n // skip). Non-interactive sessions (canPrompt false, early return)\n // never reach this.\n {\n const { authSucceededForFlush, flushAuthoringPrint } =\n await import('./AuthoringPrintState');\n if (authSucceededForFlush()) {\n flushAuthoringPrint();\n }\n }\n return true;\n}\n\n/** The option value for an entity: its `value`, else its row label. */\nfunction valueOf(pick: EntityPickSpec<unknown>, entity: unknown): string {\n return (pick.value ?? pick.label)(entity);\n}\n\n/**\n * The search-first step of a long list: asks for a text and loads the\n * matches until there are some. Returns the matches to show, `undefined`\n * when the list is short enough to load whole, or ESCAPE when the user\n * declined.\n */\nasync function searchFirst(\n command: Command,\n pick: EntityPickSpec<unknown>,\n spec: NonNullable<EntityPickSpec<unknown>['searchFirst']>\n): Promise<unknown[] | undefined | typeof ESCAPE> {\n if (!(await spec.when())) return undefined;\n const { commandPreviewFor } =\n await import('../../cli/ResolveInteractiveInputs');\n // what the prompt says under the question: the hint, then why the last text was not enough\n let note = spec.hint;\n for (;;) {\n const text = await promptInput({\n message: spec.message ?? `Search ${pick.kind}s:`,\n hint: note,\n // the search text is not the option's value: the footer is the command as it stands\n preview: () => commandPreviewFor(command) ?? '',\n });\n // '' is Esc, Ctrl-C or an empty line: all of them decline\n if (!text) return ESCAPE;\n const found = await spec.load(text.trim());\n if (typeof found !== 'string') {\n if (found.length > 0) return found;\n note = `No ${pick.kind} matches '${text.trim()}'.`;\n continue;\n }\n note = found;\n }\n}\n\nfunction apply(\n command: Command,\n pick: EntityPickSpec<unknown>,\n entity: unknown\n): void {\n const result = commitOption(command, pick.name, valueOf(pick, entity), {\n consume: pick.scopedBy,\n });\n if (result.status === 'blocked') {\n const option = command.options.find(\n (candidate) => candidate.attributeName() === pick.name\n );\n if (option) failWithConflict(command, option, result.blockedBy);\n return;\n }\n for (const dropped of result.cleared) {\n verboseMessage(\n `Dropped ${dropped.flags}: it cannot be used with the ${pick.kind} that was picked.`\n );\n }\n}\n"],"mappings":";;;;;;;;AAmHA,eAAsB,YACpB,QAC0B;CAC1B,IAAI,CAACA,8BAAAA,UAAU,GAAG,OAAO,KAAA;CACzB,OAAO,cAAc,QAAQ,EAAE,UAAU,MAAM,CAAC;AAClD;;;;;AAMA,eAAsB,eACpB,QAC0B;CAC1B,IAAI,CAACA,8BAAAA,UAAU,GAAG,OAAO,KAAA;CACzB,OAAO,cAAc,QAAQ,EAAE,UAAU,KAAK,CAAC;AACjD;;;;;;;;;;AAWA,eAAe,cACb,QACA,MACiB;CACjB,8BAAA,mBAAmB;CACnB,IAAI;EAGF,OAAO,MAAM,WACX;GAAE,GAAG;GAAQ,GAAG;EAAK,GACrB,EAAE,mBAAmB,KAAK,CAC5B;CACF,SAAS,OAAO;EACd,IAAI,iBAAiBC,8BAAAA,iBAAiB,OAAA;EACtC,MAAM;CACR;AACF;AAEA,MAAM,aAAaC,8BAAAA,cAChB,KAAuB,SAAkC;CAUxD,MAAM,CAAC,OAAO,YAAYC,8BAAAA,SAAS,EAAE;CACrC,MAAM,CAAC,QAAQ,aAAaA,8BAAAA,SAAuC,MAAM;CACzE,MAAM,SAASC,8BAAAA,UAAU,EACvB,QAAQ,WAAW,aAAa,SAAS,OAC3C,CAAC;CAGD,MAAM,QAAQC,8BAAAA,iBAAiB;CAE/B,8BAAA,aAAa,KAAK,OAAO;EACvB,IAAIC,8BAAAA,WAAW,GAAG,GAAG;GAInB,MAAM,OAAO,SAAS,GAAG,QAAQ;GACjC,IAAI,KAAK,WAAW,KAAK,IAAI,YAAY,KAAA,GAAW;IAClD,SAAS,IAAI,OAAO;IACpB,UAAU,MAAM;IAChB,KAAK,IAAI,OAAO;GAClB,OAAO,IAAI,KAAK,WAAW,GAAG;IAK5B,UAAU,UAAU;IACpB,KAAK,EAAE;GACT,OAAO;IACL,SAAS,I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D;CACF;CACA,KAAK,MAAM,WAAW,OAAO,SAC3B,gBAAA,eACE,WAAW,QAAQ,MAAM,+BAA+B,KAAK,KAAK,kBACpE;AAEJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-C-fzZZTt.cjs");
|
|
2
|
-
const require_Console = require("./Console-
|
|
2
|
+
const require_Console = require("./Console-gqjYb6W3.cjs");
|
|
3
3
|
let node_module = require("node:module");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
@@ -2654,4 +2654,4 @@ Object.defineProperty(exports, "wrapLine", {
|
|
|
2654
2654
|
}
|
|
2655
2655
|
});
|
|
2656
2656
|
|
|
2657
|
-
//# sourceMappingURL=EscapableSelectPrompt-
|
|
2657
|
+
//# sourceMappingURL=EscapableSelectPrompt-BQvkZbap.cjs.map
|