@rockcarver/frodo-cli 5.0.0-8 → 5.0.0-9

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 CHANGED
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## [v5.0.0-8] - 2026-10-14
11
+
12
+ ### Fixed
13
+ - Resolved an issue in the interactive entity-picker where loader failures could authorize destructive defaults. The entity-picker now correctly declines picks when loader errors occur, ensuring safer command execution. Additionally, the footer now indicates validity with a green status when inputs are valid as committed. (#812)
14
+
10
15
  ## [v5.0.0-7] - 2026-10-14
11
16
 
12
17
  ### Fixed
@@ -3020,6 +3025,7 @@ Frodo CLI 2.x automatically refreshes session and access tokens before they expi
3020
3025
  - Fixed problem with adding connection profiles
3021
3026
  - Miscellaneous bug fixes
3022
3027
 
3028
+ [v5.0.0-8]: https://github.com/rockcarver/frodo-cli/compare/v5.0.0-7...v5.0.0-8
3023
3029
  [v5.0.0-7]: https://github.com/rockcarver/frodo-cli/compare/v5.0.0-6...v5.0.0-7
3024
3030
  [v5.0.0-6]: https://github.com/rockcarver/frodo-cli/compare/v5.0.0-5...v5.0.0-6
3025
3031
  [v5.0.0-5]: https://github.com/rockcarver/frodo-cli/compare/v5.0.0-4...v5.0.0-5
@@ -1,6 +1,6 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
2
2
  const require_Console = require("./Console-1LBCP_JZ.cjs");
3
- const require_EscapableSelectPrompt = require("./EscapableSelectPrompt-BljVxNDm.cjs");
3
+ const require_EscapableSelectPrompt = require("./EscapableSelectPrompt-CYqJdCqN.cjs");
4
4
  //#region src/utils/interactive/EntityPickers.ts
5
5
  var EntityPickers_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
6
6
  deferEntityPicks: () => deferEntityPicks,
@@ -65,7 +65,7 @@ async function resolveEntityPicks(command) {
65
65
  }
66
66
  let chosen;
67
67
  for (;;) {
68
- const { liveOptionPreviewFor } = await Promise.resolve().then(() => require("./ResolveInteractiveInputs-D_-5704M.cjs")).then((n) => n.ResolveInteractiveInputs_exports);
68
+ const { liveOptionPreviewFor } = await Promise.resolve().then(() => require("./ResolveInteractiveInputs-DqsZuoJZ.cjs")).then((n) => n.ResolveInteractiveInputs_exports);
69
69
  chosen = await require_EscapableSelectPrompt.escapableSelect({
70
70
  message: pick.message ?? `Select ${pick.kind} to act on:`,
71
71
  hint: require_EscapableSelectPrompt.editableOptionsHint(command),
@@ -80,7 +80,7 @@ async function resolveEntityPicks(command) {
80
80
  })
81
81
  });
82
82
  if (chosen !== require_EscapableSelectPrompt.RIGHT) break;
83
- const { runInvocationEditorForCommand } = await Promise.resolve().then(() => require("./ResolveInteractiveInputs-D_-5704M.cjs")).then((n) => n.ResolveInteractiveInputs_exports);
83
+ const { runInvocationEditorForCommand } = await Promise.resolve().then(() => require("./ResolveInteractiveInputs-DqsZuoJZ.cjs")).then((n) => n.ResolveInteractiveInputs_exports);
84
84
  await runInvocationEditorForCommand(command);
85
85
  }
86
86
  if (chosen === require_EscapableSelectPrompt.EXIT_ALL) {
@@ -142,4 +142,4 @@ Object.defineProperty(exports, "resolveEntityPicks", {
142
142
  }
143
143
  });
144
144
 
145
- //# sourceMappingURL=EntityPickers-BGrRn1Yq.cjs.map
145
+ //# sourceMappingURL=EntityPickers-DBhC-5mV.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"EntityPickers-BGrRn1Yq.cjs","names":["canPrompt","escapableSelect","editableOptionsHint","RIGHT","EXIT_ALL","EXIT_ALL_SIGNAL","ESCAPE"],"sources":["../src/utils/interactive/EntityPickers.ts"],"sourcesContent":["/**\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 } from '../Console';\nimport { editableOptionsHint } from './EditableOptions';\nimport { escapableSelect, ESCAPE, RIGHT } from './EscapableSelectPrompt';\nimport { EXIT_ALL, EXIT_ALL_SIGNAL } from './ExitAll';\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 -- for every current\n * command family, the option wants the entity id/name, so the label IS\n * the value (loaders are expected to feed the 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 both the picker row label and the option value. */\n label: (entity: T) => string;\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\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 let entities: unknown[];\n try {\n entities = 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 : pick.label(entity)\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\nfunction apply(\n command: Command,\n pick: EntityPickSpec<unknown>,\n entity: unknown\n): void {\n command.setOptionValueWithSource(pick.name, pick.label(entity), 'cli');\n}\n"],"mappings":";;;;;;;;;;;AAoFA,MAA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AK,cAAc,MAAM;KAC7C,OAAO;MACL,OAAO;MACP,MAAM,KAAK,MAAM,MAAM;MACvB,GAAI,gBAAgB,KAAA,IAAY,EAAE,YAAY,IAAI,CAAC;KACrD;IACF,CAAC;GACH,CAAC;GACD,IAAI,WAAWC,8BAAAA,OAAO;GACtB,MAAM,EAAE,kCACN,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,yCAAA,CAAA,CAAA,CAAA,MAAA,MAAA,EAAA,gCAAA;GACR,MAAM,8BAA8B,OAAO;EAC7C;EACA,IAAI,WAAWC,8BAAAA,UAAU;GAKvB,MAAM,EAAE,yBAAyB,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,oCAAA,CAAA,CAAA,CAAA,MAAA,MAAA,EAAA,2BAAA;GACvC,qBAAqB;GACrB,MAAMC,8BAAAA;EACR;EACA,IAAI,WAAWC,8BAAAA,QAAQ;GAKrB,MAAM,EAAE,yBAAyB,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,oCAAA,CAAA,CAAA,CAAA,MAAA,MAAA,EAAA,2BAAA;GACvC,qBAAqB;GACrB,OAAO;EACT;EACA,MAAM,SAAS,MAAM,MAAM;CAC7B;CAaA;EACE,MAAM,EAAE,uBAAuB,wBAC7B,MAAA,QAAA,QAAA,CAAA,CAAA,WAAA,QAAM,oCAAA,CAAA,CAAA,CAAA,MAAA,MAAA,EAAA,2BAAA;EACR,IAAI,sBAAsB,GACxB,oBAAoB;CAExB;CACA,OAAO;AACT;AAEA,SAAS,MACP,SACA,MACA,QACM;CACN,QAAQ,yBAAyB,KAAK,MAAM,KAAK,MAAM,MAAM,GAAG,KAAK;AACvE"}
1
+ {"version":3,"file":"EntityPickers-DBhC-5mV.cjs","names":["canPrompt","escapableSelect","editableOptionsHint","RIGHT","EXIT_ALL","EXIT_ALL_SIGNAL","ESCAPE"],"sources":["../src/utils/interactive/EntityPickers.ts"],"sourcesContent":["/**\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 } from '../Console';\nimport { editableOptionsHint } from './EditableOptions';\nimport { escapableSelect, ESCAPE, RIGHT } from './EscapableSelectPrompt';\nimport { EXIT_ALL, EXIT_ALL_SIGNAL } from './ExitAll';\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 -- for every current\n * command family, the option wants the entity id/name, so the label IS\n * the value (loaders are expected to feed the 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 both the picker row label and the option value. */\n label: (entity: T) => string;\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\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 let entities: unknown[];\n try {\n entities = 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 : pick.label(entity)\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\nfunction apply(\n command: Command,\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+ /**
1831
+ * The status-title convention for the live dashboards (the debug
1832
+ * prompts): a `heading` main label followed by muted suffixes carrying
1833
+ * the ambient state -- '(3 tracked)', '[filter label]',
1834
+ * '(volker-dev · alpha)'. Returns the {text, plain} pair
1835
+ * `renderFramedBox` wants as its title: text is what draws, plain
1836
+ * mirrors it ANSI-free (the suffixes' brackets/parens belong to the
1837
+ * caller, so the composition stays verbatim).
1838
+ */
1839
+ function frameStatusTitle(main, suffixes = []) {
1840
+ return {
1841
+ text: [require_Console.theme.heading(main), ...suffixes.map((s) => require_Console.theme.muted(s))].join(" "),
1842
+ plain: [main, ...suffixes].join(" ")
1843
+ };
1844
+ }
1830
1845
  const INTENT_COLOR = {
1831
1846
  muted: (text) => require_Console.theme.muted(text),
1832
1847
  command: (text) => require_Console.theme.command(text),
@@ -2226,6 +2241,18 @@ Object.defineProperty(exports, "escapableSelect", {
2226
2241
  return escapableSelect;
2227
2242
  }
2228
2243
  });
2244
+ Object.defineProperty(exports, "frameInnerWidth", {
2245
+ enumerable: true,
2246
+ get: function() {
2247
+ return frameInnerWidth;
2248
+ }
2249
+ });
2250
+ Object.defineProperty(exports, "frameStatusTitle", {
2251
+ enumerable: true,
2252
+ get: function() {
2253
+ return frameStatusTitle;
2254
+ }
2255
+ });
2229
2256
  Object.defineProperty(exports, "isDownKey", {
2230
2257
  enumerable: true,
2231
2258
  get: function() {
@@ -2352,5 +2379,11 @@ Object.defineProperty(exports, "useState", {
2352
2379
  return useState;
2353
2380
  }
2354
2381
  });
2382
+ Object.defineProperty(exports, "wrapLine", {
2383
+ enumerable: true,
2384
+ get: function() {
2385
+ return wrapLine;
2386
+ }
2387
+ });
2355
2388
 
2356
- //# sourceMappingURL=EscapableSelectPrompt-BljVxNDm.cjs.map
2389
+ //# sourceMappingURL=EscapableSelectPrompt-CYqJdCqN.cjs.map